Proof continued since both e 1 e i 1 e i and e 1 e i

Info icon This preview shows pages 8–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Proof (continued). Since both { e 1 , . . . , e i - 1 , e i } and { e 1 , . . . , e i - 1 , e 0 } in- duce forests of G , we cannot have w ( e 0 ) < w ( e i ) for otherwise we would choose e 0 but not e i at the time when e i was added to T . Hence w ( e 0 ) = w ( e i ) and so H + e i - e 0 is also a minimum spanning tree of G . However, H + e i - e 0 has one more common edge with T than H . This contradicts the choice of H . Prim-Jarn´ ık’s algorithm Kruskal’s algorithm grows a forest, greedily taking the least-weight edge available. Alternatively, the Prim-Jarn´ ık’s algorithm grows a tree, taking the least-weight edge leading from the vertices already reached to a new vertex (again greedy).
Image of page 8

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

View Full Document Right Arrow Icon
Prim-Jarn´ ık’s algorithm This algorithm finds a minimum spanning tree in a connected weighted graph G with order n 2 from a root vertex u . 1. Put V ( T ) = { u } , E ( T ) = . 2. Choose an edge e of minimum weight joining a vertex of T to a vertex not in T . Add e and the new vertex to T . 3. If | V ( T ) | = n , STOP and output T . Otherwise go to Step 2. Correctness of Prim-Jarn´ ık’s algorithm Theorem 13. Prim-Jarn´ ık’s algorithm finds a minimum spanning tree in any nontrivial connected weighted graph. Proof. Let G be a nontrivial connected weighted graph with order n and weight function w . Let T be the subgraph of G obtained by using Prim- Jarn´ ık’s algorithm. Then T is a tree by the algorithm and is spanning as | V ( T ) | = n . Hence T is a spanning tree of G . Suppose that T consists of edges e 1 , e 2 , . . . , e n - 1 ordered according to the times when they were added to the growing tree. Proof (continued). Suppose to the contrary that T is not a minimum span- ning tree. Let H be a minimum spanning tree of G such that e 1 , e 2 , . . . , e k E ( H ) but e k +1 6∈ E ( H ). Choose H in such a way that k is as large as pos- sible. Then H + e k +1 contains a unique cycle. This cycle must contain an edge g 6 = e k +1 with one end-vertex in tree G [ { e 1 , e 2 , . . . , e k } ] and the other end- vertex outside of this tree. Note that e k +1 has also one end-vertex in tree G [ { e 1 , e 2 , . . . , e k } ] and the other end-vertex outside this tree. Since e k +1 was chosen at time k + 1, by the algorithm we have w ( e k +1 ) w ( g ) . Proof (continued). On the other hand, H + e k +1 - g is a spanning tree. Since H is a minimum spanning tree, we have w ( H ) w ( H + e k +1 - g ) = w ( H ) + w ( e k +1 ) - w ( g ) and so w ( e k +1 ) w ( g ) . But w ( e k +1 ) w ( g ) as shown above, so w ( e k +1 ) = w ( g ). Hence w ( H + e k +1 - g ) = w ( H ) . Thus H + e k +1 - g is another minimum spanning tree of G that agrees with T on e 1 , e 2 , . . . , e k , e k +1 E ( H ). This contradicts the choice of H and the maximality of k . Therefore, T must be a minimum spanning tree.
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern