COIN-OR::LEMON - Graph Library

Changeset 472:052af4060f3e in lemon-0.x for src/work/marci


Ignore:
Timestamp:
04/29/04 17:58:34 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@629
Message:

preflow, maxflow

File:
1 edited

Legend:

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

    r465 r472  
    66#include <smart_graph.h>
    77#include <dimacs.h>
    8 #include <edmonds_karp.h>
     8//#include <edmonds_karp.h>
    99#include <time_measure.h>
    1010//#include <graph_wrapper.h>
    1111#include <preflow.h>
    12 #include <preflow_res.h>
     12//#include <preflow_res.h>
    1313#include <for_each_macros.h>
    1414
     
    7373  Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    7474    pre_flow_test(G, s, t, cap, flow/*, true*/);
    75   Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    76     pre_flow_ize(G, s, t, cap, flow/*, false*/);
     75  //  Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
     76  //  pre_flow_ize(G, s, t, cap, flow/*, false*/);
    7777//   PreflowRes<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    7878//     pre_flow_res(G, s, t, cap, flow/*, true*/);
    79   MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    80     max_flow_test(G, s, t, cap, flow);
     79  //MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
     80  //  max_flow_test(G, s, t, cap, flow);
    8181
    8282  {
     
    9292    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    9393    ts.reset();
    94     pre_flow_ize.preflow(Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW);
     94    pre_flow_test.preflow(Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW);
    9595    std::cout << "elapsed time: " << ts << std::endl;
    96     std::cout << "flow value: "<< pre_flow_ize.flowValue() << std::endl;
     96    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
    9797  }
    9898
     
    111111    ts.reset();
    112112    int i=0;
    113     while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }
     113    while (pre_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; }
    114114    std::cout << "elapsed time: " << ts << std::endl;
    115115    std::cout << "number of augmentation phases: " << i << std::endl;
    116     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     116    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
    117117  }
    118118
    119   {
    120     std::cout << "faster physical blocking flow augmentation ..." << std::endl;
    121     FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
    122     ts.reset();
    123     int i=0;
    124     while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
    125     std::cout << "elapsed time: " << ts << std::endl;
    126     std::cout << "number of augmentation phases: " << i << std::endl;
    127     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    128   }
     119//   {
     120//     std::cout << "faster physical blocking flow augmentation ..." << std::endl;
     121//     FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     122//     ts.reset();
     123//     int i=0;
     124//     while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; }
     125//     std::cout << "elapsed time: " << ts << std::endl;
     126//     std::cout << "number of augmentation phases: " << i << std::endl;
     127//     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     128//   }
    129129
    130130  {
     
    133133    ts.reset();
    134134    int i=0;
    135     while (max_flow_test.augmentOnBlockingFlow2()) { ++i; }
     135    while (pre_flow_test.augmentOnBlockingFlow2()) { ++i; }
    136136    std::cout << "elapsed time: " << ts << std::endl;
    137137    std::cout << "number of augmentation phases: " << i << std::endl;
    138     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     138    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
    139139  }
    140140
     
    144144    ts.reset();
    145145    int i=0;
    146     while (max_flow_test.augmentOnShortestPath()) { ++i; }
     146    while (pre_flow_test.augmentOnShortestPath()) { ++i; }
    147147    std::cout << "elapsed time: " << ts << std::endl;
    148148    std::cout << "number of augmentation phases: " << i << std::endl;
    149     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
     149    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
    150150  }
    151151
Note: See TracChangeset for help on using the changeset viewer.