# HG changeset patch # User marci # Date 1077017061 0 # Node ID 46705346edd4f690dee773b125fb755d3d24beb6 # Parent cbd76005b9a77f24cec2e6c68683a0e480a59abc mostmar pontosabb erteket ad diff -r cbd76005b9a7 -r 46705346edd4 src/work/marci/preflow_demo_jacint.cc --- a/src/work/marci/preflow_demo_jacint.cc Tue Feb 17 11:23:00 2004 +0000 +++ b/src/work/marci/preflow_demo_jacint.cc Tue Feb 17 11:24:21 2004 +0000 @@ -4,6 +4,7 @@ #include #include #include +#include #include using namespace marci; @@ -19,7 +20,8 @@ ListGraph::EdgeMap cap(G); readDimacsMaxFlow(std::cin, G, s, t, cap); - std::cout << "preflow demo (JACINT)..." << std::endl; + { + std::cout << "preflow demo (preflow_push_max_flow by JACINT)..." << std::endl; //ListGraph::EdgeMap flow(G); //0 flow double pre_time=currTime(); @@ -39,6 +41,32 @@ std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; std::cout << "flow value: "<< max_flow_test.maxflow() << std::endl; std::cout << "cut value: "<< cut_value << std::endl; + } + +/* + { + std::cout << "preflow demo (preflow_push_hl by JACINT)..." << std::endl; + //ListGraph::EdgeMap flow(G); //0 flow + + double pre_time=currTime(); + preflow_push_hl max_flow_test(G, s, t, cap); + max_flow_test.run(); + ListGraph::NodeMap cut=max_flow_test.mincut(); + int cut_value=0; + for(EachEdgeIt e=G.first(); e.valid(); ++e) { + if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e); + } + double post_time=currTime(); + //std::cout << "maximum flow: "<< std::endl; + //for(EachEdgeIt e=G.first(); e.valid(); ++e) { + // std::cout<<"("<"<