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

Info icon This 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 final pred labels are: pred
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern