From b380c429437fa81836683f2aaa0758a5e1992780 Mon Sep 17 00:00:00 2001 From: jjhforrest Date: Wed, 5 Feb 2025 12:31:22 +0000 Subject: [PATCH] make bound changing after strong branching safer --- Cbc/src/CbcNode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cbc/src/CbcNode.cpp b/Cbc/src/CbcNode.cpp index 46fe12f2a..f07ace429 100644 --- a/Cbc/src/CbcNode.cpp +++ b/Cbc/src/CbcNode.cpp @@ -3291,7 +3291,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, double changePer = objectiveChange / (down + 1.0e-7); double distance = (cutoff - objectiveValue_) / changePer; distance += 1.0e-3; - if (distance < 5.0) { + if (distance < 5.0 && down > 1.0e-3) { double newLower = ceil(value - distance); if (newLower > saveLower[iColumn]) { //printf("Could increase lower bound on %d from %g to %g\n", @@ -3505,7 +3505,7 @@ int CbcNode::chooseDynamicBranch(CbcModel *model, CbcNode *lastNode, double changePer = objectiveChange / (up + 1.0e-7); double distance = (cutoff - objectiveValue_) / changePer; distance += 1.0e-3; - if (distance < 5.0) { + if (distance < 5.0 && up > 1.0e-3) { double newUpper = floor(value + distance); if (newUpper < saveUpper[iColumn]) { //printf("Could decrease upper bound on %d from %g to %g\n",