Bug fix
authordeba
Wed, 12 Dec 2007 13:35:55 +0000
changeset 2541e67ec65747fa
parent 2540 8ab1d3d7dea7
child 2542 faaa54ec4520
Bug fix
lemon/circulation.h
     1.1 --- a/lemon/circulation.h	Tue Dec 11 17:42:49 2007 +0000
     1.2 +++ b/lemon/circulation.h	Wed Dec 12 13:35:55 2007 +0000
     1.3 @@ -403,9 +403,6 @@
     1.4  	_excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_flow)[e]);
     1.5        }
     1.6  
     1.7 -      typename Graph::template NodeMap<bool> reached(_g, false);
     1.8 -
     1.9 -
    1.10        // global relabeling tested, but in general case it provides
    1.11        // worse performance for random graphs
    1.12        _level->initStart();
    1.13 @@ -436,8 +433,8 @@
    1.14  	  _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_up)[e]);
    1.15  	} else if (_tol.positive((*_excess)[_g.target(e)] + (*_lo)[e])) {
    1.16  	  _flow->set(e, (*_lo)[e]);
    1.17 -	  _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_up)[e]);
    1.18 -	  _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_up)[e]);
    1.19 +	  _excess->set(_g.target(e), (*_excess)[_g.target(e)] + (*_lo)[e]);
    1.20 +	  _excess->set(_g.source(e), (*_excess)[_g.source(e)] - (*_lo)[e]);
    1.21  	} else {
    1.22  	  Value fc = -(*_excess)[_g.target(e)];
    1.23  	  _flow->set(e, fc);
    1.24 @@ -471,7 +468,7 @@
    1.25  	int actlevel=(*_level)[act];
    1.26  	int mlevel=_node_num;
    1.27  	Value exc=(*_excess)[act];
    1.28 -	
    1.29 +
    1.30  	for(OutEdgeIt e(_g,act);e!=INVALID; ++e) {
    1.31  	  Node v = _g.target(e);
    1.32  	  Value fc=(*_up)[e]-(*_flow)[e];
    1.33 @@ -488,7 +485,7 @@
    1.34  	    }
    1.35  	    else {
    1.36  	      _flow->set(e, (*_up)[e]);
    1.37 -	      _excess->set(v, (*_excess)[v] + exc);
    1.38 +	      _excess->set(v, (*_excess)[v] + fc);
    1.39  	      if(!_level->active(v) && _tol.positive((*_excess)[v]))
    1.40  		_level->activate(v);
    1.41  	      exc-=fc;