add Kruskal algorithm