diff -r 1bafdbd2fc46 -r ee9bac10f58e lemon/cost_scaling.h --- a/lemon/cost_scaling.h Sat Mar 20 11:03:12 2010 +0100 +++ b/lemon/cost_scaling.h Sat Mar 16 16:20:41 2013 +0100 @@ -761,6 +761,10 @@ } if (_sum_supply > 0) return INFEASIBLE; + // Check lower and upper bounds + LEMON_DEBUG(checkBoundMaps(), + "Upper bounds must be greater or equal to the lower bounds"); + // Initialize vectors for (int i = 0; i != _res_node_num; ++i) { @@ -897,6 +901,15 @@ return OPTIMAL; } + + // Check if the upper bound is greater or equal to the lower bound + // on each arc. + bool checkBoundMaps() { + for (int j = 0; j != _res_arc_num; ++j) { + if (_upper[j] < _lower[j]) return false; + } + return true; + } // Execute the algorithm and transform the results void start(Method method) {