add minimum spanning tree code