next up previous index
Next: Dijkstra's algorithm Up: Shortest Paths in Weighted Previous: Shortest Paths in Weighted   Index

Paths and lengths

Recall that we are dealing with finite positively weighted directed graphs. These consist of a finite set of nodes and a finite set of arcs. An arc can be represented by a weighted arrow

\begin{displaymath}
a\stackrel{w}{\to}b
\end{displaymath}

which has a tail node $a$, a head node $b$ and a weight $w$. For the present, the weight is a non-negative integer. When such an arc exists, $b$ is said to be adjacent to $a$. Because of our special interests, we shall also refer to the weight $w$ as the length of the arc.

A path in the graph is a non-empty sequence of arcs such that the head of all but the last is the tail of the next. We can picture a path as

\begin{displaymath}
a_{0}\stackrel{w_{1}}{\to}a_{1}\stackrel{w_{2}}{\to}a_{2}
 \cdots  a_{n-1}\stackrel{w_{n}}{\to}a_{n}
\end{displaymath}

We say the path is from $a_{0}$ to $a_{n}$ and that it visits each node $a_{0},\ldots,a_{n}$. The length of a path $p$, written $\mathop{\mathrm{len}}(p)$, is the sum of the weights (lengths) of its members: $w_{1}+\cdots+w_{n}$. We shall say that a node $b$ is reachable from $a$ if either $a=b$ or there exists a path from $a$ to $b$.


next up previous index
Next: Dijkstra's algorithm Up: Shortest Paths in Weighted Previous: Shortest Paths in Weighted   Index
Peter Williams 2005-06-07