athos@511: #include athos@511: #include athos@511: athos@511: #include alpar@921: #include alpar@921: #include athos@607: #include "minlengthpaths.h" athos@511: //#include athos@511: alpar@921: using namespace lemon; athos@511: athos@511: // Use a DIMACS max flow file as stdin. athos@511: // read_dimacs_demo < dimacs_max_flow_file athos@511: int main(int argc, char ** argv) { athos@511: typedef ListGraph Graph; athos@511: athos@511: typedef Graph::Node Node; athos@511: //typedef Graph::EachEdgeIt EachEdgeIt; athos@511: athos@511: Graph G; athos@511: Node s, t; athos@511: Graph::EdgeMap cap(G); athos@607: readDimacs(std::cin, G, cap, s, t); athos@511: athos@607: std::cout << "Minlengthpaths demo (ATHOS)..." << std::endl; athos@511: //Graph::EdgeMap flow(G); //0 flow athos@511: athos@511: // double pre_time=currTime(); athos@511: athos@511: int k=1; athos@511: if (argc>1) athos@511: k = atoi(argv[1]); athos@511: MinLengthPaths > athos@511: surb_test(G,cap); athos@607: Timer ts; athos@607: ts.reset(); athos@607: std::cout << "Number of found paths: " << surb_test.run(s,t,k) << std::endl; athos@607: std::cout << "elapsed time: " << ts << std::endl; athos@607: athos@607: std::cout << "Total length of found paths: " << surb_test.totalLength() << std::endl; athos@607: //std::cout << (surb_test.checkComplementarySlackness() ? "OK (compl. slackn.)." : "Problem (compl. slackn.)!!!") << std::endl; athos@607: athos@511: //preflow_push max_flow_test(G, s, t, cap); athos@511: //int flow_value=max_flow_test.run(); athos@511: athos@511: //double post_time=currTime(); athos@511: athos@511: //std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; athos@511: //std::cout << "flow value: "<< flow_value << std::endl; athos@511: athos@511: return 0; athos@511: }