[Lemon-commits] [lemon_svn] marci: r616 - in hugo/trunk/src: include work/jacint work/marci
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:40:35 CET 2006
Author: marci
Date: Thu Apr 29 11:08:14 2004
New Revision: 616
Modified:
hugo/trunk/src/include/dimacs.h
hugo/trunk/src/work/jacint/preflow.h
hugo/trunk/src/work/marci/bipartite_matching_try.cc
hugo/trunk/src/work/marci/edmonds_karp_demo.cc
hugo/trunk/src/work/marci/lg_vs_sg.cc
Log:
mods implied by preflow mods
Modified: hugo/trunk/src/include/dimacs.h
==============================================================================
--- hugo/trunk/src/include/dimacs.h (original)
+++ hugo/trunk/src/include/dimacs.h Thu Apr 29 11:08:14 2004
@@ -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<typename Graph, typename CapacityMap>
void readDimacsMaxFlow(std::istream& is, Graph &g, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) {
g.clear();
Modified: hugo/trunk/src/work/jacint/preflow.h
==============================================================================
--- hugo/trunk/src/work/jacint/preflow.h (original)
+++ hugo/trunk/src/work/jacint/preflow.h Thu Apr 29 11:08:14 2004
@@ -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<int> 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 );
Modified: hugo/trunk/src/work/marci/bipartite_matching_try.cc
==============================================================================
--- hugo/trunk/src/work/marci/bipartite_matching_try.cc (original)
+++ hugo/trunk/src/work/marci/bipartite_matching_try.cc Thu Apr 29 11:08:14 2004
@@ -181,7 +181,7 @@
ts.reset();
stGW::EdgeMap<int> pre_flow(stgw);
Preflow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> >
- 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;
Modified: hugo/trunk/src/work/marci/edmonds_karp_demo.cc
==============================================================================
--- hugo/trunk/src/work/marci/edmonds_karp_demo.cc (original)
+++ hugo/trunk/src/work/marci/edmonds_karp_demo.cc Thu Apr 29 11:08:14 2004
@@ -71,11 +71,11 @@
Timer ts;
Graph::EdgeMap<int> flow(G); //0 flow
Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
- pre_flow_test(G, s, t, cap, flow, true);
+ pre_flow_test(G, s, t, cap, flow/*, true*/);
Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
- pre_flow_ize(G, s, t, cap, flow, false);
- PreflowRes<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
- pre_flow_res(G, s, t, cap, flow, true);
+ pre_flow_ize(G, s, t, cap, flow/*, false*/);
+// PreflowRes<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
+// pre_flow_res(G, s, t, cap, flow/*, true*/);
MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
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, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::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;
Modified: hugo/trunk/src/work/marci/lg_vs_sg.cc
==============================================================================
--- hugo/trunk/src/work/marci/lg_vs_sg.cc (original)
+++ hugo/trunk/src/work/marci/lg_vs_sg.cc Thu Apr 29 11:08:14 2004
@@ -35,7 +35,7 @@
Timer ts;
Graph::EdgeMap<int> flow(G); //0 flow
Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
- pre_flow_test(G, s, t, cap, flow, true);
+ pre_flow_test(G, s, t, cap, flow/*, true*/);
MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
max_flow_test(G, s, t, cap, flow);
@@ -109,7 +109,7 @@
Timer ts;
Graph::EdgeMap<int> flow(G); //0 flow
Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
- pre_flow_test(G, s, t, cap, flow, true);
+ pre_flow_test(G, s, t, cap, flow/*, true*/);
MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
max_flow_test(G, s, t, cap, flow);
More information about the Lemon-commits
mailing list