kruskal' algorithm in this sectionwe introduce kruskal' algorithm for constructing minimum spanning tree while the prim-jarnik algorithm builds the mst by growing single tree until it spans the graphkruskal' algorithm maintains forest of clustersrepeatedly merging pairs of clusters until single cluster spans the graph initiallyeach vertex is by itself in singleton cluster the algorithm then considers each edge in turnordered by increasing weight if an edge connects two different clustersthen is added to the set of edges of the minimum spanning treeand the two clusters connected by are merged into single cluster ifon the other hande connects two vertices that are already in the same clusterthen is discarded once the algorithm has added enough edges to form spanning treeit terminates and outputs this tree as the minimum spanning tree we give pseudo-code for kruskal' mst algorithm in code fragment and we show an example of this algorithm in figures and algorithm kruskal( )inputa simple connected weighted graph with vertices and edges outputa minimum spanning tree for for each vertex in do define an elementary cluster ( {vinitialize priority queue to contain all edges in gusing the weights as keys { will ultimately contain the edges of the mstwhile has fewer than edges do (uvvalue returned by remove min(let (ube the cluster containing uand let (vbe the cluster containing if (  (vthen add edge (uvto merge (uand (vinto one cluster return tree code fragment kruskal' algorithm for the mst problem as was the case with the prim-jarnik algorithmthe correctness of kruskal' algorithm is based upon the crucial fact about minimum spanning trees from proposition each time kruskal' algorithm adds an edge (uvto the minimum spanning tree we can define partitioning of the set of vertices (as in the propositionby letting be the cluster containing and letting contain the rest of the vertices in this clearly defines disjoint partitioning of the vertices of andmore importantlysince we are extracting edges from in order by their weightse must be minimum-weight edge with one vertex in and the other in thuskruskal' algorithm always adds valid minimum spanning tree edge