Skip to content

Commit

Permalink
avoid very long time in CbcHeuristicRounding
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Mar 15, 2024
1 parent 46d3596 commit 0fee19a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CbcHeuristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,9 @@ int CbcRounding::solution(double &solutionValue,
move = -1.0;
else if (cost < 0.0)
move = 1.0;
while (move) {
int times=20;
while (move && times) {
times--;
bool good = true;
double newValue = newSolution[iColumn] + move;
if (newValue < lower[iColumn] - useTolerance || newValue > upper[iColumn] + useTolerance) {
Expand Down

0 comments on commit 0fee19a

Please sign in to comment.