From e267a46c145a1bf78b5886f3547e083f53aefd43 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Sat, 23 Nov 2024 14:37:19 +0100 Subject: [PATCH 1/2] initialize fractionality score of spatial branching candidates --- src/scip/cons_nonlinear.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scip/cons_nonlinear.c b/src/scip/cons_nonlinear.c index 25e93d58e2..7df789cea1 100644 --- a/src/scip/cons_nonlinear.c +++ b/src/scip/cons_nonlinear.c @@ -6714,6 +6714,7 @@ SCIP_RETCODE collectBranchingCandidates( cands[*ncands].expr = consdata->varexprs[i]; cands[*ncands].var = var; cands[*ncands].auxviol = SCIPgetExprViolScoreNonlinear(consdata->varexprs[i]); + cands[*ncands].fractionality = 0.0; ++(*ncands); /* invalidate violscore-tag, so that we do not register variables that appear in multiple constraints @@ -6752,6 +6753,7 @@ SCIP_RETCODE collectBranchingCandidates( cands[*ncands].expr = expr; cands[*ncands].var = var; cands[*ncands].auxviol = SCIPgetExprViolScoreNonlinear(expr); + cands[*ncands].fractionality = 0.0; ++(*ncands); } } From 97493c65bca882a8b689b985b20953a452595ef2 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Sat, 23 Nov 2024 14:37:50 +0100 Subject: [PATCH 2/2] fix include of fractionality score into weighted score --- CHANGELOG | 1 + src/scip/cons_nonlinear.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 844040b64d..36d7c8327c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ Fixed bugs - apply same feasibility definition in PaPILO as SCIP to avoid numerical inconsistencies - check variable cancellation in SCIPvarAddVlb() and SCIPvarAddVub() to avert wrong infeasibility - SCIPfreeReoptSolve now also clears the partial solutions +- fixed bug in calculation of "fractionality score" for spatial branching candidates in cons_nonlinear Unit tests ---------- diff --git a/src/scip/cons_nonlinear.c b/src/scip/cons_nonlinear.c index 7df789cea1..773643980d 100644 --- a/src/scip/cons_nonlinear.c +++ b/src/scip/cons_nonlinear.c @@ -7171,7 +7171,7 @@ void scoreBranchingCandidates( if( maxscore.fractionality > 0.0 ) { - cands[c].fractionality += conshdlrdata->branchfracweight * cands[c].fractionality / maxscore.fractionality; + cands[c].weighted += conshdlrdata->branchfracweight * cands[c].fractionality / maxscore.fractionality; weightsum += conshdlrdata->branchfracweight; ENFOLOG( SCIPinfoMessage(scip, enfologfile, " %+g*%6.2g(frac)", conshdlrdata->branchfracweight, cands[c].fractionality / maxscore.fractionality); )