- 1 -
1. (10 points) Suppose you are given a graph G=(V,E) with edge weights w(e) and a minimum
spanning tree T of G. Now, suppose a new edge {u,v} is added to G. Describe (in words) a
method for determining if T is still a minimum spanning tree for G.
Explain how your method can be implemented to run in O(n) time if both G and T are
provided as instances of the wgraph data structure.
Suppose that instead of a single edge, you are given a set of k new edges to add to G. For
small enough k it makes sense to apply your algorithm repeatedly in order to update the
MST, but if k is “too large”, it’s more efficient to re-compute the MST from scratch. How big
does k have to be (as a function of m and n) in order for this to be a better choice? Assume
that the MST is computed using Prim’s algorithm with a d-heap, where d=2.