Minimum spanning tree implemented