08 - Kruskal's MST Algorithm

08 - Kruskal's MST Algorithm - Part II: Graph Algorithms...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Part II: Graph Algorithms Lecture 8: Kruskal’s MST Algorithm Lecture 8: Kruskal’s MST Algorithm Part II: Graph Algorithms
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objective and Outline Objective : Discuss another algorithm for the MST problem, i.e. Kruskal’s algorithm. Reference Kruskal’s MST algorithm The idea The algorithm Correctness The Disjoint Set Union-Find data structure. The basic implementation An improvement Lecture 8: Kruskal’s MST Algorithm Part II: Graph Algorithms
Background image of page 2
Recalling the Generic Algorithm start with an empty graph try to add edges one at a time, always making sure that what is built remains acyclic. if we are sure every time the resulting graph is always a subset of some minimum spanning tree, we are done. Lemma G = ( V , E ) be a connected, undirected graph with a real-valued weight function w defined on E A be a subset of E that is included in some minimum spanning tree for G. Let ( S , V - S ) be any cut of G that respects A ( u , v ) be a light edge crossing the cut ( S , V - S ) Then, edge ( u , v ) is safe for A. Lecture 8: Kruskal’s MST Algorithm Part II: Graph Algorithms
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Idea of Kruskal’s Algorithm The Kruskal’s Algorithm is based directly on the generic algorithm. Unlike Prim’s algorithm, which grows one tree, Kruskal’s algorithm grows a collection of trees (a forest ). Initially, trees of the forest are the vertices (no edges). In each step add the cheapest edge that does not create a cycle . Continue until the forest ‘merge to’ a single tree. Lecture 8: Kruskal’s MST Algorithm Part II: Graph Algorithms
Background image of page 4
Example Lecture 8: Kruskal’s MST Algorithm Part II: Graph Algorithms
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Outline Kruskal’s MST algorithm The idea The algorithm Correctness The Disjoint Set Union-Find data structure. The basic implementation An improvement Lecture 8: Kruskal’s MST Algorithm Part II: Graph Algorithms
Background image of page 6
1 Set A = and F = E , the set of all edges. 2 Choose an edge e in F of minimum weight, and check whether adding e to A creates a cycle . If “yes”, remove e from F . If “no”, move e from F to A . 3 If F = , stop and output the minimal spanning tree ( V , A ). Otherwise go to Step 2. Remark : Will see later, after each step, ( V , A ) is a subgraph of a MST. Questions How does algorithm choose edge e F with minimum weight? How does algorithm check whether adding e to A creates a cycle? Lecture 8: Kruskal’s MST Algorithm
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/18/2009 for the course COMP 271 taught by Professor Arya during the Spring '07 term at HKUST.

Page1 / 27

08 - Kruskal's MST Algorithm - Part II: Graph Algorithms...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online