Jump to content

Shortest-path tree

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 128.195.52.117 (talk) at 20:38, 2 April 2013 (This statement is false. Consider the spanning tree consisting of a random walk over the complete graph with no repeats. Definitely not a shortest path tree). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Given a connected, undirected graph G, a shortest path tree rooted at vertex v is a spanning tree T of G, such that the path distance from root v to any other vertex u in T is the shortest path distance from v to u in G.

In connected graphs where shortest paths are well-defined (i.e. where there are no negative-length cycles), we may construct a shortest path tree using the following algorithm:

  1. Compute dist(u), the shortest path distance from root v to vertex u in G using Dijkstra's algorithm or Bellman-Ford algorithm.
  2. For all non-root vertices u, we can assign to u a parent vertex pu such that pu is connected to u, and that dist(pu) + edge_dist(pu,u) = dist(u). In case multiple choices for pu exist, choose pu for which there exists a shortest path from v to pu with as few edges as possible; this tie-breaking rule is needed to prevent loops when there exist zero-length cycles.
  3. Construct the shortest path tree using the edges between each node and its parent.

The above algorithm guarantees the existence of shortest path trees. Like minimum spanning trees, shortest path trees in general are not unique.

References

Cahn, Robert S. Wide Area Network Design.

See also