diff -r 741f3108a90f -r e997802b855c src/work/marci/preflow_bug.cc --- a/src/work/marci/preflow_bug.cc Sat Nov 13 12:24:01 2004 +0000 +++ b/src/work/marci/preflow_bug.cc Sat Nov 13 12:53:28 2004 +0000 @@ -45,7 +45,7 @@ { Graph::EdgeIt e; for (g.first(e); g.valid(e); g.next(e)) - cout << 1+g.id(g.tail(e)) << "->" << 1+g.id(g.head(e)) << " cap: " << cap[e] << " preflow: " << flow[e] << endl; + cout << 1+g.id(g.source(e)) << "->" << 1+g.id(g.target(e)) << " cap: " << cap[e] << " preflow: " << flow[e] << endl; } { Graph::NodeIt n; @@ -75,15 +75,15 @@ Graph::EdgeIt e; for (g.first(e); g.valid(e); g.next(e)) { - if (cut[g.tail(e)] && !cut[g.head(e)]) { - cout << 1+g.id(g.tail(e)) << "->" << 1+g.id(g.head(e)) + if (cut[g.source(e)] && !cut[g.target(e)]) { + cout << 1+g.id(g.source(e)) << "->" << 1+g.id(g.target(e)) << "(forward edge) flow: " << flow[e] << " cap: " << cap[e]<< endl; if (flow[e]!=cap[e]) std::cout << "Slackness does not hold!" << std::endl; } - if (!cut[g.tail(e)] && cut[g.head(e)]) { - cout << 1+g.id(g.tail(e)) << "->" << 1+g.id(g.head(e)) + if (!cut[g.source(e)] && cut[g.target(e)]) { + cout << 1+g.id(g.source(e)) << "->" << 1+g.id(g.target(e)) << "(backward edge) flow: " << flow[e] << endl; if (flow[e]!=0) std::cout << "Slackness does not hold!" << std::endl; @@ -105,9 +105,9 @@ // max_flow_test.actMinCut(cut); // FOR_EACH_LOC(Graph::EdgeIt, e, g) { -// if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) +// if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) // std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) +// if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) // std::cout << "Slackness does not hold!" << std::endl; // } // } @@ -121,9 +121,9 @@ // std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; // FOR_EACH_LOC(Graph::EdgeIt, e, g) { -// if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) +// if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) // std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) +// if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) // std::cout << "Slackness does not hold!" << std::endl; // } // } @@ -148,9 +148,9 @@ // std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; // FOR_EACH_LOC(Graph::EdgeIt, e, g) { -// if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) +// if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) // std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) +// if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) // std::cout << "Slackness does not hold!" << std::endl; // } // } @@ -177,9 +177,9 @@ // std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; // FOR_EACH_LOC(Graph::EdgeIt, e, g) { -// if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) +// if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) // std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) +// if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) // std::cout << "Slackness does not hold!" << std::endl; // } // } @@ -195,9 +195,9 @@ // std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; // FOR_EACH_LOC(Graph::EdgeIt, e, g) { -// if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) +// if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) // std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) +// if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) // std::cout << "Slackness does not hold!" << std::endl; // } // } @@ -213,9 +213,9 @@ // std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; // FOR_EACH_LOC(Graph::EdgeIt, e, g) { -// if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) +// if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) // std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) +// if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) // std::cout << "Slackness does not hold!" << std::endl; // } // }