kruskal algorithm, very good