0% found this document useful (0 votes)
49 views3 pages

Minimum Spanning Trees: Correctness of Kruskal's Algorithm

Kruskal's algorithm finds a minimum spanning tree (MST) of a connected, undirected graph. The algorithm is proven correct in two parts: (1) the output is acyclic and connected, ensuring it is a tree; and (2) every edge in the output tree satisfies the cut property, implying it is minimum. Specifically, Kruskal considers edges in non-decreasing order of weight and adds each edge so long as it does not form a cycle. This ensures the first edge crossing any cut is added, maintaining connectivity at minimum cost.

Uploaded by

sirj0_hn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views3 pages

Minimum Spanning Trees: Correctness of Kruskal's Algorithm

Kruskal's algorithm finds a minimum spanning tree (MST) of a connected, undirected graph. The algorithm is proven correct in two parts: (1) the output is acyclic and connected, ensuring it is a tree; and (2) every edge in the output tree satisfies the cut property, implying it is minimum. Specifically, Kruskal considers edges in non-decreasing order of weight and adds each edge so long as it does not form a cycle. This ensures the first edge crossing any cut is added, maintaining connectivity at minimum cost.

Uploaded by

sirj0_hn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Minimum

Spanning Trees

Correctness of
Algorithms: Design
and Analysis, Part II Kruskal’s Algorithm
Correctness of Kruskal (Part I)
Theorem: Kruskal’s algorithm is correct.
Proof: Let T ∗ = output of Kruskal’s algorithm on input graph G .
(1) Clearly T ∗ has no cycles.
(2) T ∗ is connected. Why?
(2a) By Empty Cut Lemma, only need to show that T ∗ crosses
every cut.
(2b) Fix a cut (A, B). Since G connected at least one of its edges
crosses (A, B).
Key point: Kruskal will include first edge crossing (A, B) that it
sees [by Lonely Cut Corollary, cannot create a cycle]

A B First edge
Kruskal
considers

Tim Roughgarden
Correctness of Kruskal (Part II)
(3) Every edge of T ∗ satisfied by the Cut Property. (Implies T ∗ is
the MST)
Reason for (3): Consider iteration where edge (u, v ) added to
current set T . Since T ∪ {(u, v )} has no cycle, T has no u − v
path.
⇒ ∃ empty cut (A, B) separating u and v . (As in proof of Empty
Cut Lemma)
⇒ By (2b), no edges crossing (A, B) were previously considered by
Kruskal’s algorithm.
⇒ (u, v ) is the first (+ hence the cheapest!) edge crossing (A, B).
⇒ (u, v ) justified by the Cut Property. QED
A B
empty u
cut new edge

Current State: v

You might also like