For a finite connected graph, a spanning tree contains every graph vertex and is connected and acyclic. A minimum spanning tree minimizes over all such trees. A shortest-path tree rooted at is a spanning tree whose unique -to- graph path has length for every graph vertex . Here the weighted path length is the sum of its edge weights. The two optimizations generally differ, as (b) shows. Connectedness is needed for either spanning-tree object to exist.
For the grid, Kruskal's algorithm examines edges in nondecreasing order of weight and accepts an edge exactly when it joins two different components of the current forest. The weights are encountered in the orderThe horizontal and vertical acceptance rules are detailed in the two numbered subanswers. Together they produceThere are horizontal and vertical edges, totaling . Every accepted edge attaches a previously isolated graph vertex to the component already built, so the result is connected and acyclic. The correctness theorem for Kruskal's algorithm, which follows from the minimum spanning tree cut property, proves minimality. Its total cost isFor the tree has one graph vertex, no edges and cost zero. The source's numbered items specify the two edge types; the following subanswers record their contributions to the algorithm.
Kruskal spanning tree of the weighted grid, with accepted horizontal and vertical edges highlighted
. Details. At weight the edges considered are precisely the horizontal edges in row . For all graph vertices in that row are isolated, so all edges are accepted. For , the first graph vertices in that row already belong to the one component built by earlier stages, because vertical columns have already been processed. The other graph vertices are isolated. Thus the edges with would create a graph cycle, and all the edges with are accepted, successively attaching the remaining graph vertices. The rule isThe selected edges of equal weight have no cycles after the existing component is contracted, so tie ordering does not affect this conclusion. Their combined contribution to the minimum spanning tree cost is
At weight , column is considered just after horizontal row . At this point its first graph vertices already lie in the component built so far, while graph vertices above them in that column are isolated. Consequently vertical edges with create a graph cycle, while those with attach the isolated graph vertices in a chain:Together with the horizontal rule this gives an induction on the alternating row and column stages and justifies the component description used in both numbered answers. The vertical contribution to the minimum spanning tree cost is
Use a triangle with graph vertices and edge weightsIts unique minimum spanning tree is , of cost , because the other two spanning-tree costs are . In this tree the -to- graph path has length , whereas the edge gives length in the original graph. ThereforeSince the minimum spanning tree is unique, none is a shortest-path tree rooted at .
Assume throughout (c) that the graph is finite and connected, as needed for the asserted spanning trees. List its edge weights as . The stated separation implies , so for every ,Thus the weights form a superincreasing sequence. If are distinct edge sets, let be the heaviest edge in their symmetric difference. Suppose . All other uncancelled edges are lighter, soTherefore different edge sets have different total costs. In particular all distinct spanning trees have different costs. Since a finite connected graph has at least one spanning tree and only finitely many choices,This domination of every collection of smaller edges will also be used in (iii).
By (i), two simple graph paths with different edge sets have different lengths. In particular two distinct simple graph paths from the fixed root to the same graph vertex have different edge sets, so there is a unique shortest graph path from to each . Positive weights ensure that a shortest walk has no repeated graph vertex: removing a graph cycle strictly reduces its length.
For each , take the final edge of its unique shortest graph path. Every initial segment of a shortest graph path is itself shortest, since replacing it by a shorter one would shorten the whole route. Thus these edges agree with the graph paths' unique predecessors. Following a predecessor strictly decreases , so no predecessor graph cycle is possible, and all graph vertices eventually connect to . They form a shortest-path tree. Every other such tree would have to use the same unique root-to-vertex graph paths, provingLiteral wording qualification. “Any two paths” needs a convention. Reversing an undirected graph path preserves its edge set and length; distinct zero-edge graph paths at different graph vertices also have length zero. Thus the unrestricted statement is false if these count as different graph paths. The proved edge-set assertion, and in particular uniqueness for graph paths with the same ordered endpoints, is exactly what is needed for the deduction. Arbitrary walks are not included.
Let be the unique minimum spanning tree. If is an edge outside , adding it creates a unique graph cycle consisting of and the tree graph path . Every edge on that graph path has : otherwise the distinct weights would give , and replacing by would produce a cheaper spanning tree. This is the minimum spanning tree cycle property in exchange form.
By the domination inequality in (i), it follows more strongly thatNow consider any simple graph path from to that is not the tree graph path. It must use an edge outside . Replace every such edge by the corresponding tree graph path. Each replacement strictly reduces length and produces a walk entirely in . Removing any repeated-vertex excursions leaves the unique tree graph path and can only reduce length further. ThereforeSo every root-to-vertex graph path in is the unique shortest graph path in , andThe argument works for every choice of root .
Articles by others on the same topic
There are currently no matching articles.
