The Safe-Edge Theorem
The safe-edge theorem is the correctness foundation for all greedy MST algorithms. It formalises the cut property into a constructive rule: given a partial MST, any light edge crossing a cut that respects the current edge set can be safely added.
Formal Statement
Let be a connected undirected graph with weight function .
Let be a subset of some MST.
Let be any cut of that respects (no edge in crosses the cut).
Let be a light edge crossing (minimum weight among all crossing edges).
Then is a safe edge for : for some MST .
Proof (Full)
Let be an MST containing . If , we are done ().
Otherwise, . Since is a spanning tree, there is a unique path from to in . Because crosses the cut, and connects all vertices, the path must cross the cut at least once. Let be an edge on that crosses the cut.
Now , because the cut respects (no edge of crosses it).
Consider :
- is connected (removing splits into two components; adding reconnects them, since and are in opposite components)
- is acyclic (adding to created one cycle; removing breaks it)
- has edges, so it is a spanning tree
Weight comparison:
The inequality follows because is a light edge crossing the cut, so .
Since is minimum, . Combined, , so is also an MST.
and , so . Also . Hence , proving is safe.
Corollary
Let be the forest formed by the current edges (initially , so has isolated vertices). If is a light edge connecting two distinct components of , then is safe.
Proof: For any component of , the cut respects (since only contains edges within components, never between them). A light edge connecting to another component crosses this cut, so by the safe-edge theorem, it is safe.
How Kruskal and Prim Use It
-
Kruskal: processes edges in increasing weight order. When considering edge connecting two different trees in the forest , it crosses the cut where is the component containing . Since edges are processed in weight order and no lighter edge could still connect these components, is a light edge for that cut, hence safe.
-
Prim: grows a single tree from a root. At each step, the edge of minimum weight connecting a vertex in the tree to a vertex outside is a light edge crossing the cut (tree, rest-of-graph). Hence safe.
Summary
| Term | Definition |
|---|---|
| Respects | No edge in crosses the cut |
| Light edge | Minimum weight among edges crossing a given cut |
| Safe edge | Adding it preserves the invariant “subset of some MST” |
| Proof technique | Swap argument: replace a crossing edge in with the light edge |
Past Tripos: y2024p2q7, y2023p1q9.