[Lemon-commits] [lemon_svn] athos: r665 - hugo/trunk/src/work/athos
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:40:51 CET 2006
Author: athos
Date: Mon May 3 11:00:09 2004
New Revision: 665
Modified:
hugo/trunk/src/work/athos/preflow_push.hh
Log:
I changed it to correspond changing requirements
Modified: hugo/trunk/src/work/athos/preflow_push.hh
==============================================================================
--- hugo/trunk/src/work/athos/preflow_push.hh (original)
+++ hugo/trunk/src/work/athos/preflow_push.hh Mon May 3 11:00:09 2004
@@ -25,6 +25,9 @@
typedef typename Graph::Edge Edge;
typedef typename Graph::OutEdgeIt OutEdgeIt;
typedef typename Graph::InEdgeIt InEdgeIt;
+ typedef typename Graph::EdgeMap<T> CapacityType;
+
+ typedef ResGraphWrapper<const Graph,int,CapacityType,CapacityType> ResGraphType;
//---------------------------------------------
@@ -47,10 +50,10 @@
Graph& G;
Node s;
Node t;
- typename Graph::EdgeMap<T> &capacity;
+ CapacityType &capacity;
//output
- typename Graph::EdgeMap<T> preflow;
+ CapacityType preflow;
T maxflow_value;
//auxiliary variables for computation
@@ -131,7 +134,7 @@
}
cout<<endl;
}
-
+ /*
//Modifies the excess of the node and makes sufficient changes
void modify_excess(const Node& a ,T v){
//T old_value=excess[a];
@@ -155,7 +158,7 @@
modify_excess(G.tail(j),-v);
}
-
+ */
//Gives the active node to work with
//(depending on the implementation to be used)
Node get_active_node(){
@@ -380,6 +383,26 @@
//Out edges from node a
{
+ ResGraphType::OutEdgeIt j=res_graph.first(j,a);
+ while (res_graph.valid(j) && e){
+ if (is_admissible_forward_edge(j,new_level)){
+ v=min(e,res_graph.resCap(j));
+ e -= v;
+ //New node might become active
+ if (excess[res_graph.head(j)]==0){
+ make_active(res_graph.head(j));
+ }
+ res_graph.augment(j,v);
+ excess[res_graph.tail(j)] -= v;
+ excess[res_graph.head(j)] += v;
+ }
+ res_graph.next(j);
+ }
+ }
+
+ /*
+ //Out edges from node a
+ {
OutEdgeIt j=G.template first<OutEdgeIt>(a);
while (G.valid(j) && e){
@@ -411,6 +434,7 @@
G.next(j);
}
}
+ */
//if (G.id(a)==999)
//cout<<new_level<<" e: "<<e<<endl;
More information about the Lemon-commits
mailing list