Minimum spanning tree exercise