src/work/jacint/prim.h
changeset 1284 b941d044f87b
parent 921 818510fa3d99
equal deleted inserted replaced
2:fbcfb81b7250 3:a5bdf4c30733
    93 	  heap.pop();
    93 	  heap.pop();
    94 	  scanned.set(v,true);
    94 	  scanned.set(v,true);
    95 
    95 
    96 	  OutEdgeIt e;
    96 	  OutEdgeIt e;
    97 	  for( G.first(e,v); G.valid(e); G.next(e)) {
    97 	  for( G.first(e,v); G.valid(e); G.next(e)) {
    98 	    Node w=G.head(e); 
    98 	    Node w=G.target(e); 
    99 	    
    99 	    
   100 	    if ( !scanned[w] ) {
   100 	    if ( !scanned[w] ) {
   101 	      if ( !reach[w] ) {
   101 	      if ( !reach[w] ) {
   102 		reach.set(w,true);
   102 		reach.set(w,true);
   103 		heap.push(w, edge_weight[e]); 
   103 		heap.push(w, edge_weight[e]); 
   109 	    }
   109 	    }
   110 	  }
   110 	  }
   111 
   111 
   112 	  InEdgeIt f;
   112 	  InEdgeIt f;
   113 	  for( G.first(f,v); G.valid(f); G.next(f)) {
   113 	  for( G.first(f,v); G.valid(f); G.next(f)) {
   114 	    Node w=G.tail(f); 
   114 	    Node w=G.source(f); 
   115 	    
   115 	    
   116 	    if ( !scanned[w] ) {
   116 	    if ( !scanned[w] ) {
   117 	      if ( !reach[w] ) {
   117 	      if ( !reach[w] ) {
   118 		reach.set(w,true);
   118 		reach.set(w,true);
   119 		heap.push(w, edge_weight[f]); 
   119 		heap.push(w, edge_weight[f]);