Search⌘ K

Reflections on Shortest Paths

Explore the structural characteristics of shortest paths in graphs, including the nonuniqueness of paths, the behavior of concatenated paths, and the concept of shortest-paths trees. Understand why subpaths of shortest paths are also shortest and how these insights underpin common shortest-path algorithms.

Structure of shortest paths

In this lesson, we reflect on the structural properties of shortest paths, as well as the sub-digraphs formed by putting together other shortest paths. We take a look at some examples to intuit better.

Nonuniqueness of shortest paths

There may be more than one shortest path between two vertices. For example, there are two〈s, x〉 and〈s, u, v, x〉 different shortest paths from ss to xx and three〈s, u, v, w〉, 〈s, x, w〉, and 〈s, u, v, x, w〉 different ones from ss to ww.

Multiple shortest paths between some pairs of vertices
Multiple shortest paths between some pairs of vertices

Concatenation of shortest paths

When a path terminates at a vertex, from which another one begins, we refer to the resulting digraph (consisting of the two paths) as being formed from the concatenation of those two paths. We might be tempted to think that concatenating a shortest path, starting at a vertex uu, with another shortest path, ending at a vertex vv, gives a uvu-v shortest path but that’s not true. Let’s look at the following example.

Suppose we have a v1v3v_1-v_3 shortest path PP and another v3v5v_3-v_5 ...