kruskal' algorithm kruskal' algorithm is used to find the minimum spanning tree for connected weighted graph the algorithm aims to find subset of the edges that forms tree that includes every vertex the total weight of all the edges in the tree is minimized howeverif the graph is not connectedthen it finds minimum spanning forest note that forest is collection of trees similarlya minimum spanning forest is collection of minimum spanning trees kruskal' algorithm is an example of greedy algorithmas it makes the locally optimal choice at each stage with the hope of finding the global optimum the algorithm is shown in fig step create forest in such way that each graph is separate tree step create priority queue that contains all the edges of the graph step repeat steps and while is not empty step remove an edge from step if the edge obtained in step connects two different treesthen add it to the forest (for combining two trees into one treeelse discard the edge step end figure kruskal' algorithm