Q 11 Proof
Q 11 Proof
Prove that Prim’s algorithm produces minimum spanning trees using the
definition of cut.
Ans:
To prove that Prim's algorithm produces a Minimum Spanning Tree (MST), we can use
the concept of a cut in a graph. A cut divides the vertices of a graph into two disjoint
sets and identifies the edges that cross between these sets. The Cut Property states
that if we have a cut in a connected, weighted graph, and the edge with the smallest
weight crossing that cut is unique, then this edge must be in any MST.
Prim's algorithm grows an MST by starting from an arbitrary vertex and repeatedly
adding the lightest edge that connects a vertex in the growing MST to a vertex
outside the MST. This process continues until all vertices are included in the MST.
1. Initialization: We start from any arbitrary vertex v in the graph. This vertex
represents the initial subset S of the cut, where S = {v}.
2. At each step, Prim’s algorithm selects the minimum-weight edge that connects
a vertex in the subset S (vertices already in the MST) to a vertex not yet in the
MST(i.e. Subset S).
3. Using the Cut Property:
At each iteration, S represents the set of vertices included in the MST so far,
and V∖S represents the vertices not yet included.
According to the Cut Property, the smallest edge that crosses the cut (S,V∖S)
must be part of the MST if it is unique.
Since Prim's algorithm always chooses the smallest edge that crosses the cut
(S,V∖S), it is guaranteed to select a safe edge in every iteration, adding it to the
MST.
4. By repeatedly applying this rule, Prim's algorithm grows the MST one safe
edge at a time.Each edge added is the minimum-weight edge across some cut,
thus ensuring that the tree remains minimal.
5. The algorithm terminates when all vertices have been added to the MST,
ensuring that the resulting tree spans all vertices and is connected.Since each
edge added was a safe edge (due to the Cut Property), the resulting tree is
minimal in weight.
By using the Cut Property at each step, Prim's algorithm ensures that every edge
added to the MST is part of the minimum spanning tree. Therefore, Prim’s algorithm
produces a Minimum Spanning Tree.