Assigned:
Wed 18 Nov 2009
Due:
Wed 02 Dec 2009
Problem | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | ... |
---|---|---|---|---|---|---|---|---|---|---|
Credit | RC | RC | RC | EC | RC | RC | NA | RC | RC | ... |
where "RC" is "regular credit", "EC" is "extra credit", and "NA" is "not applicable" (not attempted). Failure to do so will result in an arbitrary set of problems being graded for regular credit, no problems being graded for extra credit, and a five percent penalty assessment.
Required:
Input: Undirected Graph G = (V, E); edge weights we; subset of vertices U ⊂ V
Output: The lightest spanning tree in which the nodes of U are leaves (there might be other leaves as well).
(The answer isn't necessarily a minimum spanning tree.)
Give an algorithm for this problem that runs in O(|E| log|V|) time. (Hint: When you remove nodes U from the optimal solution, what is left?)