lemon/capacity_scaling.h
changeset 1240 ee9bac10f58e
parent 1166 d59484d5fc1f
child 1241 879fcb781086
child 1296 330264b171cf
     1.1 --- a/lemon/capacity_scaling.h	Sat Mar 20 11:03:12 2010 +0100
     1.2 +++ b/lemon/capacity_scaling.h	Sat Mar 16 16:20:41 2013 +0100
     1.3 @@ -737,6 +737,11 @@
     1.4        }
     1.5        if (_sum_supply > 0) return INFEASIBLE;
     1.6  
     1.7 +      // Check lower and upper bounds
     1.8 +      LEMON_DEBUG(checkBoundMaps(),
     1.9 +          "Upper bounds must be greater or equal to the lower bounds");
    1.10 +
    1.11 +
    1.12        // Initialize vectors
    1.13        for (int i = 0; i != _root; ++i) {
    1.14          _pi[i] = 0;
    1.15 @@ -830,6 +835,15 @@
    1.16  
    1.17        return OPTIMAL;
    1.18      }
    1.19 +    
    1.20 +    // Check if the upper bound is greater or equal to the lower bound
    1.21 +    // on each arc.
    1.22 +    bool checkBoundMaps() {
    1.23 +      for (int j = 0; j != _res_arc_num; ++j) {
    1.24 +        if (_upper[j] < _lower[j]) return false;
    1.25 +      }
    1.26 +      return true;
    1.27 +    }
    1.28  
    1.29      ProblemType start() {
    1.30        // Execute the algorithm