add Kruskal's algorithms