Memra

Minimum spanning trees & the cut property

◈ 3 cards

Why an MST has exactly |V|−1 edges, and the one theorem (the cut property / safe edge) that justifies both Kruskal and Prim.

The minimum-spanning-tree problem

Given a connected, undirected graph with a real weight on each edge, a spanning tree is an acyclic subset that connects all the vertices. A minimum spanning tree (MST) is a spanning tree of minimum total weight . This models any "connect everything as cheaply as possible" problem: lay cable to every building, wire a circuit, build roads between cities.

The solution is always a tree for two reasons. It must span — touch all vertices — and it must be acyclic: a cycle would contain a removable edge whose deletion keeps the graph connected but lowers the weight, so no minimum solution has one. A connected acyclic graph on vertices has exactly edges, so every MST has exactly edges.

MSTs are not necessarily unique — if two edges tie in weight, swapping one for the other can give a second MST with the same total.

Growing an MST one safe edge at a time

Both classic algorithms follow a generic greedy template. Start with and keep the loop invariant: is a subset of some MST. At each step add a safe edge — an edge such that is still a subset of some MST. After safe additions, is an MST. The whole game is: how do you know an edge is safe?

The cut property (Theorem 21.1) — the one MST theorem

First, the vocabulary:

  • A cut is a partition of the vertices into two sides.
  • An edge crosses the cut if its endpoints are on different sides.
  • The cut respects if no edge of crosses it.
  • A light edge crossing a cut is a minimum-weight edge among all edges crossing it.

Theorem (cut property). Let be a subset of some MST, let be any cut that respects , and let be a light edge crossing that cut. Then is safe for .

Worked proof (the exchange / cut-and-paste argument). Let be an MST containing . If we are done. Otherwise, adding to creates a cycle; that cycle crosses the cut an even number of times, so it contains some other crossing edge . Because the cut respects , . Form Since is light, , so — thus is also an MST. And (we only removed a non- edge) with , so . Therefore is safe.

This is the same exchange argument as activity selection and Huffman codes from the greedy module: take any optimal solution, swap in the greedy choice, show the result is no worse. Corollary 21.2 specializes it to the natural cut induced by a connected component of the forest — and that corollary is exactly what makes Kruskal and Prim correct. Kruskal keeps many components and merges them; Prim grows one component; both always add the lightest cross-component edge.

481678112012786Light crossing edge 6–8 (w 6) is safe.
The cut property on vertices 0, 1, 2, 6, 7, 8 of the exercise graph. A = {0–1, 0–7, 6–7} lies entirely inside S = {0, 1, 6, 7}, so the cut respects A. Three edges cross it — 6–8 (6), 7–8 (7) and 1–2 (8) — and the lightest of those, 6–8, is safe to add. Edge 2–8 is lighter still (2) but does not cross this cut, so the theorem says nothing about it here.
8416711820127860–7 is in A and crosses: cut fails.
Why "respects A" is a premise and not decoration. The cut S = {0, 1, 2, 8} against {6, 7} is crossed by 0–7, which is already in A. The exchange argument could now swap out an edge of A itself, so Theorem 21.1 guarantees nothing about the lightest edge crossing this cut.
NORMAL ~/memra/learn/comp-372/mst-cut-property utf-8 LF