add kruskal algorithm