0% found this document useful (0 votes)
22 views

Prove That in A Graph With Distinct Edge Weights, Prim's Algorithm Produces A Minimum Spanning

The document discusses shortest path and minimum spanning tree algorithms including Dijkstra's algorithm, Kruskal's algorithm, and Prim's algorithm. It provides examples of applying the algorithms and proving properties about minimum spanning trees.

Uploaded by

Aditya Pudaruth
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Prove That in A Graph With Distinct Edge Weights, Prim's Algorithm Produces A Minimum Spanning

The document discusses shortest path and minimum spanning tree algorithms including Dijkstra's algorithm, Kruskal's algorithm, and Prim's algorithm. It provides examples of applying the algorithms and proving properties about minimum spanning trees.

Uploaded by

Aditya Pudaruth
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

COMP 355

Shortest paths & minimum spanning trees

(i)Trace the execution of Dijkstra’s, Kruskal’s, and Prim’s algorithms on the following weighted,
undirected graph. (For Dijkstra, give the distances from s to each vertex; for Kruskal & Prim, give the
edges of the MST in the order the algorithm selects them.)

(2)State the “Cut Property” for mmii in graphs with distinct edge weights. (See
notes from last class.)

() Prove that in a graph with distinct edge weights, Prim’s algorithm produces a minimum spanning
tree. (Hint; Use the Cut Propeitv to show that at every step, Prim’s algorithm chooses an edge that is in
every minimum spanning tree.)

() Let C be a weighted, undirected graph with distinct edge weights. Explain why C has exactly one
minimum spanning tree.

() The following statement is false; find a counterexample.


Every weighted, undirected graph G has exactly one minimum spanning free.

(That is, find a graph G with more than one minimum spanning tree. You should look for a graph G
that is as small as possible.)

(6) Prove the “Cycle Property” for minimum spanning trees:

Let G be a connected, weighted, undirected graph. For any cycle in G, the minimum spanning tree of
G excludes the maximum-weight edge in that cycle.

(Hint; Use contradiction. Assume that the minimum spanning tree T does include the maximum-
weight edge in a cycle. Then show that we can modify T to find a new spanning tree ‘F’ with smaller
total weight.)

() Consider the following algorithm for finding a minimum spanning tree:


ReverseDel ete(G):
Let T be the set of all of the edges of C.
Sort Tin decreasing order by edge weight.
For each edge e in T:
If deleting e doesn’t make T disconnected,
Then delete e from T.
Return T

(a) Try applying ReverseDelete to the graph in problem (2) above.

(b) Prove that RevserseDelete always returns the MST. (Hint: Use the Cycle Property.)

(8) [Challenge] Suppose we are given both an undirected graph C with weighted edges and a minimum
spanning tree T of C. Describe an algorithm to update the minimum spanning tree when the weight of
a single edge e is decreased.

You might also like