# HG changeset patch # User marci # Date 1083229694 0 # Node ID d72e56f1730ddd7b67c564bbca085005a4c8865d # Parent 7932f53d413de166780b94c12a956fc4f27cafb9 mods implied by preflow mods diff -r 7932f53d413d -r d72e56f1730d src/include/dimacs.h --- a/src/include/dimacs.h Thu Apr 29 08:42:05 2004 +0000 +++ b/src/include/dimacs.h Thu Apr 29 09:08:14 2004 +0000 @@ -20,6 +20,8 @@ /// and \c capacity will contain the edge capacities. /// If the data is a shortest path problem instance then \c s will be the /// source node and \c capacity will contain the edge lengths. + /// + ///\author Marton Makai template void readDimacsMaxFlow(std::istream& is, Graph &g, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) { g.clear(); diff -r 7932f53d413d -r d72e56f1730d src/work/jacint/preflow.h --- a/src/work/jacint/preflow.h Thu Apr 29 08:42:05 2004 +0000 +++ b/src/work/jacint/preflow.h Thu Apr 29 09:08:14 2004 +0000 @@ -62,7 +62,7 @@ const Graph& G; Node s; Node t; - CapMap* capacity; + const CapMap* capacity; FlowMap* flow; int n; //the number of nodes of G typename Graph::template NodeMap level; @@ -77,7 +77,7 @@ PREFLOW=2 }; - Preflow(Graph& _G, Node _s, Node _t, CapMap& _capacity, + Preflow(const Graph& _G, Node _s, Node _t, const CapMap& _capacity, FlowMap& _flow) : G(_G), s(_s), t(_t), capacity(&_capacity), flow(&_flow), n(_G.nodeNum()), level(_G), excess(_G,0) {} @@ -153,6 +153,10 @@ break; } +// default: +// break; +// ZERO_FLOW ize kell + } preflowPreproc( fe, active, level_list, left, right ); diff -r 7932f53d413d -r d72e56f1730d src/work/marci/bipartite_matching_try.cc --- a/src/work/marci/bipartite_matching_try.cc Thu Apr 29 08:42:05 2004 +0000 +++ b/src/work/marci/bipartite_matching_try.cc Thu Apr 29 09:08:14 2004 +0000 @@ -181,7 +181,7 @@ ts.reset(); stGW::EdgeMap pre_flow(stgw); Preflow, stGW::EdgeMap > - pre_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, pre_flow, true); + pre_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, pre_flow/*, true*/); pre_flow_test.run(); std::cout << "pre flow value: " << max_flow_test.flowValue() << std::endl; std::cout << "elapsed time: " << ts << std::endl; diff -r 7932f53d413d -r d72e56f1730d src/work/marci/edmonds_karp_demo.cc --- a/src/work/marci/edmonds_karp_demo.cc Thu Apr 29 08:42:05 2004 +0000 +++ b/src/work/marci/edmonds_karp_demo.cc Thu Apr 29 09:08:14 2004 +0000 @@ -71,11 +71,11 @@ Timer ts; Graph::EdgeMap flow(G); //0 flow Preflow, Graph::EdgeMap > - pre_flow_test(G, s, t, cap, flow, true); + pre_flow_test(G, s, t, cap, flow/*, true*/); Preflow, Graph::EdgeMap > - pre_flow_ize(G, s, t, cap, flow, false); - PreflowRes, Graph::EdgeMap > - pre_flow_res(G, s, t, cap, flow, true); + pre_flow_ize(G, s, t, cap, flow/*, false*/); +// PreflowRes, Graph::EdgeMap > +// pre_flow_res(G, s, t, cap, flow/*, true*/); MaxFlow, Graph::EdgeMap > max_flow_test(G, s, t, cap, flow); @@ -91,19 +91,19 @@ std::cout << "preflow ..." << std::endl; FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); ts.reset(); - pre_flow_ize.run(); + pre_flow_ize.preflow(Preflow, Graph::EdgeMap >::GEN_FLOW); std::cout << "elapsed time: " << ts << std::endl; std::cout << "flow value: "<< pre_flow_ize.flowValue() << std::endl; } - { - std::cout << "wrapped preflow ..." << std::endl; - FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); - ts.reset(); - pre_flow_res.run(); - std::cout << "elapsed time: " << ts << std::endl; - std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; - } +// { +// std::cout << "wrapped preflow ..." << std::endl; +// FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); +// ts.reset(); +// pre_flow_res.run(); +// std::cout << "elapsed time: " << ts << std::endl; +// std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; +// } { std::cout << "physical blocking flow augmentation ..." << std::endl; diff -r 7932f53d413d -r d72e56f1730d src/work/marci/lg_vs_sg.cc --- a/src/work/marci/lg_vs_sg.cc Thu Apr 29 08:42:05 2004 +0000 +++ b/src/work/marci/lg_vs_sg.cc Thu Apr 29 09:08:14 2004 +0000 @@ -35,7 +35,7 @@ Timer ts; Graph::EdgeMap flow(G); //0 flow Preflow, Graph::EdgeMap > - pre_flow_test(G, s, t, cap, flow, true); + pre_flow_test(G, s, t, cap, flow/*, true*/); MaxFlow, Graph::EdgeMap > max_flow_test(G, s, t, cap, flow); @@ -109,7 +109,7 @@ Timer ts; Graph::EdgeMap flow(G); //0 flow Preflow, Graph::EdgeMap > - pre_flow_test(G, s, t, cap, flow, true); + pre_flow_test(G, s, t, cap, flow/*, true*/); MaxFlow, Graph::EdgeMap > max_flow_test(G, s, t, cap, flow);