Scippy

SCIP

Solving Constraint Integer Programs

branch_allfullstrong.c
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* SCIP --- Solving Constraint Integer Programs */
5/* */
6/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file branch_allfullstrong.c
26 * @ingroup DEFPLUGINS_BRANCH
27 * @brief all variables full strong LP branching rule
28 * @author Tobias Achterberg
29 *
30 * The all variables full strong branching rule applies strong branching to every non-fixed variable
31 * at the current node of the branch-and-bound search. The rule selects the candidate
32 * which will cause the highest gain of the dual bound in the created sub-tree among all branching variables.
33 *
34 * For calculating the gain, a look-ahead is performed by solving the child node LPs which will result
35 * from branching on a variable.
36 *
37 * For a more mathematical description and a comparison between the strong branching rule and other branching rules
38 * in SCIP, we refer to
39 *
40 * @par
41 * Tobias Achterberg@n
42 * Constraint Integer Programming@n
43 * PhD Thesis, Technische Universität Berlin, 2007@n
44 *
45 */
46
47/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
48
51#include "scip/pub_branch.h"
52#include "scip/pub_message.h"
53#include "scip/pub_tree.h"
54#include "scip/pub_var.h"
55#include "scip/scip_branch.h"
56#include "scip/scip_exact.h"
57#include "scip/scip_general.h"
58#include "scip/scip_lp.h"
59#include "scip/scip_mem.h"
60#include "scip/scip_message.h"
61#include "scip/scip_numerics.h"
62#include "scip/scip_prob.h"
64#include "scip/scip_tree.h"
65#include "scip/scip_var.h"
66#include <string.h>
67
68
69#define BRANCHRULE_NAME "allfullstrong"
70#define BRANCHRULE_DESC "all variables full strong branching"
71#define BRANCHRULE_PRIORITY -1000
72#define BRANCHRULE_MAXDEPTH -1
73#define BRANCHRULE_MAXBOUNDDIST 1.0
74
75
76/** branching rule data */
77struct SCIP_BranchruleData
78{
79 int lastcand; /**< last evaluated candidate of last branching rule execution */
80 int skipsize; /**< size of skipdown and skipup array */
81 SCIP_Bool* skipdown; /**< should down branch be skiped? */
82 SCIP_Bool* skipup; /**< should up branch be skiped? */
83};
84
85
86/** performs the all fullstrong branching */
87static
89 SCIP* scip, /**< SCIP data structure */
90 SCIP_BRANCHRULE* branchrule, /**< branching rule */
91 SCIP_RESULT* result /**< pointer to store the result of the callback method */
92 )
93{
94 SCIP_BRANCHRULEDATA* branchruledata;
95 SCIP_VAR** pseudocands;
96 SCIP_VAR** pseudocandscopy;
97 SCIP_Real bestdown;
98 SCIP_Real bestup;
99 SCIP_Real bestscore;
100 SCIP_Real provedbound;
101 SCIP_Bool exactsolve;
102 SCIP_Bool allcolsinlp;
103 SCIP_Bool bestdownvalid;
104 SCIP_Bool bestupvalid;
105 int npseudocands;
106 int npriopseudocands;
107 int bestpseudocand;
108
109 assert(branchrule != NULL);
110 assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
111 assert(scip != NULL);
112 assert(result != NULL);
113
114 /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
115 allcolsinlp = SCIPallColsInLP(scip);
116
117 /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
118 * for cutting off sub problems and improving lower bounds of children
119 */
120 exactsolve = SCIPisExact(scip);
121
122 /* get branching rule data */
123 branchruledata = SCIPbranchruleGetData(branchrule);
124 assert(branchruledata != NULL);
125
126 if( branchruledata->skipdown == NULL )
127 {
128 assert(branchruledata->skipup == NULL);
129
130 branchruledata->skipsize = SCIPgetNVars(scip);
131 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->skipdown, branchruledata->skipsize) );
132 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->skipup, branchruledata->skipsize) );
133 BMSclearMemoryArray(branchruledata->skipdown, branchruledata->skipsize);
134 BMSclearMemoryArray(branchruledata->skipup, branchruledata->skipsize);
135 }
136
137 /* get all non-fixed variables (not only the fractional ones) */
138 SCIP_CALL( SCIPgetPseudoBranchCands(scip, &pseudocands, &npseudocands, &npriopseudocands) );
139 assert(npseudocands > 0);
140 assert(npriopseudocands > 0);
141
142 SCIP_CALL( SCIPduplicateBufferArray(scip, &pseudocandscopy, pseudocands, npseudocands) );
143
144 SCIP_CALL( SCIPselectVarPseudoStrongBranching(scip, pseudocandscopy, branchruledata->skipdown, branchruledata->skipup, npseudocands,
145 npriopseudocands, &bestpseudocand, &bestdown, &bestup, &bestscore, &bestdownvalid, &bestupvalid, &provedbound, result) );
146
147 if( *result != SCIP_CUTOFF )
148 {
149 /* update lower bound of current node */
150 if( allcolsinlp && !exactsolve )
151 {
153 SCIPdebugMsg(scip, " -> current focus' lowerbound: %g\n", SCIPgetLocalLowerbound(scip));
154 }
155
156 if( *result != SCIP_REDUCEDDOM && *result != SCIP_CONSADDED )
157 {
158 SCIP_NODE* downchild;
159 SCIP_NODE* eqchild;
160 SCIP_NODE* upchild;
161 SCIP_VAR* var;
162
163 assert(*result == SCIP_DIDNOTRUN);
164 assert(0 <= bestpseudocand && bestpseudocand < npseudocands);
165 assert(SCIPisLT(scip, provedbound, SCIPgetCutoffbound(scip)));
166
167 var = pseudocandscopy[bestpseudocand];
168
169 /* perform the branching */
170 SCIPdebugMsg(scip, " -> %d candidates, selected candidate %d: variable <%s>[%g,%g] (solval=%g, down=%g, up=%g, score=%g)\n",
171 npseudocands, bestpseudocand, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), SCIPvarGetLPSol(var),
172 bestdown, bestup, bestscore);
173 SCIP_CALL( SCIPbranchVarVal(scip, var, SCIPvarGetLPSol(var), &downchild, &eqchild, &upchild) );
174
175 /* update the lower bounds in the children */
176 if( allcolsinlp && !exactsolve )
177 {
178 if( downchild != NULL && bestdownvalid )
179 {
180 SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) );
181 SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
182 }
183 if( upchild != NULL && bestupvalid )
184 {
185 SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) );
186 SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));
187 }
188 }
189
190 *result = SCIP_BRANCHED;
191 }
192 }
193
194 SCIPfreeBufferArray(scip, &pseudocandscopy);
195
196 return SCIP_OKAY;
197}
198
199
200/*
201 * Callback methods
202 */
203
204/** copy method for branchrule plugins (called when SCIP copies plugins) */
205static
206SCIP_DECL_BRANCHCOPY(branchCopyAllfullstrong)
207{ /*lint --e{715}*/
208 assert(scip != NULL);
209 assert(branchrule != NULL);
210 assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
211
212 /* call inclusion method of branchrule */
214
215 return SCIP_OKAY;
216}
217
218/** destructor of branching rule to free user data (called when SCIP is exiting) */
219static
220SCIP_DECL_BRANCHFREE(branchFreeAllfullstrong)
221{ /*lint --e{715}*/
222 SCIP_BRANCHRULEDATA* branchruledata;
223
224 /* free branching rule data */
225 branchruledata = SCIPbranchruleGetData(branchrule);
226 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipdown, branchruledata->skipsize);
227 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipup, branchruledata->skipsize);
228
229 SCIPfreeBlockMemory(scip, &branchruledata);
230 SCIPbranchruleSetData(branchrule, NULL);
231
232 return SCIP_OKAY;
233}
234
235
236/** initialization method of branching rule (called after problem was transformed) */
237static
238SCIP_DECL_BRANCHINIT(branchInitAllfullstrong)
239{ /*lint --e{715}*/
240 SCIP_BRANCHRULEDATA* branchruledata;
241
242 /* initialize branching rule data */
243 branchruledata = SCIPbranchruleGetData(branchrule);
244 branchruledata->lastcand = 0;
245
246 return SCIP_OKAY;
247}
248
249
250/** branching execution method for fractional LP solutions */
251static
252SCIP_DECL_BRANCHEXECLP(branchExeclpAllfullstrong)
253{ /*lint --e{715}*/
254 assert(result != NULL);
255
256 SCIPdebugMsg(scip, "Execlp method of allfullstrong branching\n");
257
258 *result = SCIP_DIDNOTRUN;
259
260 SCIP_CALL( branch(scip, branchrule, result) );
261
262 return SCIP_OKAY;
263}
264
265
266/** branching execution method for not completely fixed pseudo solutions */
267static
268SCIP_DECL_BRANCHEXECPS(branchExecpsAllfullstrong)
269{ /*lint --e{715}*/
270 assert(result != NULL);
271
272 SCIPdebugMsg(scip, "Execps method of allfullstrong branching\n");
273
274 *result = SCIP_DIDNOTRUN;
275
277 {
278 SCIP_CALL( branch(scip, branchrule, result) );
279 }
280
281 return SCIP_OKAY;
282}
283
284
285/*
286 * branching specific interface methods
287 */
288/**
289 * Selects a variable from a set of candidates by strong branching
290 *
291 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
292 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
293 *
294 * @note The variables in the lpcands array must have a fractional value in the current LP solution
295 */
297 SCIP* scip, /**< original SCIP data structure */
298 SCIP_VAR** pseudocands, /**< branching candidates */
299 SCIP_Bool* skipdown, /**< should down branchings be skipped? */
300 SCIP_Bool* skipup, /**< should up branchings be skipped? */
301 int npseudocands, /**< number of branching candidates */
302 int npriopseudocands, /**< number of priority branching candidates */
303 int* bestpseudocand, /**< best candidate for branching */
304 SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
305 SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
306 SCIP_Real* bestscore, /**< score for bestcand */
307 SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
308 SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
309 SCIP_Real* provedbound, /**< proved dual bound for current subtree */
310 SCIP_RESULT* result /**< result pointer */
311 )
312{ /*lint --e{715}*/
313 SCIP_Real lpobjval;
314 SCIP_Bool allcolsinlp;
315 SCIP_Bool exactsolve;
316
317 assert(scip != NULL);
318 assert(pseudocands != NULL);
319 assert(bestpseudocand != NULL);
320 assert(skipdown != NULL);
321 assert(skipup != NULL);
322 assert(bestdown != NULL);
323 assert(bestup != NULL);
324 assert(bestscore != NULL);
325 assert(bestdownvalid != NULL);
326 assert(bestupvalid != NULL);
327 assert(provedbound != NULL);
328 assert(result != NULL);
330
331 /* get current LP objective bound of the local sub problem and global cutoff bound */
332 lpobjval = SCIPgetLPObjval(scip);
333
334 /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
335 * for cutting off sub problems and improving lower bounds of children
336 */
337 exactsolve = SCIPisExact(scip);
338
339 /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
340 allcolsinlp = SCIPallColsInLP(scip);
341
342 /* if only one candidate exists, choose this one without applying strong branching */
343 *bestpseudocand = 0;
344 *bestdown = lpobjval;
345 *bestup = lpobjval;
346 *bestdownvalid = FALSE;
347 *bestupvalid = FALSE;
348 *bestscore = -SCIPinfinity(scip);
349 *provedbound = lpobjval;
350 if( npseudocands > 1 )
351 {
352 SCIP_BRANCHRULE* branchrule;
353 SCIP_BRANCHRULEDATA* branchruledata;
354
355 SCIP_Real solval;
356 SCIP_Real down;
357 SCIP_Real up;
358 SCIP_Real downgain;
359 SCIP_Real upgain;
360 SCIP_Real score;
361 SCIP_Bool integral;
362 SCIP_Bool lperror;
363 SCIP_Bool downvalid;
364 SCIP_Bool upvalid;
365 SCIP_Bool downinf;
366 SCIP_Bool upinf;
367 SCIP_Bool downconflict;
368 SCIP_Bool upconflict;
369 int nsbcalls;
370 int i;
371 int c;
372
374 assert(branchrule != NULL);
375
376 /* get branching rule data */
377 branchruledata = SCIPbranchruleGetData(branchrule);
378 assert(branchruledata != NULL);
379
380 /* initialize strong branching */
382
383 /* search the full strong candidate:
384 * cycle through the candidates, starting with the position evaluated in the last run
385 */
386 nsbcalls = 0;
387 for( i = 0, c = branchruledata->lastcand; i < npseudocands; ++i, ++c )
388 {
389 c = c % npseudocands;
390 assert(pseudocands[c] != NULL);
391
392 /* we can only apply strong branching on COLUMN variables that are in the current LP */
393 if( !SCIPvarIsInLP(pseudocands[c]) )
394 continue;
395
396 solval = SCIPvarGetLPSol(pseudocands[c]);
397 integral = SCIPisFeasIntegral(scip, solval);
398
399 SCIPdebugMsg(scip, "applying strong branching on %s variable <%s>[%g,%g] with solution %g\n",
400 integral ? "integral" : "fractional", SCIPvarGetName(pseudocands[c]), SCIPvarGetLbLocal(pseudocands[c]),
401 SCIPvarGetUbLocal(pseudocands[c]), solval);
402
403 up = -SCIPinfinity(scip);
404 down = -SCIPinfinity(scip);
405
406 if( integral )
407 {
408 SCIP_CALL( SCIPgetVarStrongbranchInt(scip, pseudocands[c], INT_MAX, FALSE,
409 skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
410 }
411 else
412 {
413 SCIP_CALL( SCIPgetVarStrongbranchFrac(scip, pseudocands[c], INT_MAX, FALSE,
414 skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
415 }
416 nsbcalls++;
417
418 /* display node information line in root node */
419 if( SCIPgetDepth(scip) == 0 && nsbcalls % 100 == 0 )
420 {
422 }
423
424 /* check for an error in strong branching */
425 if( lperror )
426 {
428 "(node %" SCIP_LONGINT_FORMAT ") error in strong branching call for variable <%s> with solution %g\n",
429 SCIPgetNNodes(scip), SCIPvarGetName(pseudocands[c]), solval);
430 break;
431 }
432
433 /* evaluate strong branching */
434 down = MAX(down, lpobjval);
435 up = MAX(up, lpobjval);
436 downgain = down - lpobjval;
437 upgain = up - lpobjval;
438 assert(!allcolsinlp || exactsolve || !downvalid || downinf == SCIPisGE(scip, down, SCIPgetCutoffbound(scip)));
439 assert(!allcolsinlp || exactsolve || !upvalid || upinf == SCIPisGE(scip, up, SCIPgetCutoffbound(scip)));
440 assert(downinf || !downconflict);
441 assert(upinf || !upconflict);
442
443 /* check if there are infeasible roundings */
444 if( downinf || upinf )
445 {
446 assert(allcolsinlp);
447 assert(!exactsolve);
448
449 if( downinf && upinf )
450 {
451 if( integral )
452 {
453 SCIP_Bool infeasible;
454 SCIP_Bool fixed;
455
456 /* both bound changes are infeasible: variable can be fixed to its current value */
457 SCIP_CALL( SCIPfixVar(scip, pseudocands[c], solval, &infeasible, &fixed) );
458 assert(!infeasible);
459 assert(fixed);
460 *result = SCIP_REDUCEDDOM;
461 SCIPdebugMsg(scip, " -> integral variable <%s> is infeasible in both directions\n",
462 SCIPvarGetName(pseudocands[c]));
463 break; /* terminate initialization loop, because LP was changed */
464 }
465 else
466 {
467 /* both roundings are infeasible: the node is infeasible */
468 *result = SCIP_CUTOFF;
469 SCIPdebugMsg(scip, " -> fractional variable <%s> is infeasible in both directions\n",
470 SCIPvarGetName(pseudocands[c]));
471 break; /* terminate initialization loop, because node is infeasible */
472 }
473 }
474 else if( downinf )
475 {
476 SCIP_Real newlb;
477
478 /* downwards rounding is infeasible -> change lower bound of variable to upward rounding */
479 newlb = SCIPfeasCeil(scip, solval);
480 if( SCIPvarGetLbLocal(pseudocands[c]) < newlb - 0.5 )
481 {
482 SCIP_CALL( SCIPchgVarLb(scip, pseudocands[c], newlb) );
483 *result = SCIP_REDUCEDDOM;
484 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in downward branch\n", SCIPvarGetName(pseudocands[c]));
485 break; /* terminate initialization loop, because LP was changed */
486 }
487 else
488 downvalid = FALSE;
489 }
490 else
491 {
492 SCIP_Real newub;
493
494 /* upwards rounding is infeasible -> change upper bound of variable to downward rounding */
495 newub = SCIPfeasFloor(scip, solval);
496 if( SCIPvarGetUbLocal(pseudocands[c]) > newub + 0.5 )
497 {
498 SCIP_CALL( SCIPchgVarUb(scip, pseudocands[c], newub) );
499 *result = SCIP_REDUCEDDOM;
500 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in upward branch\n", SCIPvarGetName(pseudocands[c]));
501 break; /* terminate initialization loop, because LP was changed */
502 }
503 else
504 upvalid = FALSE;
505 }
506 }
507 else if( allcolsinlp && !exactsolve && !integral && downvalid && upvalid )
508 {
509 SCIP_Real minbound;
510
511 /* the minimal lower bound of both children is a proved lower bound of the current subtree */
512 minbound = MIN(down, up);
513 *provedbound = MAX(*provedbound, minbound);
514 }
515
516 /* check for a better score, if we are within the maximum priority candidates */
517 if( c < npriopseudocands )
518 {
519 if( integral )
520 {
521 if( skipdown[c] )
522 {
523 downgain = 0.0;
524 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
525 }
526 else if( skipup[c] )
527 {
528 upgain = 0.0;
529 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
530 }
531 else
532 {
533 SCIP_Real gains[3];
534
535 gains[0] = downgain;
536 gains[1] = 0.0;
537 gains[2] = upgain;
538 score = SCIPgetBranchScoreMultiple(scip, pseudocands[c], 3, gains);
539 }
540 }
541 else
542 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
543
544 if( score > *bestscore )
545 {
546 *bestpseudocand = c;
547 *bestdown = down;
548 *bestup = up;
549 *bestdownvalid = downvalid;
550 *bestupvalid = upvalid;
551 *bestscore = score;
552 }
553 }
554 else
555 {
556 SCIPdebug( score = 0.0; )
557 }
558
559 /* update pseudo cost values */
560 if( !downinf )
561 {
562 SCIP_CALL( SCIPupdateVarPseudocost(scip, pseudocands[c],
563 solval-SCIPfeasCeil(scip, solval-1.0), downgain, 1.0) );
564 }
565 if( !upinf )
566 {
567 SCIP_CALL( SCIPupdateVarPseudocost(scip, pseudocands[c],
568 solval-SCIPfeasFloor(scip, solval+1.0), upgain, 1.0) );
569 }
570
571 SCIPdebugMsg(scip, " -> var <%s> (solval=%g, downgain=%g, upgain=%g, score=%g) -- best: <%s> (%g)\n",
572 SCIPvarGetName(pseudocands[c]), solval, downgain, upgain, score,
573 SCIPvarGetName(pseudocands[*bestpseudocand]), *bestscore);
574 }
575
576 /* remember last evaluated candidate */
577 branchruledata->lastcand = c;
578
579 /* end strong branching */
581 }
582
583 return SCIP_OKAY;
584}
585
586/** creates the all variables full strong LP branching rule and includes it in SCIP */
588 SCIP* scip /**< SCIP data structure */
589 )
590{
591 SCIP_BRANCHRULEDATA* branchruledata;
592 SCIP_BRANCHRULE* branchrule;
593
594 /* create allfullstrong branching rule data */
595 SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata) );
596 branchruledata->lastcand = 0;
597 branchruledata->skipsize = 0;
598 branchruledata->skipup = NULL;
599 branchruledata->skipdown = NULL;
600
601 /* include allfullstrong branching rule */
604
605 assert(branchrule != NULL);
606
607 /* set non-fundamental callbacks via specific setter functions*/
608 SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyAllfullstrong) );
609 SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeAllfullstrong) );
610 SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitAllfullstrong) );
611 SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpAllfullstrong) );
612 SCIP_CALL( SCIPsetBranchruleExecPs(scip, branchrule, branchExecpsAllfullstrong) );
613
614 return SCIP_OKAY;
615}
#define BRANCHRULE_DESC
static SCIP_RETCODE branch(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_RESULT *result)
SCIP_RETCODE SCIPselectVarPseudoStrongBranching(SCIP *scip, SCIP_VAR **pseudocands, SCIP_Bool *skipdown, SCIP_Bool *skipup, int npseudocands, int npriopseudocands, int *bestpseudocand, SCIP_Real *bestdown, SCIP_Real *bestup, SCIP_Real *bestscore, SCIP_Bool *bestdownvalid, SCIP_Bool *bestupvalid, SCIP_Real *provedbound, SCIP_RESULT *result)
static SCIP_DECL_BRANCHCOPY(branchCopyAllfullstrong)
#define BRANCHRULE_PRIORITY
#define BRANCHRULE_NAME
SCIP_RETCODE SCIPincludeBranchruleAllfullstrong(SCIP *scip)
static SCIP_DECL_BRANCHFREE(branchFreeAllfullstrong)
static SCIP_DECL_BRANCHEXECLP(branchExeclpAllfullstrong)
static SCIP_DECL_BRANCHINIT(branchInitAllfullstrong)
#define BRANCHRULE_MAXDEPTH
#define BRANCHRULE_MAXBOUNDDIST
static SCIP_DECL_BRANCHEXECPS(branchExecpsAllfullstrong)
all variables full strong LP branching rule
#define NULL
Definition: def.h:248
#define SCIP_Bool
Definition: def.h:91
#define MIN(x, y)
Definition: def.h:224
#define SCIP_Real
Definition: def.h:156
#define TRUE
Definition: def.h:93
#define FALSE
Definition: def.h:94
#define MAX(x, y)
Definition: def.h:220
#define SCIP_LONGINT_FORMAT
Definition: def.h:148
#define SCIP_CALL(x)
Definition: def.h:355
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:2246
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip_prob.c:4354
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip_prob.c:4289
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
Definition: scip_prob.c:4178
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:225
#define SCIPdebugMsg
Definition: scip_message.h:78
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: scip_branch.c:256
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip_branch.c:304
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: scip_branch.c:160
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
Definition: scip_branch.c:123
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: scip_branch.c:288
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2018
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1886
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: scip_branch.c:176
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip_branch.c:192
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch.c:1896
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip_branch.c:1134
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: scip_branch.c:741
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: scip_branch.c:880
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip_branch.c:857
SCIP_Bool SCIPisExact(SCIP *scip)
Definition: scip_exact.c:193
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip_lp.c:87
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip_lp.c:174
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip_lp.c:655
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip_lp.c:253
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:136
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip_mem.h:132
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:93
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:108
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip_mem.h:111
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:89
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
Definition: tree.c:8503
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetDepth(SCIP *scip)
Definition: scip_tree.c:672
SCIP_RETCODE SCIPgetVarStrongbranchFrac(SCIP *scip, SCIP_VAR *var, int itlim, SCIP_Bool idempotent, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
Definition: scip_var.c:3664
SCIP_RETCODE SCIPgetVarStrongbranchInt(SCIP *scip, SCIP_VAR *var, int itlim, SCIP_Bool idempotent, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
Definition: scip_var.c:4478
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
Definition: scip_var.c:3488
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_var.c:5697
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:24268
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_var.c:5875
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:23267
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:24664
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:24234
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: scip_var.c:11122
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip_var.c:10318
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip_var.c:3430
SCIP_Bool SCIPvarIsInLP(SCIP_VAR *var)
Definition: var.c:23706
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
Definition: memory.h:130
public methods for branching rules
public methods for message output
#define SCIPdebug(x)
Definition: pub_message.h:93
public methods for branch and bound tree
public methods for problem variables
public methods for branching rule plugins and branching
public methods for exact solving
general public methods
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for global and local (sub)problems
public methods for querying solving statistics
public methods for the branch-and-bound tree
public methods for SCIP variables
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
Definition: type_branch.h:57
@ SCIP_LPSOLSTAT_OPTIMAL
Definition: type_lp.h:44
@ SCIP_VERBLEVEL_HIGH
Definition: type_message.h:61
@ SCIP_DIDNOTRUN
Definition: type_result.h:42
@ SCIP_CUTOFF
Definition: type_result.h:48
@ SCIP_REDUCEDDOM
Definition: type_result.h:51
@ SCIP_CONSADDED
Definition: type_result.h:52
@ SCIP_BRANCHED
Definition: type_result.h:54
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
@ SCIP_OKAY
Definition: type_retcode.h:42
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63