next up previous index
Next: Paths and lengths Up: Data Structures Previous: Code   Index


Shortest Paths in Weighted Graphs

Consider the weighted directed graph shown in Figure 13.1.

Figure 13.1: A positively weighted directed graph.

\begin{picture}(70,40)(-5,-5)
\put(0,30){\circle{10}}
\put(0,30){\makebox(0,0)...
...,5){\makebox(0,0){\rm 87}}
\put(48.5,13.5){\makebox(0,0){\rm 43}}
\end{picture}

The shortest path from $A$ to $E$ is not the direct route $A\to E$ but the indirect route $A \to B \to C \to E$. The former has length 87, the latter has length 66.

Our aim here is to discuss algorithms for finding shortest paths in directed graphs. We concentrate on Dijkstra's algorithm, which solves the single-source-all-paths problem for positively weighted directed graphs. Other algorithms will be discussed in a later course.



Subsections

Peter Williams 2005-06-07