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
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThe 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
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 SHAHRIARSHAMSIAN
 Graph Theory, Dijkstra, maximum weighted edge

Click to edit the document details