add kruskal to solve the minimum spanning tree problem