alpar@74: #include alpar@74: #include alpar@74: alpar@103: #include "smart_graph.h" alpar@103: alpar@74: #include "../list_graph.hh" alpar@74: #include "../marci/dimacs.hh" alpar@74: #include "f_ed_ka.h" alpar@74: #include "../marci/time_measure.h" alpar@74: alpar@921: using namespace lemon; alpar@74: alpar@74: // Use a DIMACS max flow file as stdin. alpar@74: // read_dimacs_demo < dimacs_max_flow_file alpar@74: alpar@74: int main(int, char **) { alpar@108: typedef SmartGraph Graph; alpar@108: //typedef ListGraph Graph; alpar@74: alpar@103: typedef Graph::NodeIt NodeIt; alpar@103: typedef Graph::EachNodeIt EachNodeIt; alpar@103: typedef Graph::EachEdgeIt EachEdgeIt; alpar@103: alpar@103: Graph G; marci@95: NodeIt s, t; alpar@118: Timer ts; alpar@108: Graph::DynEdgeMap cap(G); alpar@74: readDimacsMaxFlow(std::cin, G, s, t, cap); alpar@74: alpar@118: std::cout << "loading time: " << ts << std::endl; alpar@118: ts.reset(); alpar@74: std::cout << "edmonds karp demo..." << std::endl; alpar@108: Graph::DynEdgeMap flow(G); //0 flow alpar@74: alpar@74: int ret; alpar@118: // double pre_time=currTime(); alpar@117: alpar@74: ret = maxFlow(G,flow,cap,s,t); alpar@118: // double post_time=currTime(); alpar@118: std::cout << "running time: " << ts << std::endl; alpar@117: alpar@74: //std::cout << "maximum flow: "<< std::endl; alpar@74: //for(EachEdgeIt e=G.first(); e.valid(); ++e) { alpar@74: // std::cout<<"("<"<