Lecture 4: Minimum Spanning Trees
Minimum Spanning Tree (MST):
Given a connected graph G=(V,E), a spanning tree is a connected subgraph on V. A minimal spanning tree is a spanning tree with the minimal number of edges.
“A spanning tree is a tree.”
To not be a tree, it must (a) be not connected or (b) have a cycle. By definition, (a) is false, because an MST is defined as a connected subgraph. For (b), if a cycle exists we can erase any edge in the cycle and still maintain connectedness.
Each edge has a cost. The minimum spanning tree is a least total cost tree. For example:

MST Algorithm:
- Choose all edges, dropping expensive edges until you have a complete tree
- Choose least cost edges that do not make a cycle (Kruskal’s)
- Build a single tree, always adding least cost edges (Prim’s)
Kruskal’s Algorithm:
Sort edges by cost
T = {}
for e in edges do
if e does not create a cycle then
add e to T
endif
endfor
Prim’s Algorithm:
Choose a start vertex s
T = {s}
While there is a vertex not in T do
choose least cost edge from T to some vertex not in T
add this edge to T
endwhile
“Kruskal’s algorithm produces an MST”
Let k1, … , kn-1 be edges added by Kruskal’s algorithm in the order added. Assume k1, … , kn-1 is not an MST. Then let ki be the first edge added that makes it impossible to extend k1, … , ki to an MST. Consider a true MST that uses k1, … , ki-1. Let k1, … , ki-1,mi, …, mn-1 be the true MST. If we add ki to k1, … , ki-1,mi, …, mn-1 (true MST) then we get a cycle. This cycle contains some edge mj where j >= i. The cycle cannot be all k’s because Kruskal’s algorithm would not have added k.
Consider the graph from adding ki and removing mj in k1, … , ki-1,mi, …, mn-1. We still have a spanning tree, with three cases:
- |ki| < |mj| => Contradiction, because the new tree has less cost than the true MST
- |ki| > |mj| => Contradiction, because mj would have been chosen by Kruskal's algorithm before ki.
- |ki| = |mj| => Contradiction, because now both trees are MST and have the same cost, but ki was chosen to not be in an MST with k1, … , ki.
This entry was posted on Monday, January 31st, 2005 at 2:10 pm and is tagged with minimum spanning tree, nbsp nbsp nbsp nbsp nbsp, kruskal s algorithm, connected graph, minimal spanning tree, connected subgraph, spanning trees, single tree, minimal number, k1, vertex, mj, contradiction, lt. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.
One Response to 'Lecture 4: Minimum Spanning Trees'
Leave a Reply
Please take time to enjoy the archives: May 2005 (1) April 2005 (11) March 2005 (11) February 2005 (15) January 2005 (7)
Fresh, related resources:
- ELECTRONICS AND COMMUNICATION ENGINEERING
Shortest path algorithms, Minimum spanning tree algorithm, Depth first search, Breadth first search, Binary decision diagrams. Text Book : 1. AV Aho and JD Ullman et al: Data Structures and Algorithms, Addison Wesley References: ... - CSE Syllabus2nd year
4. Binary Search Tree: Implementation with insertion, deletion and traversal. 5. Infix Expression Evaluation: Using expression tree. 6. Graph Search Algorithms: DFS and BFS on a connected directed graph. 7. Minimal Spanning Tree: ... - CSE Syllabus 3rd year
Trees - definitions and properties - rooted trees - trees and sorting - weighted trees and prefix codes - biconnected components and articulation points - Kruskal's and Prim's algorithms for minimal spanning trees - Dijkstra's shortest ... - CSE Syllabus 4th year
Distributed models - synchronous algorithms - leader election - BFS - shortest path - maximal independent set - minimal spanning tree - consensus algorithms with link and process failures - byzantine agreement problem - asynchronous ... - Algorithms: Design Techniques and Analysis (Lecture Notes Series ...
I also enjoyed reading through the section on greedy algorithms (shortest path and minimum spanning tree problems). Section on computational complexity and analysis of the relationship between complexity classes seems to be a bit ...

on May 14th, 2005 at 9:42 pm
[…] All of these MST algorithms can be implemented in O(m log n) time. Lecture 4 contains a proof that Kruskal’s algorithm produces an MST, lecture […]