L16-MST

Then the set a e is part of a minimum spanning tree

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: f T . First, draw a picture of the situation: Now consider adding edge e to T . This creates a cycle from u to v to u. (why?) Kruskal-pseudocode(G) 1 A⌅⌥ 2 repeat V 1 times: 3 add to A the lightest edge e ⇧ E that does not create a cycle correctness Theorem 2 Suppose the set of edges A is part of a minimum spanning tree of G = (V, E ). Let (S, V S ) be any cut that respects A and let e be the edge with the minimum weight that crosses (S, V S ). Then the set A {e} is part of a minimum spanning tree. proof: by induction. in step 1, A is part of some MST. suppose that after k steps, A is part of some MST (line 2). in line 3, we add an edge e=(u,v) to A. Proof. By assumption, A ⇥ T for some minimum spanning tree T of G. Case 1 If A {e} ⇥ T , then the theorem is true already. Case 2 Suppose A {e} ⌃⇥ T . Let e = (u, v ). We shall construct a new tree T that contains A {e} by changing only a few edges of T . First, draw a picture of the situation: Now consider adding edge e to T . This creates a cycle from u to v to u. (why?) 3 cases for edge e. Case 1: e=(u,v) and both u,v are in A. 3 cases for edge e. Case 2: e=(u,v) and only u is in A. 3 cases for edge e. Case 3: e=(u,v) and neither u nor v are in A. 3 cases for edge e S S S analysis? 1 Minimum Spanning Tree Algorithm Kruskal-pseudocode(G) 1 A⌅⌥ 2 repeat V 1 times: 3 add to A the lightest edge e ⇧ E that does not create a cycle Theorem 2 Suppose the set of edges A is part of a minimum spanning tree of G = (V, E ). Let (S, V S ) be any cut that respects A and let e be the edge with the minimum weight that crosses (S, V S ). Then the set A {e} is part of a minimum spanning tree. Proof. By assumption, A ⇥ T for some minimum spanning tree T of G. Case 1 If A {e} ⇥ T , then the theorem is true already. Case 2 Suppose A {e} ⌃⇥ T . Let e = (u, v ). We shall construct a new tree T that contains A {e} by changing only a few edges of T . First, draw a picture of the situation: General-MST-Strategy(G = (V, E )) 1 A⇥⇤ 2 repeat V 1...
View Full Document

This note was uploaded on 02/25/2014 for the course CS 4102 taught by Professor Horton during the Spring '10 term at UVA.

Ask a homework question - tutors are online