Alpar, nezz bele
authorathos
Mon, 23 Feb 2004 11:17:41 +0000
changeset 1199b3345f9d8ed
parent 118 38e16c594a4f
child 120 576f55fec89e
Alpar, nezz bele
src/work/athos/preflow_push.hh
     1.1 --- a/src/work/athos/preflow_push.hh	Mon Feb 23 07:05:27 2004 +0000
     1.2 +++ b/src/work/athos/preflow_push.hh	Mon Feb 23 11:17:41 2004 +0000
     1.3 @@ -8,7 +8,7 @@
     1.4  //#include <marci_list_graph.hh>
     1.5  //#include <marci_graph_traits.hh>
     1.6  
     1.7 -#include "reverse_bfs.hh"
     1.8 +#include <reverse_bfs.hh>
     1.9  
    1.10  using namespace std;
    1.11  
    1.12 @@ -175,7 +175,7 @@
    1.13      //Gives the active node to work with 
    1.14      //(depending on the implementation to be used)
    1.15      NodeIt get_active_node(){
    1.16 -      //cout<<highest_active<<endl;
    1.17 +      
    1.18  
    1.19        switch(implementation) {
    1.20        case impl_highest_label : {
    1.21 @@ -186,8 +186,11 @@
    1.22  	}
    1.23  
    1.24  	if( highest_active>=0) {
    1.25 +	  
    1.26 +
    1.27  	  NodeIt a=active_nodes[highest_active].front();
    1.28  	  active_nodes[highest_active].pop_front();
    1.29 +	  
    1.30  	  return a;
    1.31  	}
    1.32  	else {
    1.33 @@ -304,6 +307,7 @@
    1.34      //If the preflow is less than the capacity on the given edge
    1.35      //then it is an edge in the residual graph
    1.36      bool is_admissible_forward_edge(OutEdgeIt j, int& new_level){
    1.37 +
    1.38        if (capacity.get(j)>preflow.get(j)){
    1.39  	if(level.get(G.tail(j))==level.get(G.head(j))+1){
    1.40  	  return true;
    1.41 @@ -319,8 +323,10 @@
    1.42      //If the preflow is greater than 0 on the given edge
    1.43      //then the edge reversd is an edge in the residual graph
    1.44      bool is_admissible_backward_edge(InEdgeIt j, int& new_level){
    1.45 +      
    1.46        if (0<preflow.get(j)){
    1.47  	if(level.get(G.tail(j))==level.get(G.head(j))-1){
    1.48 +	 
    1.49  	  return true;
    1.50  	}
    1.51  	else{
    1.52 @@ -339,10 +345,11 @@
    1.53      T preflow_push<graph_type, T>::run() {
    1.54      
    1.55      preprocess();
    1.56 -    
    1.57 +    //write_property_vector(level,"level");
    1.58      T e,v;
    1.59      NodeIt a;
    1.60      while (a=get_active_node(), a.valid()){
    1.61 +      
    1.62        //cout<<G.id(a)<<endl;
    1.63        //write_property_vector(excess,"excess");
    1.64        //write_property_vector(level,"level");
    1.65 @@ -351,7 +358,6 @@
    1.66        bool go_to_next_node=false;
    1.67        e = excess.get(a);
    1.68        while (!go_to_next_node){
    1.69 -
    1.70  	//Initial value for the new level for the active node we are dealing with
    1.71  	int new_level=2*number_of_nodes;
    1.72  	//write_property_vector(excess,"excess");
    1.73 @@ -391,6 +397,8 @@
    1.74  	  }
    1.75  	}
    1.76  
    1.77 +	//if (G.id(a)==999)
    1.78 +	//cout<<new_level<<" e: "<<e<<endl;
    1.79  	//cout<<G.id(a)<<" "<<new_level<<endl;
    1.80  
    1.81  	if (0==e){