src/work/marci/lg_vs_sg.cc
changeset 476 cfe550761745
parent 465 d72e56f1730d
child 480 4fb0d1e166ea
     1.1 --- a/src/work/marci/lg_vs_sg.cc	Thu Apr 29 16:08:16 2004 +0000
     1.2 +++ b/src/work/marci/lg_vs_sg.cc	Thu Apr 29 16:25:03 2004 +0000
     1.3 @@ -6,7 +6,6 @@
     1.4  #include <list_graph.h>
     1.5  #include <smart_graph.h>
     1.6  #include <dimacs.h>
     1.7 -#include <edmonds_karp.h>
     1.8  #include <preflow.h>
     1.9  #include <time_measure.h>
    1.10  #include <for_each_macros.h>
    1.11 @@ -34,19 +33,17 @@
    1.12  
    1.13      Timer ts;
    1.14      Graph::EdgeMap<int> flow(G); //0 flow
    1.15 -    Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 
    1.16 -      pre_flow_test(G, s, t, cap, flow/*, true*/);
    1.17      MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 
    1.18 -      max_flow_test(G, s, t, cap, flow);
    1.19 +      max_flow_test(G, s, t, cap, flow/*, true*/);
    1.20  
    1.21      std::cout << "ListGraph ..." << std::endl;
    1.22  
    1.23      {
    1.24        std::cout << "preflow ..." << std::endl;
    1.25        ts.reset();
    1.26 -      pre_flow_test.run();
    1.27 +      max_flow_test.run();
    1.28        std::cout << "elapsed time: " << ts << std::endl;
    1.29 -      std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
    1.30 +      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.31      }
    1.32  
    1.33      {
    1.34 @@ -60,16 +57,16 @@
    1.35        std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.36      }
    1.37  
    1.38 -    {
    1.39 -      std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    1.40 -      FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.41 -      ts.reset();
    1.42 -      int i=0;
    1.43 -      while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    1.44 -      std::cout << "elapsed time: " << ts << std::endl;
    1.45 -      std::cout << "number of augmentation phases: " << i << std::endl; 
    1.46 -      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.47 -    }
    1.48 +//     {
    1.49 +//       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    1.50 +//       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.51 +//       ts.reset();
    1.52 +//       int i=0;
    1.53 +//       while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    1.54 +//       std::cout << "elapsed time: " << ts << std::endl;
    1.55 +//       std::cout << "number of augmentation phases: " << i << std::endl; 
    1.56 +//       std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.57 +//     }
    1.58  
    1.59      {
    1.60        std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;
    1.61 @@ -108,10 +105,10 @@
    1.62  
    1.63      Timer ts;
    1.64      Graph::EdgeMap<int> flow(G); //0 flow
    1.65 -    Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 
    1.66 -      pre_flow_test(G, s, t, cap, flow/*, true*/);
    1.67      MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 
    1.68 -      max_flow_test(G, s, t, cap, flow);
    1.69 +      max_flow_test(G, s, t, cap, flow/*, true*/);
    1.70 +    //    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 
    1.71 +    //  max_flow_test(G, s, t, cap, flow);
    1.72  
    1.73      std::cout << "SmatrGraph ..." << std::endl;
    1.74  
    1.75 @@ -119,9 +116,9 @@
    1.76        std::cout << "preflow ..." << std::endl;
    1.77        FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.78        ts.reset();
    1.79 -      pre_flow_test.run();
    1.80 +      max_flow_test.run();
    1.81        std::cout << "elapsed time: " << ts << std::endl;
    1.82 -      std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
    1.83 +      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.84      }
    1.85  
    1.86      {
    1.87 @@ -135,16 +132,16 @@
    1.88        std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    1.89      }
    1.90  
    1.91 -    {
    1.92 -      std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    1.93 -      FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    1.94 -      ts.reset();
    1.95 -      int i=0;
    1.96 -      while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    1.97 -      std::cout << "elapsed time: " << ts << std::endl;
    1.98 -      std::cout << "number of augmentation phases: " << i << std::endl; 
    1.99 -      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
   1.100 -    }
   1.101 +//     {
   1.102 +//       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
   1.103 +//       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
   1.104 +//       ts.reset();
   1.105 +//       int i=0;
   1.106 +//       while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
   1.107 +//       std::cout << "elapsed time: " << ts << std::endl;
   1.108 +//       std::cout << "number of augmentation phases: " << i << std::endl; 
   1.109 +//       std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
   1.110 +//     }
   1.111  
   1.112      {
   1.113        std::cout << "on-the-fly blocking flow augmentation ..." << std::endl;