Index: lemon/preflow.h
===================================================================
--- lemon/preflow.h	(revision 2151)
+++ lemon/preflow.h	(revision 2330)
@@ -275,6 +275,8 @@
 	  first[b]=next[w];
 	  int newlevel=push(w, next, first);
-	  if ( _surely.positive(excess[w]) ) relabel(w, newlevel, first, next, level_list, 
-				       left, right, b, k, what_heur);
+	  if ( excess[w] != 0 ) {
+            relabel(w, newlevel, first, next, level_list, 
+                    left, right, b, k, what_heur);
+          }
 
 	  ++numrelabel;
@@ -317,4 +319,8 @@
     ///maxMinCut return the inclusionwise minimum and maximum cuts of
     ///minimum value, resp.  \pre \ref phase1 must be called before.
+    ///
+    /// \todo The inexact computation can cause positive excess on a set of 
+    /// unpushable nodes. We may have to watch the empty level in this case 
+    /// due to avoid the terrible long running time.
     void phase2()
     {
@@ -337,10 +343,10 @@
 
 	for(InEdgeIt e(*_g,v); e!=INVALID; ++e) {
-	  if ( !_surely.less((*_flow)[e], (*_capacity)[e]) ) continue;
+	  if ( !_surely.positive((*_capacity)[e] - (*_flow)[e])) continue;
 	  Node u=_g->source(e);
 	  if ( level[u] >= _node_num ) {
 	    bfs_queue.push(u);
 	    level.set(u, l);
-	    if ( _surely.positive(excess[u]) ) {
+	    if ( excess[u] != 0 ) {
 	      next.set(u,first[l]);
 	      first[l]=u;
@@ -355,5 +361,5 @@
 	    bfs_queue.push(u);
 	    level.set(u, l);
-	    if ( _surely.positive(excess[u]) ) {
+	    if ( excess[u] != 0 ) {
 	      next.set(u,first[l]);
 	      first[l]=u;
@@ -373,6 +379,10 @@
 	  int newlevel=push(w,next, first);
 	  
+          if ( newlevel == _node_num) {
+            excess.set(w, 0);
+	    level.set(w,_node_num);
+          }
 	  //relabel
-	  if ( _surely.positive(excess[w]) ) {
+	  if ( excess[w] != 0 ) {
 	    level.set(w,++newlevel);
 	    next.set(w,first[newlevel]);
@@ -444,5 +454,5 @@
 	for(OutEdgeIt e(*_g,w) ; e!=INVALID; ++e) {
 	  Node v=_g->target(e);
-	  if (!M[v] && _surely.less((*_flow)[e] , (*_capacity)[e]) ) {
+	  if (!M[v] && _surely.positive((*_capacity)[e] -(*_flow)[e]) ) {
 	    queue.push(v);
 	    M.set(v, true);
@@ -482,5 +492,5 @@
 	for(InEdgeIt e(*_g,w) ; e!=INVALID; ++e) {
 	  Node v=_g->source(e);
-	  if (M[v] && _surely.less((*_flow)[e], (*_capacity)[e]) ) {
+	  if (M[v] && _surely.positive((*_capacity)[e] - (*_flow)[e]) ) {
 	    queue.push(v);
 	    M.set(v, false);
@@ -577,10 +587,10 @@
 
       for(OutEdgeIt e(*_g,w) ; e!=INVALID; ++e) {
-	if ( !_surely.less((*_flow)[e], (*_capacity)[e]) ) continue;
+	if ( !_surely.positive((*_capacity)[e] - (*_flow)[e])) continue;
 	Node v=_g->target(e);
 	
 	if( lev > level[v] ) { //Push is allowed now
 	  
-	  if ( !_surely.positive(excess[v]) && v!=_target && v!=_source ) {
+	  if ( excess[v] == 0 && v!=_target && v!=_source ) {
 	    next.set(v,first[level[v]]);
 	    first[level[v]]=v;
@@ -606,5 +616,5 @@
       } //for out edges wv
 
-      if ( _surely.positive(exc) ) {
+      if ( exc != 0 ) {
 	for(InEdgeIt e(*_g,w) ; e!=INVALID; ++e) {
 	  
@@ -614,5 +624,5 @@
 	  if( lev > level[v] ) { //Push is allowed now
 
-	    if ( !_surely.positive(excess[v]) && v!=_target && v!=_source ) {
+	    if ( excess[v] == 0 && v!=_target && v!=_source ) {
 	      next.set(v,first[level[v]]);
 	      first[level[v]]=v;
@@ -664,5 +674,5 @@
 	  
 	  for(InEdgeIt e(*_g,v) ; e!=INVALID; ++e) {
-	    if ( !_surely.less((*_flow)[e],(*_capacity)[e]) ) continue;
+	    if ( !_surely.positive((*_capacity)[e] - (*_flow)[e] )) continue;
 	    Node w=_g->source(e);
 	    if ( level[w] == _node_num && w != _source ) {
@@ -727,5 +737,5 @@
 	  Node w=_g->target(e);
 	  if ( level[w] < _node_num ) {
-	    if ( !_surely.positive(excess[w]) && w!=_target ) { //putting into the stack
+	    if ( excess[w] == 0 && w!=_target ) { //putting into the stack
 	      next.set(w,first[level[w]]);
 	      first[level[w]]=w;
@@ -743,5 +753,8 @@
 	  for(InEdgeIt e(*_g,_target) ; e!=INVALID; ++e) exc+=(*_flow)[e];
 	  for(OutEdgeIt e(*_g,_target) ; e!=INVALID; ++e) exc-=(*_flow)[e];
-	  excess.set(_target,exc);
+          if (!_surely.positive(exc)) {
+            exc = 0;
+          }
+          excess.set(_target,exc);
 	}
 
@@ -752,5 +765,5 @@
 	  Node w=_g->target(e);
 	  if ( level[w] < _node_num ) {
-	    if ( !_surely.positive(excess[w]) && w!=_target ) { //putting into the stack
+	    if ( excess[w] == 0 && w!=_target ) { //putting into the stack
 	      next.set(w,first[level[w]]);
 	      first[level[w]]=w;
@@ -765,5 +778,5 @@
 	  Node w=_g->source(e);
 	  if ( level[w] < _node_num ) {
-	    if ( !_surely.positive(excess[w]) && w!=_target ) {
+	    if ( excess[w] == 0 && w!=_target ) {
 	      next.set(w,first[level[w]]);
 	      first[level[w]]=w;
@@ -795,9 +808,12 @@
 	  for(InEdgeIt e(*_g,w); e!=INVALID; ++e) exc+=(*_flow)[e];
 	  for(OutEdgeIt e(*_g,w); e!=INVALID; ++e) exc-=(*_flow)[e];
+          if (!_surely.positive(exc)) {
+            exc = 0;
+          }
 	  excess.set(w,exc);
 	  
 	  //putting the active nodes into the stack
 	  int lev=level[w];
-	    if ( _surely.positive(exc) && lev < _node_num && Node(w) != _target ) {
+	    if ( exc != 0 && lev < _node_num && Node(w) != _target ) {
 	      next.set(w,first[lev]);
 	      first[lev]=w;
