COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
04/22/04 18:07:17 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@506
Message:

preflow mods

File:
1 edited

Legend:

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

    r333 r376  
    1010//#include <graph_wrapper.h>
    1111#include <preflow.h>
     12#include <preflowproba.h>
    1213#include <for_each_macros.h>
    1314
     
    7172  Graph::EdgeMap<int> flow(G); //0 flow
    7273  Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    73     pre_flow_test(G, s, t, cap, flow);
     74    pre_flow_test(G, s, t, cap, flow, true);
     75  PreflowProba<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
     76    pre_flow_proba(G, s, t, cap, flow, true, true);
    7477  MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    7578    max_flow_test(G, s, t, cap, flow);
     
    7982    ts.reset();
    8083    pre_flow_test.run();
     84    std::cout << "elapsed time: " << ts << std::endl;
     85    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
     86  }
     87
     88  {
     89    std::cout << "wrapped preflow ..." << std::endl;
     90    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     91    ts.reset();
     92    pre_flow_proba.run();
    8193    std::cout << "elapsed time: " << ts << std::endl;
    8294    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
Note: See TracChangeset for help on using the changeset viewer.