src/lemon/kruskal.h
changeset 986 e997802b855c
parent 921 818510fa3d99
child 987 87f7c54892df
equal deleted inserted replaced
0:00eebcbff6aa 1:3a52c9cf69b6
    80     UnionFind<Node,NodeIntMap> uf(comp); 
    80     UnionFind<Node,NodeIntMap> uf(comp); 
    81       
    81       
    82     EdgeCost tot_cost = 0;
    82     EdgeCost tot_cost = 0;
    83     for (typename IN::const_iterator p = in.begin(); 
    83     for (typename IN::const_iterator p = in.begin(); 
    84 	 p!=in.end(); ++p ) {
    84 	 p!=in.end(); ++p ) {
    85       if ( uf.join(G.head((*p).first),
    85       if ( uf.join(G.target((*p).first),
    86 		   G.tail((*p).first)) ) {
    86 		   G.source((*p).first)) ) {
    87 	out.set((*p).first, true);
    87 	out.set((*p).first, true);
    88 	tot_cost += (*p).second;
    88 	tot_cost += (*p).second;
    89       }
    89       }
    90       else {
    90       else {
    91 	out.set((*p).first, false);
    91 	out.set((*p).first, false);