From cdc41a514c5dfacb4698d6c651e072d973972054 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 29 Oct 2024 00:21:20 +0100 Subject: [PATCH] Fix non node strong branching --- src/scip/branch_allfullstrong.c | 4 ++-- src/scip/branch_fullstrong.c | 11 ++++------- src/scip/branch_vanillafullstrong.c | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/scip/branch_allfullstrong.c b/src/scip/branch_allfullstrong.c index 091209035c..b393966b52 100644 --- a/src/scip/branch_allfullstrong.c +++ b/src/scip/branch_allfullstrong.c @@ -174,12 +174,12 @@ SCIP_RETCODE branch( /* update the lower bounds in the children */ if( allcolsinlp && !exactsolve ) { - if( bestdownvalid ) + if( downchild != NULL && bestdownvalid ) { SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) ); SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild)); } - if( bestupvalid ) + if( upchild != NULL && bestupvalid ) { SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) ); SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild)); diff --git a/src/scip/branch_fullstrong.c b/src/scip/branch_fullstrong.c index e7362f18f7..854bc259a0 100644 --- a/src/scip/branch_fullstrong.c +++ b/src/scip/branch_fullstrong.c @@ -637,25 +637,22 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpFullstrong) SCIPdebugMsg(scip, " -> %d candidates, selected candidate %d: variable <%s> (solval=%g, down=%g, up=%g, score=%g)\n", nlpcands, bestcand, SCIPvarGetName(var), lpcandssol[bestcand], bestdown, bestup, bestscore); SCIP_CALL( SCIPbranchVarVal(scip, var, val, &downchild, NULL, &upchild) ); - assert(downchild != NULL); - assert(upchild != NULL); /* update the lower bounds in the children */ if( allcolsinlp && !exactsolve ) { - if( bestdownvalid ) + if( downchild != NULL && bestdownvalid ) { SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) ); + SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild)); } - if( bestupvalid ) + if( upchild != NULL && bestupvalid ) { SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) ); + SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild)); } } - SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild)); - SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild)); - *result = SCIP_BRANCHED; } } diff --git a/src/scip/branch_vanillafullstrong.c b/src/scip/branch_vanillafullstrong.c index 60f42ce984..036e9d5429 100644 --- a/src/scip/branch_vanillafullstrong.c +++ b/src/scip/branch_vanillafullstrong.c @@ -497,12 +497,12 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpVanillafullstrong) /* update the lower bounds in the children */ if( !branchruledata->idempotent && allcolsinlp && !exactsolve ) { - if( bestdownvalid ) + if( downchild != NULL && bestdownvalid ) { SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) ); SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild)); } - if( bestupvalid ) + if( upchild != NULL && bestupvalid ) { SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) ); SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));