[Lemon-commits] alpar: r3288 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Tue Jun 5 19:27:55 CEST 2007


Author: alpar
Date: Tue Jun  5 19:27:54 2007
New Revision: 3288

Modified:
   lemon/trunk/lemon/circulation.h

Log:

Negate the meaning of the delta parameter


Modified: lemon/trunk/lemon/circulation.h
==============================================================================
--- lemon/trunk/lemon/circulation.h	(original)
+++ lemon/trunk/lemon/circulation.h	Tue Jun  5 19:27:54 2007
@@ -37,7 +37,7 @@
   ///This class implements a preflow algorithm
   ///for the Network Circulation Problem.
   ///The exact formulation of this problem is the following.
-  /// \f[\sum_{e\in\rho(v)}x(e)-\sum_{e\in\delta(v)}x(e)\leq delta(v)\quad \forall v\in V \f]
+  /// \f[\sum_{e\in\rho(v)}x(e)-\sum_{e\in\delta(v)}x(e)\leq -delta(v)\quad \forall v\in V \f]
   /// \f[ lo(e)\leq x(e) \leq up(e) \quad \forall e\in E \f]
   ///
   template<class Graph,
@@ -95,7 +95,7 @@
      
       _x=_lo;
 
-      for(NodeIt n(_g);n!=INVALID;++n) _excess[n]=-_delta[n];
+      for(NodeIt n(_g);n!=INVALID;++n) _excess[n]=_delta[n];
 
       for(EdgeIt e(_g);e!=INVALID;++e)
 	{
@@ -120,7 +120,7 @@
 	if(x[e]<_lo[e]||x[e]>_up[e]) return false;
       for(NodeIt n(_g);n!=INVALID;++n)
 	{
-	  Value dif=_delta[n];
+	  Value dif=-_delta[n];
 	  for(InEdgeIt e(_g,n);e!=INVALID;++e) dif-=x[e];
 	  for(OutEdgeIt e(_g,n);e!=INVALID;++e) dif+=x[e];
 	  if(_tol.negative(dif)) return false;
@@ -140,7 +140,7 @@
       Value delta=0;
       for(NodeIt n(_g);n!=INVALID;++n)
 	if(bar[n])
-	  delta+=_delta[n];
+	  delta-=_delta[n];
       for(EdgeIt e(_g);e!=INVALID;++e)
 	{
 	  Node s=_g.source(e);
@@ -279,7 +279,7 @@
     ///Return a barrier
     
     ///Barrier is a set \e B of nodes for which
-    /// \f[ \sum_{v\in B}delta(v)<\sum_{e\in\rho(B)}lo(e)-\sum_{e\in\delta(B)}up(e) \f]
+    /// \f[ \sum_{v\in B}-delta(v)<\sum_{e\in\rho(B)}lo(e)-\sum_{e\in\delta(B)}up(e) \f]
     ///holds. The existence of a set with this property prooves that a feasible
     ///flow cannot exists.
     ///\pre The run() must have been executed, and its return value was -1.



More information about the Lemon-commits mailing list