add  minimum cost spanning tree method in class Graph