.
authormarci
Mon, 01 Mar 2004 12:06:56 +0000
changeset 138c6297c121409
parent 137 6364b07f8cd4
child 139 c76f1eea05d2
.
src/work/marci/edmonds_karp_demo.cc
     1.1 --- a/src/work/marci/edmonds_karp_demo.cc	Mon Mar 01 11:33:10 2004 +0000
     1.2 +++ b/src/work/marci/edmonds_karp_demo.cc	Mon Mar 01 12:06:56 2004 +0000
     1.3 @@ -26,7 +26,8 @@
     1.4    double pre_time=currTime();
     1.5    MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap);
     1.6    //max_flow_test.augmentWithBlockingFlow<ListGraph>();
     1.7 -  max_flow_test.run<ListGraph>();
     1.8 +  int i=0;
     1.9 +  while (max_flow_test.augmentOnBlockingFlow<ListGraph>()) { ++i; }
    1.10    double post_time=currTime();
    1.11  
    1.12    //std::cout << "maximum flow: "<< std::endl;
    1.13 @@ -35,6 +36,7 @@
    1.14    //}
    1.15    //std::cout<<std::endl;
    1.16    std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    1.17 +  std::cout << "number of augmentation phases: " << i << std::endl; 
    1.18    std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.19    }
    1.20  
    1.21 @@ -45,7 +47,8 @@
    1.22    double pre_time=currTime();
    1.23    MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap);
    1.24    //max_flow_test.augmentWithBlockingFlow<ListGraph>();
    1.25 -  max_flow_test.run();
    1.26 +  int i=0;
    1.27 +  while (max_flow_test.augmentOnShortestPath()) { ++i; }
    1.28    double post_time=currTime();
    1.29  
    1.30    //std::cout << "maximum flow: "<< std::endl;
    1.31 @@ -54,6 +57,7 @@
    1.32    //}
    1.33    //std::cout<<std::endl;
    1.34    std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    1.35 +  std::cout << "number of augmentation phases: " << i << std::endl; 
    1.36    std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.37    }
    1.38