Homework_3_sol

Homework_3_sol - Homework 3 Problem 1 Show an example where...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 3 Problem 1: Show an example where Dijkstra’s algorithm fails. Problem 2: Run Dijkstra’s algorithm manually for the following graph. (A as a source) Problem 3: Suppose that a graph G has a minimum spanning tree already computed. How quickly can the minimum spanning tree be updated if a new vertex and incident edges are added to G
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The basic idea here is to remove the maximum weighted edge from a cycle to obtain a better tree. Algorithm: Let e be the lightest edge across the cut ( V- v, v ), where v is the new vertex added, then add e to the tree. Now, for each new edge ( v;w ) added in the graph do the following. Add the edge ( v;w ) to the tree, and then remove the maximum weight edge from the resulting cycle. The most important thing here is to find the maximum weighted edge in a cycle. A new added edge e will result in only one cycle in the tree. Correctness: Considering the fact that the new tree we obtained is a spanning tree and the most expensive edge in the cycle will never in the MST, we can see that the new tree
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Homework_3_sol - Homework 3 Problem 1 Show an example where...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online