Kruskal'S Algorithm - kumarpranav1987/Graph GitHub Wiki

Kruskal'S Algorithm

Kruskal-MST(G)
     Put the edges in a priority queue ordered by weight.
     count = 0
     while (count < n − 1) do
        get next edge (v,w)
        if (component (v) = component(w))
           add to Tkruskal
           merge component(v) and component(w)