[Lemon-commits] [lemon_svn] athos: r155 - hugo/trunk/src/work/athos
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:37:50 CET 2006
Author: athos
Date: Mon Feb 23 12:17:41 2004
New Revision: 155
Modified:
hugo/trunk/src/work/athos/preflow_push.hh
Log:
Alpar, nezz bele
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 Feb 23 12:17:41 2004
@@ -8,7 +8,7 @@
//#include <marci_list_graph.hh>
//#include <marci_graph_traits.hh>
-#include "reverse_bfs.hh"
+#include <reverse_bfs.hh>
using namespace std;
@@ -175,7 +175,7 @@
//Gives the active node to work with
//(depending on the implementation to be used)
NodeIt get_active_node(){
- //cout<<highest_active<<endl;
+
switch(implementation) {
case impl_highest_label : {
@@ -186,8 +186,11 @@
}
if( highest_active>=0) {
+
+
NodeIt a=active_nodes[highest_active].front();
active_nodes[highest_active].pop_front();
+
return a;
}
else {
@@ -304,6 +307,7 @@
//If the preflow is less than the capacity on the given edge
//then it is an edge in the residual graph
bool is_admissible_forward_edge(OutEdgeIt j, int& new_level){
+
if (capacity.get(j)>preflow.get(j)){
if(level.get(G.tail(j))==level.get(G.head(j))+1){
return true;
@@ -319,8 +323,10 @@
//If the preflow is greater than 0 on the given edge
//then the edge reversd is an edge in the residual graph
bool is_admissible_backward_edge(InEdgeIt j, int& new_level){
+
if (0<preflow.get(j)){
if(level.get(G.tail(j))==level.get(G.head(j))-1){
+
return true;
}
else{
@@ -339,10 +345,11 @@
T preflow_push<graph_type, T>::run() {
preprocess();
-
+ //write_property_vector(level,"level");
T e,v;
NodeIt a;
while (a=get_active_node(), a.valid()){
+
//cout<<G.id(a)<<endl;
//write_property_vector(excess,"excess");
//write_property_vector(level,"level");
@@ -351,7 +358,6 @@
bool go_to_next_node=false;
e = excess.get(a);
while (!go_to_next_node){
-
//Initial value for the new level for the active node we are dealing with
int new_level=2*number_of_nodes;
//write_property_vector(excess,"excess");
@@ -391,6 +397,8 @@
}
}
+ //if (G.id(a)==999)
+ //cout<<new_level<<" e: "<<e<<endl;
//cout<<G.id(a)<<" "<<new_level<<endl;
if (0==e){
More information about the Lemon-commits
mailing list