27.10.2014 Views

slides

slides

slides

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Variant 1: forward-update<br />

1. topological sort<br />

2. visit each vertex v in sorted order and do updates<br />

• for each outgoing edge (v, u) in E<br />

• use d(v) to update d(u):<br />

•<br />

d(u) ⊕ = d(v) ⊗ w(v, u)<br />

key observation: d(v) is fixed to optimal at this time<br />

w(v, u)<br />

• time complexity: O( V + E )<br />

Liang Huang<br />

14<br />

Dynamic Programming

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!