Material Type: Exam;
Professor: Chen;
Class: Algorithm & Data Structures;
Subject: Computer Science;
University: University of North Carolina - Charlotte;
Term: Spring 2010;
Download Algorithm and Data Structures - Final Exam | ITCS 6114 and more Exams Computer Science in PDF only on Docsity!
Final Exam ITCS 6114/8114 Spring 2010 Name: at (10 pts. Each) 1 Prove that every weighted undirected connected graph of which all edge weights are distinct has a unique minimum spanning tree. Sol. We know the following theorem: Let G = be a weighted graph and V; & V2 be a decomposition of the set of vertices V. Then the shortest edge between a vertex in V; and a vertex V2 must be in every MST of G. Since all edges of G are distinct, Prim’s algorithm selects a unique set of |V| - 1 edges. And the [V| - 1 edges selected by the Prim’s algorithm must be in any MST by the above theorem. But a MST contains exactly |V| - 1 edges, so all MSTs of G are the same as the one generated by the Prim’s algorithm.