flowValue() is reset to deal with excess[t].
authormarci
Tue, 17 Aug 2004 10:24:19 +0000
changeset 76158243a389464
parent 760 49d4fe04fbc0
child 762 511200bdb71f
flowValue() is reset to deal with excess[t].
src/hugo/max_flow.h
     1.1 --- a/src/hugo/max_flow.h	Thu Aug 05 11:41:36 2004 +0000
     1.2 +++ b/src/hugo/max_flow.h	Tue Aug 17 10:24:19 2004 +0000
     1.3 @@ -344,16 +344,18 @@
     1.4      }
     1.5  
     1.6  
     1.7 -    /// Returns the maximum value of a flow.
     1.8 +    /// Returns the value of the maximum flow.
     1.9  
    1.10 -    /// Returns the maximum value of a flow, by counting the 
    1.11 -    /// over-flow of the target node \ref t.
    1.12 +    /// Returns the excess of the target node \ref t. 
    1.13 +    /// After running \ref preflowPhase1, this is the value of 
    1.14 +    /// the maximum flow.
    1.15      /// It can be called already after running \ref preflowPhase1.
    1.16      Num flowValue() const {
    1.17 -      Num a=0;
    1.18 -      for(InEdgeIt e(*g,t);g->valid(e);g->next(e)) a+=(*flow)[e];
    1.19 -      for(OutEdgeIt e(*g,t);g->valid(e);g->next(e)) a-=(*flow)[e];
    1.20 -      return a;
    1.21 +//       Num a=0;
    1.22 +//       for(InEdgeIt e(*g,t);g->valid(e);g->next(e)) a+=(*flow)[e];
    1.23 +//       for(OutEdgeIt e(*g,t);g->valid(e);g->next(e)) a-=(*flow)[e];
    1.24 +//       return a;
    1.25 +      return excess[t];
    1.26        //marci figyu: excess[t] epp ezt adja preflow 1. fazisa utan   
    1.27      }
    1.28