Maximum spanning tree 2026-10-31
A spanning tree with greatest total edge weight. Apply Kruskal's algorithm in decreasing weight order, or negate every edge weight and compute a minimum spanning tree. Every graph path within a maximum spanning tree solves the widest path problem between its endpoints.
Run Kruskal's algorithm in nonincreasing order of edge weight, accepting an edge exactly when its endpoints belong to different current connected components. Use a disjoint-set data structure to test and merge those components. Stop after accepting edges.
Equivalently, apply ordinary Kruskal's algorithm to . For every spanning tree,so minimizing transformed total weight is exactly maximizing original total weight. Thus the output is a maximum spanning tree. Equal weights may be processed in any fixed order. Sorting dominates the time complexity, giving with the usual efficient disjoint-set data structure.
Build a maximum spanning tree by the decreasing-weight version of Kruskal's algorithm. For the specified distinct endpoints , find their unique graph path in by depth-first search, retaining predecessors to reconstruct it. Return that path and its minimum edge weight .
For correctness, choose an edge of weight on . Deleting it splits into two connected components, separating from . No edge across this cut of a graph can have : replacing by would give a spanning tree of greater total weight, contradicting maximality of .
Every – graph path must cross the same cut of a graph, so it contains a crossing edge with . Therefore its minimum edge weight is at most . The tree route attains , provingThis is precisely the widest path problem. The proof allows tied, zero and negative edge weights. It depends on maximizing the total tree weight, not on a shortest-distance algorithm.
Let and . Sorting and Kruskal's algorithm take time; the tree search adds . HenceFor a connected simple graph with at least two vertices, , so the time is also . The expression remains valid when parallel edges are permitted. If the two endpoints coincide, the empty path is returned, with bottleneck under the usual empty-minimum convention; otherwise connectedness guarantees a nonempty route.
Widest path problem 2026-10-31
Find a graph path whose least edge weight is as large as possible. In a connected undirected graph, use the unique route in a maximum spanning tree. Deleting a least-weight edge on that route gives a separating cut of a graph; a heavier crossing edge would improve the tree's total weight, so every competing route contains an edge no heavier than the deleted one. This proves the bottleneck optimum without assuming distinct weights.