update minimum spanning tree