Skip to content

Commit b328e8b

Browse files
committed
Merge branch 'fix-non-branching' into 'v91-bugfix'
Fix non node strong branching See merge request integer/scip!3554
2 parents 520de9d + cdc41a5 commit b328e8b

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/scip/branch_allfullstrong.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ SCIP_RETCODE branch(
174174
/* update the lower bounds in the children */
175175
if( allcolsinlp && !exactsolve )
176176
{
177-
if( bestdownvalid )
177+
if( downchild != NULL && bestdownvalid )
178178
{
179179
SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) );
180180
SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
181181
}
182-
if( bestupvalid )
182+
if( upchild != NULL && bestupvalid )
183183
{
184184
SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) );
185185
SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));

src/scip/branch_fullstrong.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,25 +637,22 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpFullstrong)
637637
SCIPdebugMsg(scip, " -> %d candidates, selected candidate %d: variable <%s> (solval=%g, down=%g, up=%g, score=%g)\n",
638638
nlpcands, bestcand, SCIPvarGetName(var), lpcandssol[bestcand], bestdown, bestup, bestscore);
639639
SCIP_CALL( SCIPbranchVarVal(scip, var, val, &downchild, NULL, &upchild) );
640-
assert(downchild != NULL);
641-
assert(upchild != NULL);
642640

643641
/* update the lower bounds in the children */
644642
if( allcolsinlp && !exactsolve )
645643
{
646-
if( bestdownvalid )
644+
if( downchild != NULL && bestdownvalid )
647645
{
648646
SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) );
647+
SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
649648
}
650-
if( bestupvalid )
649+
if( upchild != NULL && bestupvalid )
651650
{
652651
SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) );
652+
SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));
653653
}
654654
}
655655

656-
SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
657-
SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));
658-
659656
*result = SCIP_BRANCHED;
660657
}
661658
}

src/scip/branch_vanillafullstrong.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,12 @@ SCIP_DECL_BRANCHEXECLP(branchExeclpVanillafullstrong)
497497
/* update the lower bounds in the children */
498498
if( !branchruledata->idempotent && allcolsinlp && !exactsolve )
499499
{
500-
if( bestdownvalid )
500+
if( downchild != NULL && bestdownvalid )
501501
{
502502
SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) );
503503
SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
504504
}
505-
if( bestupvalid )
505+
if( upchild != NULL && bestupvalid )
506506
{
507507
SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) );
508508
SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));

0 commit comments

Comments
 (0)