24.04.2015 Views

Knapsack problem, Huffman Code, Single Source Shortest Path ...

Knapsack problem, Huffman Code, Single Source Shortest Path ...

Knapsack problem, Huffman Code, Single Source Shortest Path ...

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.

Chapter 4: The Greedy Method<br />

We assume that starting vertex is the source and the last vertex<br />

is the destination, directed graph G = (V, E) a weighting<br />

function c(e) for the edges of G and a source vertex v 0 .<br />

20<br />

45<br />

50 10<br />

V 0<br />

V 1 V 4<br />

10 15<br />

20 35 30<br />

V 2 V<br />

15<br />

3<br />

V<br />

3<br />

5<br />

25<br />

<strong>Path</strong> Length<br />

V 0 V 2 10<br />

V 0 V 2 V 3 25<br />

V 0 V 2 V 3 V 1 45<br />

V 0 V 4 45

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

Saved successfully!

Ooh no, something went wrong!