A tree is a connected graph with no cycles. Equivalently, between any two of its vertices there is exactly one graph path. A single vertex with no edges is also a tree.
A shortest path from to is a graph path joining these endpoints such that
for every other -path in , where is the sum of its edge weights. Here paths have no repeated vertices; minimizing over unrestricted walks is a different problem when negative edge weights occur.
A shortest-path tree rooted at is a spanning tree of for which the unique -path in is a -shortest -path in for every vertex . It simultaneously realizes all distances from the root. It need not be a minimum spanning tree, which minimizes total tree weight instead.
Use a triangle with vertices and weights , . The unique shortest -path is , of weight one, while the unique shortest -path is , also of weight one. A shortest-path tree would therefore need all three edges of the triangle. This is impossible for a tree.
Thus negative edge weights can prevent a shortest-path tree, even though the shortest simple path to each individual vertex exists. This is the example in signed edge weights can prevent a shortest-path tree.
Under the usual walk convention allowing repeated edges, the stated hypothesis is insufficient. Take the connected graph consisting of one zero-weight edge . It has no simple cycles, so the cycle condition holds. Nevertheless is a minimum-weight -walk of weight zero and is not a path.
If the course uses “walk” to mean an edge-nonrepeating trail, the intended argument is valid. If such a minimum trail repeats a vertex, take its first repeated-vertex segment. Its interior vertices are distinct and no edge repeats, so this segment is a simple cycle . Removing it leaves an -trail of weight , a contradiction. Hence is a path. Since every -path is a competing trail, it is a shortest path.
For unrestricted walks, the same proof works if every nontrivial closed subwalk has positive weight, in particular if every edge has positive weight. This is cycle erasure in minimum-weight walks. The exact 2017 course convention was not available to check; the counterexample and the trail interpretation distinguish the two meanings explicitly.
Let be the weight of a shortest -path, and let be the predecessor of on the chosen . Its prefix to must also be shortest: a cheaper prefix followed by the final edge would give a cheaper walk to , and cycle erasure in minimum-weight walks would produce a cheaper path because every edge weight is positive. Therefore
Following predecessor arrows strictly decreases , so cannot revisit a vertex. Since each nonroot vertex has a predecessor, finiteness forces every predecessor chain to end at . Thus is connected.
The edges are distinct: if two vertices selected the same undirected edge, each would be the other's predecessor, contradicting strict decrease. Hence has exactly edges. A finite connected graph with this edge count is a tree. This proves that positive-weight shortest-path predecessors form a tree, without requiring the initially chosen paths to be mutually consistent.
The unique root-to- path in is the reversal of its predecessor chain. Every edge satisfies . Summing along that chain telescopes to
since for positive weights. Thus the tree path is a shortest -path in for every , and is a shortest-path tree rooted at .
Figure 1.
Negative weights obstruct a shortest-path tree; positive predecessors decrease distance
. Original examples. In the left triangle, the two individually shortest root paths require all three edges. In the right graph, selected predecessors point strictly toward smaller root distances and therefore form a tree. Details.

Articles by others on the same topic (0)

There are currently no matching articles.