Minimum spanning tree of graphs, Kruskal algorithm, Plim algorithm