public static int computeMST(Graph graph,int numvert){
  int cost=0;
  Vertex inserted=graph.firstNode();
  Vertex tmp=inserted.next();
  MyVertexList=tmp;
  numvert--;
  while (numvert != 0) {
    BlueReturn br=doAllBlueRule(inserted);
    inserted=br.vert();
    int dist=br.dist();
    numvert--;
    cost+=dist;
  }
  return cost;
}

public static int computeMST ( Graph graph , int numvert ) { int cost = 0 ; Vertex inserted = graph . firstNode ( ) ; Vertex tmp = inserted . next ( ) ; MyVertexList = tmp ; numvert -- ; while ( numvert != 0 ) { BlueReturn br = doAllBlueRule ( inserted ) ; inserted = br . vert ( ) ; int dist = br . dist ( ) ; numvert -- ; cost += dist ; } return cost ; }
the method to compute the minimum spanning tree .
