SCIP Doxygen Documentation
Loading...
Searching...
No Matches
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-2026 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
67
68#define BRANCHRULE_NAME "allfullstrong"
69#define BRANCHRULE_DESC "all variables full strong branching"
70#define BRANCHRULE_PRIORITY -1000
71#define BRANCHRULE_MAXDEPTH -1
72#define BRANCHRULE_MAXBOUNDDIST 1.0
73
74
75/** branching rule data */
76struct SCIP_BranchruleData
77{
78 int lastcand; /**< last evaluated candidate of last branching rule execution */
79 int skipsize; /**< size of skipdown and skipup array */
80 SCIP_Bool* skipdown; /**< should down branch be skiped? */
81 SCIP_Bool* skipup; /**< should up branch be skiped? */
82};
83
84
85/** performs the all fullstrong branching */
86static
88 SCIP* scip, /**< SCIP data structure */
89 SCIP_BRANCHRULE* branchrule, /**< branching rule */
90 SCIP_RESULT* result /**< pointer to store the result of the callback method */
91 )
92{
93 SCIP_BRANCHRULEDATA* branchruledata;
95 SCIP_VAR** pseudocandscopy;
96 SCIP_Real bestdown;
97 SCIP_Real bestup;
98 SCIP_Real bestscore;
99 SCIP_Real provedbound;
100 SCIP_Bool exactsolve;
101 SCIP_Bool allcolsinlp;
102 SCIP_Bool bestdownvalid;
103 SCIP_Bool bestupvalid;
104 int npseudocands;
105 int npriopseudocands;
106 int bestpseudocand;
107
108 assert(branchrule != NULL);
109 assert(scip != NULL);
110 assert(result != NULL);
111
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
157 {
158 SCIP_NODE* downchild;
159 SCIP_NODE* eqchild;
160 SCIP_NODE* upchild;
161 SCIP_VAR* var;
162
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
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
212
213 /* call inclusion method of branchrule */
215
216 return SCIP_OKAY;
217}
218
219/** destructor of branching rule to free user data (called when SCIP is exiting) */
220static
221SCIP_DECL_BRANCHFREE(branchFreeAllfullstrong)
222{ /*lint --e{715}*/
223 SCIP_BRANCHRULEDATA* branchruledata;
224
225 /* free branching rule data */
226 branchruledata = SCIPbranchruleGetData(branchrule);
227 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipdown, branchruledata->skipsize);
228 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipup, branchruledata->skipsize);
229
230 SCIPfreeBlockMemory(scip, &branchruledata);
231 SCIPbranchruleSetData(branchrule, NULL);
232
233 return SCIP_OKAY;
234}
235
236
237/** initialization method of branching rule (called after problem was transformed) */
238static
239SCIP_DECL_BRANCHINIT(branchInitAllfullstrong)
240{ /*lint --e{715}*/
241 SCIP_BRANCHRULEDATA* branchruledata;
242
243 /* initialize branching rule data */
244 branchruledata = SCIPbranchruleGetData(branchrule);
245 branchruledata->lastcand = 0;
246
247 return SCIP_OKAY;
248}
249
250
251/** branching execution method for fractional LP solutions */
252static
253SCIP_DECL_BRANCHEXECLP(branchExeclpAllfullstrong)
254{ /*lint --e{715}*/
255 assert(result != NULL);
256
257 SCIPdebugMsg(scip, "Execlp method of allfullstrong branching\n");
258
260
261 SCIP_CALL( branch(scip, branchrule, result) );
262
263 return SCIP_OKAY;
264}
265
266
267/** branching execution method for not completely fixed pseudo solutions */
268static
269SCIP_DECL_BRANCHEXECPS(branchExecpsAllfullstrong)
270{ /*lint --e{715}*/
271 assert(result != NULL);
272
273 SCIPdebugMsg(scip, "Execps method of allfullstrong branching\n");
274
276
278 {
279 SCIP_CALL( branch(scip, branchrule, result) );
280 }
281
282 return SCIP_OKAY;
283}
284
285
286/*
287 * branching specific interface methods
288 */
289/**
290 * Selects a variable from a set of candidates by strong branching
291 *
292 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
293 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
294 *
295 * @note The variables in the lpcands array must have a fractional value in the current LP solution
296 */
298 SCIP* scip, /**< original SCIP data structure */
299 SCIP_VAR** pseudocands, /**< branching candidates */
300 SCIP_Bool* skipdown, /**< should down branchings be skipped? */
301 SCIP_Bool* skipup, /**< should up branchings be skipped? */
302 int npseudocands, /**< number of branching candidates */
303 int npriopseudocands, /**< number of priority branching candidates */
304 int* bestpseudocand, /**< best candidate for branching */
305 SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
306 SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
307 SCIP_Real* bestscore, /**< score for bestcand */
308 SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
309 SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
310 SCIP_Real* provedbound, /**< proved dual bound for current subtree */
311 SCIP_RESULT* result /**< result pointer */
312 )
313{ /*lint --e{715}*/
314 SCIP_Real lpobjval;
315 SCIP_Bool allcolsinlp;
316 SCIP_Bool exactsolve;
317
318 assert(scip != NULL);
320 assert(bestpseudocand != NULL);
321 assert(skipdown != NULL);
322 assert(skipup != NULL);
323 assert(bestdown != NULL);
324 assert(bestup != NULL);
325 assert(bestscore != NULL);
326 assert(bestdownvalid != NULL);
327 assert(bestupvalid != NULL);
328 assert(provedbound != NULL);
329 assert(result != NULL);
331
332 /* get current LP objective bound of the local sub problem and global cutoff bound */
333 lpobjval = SCIPgetLPObjval(scip);
334
335 /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
336 * for cutting off sub problems and improving lower bounds of children
337 */
338 exactsolve = SCIPisExact(scip);
339
340 /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
341 allcolsinlp = SCIPallColsInLP(scip);
342
343 /* if only one candidate exists, choose this one without applying strong branching */
344 *bestpseudocand = 0;
345 *bestdown = lpobjval;
346 *bestup = lpobjval;
347 *bestdownvalid = FALSE;
348 *bestupvalid = FALSE;
349 *bestscore = -SCIPinfinity(scip);
350 *provedbound = lpobjval;
351 if( npseudocands > 1 )
352 {
353 SCIP_BRANCHRULE* branchrule;
354 SCIP_BRANCHRULEDATA* branchruledata;
355
356 SCIP_Real solval;
357 SCIP_Real down;
358 SCIP_Real up;
359 SCIP_Real downgain;
360 SCIP_Real upgain;
361 SCIP_Real score;
362 SCIP_Bool integral;
364 SCIP_Bool downvalid;
365 SCIP_Bool upvalid;
366 SCIP_Bool downinf;
367 SCIP_Bool upinf;
368 SCIP_Bool downconflict;
369 SCIP_Bool upconflict;
370 int nsbcalls;
371 int i;
372 int c;
373
375 assert(branchrule != NULL);
376
377 /* get branching rule data */
378 branchruledata = SCIPbranchruleGetData(branchrule);
379 assert(branchruledata != NULL);
380
381 /* initialize strong branching */
383
384 /* search the full strong candidate:
385 * cycle through the candidates, starting with the position evaluated in the last run
386 */
387 nsbcalls = 0;
388 for( i = 0, c = branchruledata->lastcand; i < npseudocands; ++i, ++c )
389 {
390 c = c % npseudocands;
392
393 /* we can only apply strong branching on COLUMN variables that are in the current LP */
395 continue;
396
397 solval = SCIPvarGetLPSol(pseudocands[c]);
398 integral = SCIPisFeasIntegral(scip, solval);
399
400 SCIPdebugMsg(scip, "applying strong branching on %s variable <%s>[%g,%g] with solution %g\n",
401 integral ? "integral" : "fractional", SCIPvarGetName(pseudocands[c]), SCIPvarGetLbLocal(pseudocands[c]),
403
404 up = -SCIPinfinity(scip);
405 down = -SCIPinfinity(scip);
406
407 if( integral )
408 {
410 skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
411 }
412 else
413 {
415 skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
416 }
417 nsbcalls++;
418
419 /* display node information line in root node */
420 if( SCIPgetDepth(scip) == 0 && nsbcalls % 100 == 0 )
421 {
423 }
424
425 /* check for an error in strong branching */
426 if( lperror )
427 {
429 "(node %" SCIP_LONGINT_FORMAT ") error in strong branching call for variable <%s> with solution %g\n",
431 break;
432 }
433
434 /* evaluate strong branching */
435 down = MAX(down, lpobjval);
436 up = MAX(up, lpobjval);
437 downgain = down - lpobjval;
438 upgain = up - lpobjval;
439 assert(!allcolsinlp || exactsolve || !downvalid || downinf == SCIPisGE(scip, down, SCIPgetCutoffbound(scip)));
440 assert(!allcolsinlp || exactsolve || !upvalid || upinf == SCIPisGE(scip, up, SCIPgetCutoffbound(scip)));
441 assert(downinf || !downconflict);
442 assert(upinf || !upconflict);
443
444 /* check if there are infeasible roundings */
445 if( downinf || upinf )
446 {
447 assert(allcolsinlp);
448 assert(!exactsolve);
449
450 if( downinf && upinf )
451 {
452 if( integral )
453 {
454 SCIP_Bool infeasible;
455 SCIP_Bool fixed;
456
457 /* both bound changes are infeasible: variable can be fixed to its current value */
458 SCIP_CALL( SCIPfixVar(scip, pseudocands[c], solval, &infeasible, &fixed) );
459 assert(!infeasible);
460 assert(fixed);
462 SCIPdebugMsg(scip, " -> integral variable <%s> is infeasible in both directions\n",
464 break; /* terminate initialization loop, because LP was changed */
465 }
466 else
467 {
468 /* both roundings are infeasible: the node is infeasible */
470 SCIPdebugMsg(scip, " -> fractional variable <%s> is infeasible in both directions\n",
472 break; /* terminate initialization loop, because node is infeasible */
473 }
474 }
475 else if( downinf )
476 {
477 SCIP_Real newlb;
478
479 /* downwards rounding is infeasible -> change lower bound of variable to upward rounding */
480 newlb = SCIPfeasCeil(scip, solval);
481 if( SCIPvarGetLbLocal(pseudocands[c]) < newlb - 0.5 )
482 {
485 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in downward branch\n", SCIPvarGetName(pseudocands[c]));
486 break; /* terminate initialization loop, because LP was changed */
487 }
488 else
489 downvalid = FALSE;
490 }
491 else
492 {
493 SCIP_Real newub;
494
495 /* upwards rounding is infeasible -> change upper bound of variable to downward rounding */
496 newub = SCIPfeasFloor(scip, solval);
497 if( SCIPvarGetUbLocal(pseudocands[c]) > newub + 0.5 )
498 {
501 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in upward branch\n", SCIPvarGetName(pseudocands[c]));
502 break; /* terminate initialization loop, because LP was changed */
503 }
504 else
505 upvalid = FALSE;
506 }
507 }
508 else if( allcolsinlp && !exactsolve && !integral && downvalid && upvalid )
509 {
510 SCIP_Real minbound;
511
512 /* the minimal lower bound of both children is a proved lower bound of the current subtree */
513 minbound = MIN(down, up);
514 *provedbound = MAX(*provedbound, minbound);
515 }
516
517 /* check for a better score, if we are within the maximum priority candidates */
518 if( c < npriopseudocands )
519 {
520 if( integral )
521 {
522 if( skipdown[c] )
523 {
524 downgain = 0.0;
525 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
526 }
527 else if( skipup[c] )
528 {
529 upgain = 0.0;
530 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
531 }
532 else
533 {
534 SCIP_Real gains[3];
535
536 gains[0] = downgain;
537 gains[1] = 0.0;
538 gains[2] = upgain;
539 score = SCIPgetBranchScoreMultiple(scip, pseudocands[c], 3, gains);
540 }
541 }
542 else
543 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
544
545 if( score > *bestscore )
546 {
547 *bestpseudocand = c;
548 *bestdown = down;
549 *bestup = up;
550 *bestdownvalid = downvalid;
551 *bestupvalid = upvalid;
552 *bestscore = score;
553 }
554 }
555 else
556 {
557 SCIPdebug( score = 0.0; )
558 }
559
560 /* update pseudo cost values */
561 if( !downinf )
562 {
564 solval-SCIPfeasCeil(scip, solval-1.0), downgain, 1.0) );
565 }
566 if( !upinf )
567 {
569 solval-SCIPfeasFloor(scip, solval+1.0), upgain, 1.0) );
570 }
571
572 SCIPdebugMsg(scip, " -> var <%s> (solval=%g, downgain=%g, upgain=%g, score=%g) -- best: <%s> (%g)\n",
573 SCIPvarGetName(pseudocands[c]), solval, downgain, upgain, score,
574 SCIPvarGetName(pseudocands[*bestpseudocand]), *bestscore);
575 }
576
577 /* remember last evaluated candidate */
578 branchruledata->lastcand = c;
579
580 /* end strong branching */
582 }
583
584 return SCIP_OKAY;
585}
586
587/** creates the all variables full strong LP branching rule and includes it in SCIP */
589 SCIP* scip /**< SCIP data structure */
590 )
591{
592 SCIP_BRANCHRULEDATA* branchruledata;
593 SCIP_BRANCHRULE* branchrule;
594
595 /* create allfullstrong branching rule data */
596 SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata) );
597 branchruledata->lastcand = 0;
598 branchruledata->skipsize = 0;
599 branchruledata->skipup = NULL;
600 branchruledata->skipdown = NULL;
601
602 /* include allfullstrong branching rule */
605
606 assert(branchrule != NULL);
607
608 /* set non-fundamental callbacks via specific setter functions*/
609 SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyAllfullstrong) );
610 SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeAllfullstrong) );
611 SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitAllfullstrong) );
612 SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpAllfullstrong) );
613 SCIP_CALL( SCIPsetBranchruleExecPs(scip, branchrule, branchExecpsAllfullstrong) );
614
615 return SCIP_OKAY;
616}
#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)
#define BRANCHRULE_PRIORITY
#define BRANCHRULE_NAME
SCIP_RETCODE SCIPincludeBranchruleAllfullstrong(SCIP *scip)
#define BRANCHRULE_MAXDEPTH
#define BRANCHRULE_MAXBOUNDDIST
all variables full strong LP branching rule
#define NULL
Definition def.h:257
#define SCIP_Bool
Definition def.h:100
#define MIN(x, y)
Definition def.h:233
#define SCIP_STRINGEQ(name, reference, retcode)
Definition def.h:454
#define SCIP_Real
Definition def.h:165
#define TRUE
Definition def.h:102
#define FALSE
Definition def.h:103
#define MAX(x, y)
Definition def.h:229
#define SCIP_LONGINT_FORMAT
Definition def.h:157
#define SCIP_CALL(x)
Definition def.h:364
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,...)
#define SCIPdebugMsg
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition branch.c:2018
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
Definition branch.c:1886
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
Definition branch.c:1896
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
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:8533
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:24300
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:23299
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition var.c:24696
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition var.c:24266
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:23738
return SCIP_OKAY
SCIP_VAR ** pseudocands
SCIP_Bool lperror
int c
assert(minobj< SCIPgetCutoffbound(scip))
SCIP_VAR * var
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
#define SCIP_DECL_BRANCHEXECPS(x)
#define SCIP_DECL_BRANCHEXECLP(x)
#define SCIP_DECL_BRANCHINIT(x)
Definition type_branch.h:83
#define SCIP_DECL_BRANCHCOPY(x)
Definition type_branch.h:67
#define SCIP_DECL_BRANCHFREE(x)
Definition type_branch.h:75
struct SCIP_Branchrule SCIP_BRANCHRULE
Definition type_branch.h:56
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
Definition type_branch.h:57
@ SCIP_LPSOLSTAT_OPTIMAL
Definition type_lp.h:44
@ SCIP_VERBLEVEL_HIGH
@ 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_INVALIDCALL
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
Definition type_scip.h:39
struct SCIP_Node SCIP_NODE
Definition type_tree.h:63
struct SCIP_Var SCIP_VAR
Definition type_var.h:166