minimum spanning tree solution