Solved the minimal spanning tree