bug fix, test...
7 #include <hugo/invalid.h>
8 #include <hugo/time_measure.h>
9 #include <hugo/graph_wrapper.h>
10 #include <hugo/max_flow.h>
11 #include <hugo/dimacs.h>
12 #include <hugo/list_graph.h>
19 template<typename Graph>
20 void timeTest(std::string str, Graph& g) {
22 typename Graph::Node s;
23 typename Graph::Node t;
24 typedef typename Graph::template EdgeMap<int> FlowMap;
27 std::ifstream is(str.c_str());
28 readDimacs(is, g, cap, s, t);
31 cout << g.nodeNum() << endl;
32 cout << g.edgeNum() << endl;
33 typedef MaxFlow<Graph, int, FlowMap, FlowMap> MyMaxFlow;
34 MyMaxFlow max_flow(g, s, t, cap, flow);
35 max_flow.run(MyMaxFlow::NO_FLOW);
39 int main(int, char** argv) {
40 std::string in=argv[1];
42 typedef ListGraph Graph;
44 // cout << g.id(g.addNode()) << endl;
45 // cout << g.id(g.addNode()) << endl;
46 // cout << g.nodeNum() << endl;
47 timeTest<Graph>(in, g);
48 typedef GraphWrapper<Graph> Graph1;
51 // cout << g.id(g1.addNode()) << endl;
52 // cout << g.id(g1.addNode()) << endl;
53 // cout << g1.nodeNum() << endl;
55 timeTest<Graph1>(in, g1);
56 typedef GraphWrapper<Graph1> Graph2;
58 timeTest<Graph2>(in, g2);
59 typedef GraphWrapper<Graph2> Graph3;
61 timeTest<Graph3>(in, g3);
62 // typedef GraphWrapper<Graph3> Graph4;
64 // timeTest<Graph4>(in, g4);
65 // typedef GraphWrapper<Graph4> Graph5;
67 // timeTest<Graph5>(in, g5);
68 // typedef GraphWrapper<Graph5> Graph6;
70 // timeTest<Graph6>(in, g6);
71 // typedef GraphWrapper<Graph6> Graph7;
73 // timeTest<Graph7>(in, g7);