3 // Use a DIMACS max flow file as follows:
4 // graph_wrapper_time dimacs_max_flow_file
10 #include <hugo/invalid.h>
11 #include <hugo/time_measure.h>
12 #include <hugo/graph_wrapper.h>
13 #include <hugo/max_flow.h>
14 #include <hugo/dimacs.h>
15 #include <hugo/list_graph.h>
22 template<typename Graph>
23 void timeTest(std::string str, Graph& g) {
25 typename Graph::Node s;
26 typename Graph::Node t;
27 typedef typename Graph::template EdgeMap<int> FlowMap;
30 std::ifstream is(str.c_str());
31 readDimacs(is, g, cap, s, t);
35 typedef MaxFlow<Graph, int, FlowMap, FlowMap> MyMaxFlow;
36 MyMaxFlow max_flow(g, s, t, cap, flow);
37 max_flow.run(MyMaxFlow::NO_FLOW);
41 int main(int, char** argv) {
42 std::string in=argv[1];
44 typedef ListGraph Graph;
46 timeTest<Graph>(in, g);
47 typedef GraphWrapper<Graph> Graph1;
49 timeTest<Graph1>(in, g1);
50 typedef GraphWrapper<Graph1> Graph2;
52 timeTest<Graph2>(in, g2);
53 typedef GraphWrapper<Graph2> Graph3;
55 timeTest<Graph3>(in, g3);
56 typedef GraphWrapper<Graph3> Graph4;
58 timeTest<Graph4>(in, g4);
59 typedef GraphWrapper<Graph4> Graph5;
61 timeTest<Graph5>(in, g5);
62 typedef GraphWrapper<Graph5> Graph6;
64 timeTest<Graph6>(in, g6);
65 typedef GraphWrapper<Graph6> Graph7;
67 timeTest<Graph7>(in, g7);