1. The shortest-paths problem
- Distance δ(s, v) : The length of the shortest path from s to v. For example δ(s, c)=2.
- The problem:
- Input: A graph G = (V, E) and a source vertex s∈V
- Question: A shortest path from s to each vertex v ∈V and the distance δ(s, v) .
2. Algorithm
-
Some details:
- White:represented “undiscovered” vertices
- Gray:represented “discovered” but not “processed” vertices
- Black:represented “processed” vertices