cos423: Theory of Algorithms | handout #6 |
Michael Goldwasser | |
Princeton University | Tuesday, February 17, 1998 |
Homework #3: | Minimum Spanning Trees and Priority Queues |
Due Date: | Tuesday, February 24, 1998 (9:00am) |
The following pseudocode, which can be proven correct using techniques from Section 24.1, constructs a minimum spanning tree T (you do not have to prove the correctness here). It maintains a partition of the vertices of V and, with each set Vi, a set
of edges incident on vertices in Vi.
MST-Mergeable-Heap(G) 1 2 for each vertex 3 do 4 5 while there is more than one set Vi 6 do choose any set Vi 7 extract the minimum-weight edge (u,v) from Ei 8 assume without loss of generality that and 9 if 10 then 11 , destroying Vj 12
Describe how to implement this algorithm using the mergeable-heap operations given in Figure 20.1. Give the running time of your implementation, assuming that the mergeable heaps are implemented by binomial heaps (Please be very specific about which lines in the code above correspond to which specific mergeable heap operations. )
CLR 24.1-8. Let T be a minimum spanning tree of a graph G, and let L be the sorted list of the edge weights of T. Show that for any other minimum spanning tree T' of G, the list L is also the sorted list of edge weights of T'.
Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.