26 FlowMap flow(g); |
29 FlowMap flow(g); |
27 std::ifstream is(str.c_str()); |
30 std::ifstream is(str.c_str()); |
28 readDimacs(is, g, cap, s, t); |
31 readDimacs(is, g, cap, s, t); |
29 Timer ts; |
32 Timer ts; |
30 ts.reset(); |
33 ts.reset(); |
31 cout << g.nodeNum() << endl; |
34 |
32 cout << g.edgeNum() << endl; |
|
33 typedef MaxFlow<Graph, int, FlowMap, FlowMap> MyMaxFlow; |
35 typedef MaxFlow<Graph, int, FlowMap, FlowMap> MyMaxFlow; |
34 MyMaxFlow max_flow(g, s, t, cap, flow); |
36 MyMaxFlow max_flow(g, s, t, cap, flow); |
35 max_flow.run(MyMaxFlow::NO_FLOW); |
37 max_flow.run(MyMaxFlow::NO_FLOW); |
36 cout << ts << endl; |
38 cout << ts << endl; |
37 } |
39 } |
39 int main(int, char** argv) { |
41 int main(int, char** argv) { |
40 std::string in=argv[1]; |
42 std::string in=argv[1]; |
41 |
43 |
42 typedef ListGraph Graph; |
44 typedef ListGraph Graph; |
43 Graph g; |
45 Graph g; |
44 // cout << g.id(g.addNode()) << endl; |
|
45 // cout << g.id(g.addNode()) << endl; |
|
46 // cout << g.nodeNum() << endl; |
|
47 timeTest<Graph>(in, g); |
46 timeTest<Graph>(in, g); |
48 typedef GraphWrapper<Graph> Graph1; |
47 typedef GraphWrapper<Graph> Graph1; |
49 Graph1 g1(g); |
48 Graph1 g1(g); |
50 // g1.clear(); |
|
51 // cout << g.id(g1.addNode()) << endl; |
|
52 // cout << g.id(g1.addNode()) << endl; |
|
53 // cout << g1.nodeNum() << endl; |
|
54 // g1.clear(); |
|
55 timeTest<Graph1>(in, g1); |
49 timeTest<Graph1>(in, g1); |
56 typedef GraphWrapper<Graph1> Graph2; |
50 typedef GraphWrapper<Graph1> Graph2; |
57 Graph2 g2(g1); |
51 Graph2 g2(g1); |
58 timeTest<Graph2>(in, g2); |
52 timeTest<Graph2>(in, g2); |
59 typedef GraphWrapper<Graph2> Graph3; |
53 typedef GraphWrapper<Graph2> Graph3; |
60 Graph3 g3(g2); |
54 Graph3 g3(g2); |
61 timeTest<Graph3>(in, g3); |
55 timeTest<Graph3>(in, g3); |
62 // typedef GraphWrapper<Graph3> Graph4; |
56 typedef GraphWrapper<Graph3> Graph4; |
63 // Graph4 g4(g3); |
57 Graph4 g4(g3); |
64 // timeTest<Graph4>(in, g4); |
58 timeTest<Graph4>(in, g4); |
65 // typedef GraphWrapper<Graph4> Graph5; |
59 typedef GraphWrapper<Graph4> Graph5; |
66 // Graph5 g5(g4); |
60 Graph5 g5(g4); |
67 // timeTest<Graph5>(in, g5); |
61 timeTest<Graph5>(in, g5); |
68 // typedef GraphWrapper<Graph5> Graph6; |
62 typedef GraphWrapper<Graph5> Graph6; |
69 // Graph6 g6(g5); |
63 Graph6 g6(g5); |
70 // timeTest<Graph6>(in, g6); |
64 timeTest<Graph6>(in, g6); |
71 // typedef GraphWrapper<Graph6> Graph7; |
65 typedef GraphWrapper<Graph6> Graph7; |
72 // Graph7 g7(g6); |
66 Graph7 g7(g6); |
73 // timeTest<Graph7>(in, g7); |
67 timeTest<Graph7>(in, g7); |
74 |
68 |
75 return 0; |
69 return 0; |
76 } |
70 } |