diff -r d1a48668ddb4 -r 879fcb781086 lemon/network_simplex.h --- a/lemon/network_simplex.h Tue Jul 30 15:14:29 2013 +0200 +++ b/lemon/network_simplex.h Tue Jul 30 15:24:45 2013 +0200 @@ -1067,6 +1067,10 @@ if ( !((_stype == GEQ && _sum_supply <= 0) || (_stype == LEQ && _sum_supply >= 0)) ) return false; + // Check lower and upper bounds + LEMON_DEBUG(checkBoundMaps(), + "Upper bounds must be greater or equal to the lower bounds"); + // Remove non-zero lower bounds if (_have_lower) { for (int i = 0; i != _arc_num; ++i) { @@ -1230,6 +1234,15 @@ return true; } + + // Check if the upper bound is greater or equal to the lower bound + // on each arc. + bool checkBoundMaps() { + for (int j = 0; j != _arc_num; ++j) { + if (_upper[j] < _lower[j]) return false; + } + return true; + } // Find the join node void findJoinNode() {