COIN-OR::LEMON - Graph Library

Changeset 476:cfe550761745 in lemon-0.x for src/work/marci/lg_vs_sg.cc


Ignore:
Timestamp:
04/29/04 18:25:03 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@633
Message:

preflow, maxflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/lg_vs_sg.cc

    r465 r476  
    77#include <smart_graph.h>
    88#include <dimacs.h>
    9 #include <edmonds_karp.h>
    109#include <preflow.h>
    1110#include <time_measure.h>
     
    3534    Timer ts;
    3635    Graph::EdgeMap<int> flow(G); //0 flow
    37     Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    38       pre_flow_test(G, s, t, cap, flow/*, true*/);
    3936    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    40       max_flow_test(G, s, t, cap, flow);
     37      max_flow_test(G, s, t, cap, flow/*, true*/);
    4138
    4239    std::cout << "ListGraph ..." << std::endl;
     
    4542      std::cout << "preflow ..." << std::endl;
    4643      ts.reset();
    47       pre_flow_test.run();
     44      max_flow_test.run();
    4845      std::cout << "elapsed time: " << ts << std::endl;
    49       std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
     46      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    5047    }
    5148
     
    6158    }
    6259
    63     {
    64       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    65       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    66       ts.reset();
    67       int i=0;
    68       while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    69       std::cout << "elapsed time: " << ts << std::endl;
    70       std::cout << "number of augmentation phases: " << i << std::endl;
    71       std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    72     }
     60//     {
     61//       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
     62//       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     63//       ts.reset();
     64//       int i=0;
     65//       while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
     66//       std::cout << "elapsed time: " << ts << std::endl;
     67//       std::cout << "number of augmentation phases: " << i << std::endl;
     68//       std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     69//     }
    7370
    7471    {
     
    109106    Timer ts;
    110107    Graph::EdgeMap<int> flow(G); //0 flow
    111     Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    112       pre_flow_test(G, s, t, cap, flow/*, true*/);
    113108    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    114       max_flow_test(G, s, t, cap, flow);
     109      max_flow_test(G, s, t, cap, flow/*, true*/);
     110    //    MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
     111    //  max_flow_test(G, s, t, cap, flow);
    115112
    116113    std::cout << "SmatrGraph ..." << std::endl;
     
    120117      FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    121118      ts.reset();
    122       pre_flow_test.run();
     119      max_flow_test.run();
    123120      std::cout << "elapsed time: " << ts << std::endl;
    124       std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
     121      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    125122    }
    126123
     
    136133    }
    137134
    138     {
    139       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    140       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    141       ts.reset();
    142       int i=0;
    143       while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    144       std::cout << "elapsed time: " << ts << std::endl;
    145       std::cout << "number of augmentation phases: " << i << std::endl;
    146       std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    147     }
     135//     {
     136//       std::cout << "faster physical blocking flow augmentation ..." << std::endl;
     137//       FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     138//       ts.reset();
     139//       int i=0;
     140//       while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
     141//       std::cout << "elapsed time: " << ts << std::endl;
     142//       std::cout << "number of augmentation phases: " << i << std::endl;
     143//       std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     144//     }
    148145
    149146    {
Note: See TracChangeset for help on using the changeset viewer.