add kruskal but not tested.