next up previous
Next: Up: Previous:

Shortest Path Problem Has Optimal Substructure

Corollary 25.2

If shortest path p from s to v can be decomposed into \(s \stackrel{p'}{\leadsto} u \rightarrow v\), then p' is a shortest path from s to u, and \(\delta(s,v) \;=\; \delta(s,u) \;+\; w(u,v)\).



Because the problem has optimal substructure, we can try to use dynamic programming and greedy algorithms.


next up previous
Next: Up: Previous: