This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Chapter 5  Solutions 2 5.1 (a) 19 (b) 2 (c) Edge included Cut AE { A,B,C,D } & { E,F,G,H } EF { A,B,C,D,E } & { F,G,H } BE { A,E,F,G,H } & { B,C,D } FG { A,B,E } & { C,D,F,G,H } GH { A,B,E,F,G } & { C,D,H } CG { A,B,E,F,G,H } & { C,D } GD { A,B,C,E,F,G,H } & { D } 5.2 (a) Vertex included Edge included Cost A B AB 1 C BC 3 G CG 5 D GD 6 F GF 7 H GH 8 E AE 9 5.3 Since the graph is given to be connected, it will have an edge whose removal still leaves it connected, if and only if it is not a tree i.e. has more than  V   1 edges. We perform a DFS on the graph until we see  V  edges. If we can find  V  edges then the answer is “yes” else it is “no”. In either case, the time taken is O (  V  ). 5.4 Let e i ,n i denote the number of edges and vertices in the i th component. Since a connected graph on t vertices must have at least t 1 edges,  E  = k X i =1 e i ≥ k X i =1 ( n i 1) = n k 5.5 (a) The minimum spanning tree does not change. Since, each spanning tree contains exactly n 1 edges, the cost of each tree is increased n 1 and hence the minimum is unchanged. (b) The shortest paths may change. In the following graph, the shortest path from A to D changes from AB BC CD to AD if each edge weight is increased by 1. B A C D 1 1 5 1 5.6 Suppose the graph has two different MSTs T 1 and T 2 . Let e be the lightest edge which is present in exactly one of the trees (there must be some such edge since the trees must differ in at least one edge). Without loss of generality, say e ∈ T 1 . Then adding e to T 2 gives a cycle. Moreover, this cycle must contain an edge e which is (strictly) heavier that e , since all lighter edges are also present in T 1 , where e does not induce a cycle. Then adding e to T 2 and removing e gives a (strictly) better spanning tree than T 2 which is a contradiction. 5.7 Multiply the weights of all the edges by 1. Since both Kruskal’s and Prim’s algorithms work for positive as well as negative weights, we can find the minimum spanning tree of the new graph. This is the same as the maximum spanning tree of the original graph. 3 5.8 Consider the edge e = ( s,u ) having the minimum weight among all the edges incident on s . Since all the edge weights are positive, this is the unique shortest path from s to u and hence must be present in any shortest path tree. Also, Prim’s algorithm includes this edge in construction of the MST. Since by problem 5.6, the MST must be unique (because of distict edge weights), all the shortest path trees and the MST must share at least one edge. 5.9 (a) False, consider the case where the heaviest edge is a bridge (is the only edge connecting two connected components of G . (b) True, consider removing e from the MST and adding another edge belonging to the same cycle....
View
Full
Document
This note was uploaded on 04/30/2010 for the course L&S 101 taught by Professor Chow during the Spring '10 term at Berkeley.
 Spring '10
 CHOW

Click to edit the document details