diff -r f2994a2b10b2 -r a82713ed19f3 src/work/marci/max_flow_demo.cc --- a/src/work/marci/max_flow_demo.cc Tue Aug 31 13:40:07 2004 +0000 +++ b/src/work/marci/max_flow_demo.cc Tue Aug 31 17:54:22 2004 +0000 @@ -1,4 +1,9 @@ // -*- c++ -*- + +// Use a DIMACS max flow file as stdin. +// max_flow_demo < dimacs_max_flow_file + + #include #include @@ -15,9 +20,6 @@ using namespace hugo; -// Use a DIMACS max flow file as stdin. -// max_flow_demo < dimacs_max_flow_file - int main(int, char **) { typedef SageGraph MutableGraph; @@ -102,23 +104,23 @@ } } -// { -// std::cout << "on-the-fly blocking flow augmentation ..." << std::endl; -// FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); -// ts.reset(); -// int i=0; -// while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } -// std::cout << "elapsed time: " << ts << std::endl; -// std::cout << "number of augmentation phases: " << i << std::endl; -// std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl; + { + std::cout << "on-the-fly blocking flow augmentation ..." << std::endl; + FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); + ts.reset(); + int i=0; + while (augmenting_flow_test.augmentOnBlockingFlow2()) { ++i; } + std::cout << "elapsed time: " << ts << std::endl; + std::cout << "number of augmentation phases: " << i << std::endl; + 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]) -// std::cout << "Slackness does not hold!" << std::endl; -// if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) -// std::cout << "Slackness does not hold!" << std::endl; -// } -// } + FOR_EACH_LOC(Graph::EdgeIt, e, g) { + if (cut[g.tail(e)] && !cut[g.head(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) + std::cout << "Slackness does not hold!" << std::endl; + } + } { std::cout << "on-the-fly shortest path augmentation ..." << std::endl;