// -*- c++ -*- #include #include #include #include #include #include #include #include #include #include using namespace hugo; using std::cout; using std::endl; template void timeTest(std::string str, Graph& g) { g.clear(); typename Graph::Node s; typename Graph::Node t; typedef typename Graph::template EdgeMap FlowMap; FlowMap cap(g); FlowMap flow(g); std::ifstream is(str.c_str()); readDimacs(is, g, cap, s, t); Timer ts; ts.reset(); cout << g.nodeNum() << endl; cout << g.edgeNum() << endl; typedef MaxFlow MyMaxFlow; MyMaxFlow max_flow(g, s, t, cap, flow); max_flow.run(MyMaxFlow::NO_FLOW); cout << ts << endl; } int main(int, char** argv) { std::string in=argv[1]; typedef ListGraph Graph; Graph g; // cout << g.id(g.addNode()) << endl; // cout << g.id(g.addNode()) << endl; // cout << g.nodeNum() << endl; timeTest(in, g); typedef GraphWrapper Graph1; Graph1 g1(g); // g1.clear(); // cout << g.id(g1.addNode()) << endl; // cout << g.id(g1.addNode()) << endl; // cout << g1.nodeNum() << endl; // g1.clear(); timeTest(in, g1); typedef GraphWrapper Graph2; Graph2 g2(g1); timeTest(in, g2); typedef GraphWrapper Graph3; Graph3 g3(g2); timeTest(in, g3); // typedef GraphWrapper Graph4; // Graph4 g4(g3); // timeTest(in, g4); // typedef GraphWrapper Graph5; // Graph5 g5(g4); // timeTest(in, g5); // typedef GraphWrapper Graph6; // Graph6 g6(g5); // timeTest(in, g6); // typedef GraphWrapper Graph7; // Graph7 g7(g6); // timeTest(in, g7); return 0; }