
ECS122A: Algorithm Design and Analysis Due: 4:00pm, June 2, 2009
Homework Assignment #6
1. Let G= (V, E ) be a connected, undirected graph with distinct edge weights. Show that Ghas a
unique minimum spanning tree.
2. Show the result of running Kruskal’s algorithm for finding the minimum spanning tree on the
following graph.
b
h
c d
f
e
a
g
i
4
8 7
9
11
87
2
1
64
2
14
10
3. Show the result of running Prim’s algorithm for finding the minimum spanning tree on the graph
shown in Problem 2, using eas the root.
4. Prove or disprove: Prim’s MST algorithm will work correctly even if weights may be negative.
5. (a) Run the Bellman-Ford algorithm on the following directed graph, using vertex yas the source.
Relax edges in lexicographic order in each pass, and show the dand πvalues after each pass.
(b) Change the weight of edge (y, v) to 4 and run the algorithm again, using zas the source.
1