equal
deleted
inserted
replaced
735 for (int i = 0; i != _root; ++i) { |
735 for (int i = 0; i != _root; ++i) { |
736 _sum_supply += _supply[i]; |
736 _sum_supply += _supply[i]; |
737 } |
737 } |
738 if (_sum_supply > 0) return INFEASIBLE; |
738 if (_sum_supply > 0) return INFEASIBLE; |
739 |
739 |
|
740 // Check lower and upper bounds |
|
741 LEMON_DEBUG(checkBoundMaps(), |
|
742 "Upper bounds must be greater or equal to the lower bounds"); |
|
743 |
|
744 |
740 // Initialize vectors |
745 // Initialize vectors |
741 for (int i = 0; i != _root; ++i) { |
746 for (int i = 0; i != _root; ++i) { |
742 _pi[i] = 0; |
747 _pi[i] = 0; |
743 _excess[i] = _supply[i]; |
748 _excess[i] = _supply[i]; |
744 } |
749 } |
827 // Without scaling |
832 // Without scaling |
828 _delta = 1; |
833 _delta = 1; |
829 } |
834 } |
830 |
835 |
831 return OPTIMAL; |
836 return OPTIMAL; |
|
837 } |
|
838 |
|
839 // Check if the upper bound is greater or equal to the lower bound |
|
840 // on each arc. |
|
841 bool checkBoundMaps() { |
|
842 for (int j = 0; j != _res_arc_num; ++j) { |
|
843 if (_upper[j] < _lower[j]) return false; |
|
844 } |
|
845 return true; |
832 } |
846 } |
833 |
847 |
834 ProblemType start() { |
848 ProblemType start() { |
835 // Execute the algorithm |
849 // Execute the algorithm |
836 ProblemType pt; |
850 ProblemType pt; |