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-2024 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_general.h"
57#include "scip/scip_lp.h"
58#include "scip/scip_mem.h"
59#include "scip/scip_message.h"
60#include "scip/scip_numerics.h"
61#include "scip/scip_prob.h"
63#include "scip/scip_tree.h"
64#include "scip/scip_var.h"
65#include <string.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;
94 SCIP_VAR** pseudocands;
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(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
110 assert(scip != NULL);
111 assert(result != NULL);
112
113 /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
114 allcolsinlp = SCIPallColsInLP(scip);
115
116 /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
117 * for cutting off sub problems and improving lower bounds of children
118 */
119 exactsolve = SCIPisExactSolve(scip);
120
121 /* get branching rule data */
122 branchruledata = SCIPbranchruleGetData(branchrule);
123 assert(branchruledata != NULL);
124
125 if( branchruledata->skipdown == NULL )
126 {
127 assert(branchruledata->skipup == NULL);
128
129 branchruledata->skipsize = SCIPgetNVars(scip);
130 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->skipdown, branchruledata->skipsize) );
131 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->skipup, branchruledata->skipsize) );
132 BMSclearMemoryArray(branchruledata->skipdown, branchruledata->skipsize);
133 BMSclearMemoryArray(branchruledata->skipup, branchruledata->skipsize);
134 }
135
136 /* get all non-fixed variables (not only the fractional ones) */
137 SCIP_CALL( SCIPgetPseudoBranchCands(scip, &pseudocands, &npseudocands, &npriopseudocands) );
138 assert(npseudocands > 0);
139 assert(npriopseudocands > 0);
140
141 SCIP_CALL( SCIPduplicateBufferArray(scip, &pseudocandscopy, pseudocands, npseudocands) );
142
143 SCIP_CALL( SCIPselectVarPseudoStrongBranching(scip, pseudocandscopy, branchruledata->skipdown, branchruledata->skipup, npseudocands,
144 npriopseudocands, &bestpseudocand, &bestdown, &bestup, &bestscore, &bestdownvalid, &bestupvalid, &provedbound, result) );
145
146 if( *result != SCIP_CUTOFF )
147 {
148 /* update lower bound of current node */
149 if( allcolsinlp && !exactsolve )
150 {
152 SCIPdebugMsg(scip, " -> current focus' lowerbound: %g\n", SCIPgetLocalLowerbound(scip));
153 }
154
155 if( *result != SCIP_REDUCEDDOM && *result != SCIP_CONSADDED )
156 {
157 SCIP_NODE* downchild;
158 SCIP_NODE* eqchild;
159 SCIP_NODE* upchild;
160 SCIP_VAR* var;
161
162 assert(*result == SCIP_DIDNOTRUN);
163 assert(0 <= bestpseudocand && bestpseudocand < npseudocands);
164 assert(SCIPisLT(scip, provedbound, SCIPgetCutoffbound(scip)));
165
166 var = pseudocandscopy[bestpseudocand];
167
168 /* perform the branching */
169 SCIPdebugMsg(scip, " -> %d candidates, selected candidate %d: variable <%s>[%g,%g] (solval=%g, down=%g, up=%g, score=%g)\n",
170 npseudocands, bestpseudocand, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), SCIPvarGetLPSol(var),
171 bestdown, bestup, bestscore);
172 SCIP_CALL( SCIPbranchVarVal(scip, var, SCIPvarGetLPSol(var), &downchild, &eqchild, &upchild) );
173
174 /* update the lower bounds in the children */
175 if( allcolsinlp && !exactsolve )
176 {
177 if( downchild != NULL && bestdownvalid )
178 {
179 SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) );
180 SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
181 }
182 if( upchild != NULL && bestupvalid )
183 {
184 SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) );
185 SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));
186 }
187 }
188
189 *result = SCIP_BRANCHED;
190 }
191 }
192
193 SCIPfreeBufferArray(scip, &pseudocandscopy);
194
195 return SCIP_OKAY;
196}
197
198
199/*
200 * Callback methods
201 */
202
203/** copy method for branchrule plugins (called when SCIP copies plugins) */
204static
205SCIP_DECL_BRANCHCOPY(branchCopyAllfullstrong)
206{ /*lint --e{715}*/
207 assert(scip != NULL);
208 assert(branchrule != NULL);
209 assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
210
211 /* call inclusion method of branchrule */
213
214 return SCIP_OKAY;
215}
216
217/** destructor of branching rule to free user data (called when SCIP is exiting) */
218static
219SCIP_DECL_BRANCHFREE(branchFreeAllfullstrong)
220{ /*lint --e{715}*/
221 SCIP_BRANCHRULEDATA* branchruledata;
222
223 /* free branching rule data */
224 branchruledata = SCIPbranchruleGetData(branchrule);
225 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipdown, branchruledata->skipsize);
226 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipup, branchruledata->skipsize);
227
228 SCIPfreeBlockMemory(scip, &branchruledata);
229 SCIPbranchruleSetData(branchrule, NULL);
230
231 return SCIP_OKAY;
232}
233
234
235/** initialization method of branching rule (called after problem was transformed) */
236static
237SCIP_DECL_BRANCHINIT(branchInitAllfullstrong)
238{ /*lint --e{715}*/
239 SCIP_BRANCHRULEDATA* branchruledata;
240
241 /* initialize branching rule data */
242 branchruledata = SCIPbranchruleGetData(branchrule);
243 branchruledata->lastcand = 0;
244
245 return SCIP_OKAY;
246}
247
248
249/** branching execution method for fractional LP solutions */
250static
251SCIP_DECL_BRANCHEXECLP(branchExeclpAllfullstrong)
252{ /*lint --e{715}*/
253 assert(result != NULL);
254
255 SCIPdebugMsg(scip, "Execlp method of allfullstrong branching\n");
256
257 *result = SCIP_DIDNOTRUN;
258
259 SCIP_CALL( branch(scip, branchrule, result) );
260
261 return SCIP_OKAY;
262}
263
264
265/** branching execution method for not completely fixed pseudo solutions */
266static
267SCIP_DECL_BRANCHEXECPS(branchExecpsAllfullstrong)
268{ /*lint --e{715}*/
269 assert(result != NULL);
270
271 SCIPdebugMsg(scip, "Execps method of allfullstrong branching\n");
272
273 *result = SCIP_DIDNOTRUN;
274
276 {
277 SCIP_CALL( branch(scip, branchrule, result) );
278 }
279
280 return SCIP_OKAY;
281}
282
283
284/*
285 * branching specific interface methods
286 */
287/**
288 * Selects a variable from a set of candidates by strong branching
289 *
290 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
291 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
292 *
293 * @note The variables in the lpcands array must have a fractional value in the current LP solution
294 */
296 SCIP* scip, /**< original SCIP data structure */
297 SCIP_VAR** pseudocands, /**< branching candidates */
298 SCIP_Bool* skipdown, /**< should down branchings be skipped? */
299 SCIP_Bool* skipup, /**< should up branchings be skipped? */
300 int npseudocands, /**< number of branching candidates */
301 int npriopseudocands, /**< number of priority branching candidates */
302 int* bestpseudocand, /**< best candidate for branching */
303 SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
304 SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
305 SCIP_Real* bestscore, /**< score for bestcand */
306 SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
307 SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
308 SCIP_Real* provedbound, /**< proved dual bound for current subtree */
309 SCIP_RESULT* result /**< result pointer */
310 )
311{ /*lint --e{715}*/
312 SCIP_Real lpobjval;
313 SCIP_Bool allcolsinlp;
314 SCIP_Bool exactsolve;
315
316 assert(scip != NULL);
317 assert(pseudocands != NULL);
318 assert(bestpseudocand != NULL);
319 assert(skipdown != NULL);
320 assert(skipup != NULL);
321 assert(bestdown != NULL);
322 assert(bestup != NULL);
323 assert(bestscore != NULL);
324 assert(bestdownvalid != NULL);
325 assert(bestupvalid != NULL);
326 assert(provedbound != NULL);
327 assert(result != NULL);
329
330 /* get current LP objective bound of the local sub problem and global cutoff bound */
331 lpobjval = SCIPgetLPObjval(scip);
332
333 /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
334 * for cutting off sub problems and improving lower bounds of children
335 */
336 exactsolve = SCIPisExactSolve(scip);
337
338 /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
339 allcolsinlp = SCIPallColsInLP(scip);
340
341 /* if only one candidate exists, choose this one without applying strong branching */
342 *bestpseudocand = 0;
343 *bestdown = lpobjval;
344 *bestup = lpobjval;
345 *bestdownvalid = FALSE;
346 *bestupvalid = FALSE;
347 *bestscore = -SCIPinfinity(scip);
348 *provedbound = lpobjval;
349 if( npseudocands > 1 )
350 {
351 SCIP_BRANCHRULE* branchrule;
352 SCIP_BRANCHRULEDATA* branchruledata;
353
354 SCIP_Real solval;
355 SCIP_Real down;
356 SCIP_Real up;
357 SCIP_Real downgain;
358 SCIP_Real upgain;
359 SCIP_Real score;
360 SCIP_Bool integral;
361 SCIP_Bool lperror;
362 SCIP_Bool downvalid;
363 SCIP_Bool upvalid;
364 SCIP_Bool downinf;
365 SCIP_Bool upinf;
366 SCIP_Bool downconflict;
367 SCIP_Bool upconflict;
368 int nsbcalls;
369 int i;
370 int c;
371
373 assert(branchrule != NULL);
374
375 /* get branching rule data */
376 branchruledata = SCIPbranchruleGetData(branchrule);
377 assert(branchruledata != NULL);
378
379 /* initialize strong branching */
381
382 /* search the full strong candidate:
383 * cycle through the candidates, starting with the position evaluated in the last run
384 */
385 nsbcalls = 0;
386 for( i = 0, c = branchruledata->lastcand; i < npseudocands; ++i, ++c )
387 {
388 c = c % npseudocands;
389 assert(pseudocands[c] != NULL);
390
391 /* we can only apply strong branching on COLUMN variables that are in the current LP */
392 if( !SCIPvarIsInLP(pseudocands[c]) )
393 continue;
394
395 solval = SCIPvarGetLPSol(pseudocands[c]);
396 integral = SCIPisFeasIntegral(scip, solval);
397
398 SCIPdebugMsg(scip, "applying strong branching on %s variable <%s>[%g,%g] with solution %g\n",
399 integral ? "integral" : "fractional", SCIPvarGetName(pseudocands[c]), SCIPvarGetLbLocal(pseudocands[c]),
400 SCIPvarGetUbLocal(pseudocands[c]), solval);
401
402 up = -SCIPinfinity(scip);
403 down = -SCIPinfinity(scip);
404
405 if( integral )
406 {
407 SCIP_CALL( SCIPgetVarStrongbranchInt(scip, pseudocands[c], INT_MAX, FALSE,
408 skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
409 }
410 else
411 {
412 SCIP_CALL( SCIPgetVarStrongbranchFrac(scip, pseudocands[c], INT_MAX, FALSE,
413 skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
414 }
415 nsbcalls++;
416
417 /* display node information line in root node */
418 if( SCIPgetDepth(scip) == 0 && nsbcalls % 100 == 0 )
419 {
421 }
422
423 /* check for an error in strong branching */
424 if( lperror )
425 {
427 "(node %" SCIP_LONGINT_FORMAT ") error in strong branching call for variable <%s> with solution %g\n",
428 SCIPgetNNodes(scip), SCIPvarGetName(pseudocands[c]), solval);
429 break;
430 }
431
432 /* evaluate strong branching */
433 down = MAX(down, lpobjval);
434 up = MAX(up, lpobjval);
435 downgain = down - lpobjval;
436 upgain = up - lpobjval;
437 assert(!allcolsinlp || exactsolve || !downvalid || downinf == SCIPisGE(scip, down, SCIPgetCutoffbound(scip)));
438 assert(!allcolsinlp || exactsolve || !upvalid || upinf == SCIPisGE(scip, up, SCIPgetCutoffbound(scip)));
439 assert(downinf || !downconflict);
440 assert(upinf || !upconflict);
441
442 /* check if there are infeasible roundings */
443 if( downinf || upinf )
444 {
445 assert(allcolsinlp);
446 assert(!exactsolve);
447
448 if( downinf && upinf )
449 {
450 if( integral )
451 {
452 SCIP_Bool infeasible;
453 SCIP_Bool fixed;
454
455 /* both bound changes are infeasible: variable can be fixed to its current value */
456 SCIP_CALL( SCIPfixVar(scip, pseudocands[c], solval, &infeasible, &fixed) );
457 assert(!infeasible);
458 assert(fixed);
459 *result = SCIP_REDUCEDDOM;
460 SCIPdebugMsg(scip, " -> integral variable <%s> is infeasible in both directions\n",
461 SCIPvarGetName(pseudocands[c]));
462 break; /* terminate initialization loop, because LP was changed */
463 }
464 else
465 {
466 /* both roundings are infeasible: the node is infeasible */
467 *result = SCIP_CUTOFF;
468 SCIPdebugMsg(scip, " -> fractional variable <%s> is infeasible in both directions\n",
469 SCIPvarGetName(pseudocands[c]));
470 break; /* terminate initialization loop, because node is infeasible */
471 }
472 }
473 else if( downinf )
474 {
475 SCIP_Real newlb;
476
477 /* downwards rounding is infeasible -> change lower bound of variable to upward rounding */
478 newlb = SCIPfeasCeil(scip, solval);
479 if( SCIPvarGetLbLocal(pseudocands[c]) < newlb - 0.5 )
480 {
481 SCIP_CALL( SCIPchgVarLb(scip, pseudocands[c], newlb) );
482 *result = SCIP_REDUCEDDOM;
483 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in downward branch\n", SCIPvarGetName(pseudocands[c]));
484 break; /* terminate initialization loop, because LP was changed */
485 }
486 else
487 downvalid = FALSE;
488 }
489 else
490 {
491 SCIP_Real newub;
492
493 /* upwards rounding is infeasible -> change upper bound of variable to downward rounding */
494 newub = SCIPfeasFloor(scip, solval);
495 if( SCIPvarGetUbLocal(pseudocands[c]) > newub + 0.5 )
496 {
497 SCIP_CALL( SCIPchgVarUb(scip, pseudocands[c], newub) );
498 *result = SCIP_REDUCEDDOM;
499 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in upward branch\n", SCIPvarGetName(pseudocands[c]));
500 break; /* terminate initialization loop, because LP was changed */
501 }
502 else
503 upvalid = FALSE;
504 }
505 }
506 else if( allcolsinlp && !exactsolve && !integral && downvalid && upvalid )
507 {
508 SCIP_Real minbound;
509
510 /* the minimal lower bound of both children is a proved lower bound of the current subtree */
511 minbound = MIN(down, up);
512 *provedbound = MAX(*provedbound, minbound);
513 }
514
515 /* check for a better score, if we are within the maximum priority candidates */
516 if( c < npriopseudocands )
517 {
518 if( integral )
519 {
520 if( skipdown[c] )
521 {
522 downgain = 0.0;
523 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
524 }
525 else if( skipup[c] )
526 {
527 upgain = 0.0;
528 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
529 }
530 else
531 {
532 SCIP_Real gains[3];
533
534 gains[0] = downgain;
535 gains[1] = 0.0;
536 gains[2] = upgain;
537 score = SCIPgetBranchScoreMultiple(scip, pseudocands[c], 3, gains);
538 }
539 }
540 else
541 score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
542
543 if( score > *bestscore )
544 {
545 *bestpseudocand = c;
546 *bestdown = down;
547 *bestup = up;
548 *bestdownvalid = downvalid;
549 *bestupvalid = upvalid;
550 *bestscore = score;
551 }
552 }
553 else
554 {
555 SCIPdebug( score = 0.0; )
556 }
557
558 /* update pseudo cost values */
559 if( !downinf )
560 {
561 SCIP_CALL( SCIPupdateVarPseudocost(scip, pseudocands[c],
562 solval-SCIPfeasCeil(scip, solval-1.0), downgain, 1.0) );
563 }
564 if( !upinf )
565 {
566 SCIP_CALL( SCIPupdateVarPseudocost(scip, pseudocands[c],
567 solval-SCIPfeasFloor(scip, solval+1.0), upgain, 1.0) );
568 }
569
570 SCIPdebugMsg(scip, " -> var <%s> (solval=%g, downgain=%g, upgain=%g, score=%g) -- best: <%s> (%g)\n",
571 SCIPvarGetName(pseudocands[c]), solval, downgain, upgain, score,
572 SCIPvarGetName(pseudocands[*bestpseudocand]), *bestscore);
573 }
574
575 /* remember last evaluated candidate */
576 branchruledata->lastcand = c;
577
578 /* end strong branching */
580 }
581
582 return SCIP_OKAY;
583}
584
585/** creates the all variables full strong LP branching rule and includes it in SCIP */
587 SCIP* scip /**< SCIP data structure */
588 )
589{
590 SCIP_BRANCHRULEDATA* branchruledata;
591 SCIP_BRANCHRULE* branchrule;
592
593 /* create allfullstrong branching rule data */
594 SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata) );
595 branchruledata->lastcand = 0;
596 branchruledata->skipsize = 0;
597 branchruledata->skipup = NULL;
598 branchruledata->skipdown = NULL;
599
600 /* include allfullstrong branching rule */
603
604 assert(branchrule != NULL);
605
606 /* set non-fundamental callbacks via specific setter functions*/
607 SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyAllfullstrong) );
608 SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeAllfullstrong) );
609 SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitAllfullstrong) );
610 SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpAllfullstrong) );
611 SCIP_CALL( SCIPsetBranchruleExecPs(scip, branchrule, branchExecpsAllfullstrong) );
612
613 return SCIP_OKAY;
614}
#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:266
#define SCIP_Bool
Definition: def.h:91
#define MIN(x, y)
Definition: def.h:242
#define SCIP_Real
Definition: def.h:172
#define TRUE
Definition: def.h:93
#define FALSE
Definition: def.h:94
#define MAX(x, y)
Definition: def.h:238
#define SCIP_LONGINT_FORMAT
Definition: def.h:164
#define SCIP_CALL(x)
Definition: def.h:373
SCIP_Bool SCIPisExactSolve(SCIP *scip)
Definition: scip_general.c:621
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1992
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip_prob.c:3762
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip_prob.c:3697
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
Definition: scip_prob.c:3586
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:249
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip_branch.c:297
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: scip_branch.c:153
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:116
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: scip_branch.c:281
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1971
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1849
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: scip_branch.c:169
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip_branch.c:185
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch.c:1859
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip_branch.c:1126
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: scip_branch.c:733
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: scip_branch.c:872
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip_branch.c:849
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip_lp.c:83
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip_lp.c:168
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip_lp.c:649
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip_lp.c:247
#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:7530
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:2919
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:3739
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
Definition: scip_var.c:2744
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_var.c:4799
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:18143
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_var.c:4889
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:17418
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:18451
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:18133
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: scip_var.c:8903
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip_var.c:8399
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip_var.c:2686
SCIP_Bool SCIPvarIsInLP(SCIP_VAR *var)
Definition: var.c:17799
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
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:43
@ SCIP_VERBLEVEL_HIGH
Definition: type_message.h:56
@ 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