src/work/marci/graph_wrapper_time.cc
changeset 900 fc7bc2dacee5
parent 784 a48964a87141
child 921 818510fa3d99
equal deleted inserted replaced
2:9e3361372e56 3:e5ceeba68cce
     8 #include <string>
     8 #include <string>
     9 #include <vector>
     9 #include <vector>
    10 #include <hugo/invalid.h>
    10 #include <hugo/invalid.h>
    11 #include <hugo/time_measure.h>
    11 #include <hugo/time_measure.h>
    12 #include <hugo/graph_wrapper.h>
    12 #include <hugo/graph_wrapper.h>
    13 #include <hugo/max_flow.h>
    13 #include <hugo/preflow.h>
    14 #include <hugo/dimacs.h>
    14 #include <hugo/dimacs.h>
    15 #include <hugo/list_graph.h>
    15 #include <hugo/list_graph.h>
    16 
    16 
    17 using namespace hugo;
    17 using namespace hugo;
    18 
    18 
    30   std::ifstream is(str.c_str());
    30   std::ifstream is(str.c_str());
    31   readDimacs(is, g, cap, s, t);
    31   readDimacs(is, g, cap, s, t);
    32   Timer ts;
    32   Timer ts;
    33   ts.reset();
    33   ts.reset();
    34 
    34 
    35   typedef MaxFlow<Graph, int, FlowMap, FlowMap> MyMaxFlow;
    35   typedef Preflow<Graph, int, FlowMap, FlowMap> MyPreflow;
    36   MyMaxFlow max_flow(g, s, t, cap, flow);
    36   MyPreflow max_flow(g, s, t, cap, flow);
    37   max_flow.run(MyMaxFlow::NO_FLOW);
    37   max_flow.run(MyPreflow::NO_FLOW);
    38   cout << "flow value: " << max_flow.flowValue() << endl;
    38   cout << "flow value: " << max_flow.flowValue() << endl;
    39   cout << ts << endl;
    39   cout << ts << endl;
    40 }
    40 }
    41 
    41 
    42 int main(int, char** argv) {
    42 int main(int, char** argv) {