Find minimum spanning tree using Kruskal's algorithm