src/work/johanna/kruskal.h
changeset 555 995bc1f1a3ce
parent 352 4b89077ab715
child 682 1ea8162ce638
equal deleted inserted replaced
4:3a7738586858 5:3252800ec51c
    23     UnionFind<Node,NodeIntMap> uf(comp_map); 
    23     UnionFind<Node,NodeIntMap> uf(comp_map); 
    24       
    24       
    25     EdgeCost tot_cost = 0;
    25     EdgeCost tot_cost = 0;
    26     for (typename InputEdgeOrder::const_iterator p = edges.begin(); 
    26     for (typename InputEdgeOrder::const_iterator p = edges.begin(); 
    27 	 p!=edges.end(); ++p ) {
    27 	 p!=edges.end(); ++p ) {
    28       if ( uf.joinComponents(G.head(edges.first(p)),
    28       if ( uf.join(G.head(edges.first(p)),
    29 			     G.tail(edges.first(p))) ) {
    29 			     G.tail(edges.first(p))) ) {
    30 	out_map.set(edges.first(p), true);
    30 	out_map.set(edges.first(p), true);
    31 	tot_cost += edges.second(p);
    31 	tot_cost += edges.second(p);
    32       }
    32       }
    33       else {
    33       else {