Add minimum spanning tree method to Graph.