Proofs: Eppstein-Galil-Italiano-Nissenzweig algorithm
These are the human proofs of Eppstein-Galil-Italiano-Nissenzweig algorithm, at full length.
The root of the sparsification tree holds the minimum spanning forest full
This proof shows: correctness.
Fix a strict total order on the edges: if , or and has the smaller id. For a finite multigraph on the vertex set , let be the minimum spanning forest for this order. It is unique, because all weights are distinct under , and Kruskal's algorithm computes it.
Lemma 1 (cycle rule). An edge of is not in if and only if has a cycle on which is the -largest edge.
Proof. Kruskal's algorithm scans the edges in -order and rejects exactly when its ends are already joined by earlier, so smaller, edges; those edges and form a cycle with largest. Conversely, if is largest on a cycle , then when Kruskal scans , every other edge of has been scanned, and each of them is either in the forest or has its ends already joined, so and are already joined and is rejected.
Lemma 2 (strong certificate). For any multigraphs and on , .
Proof. Write , a subgraph of . First, : an edge of outside is largest on a cycle of by Lemma 1, hence largest on a cycle of , hence not in . Now take any edge of . If , then by Lemma 1 there is a cycle in on which is largest. Take such a cycle and replace each edge on it that is not in : such an is in , so its ends are joined in by a path of edges . The result is a closed walk in through once, all of whose other edges are ; it contains a cycle through with largest. So . Conversely, if , then is largest on a cycle of , which is a cycle of , so . Hence the two forests have the same edges.
Corollary. , by applying Lemma 2 twice: once with , , then with , .
Stability. The time bound of the paper uses one more fact, which the correctness proof below does not need: if one edge is inserted into or deleted from , then changes by at most one inserted and one deleted edge. For an insertion of , the new forest is the old one plus , minus the largest edge on the cycle that closes, if any. For a deletion of a forest edge, the new forest is the old one minus that edge, plus the smallest edge that reconnects the two parts, if any.
Theorem. After each operation, for the current graph .
Proof. For a node , let be the union of the groups at the leaves below . Claim: after each operation, for every node . It holds after a build, by induction from the leaves: at a leaf by definition, and at an internal node by the Corollary, since .
Assume the claim before an update. INSERT changes one group (line L1), and DELETE changes at most two groups, the group and the last group (lines L3 and L4). For a node , the set changes only if a changed group is below , that is, if is on the path from a changed leaf to the root. Lines L2 and L5 call RECOMPUTE-PATH on every changed leaf. RECOMPUTE-PATH goes from the leaf upward (line L6), so when it recomputes in line L7, both children of already hold the correct forests: a child on a recomputed path was done earlier in this or the previous call, and a child on no such path has an unchanged . By the Corollary, is then . Nodes on no recomputed path keep their correct forests. When the number of groups exceeds the number of leaves, the implementation rebuilds the whole tree, which is again correct by the build argument.
At the root, is the set of all current edges, because every edge is in exactly one group and moving an edge in line L4 keeps it in some group. So , which line L8 reports.