sol6 - 2 = 6, pred 3 = 2, pred 4 = 3, pred 5 = 4, pred 6 =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
AMS 301.2 (Spring, 2011) Estie Arkin Homework Set # 6 – Solution Notes A: (a) Kruskal’s algorithms would insert the edges in the following order: (E,F) (A,B) (C,D) (C,E) (C,B). Cost of the MST 2 + 5 + 4 + 1 + 3 = 15 (b). Prim’s algorithm would insert the edges in the following order: (A,B), (B,C), (C,E), (C,D), (E,F). Cost of the MST 2 + 5 + 4 + 1 + 3 = 15 (c). Edge (A,B) is currently part of the minimum spanning tree. Suppose its cost is increased from 2 to 11. Will it still be part of the minimum spanning tree? Explain. No. If (A,B) remains in the tree, its cost is now 11 + 5 + 4 + 1 + 3 = 24, but removing (A,B) and including (A,D) yields a tree of smaller cost, 9 + 5 + 4 + 1 + 3 = 22. B: The edges in the shortest path tree are: (A,B) (B,C) (A,D) (C,E) (A,F). Here is the entire execution of the algorithm: u A u B u C u D u E u F node becoming perm 0 2 9 12 node B - - 7 9 12 12 node C - - - 9 11 12 node D - - - - 11 12 node E - - - - - 12 node F The ±nal pred labels are: pred
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2 = 6, pred 3 = 2, pred 4 = 3, pred 5 = 4, pred 6 = 1, pred 7 = 6. C: Quick TSP: T 1 = 1 T 2 = 1 , 4 , 1 T 3 = 1 , 3 , 4 , 1 T 4 = 1 , 2 , 3 , 4 , 1 T 5 = 1 , 2 , 3 , 5 , 4 , 1 T 6 = 1 , 2 , 3 , 6 , 5 , 4 , 1, at cost 4 + 2 + 6 + 2 + 2 + 2 = 18 Using the double the MST method we get: The minimum spanning tree contains edges (3,4) (2,3) (1,4) (4,5) (5,6). Doubling it, we get an Euler cycle 1-4-3-2-3-4-5-6-5-4-1. Shortcutting this by eliminating repeated nodes, we get the nal tour: 1-4-3-2-5-6-1 of length 2+1+2+5+2+4 = 16. Note that this solution is dierent, neither method gaurantees that we nd an optimal tour! D: Let each red edge have a cost 0 and each blue edge have cost 1. Now nd a mimimum cost spanning tree by any of the algorithms from class. It will contain as few blue edges as possible, and therefore as many red edges as possible....
View Full Document

Ask a homework question - tutors are online