[Lemon-commits] [lemon_svn] marci: r1023 - hugo/trunk/src/hugo

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:42:46 CET 2006


Author: marci
Date: Tue Aug 17 12:24:19 2004
New Revision: 1023

Modified:
   hugo/trunk/src/hugo/max_flow.h

Log:
flowValue() is reset to deal with excess[t]. 


Modified: hugo/trunk/src/hugo/max_flow.h
==============================================================================
--- hugo/trunk/src/hugo/max_flow.h	(original)
+++ hugo/trunk/src/hugo/max_flow.h	Tue Aug 17 12:24:19 2004
@@ -344,16 +344,18 @@
     }
 
 
-    /// Returns the maximum value of a flow.
+    /// Returns the value of the maximum flow.
 
-    /// Returns the maximum value of a flow, by counting the 
-    /// over-flow of the target node \ref t.
+    /// Returns the excess of the target node \ref t. 
+    /// After running \ref preflowPhase1, this is the value of 
+    /// the maximum flow.
     /// It can be called already after running \ref preflowPhase1.
     Num flowValue() const {
-      Num a=0;
-      for(InEdgeIt e(*g,t);g->valid(e);g->next(e)) a+=(*flow)[e];
-      for(OutEdgeIt e(*g,t);g->valid(e);g->next(e)) a-=(*flow)[e];
-      return a;
+//       Num a=0;
+//       for(InEdgeIt e(*g,t);g->valid(e);g->next(e)) a+=(*flow)[e];
+//       for(OutEdgeIt e(*g,t);g->valid(e);g->next(e)) a-=(*flow)[e];
+//       return a;
+      return excess[t];
       //marci figyu: excess[t] epp ezt adja preflow 1. fazisa utan   
     }
 



More information about the Lemon-commits mailing list