diff -r 5fa75db9ebb4 -r cfe550761745 src/work/marci/max_flow_demo.cc --- a/src/work/marci/max_flow_demo.cc Thu Apr 29 16:08:16 2004 +0000 +++ b/src/work/marci/max_flow_demo.cc Thu Apr 29 16:25:03 2004 +0000 @@ -5,7 +5,6 @@ #include #include #include -//#include #include //#include #include @@ -70,30 +69,24 @@ readDimacsMaxFlow(std::cin, G, s, t, cap); Timer ts; Graph::EdgeMap flow(G); //0 flow - Preflow, Graph::EdgeMap > - pre_flow_test(G, s, t, cap, flow/*, true*/); - // Preflow, Graph::EdgeMap > - // pre_flow_ize(G, s, t, cap, flow/*, false*/); -// PreflowRes, Graph::EdgeMap > -// pre_flow_res(G, s, t, cap, flow/*, true*/); - //MaxFlow, Graph::EdgeMap > - // max_flow_test(G, s, t, cap, flow); + MaxFlow, Graph::EdgeMap > + max_flow_test(G, s, t, cap, flow); { std::cout << "preflow ..." << std::endl; ts.reset(); - pre_flow_test.run(); + max_flow_test.run(); std::cout << "elapsed time: " << ts << std::endl; - std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; + std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; } { std::cout << "preflow ..." << std::endl; FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); ts.reset(); - pre_flow_test.preflow(Preflow, Graph::EdgeMap >::GEN_FLOW); + max_flow_test.preflow(MaxFlow, Graph::EdgeMap >::GEN_FLOW); std::cout << "elapsed time: " << ts << std::endl; - std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; + std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; } // { @@ -110,10 +103,10 @@ FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); ts.reset(); int i=0; - while (pre_flow_test.augmentOnBlockingFlow()) { ++i; } + while (max_flow_test.augmentOnBlockingFlow()) { ++i; } std::cout << "elapsed time: " << ts << std::endl; std::cout << "number of augmentation phases: " << i << std::endl; - std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; + std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; } // { @@ -132,10 +125,10 @@ FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); ts.reset(); int i=0; - while (pre_flow_test.augmentOnBlockingFlow2()) { ++i; } + while (max_flow_test.augmentOnBlockingFlow2()) { ++i; } std::cout << "elapsed time: " << ts << std::endl; std::cout << "number of augmentation phases: " << i << std::endl; - std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; + std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; } { @@ -143,10 +136,10 @@ FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); ts.reset(); int i=0; - while (pre_flow_test.augmentOnShortestPath()) { ++i; } + while (max_flow_test.augmentOnShortestPath()) { ++i; } std::cout << "elapsed time: " << ts << std::endl; std::cout << "number of augmentation phases: " << i << std::endl; - std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; + std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; }