From a64ad9c91e897decda0ae90585a200082b41e689 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Fri, 25 Aug 2023 14:32:22 +0200 Subject: [PATCH] Resolve "Incorrect optimal objective value for traininstance6" --- CHANGELOG | 1 + src/scip/cuts.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e75680147e..31837690ab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,7 @@ Fixed bugs - globalize constraint changes before bound changes during the effective root shift in treeSwitchPath() to correctly update variable locks by avoiding global bounds with outstanding bound change events when deleting constraints - fixed error when attempting to copy SCIP with activated pricers - remove integrality check for implicit integral variables in cons_integral.c +- avoid invalid strong Chvatal-Gomory cuts by ceiling with tolerance in the calculation of parameter k @section RN804 SCIP 8.0.4 ************************* diff --git a/src/scip/cuts.c b/src/scip/cuts.c index d83d996096..319a6a623c 100644 --- a/src/scip/cuts.c +++ b/src/scip/cuts.c @@ -8696,7 +8696,7 @@ SCIP_RETCODE cutsRoundStrongCG( SCIPquadprecProdQD(cutaj, cutaj, k); SCIPquadprecProdQQ(cutaj, cutaj, onedivoneminusf0); pj = SCIPceil(scip, QUAD_TO_DBL(cutaj)); - assert(pj >= 0); /* should be >= 1, but due to rounding bias can be 0 if fj almost equal to f0 */ + assert(pj >= 0); /* should be >= 1, but due to rounding bias can be 0 if fj is almost equal to f0 */ assert(pj <= k); SCIPquadprecDivDD(cutaj, pj, k + 1.0); SCIPquadprecSumQQ(cutaj, cutaj, downaj); @@ -8891,7 +8891,7 @@ SCIP_RETCODE cutsSubstituteStrongCG( SCIPquadprecProdQQ(cutar, cutar, onedivoneminusf0); SCIPquadprecProdQD(cutar, cutar, k); pr = SCIPceil(scip, QUAD_TO_DBL(cutar)); - assert(pr >= 0); /* should be >= 1, but due to rounding bias can be 0 if fr almost equal to f0 */ + assert(pr >= 0); /* should be >= 1, but due to rounding bias can be 0 if fr is almost equal to f0 */ assert(pr <= k); SCIPquadprecDivDD(cutar, pr, k + 1.0); SCIPquadprecSumQD(cutar, cutar, downar); @@ -9126,7 +9126,8 @@ SCIP_RETCODE SCIPcalcStrongCG( SCIPquadprecSumDD(f0, QUAD_HI(f0), QUAD_LO(f0)); SCIPquadprecDivDQ(tmp, 1.0, f0); - k = SCIPround(scip, ceil(QUAD_TO_DBL(tmp)) - 1.0); + SCIPquadprecSumQD(tmp, tmp, -1.0); + k = SCIPceil(scip, QUAD_TO_DBL(tmp)); QUAD_ASSIGN_Q(rhs, downrhs);