Scippy

SCIP

Solving Constraint Integer Programs

branch_vanillafullstrong.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_vanillafullstrong.c
26 * @ingroup DEFPLUGINS_BRANCH
27 * @brief vanilla full strong LP branching rule
28 * @author Tobias Achterberg
29 * @author Maxime Gasse
30 */
31
32/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33
36#include "scip/pub_branch.h"
37#include "scip/pub_message.h"
38#include "scip/pub_tree.h"
39#include "scip/pub_var.h"
40#include "scip/scip_branch.h"
41#include "scip/scip_general.h"
42#include "scip/scip_lp.h"
43#include "scip/scip_mem.h"
44#include "scip/scip_message.h"
45#include "scip/scip_numerics.h"
46#include "scip/scip_param.h"
47#include "scip/scip_prob.h"
49#include "scip/scip_tree.h"
50#include "scip/scip_var.h"
51#include <string.h>
52
53
54#define BRANCHRULE_NAME "vanillafullstrong"
55#define BRANCHRULE_DESC "vanilla full strong branching"
56#define BRANCHRULE_PRIORITY -2000
57#define BRANCHRULE_MAXDEPTH -1
58#define BRANCHRULE_MAXBOUNDDIST 1.0
59
60#define DEFAULT_INTEGRALCANDS FALSE /**< should integral variables in the current LP solution be considered as
61 * branching candidates ? */
62#define DEFAULT_SCOREALL FALSE /**< should strong branching scores be computed for all candidates, or can
63 * we early stop when a variable has infinite score ? */
64#define DEFAULT_IDEMPOTENT FALSE /**< should strong branching side-effects be prevented (e.g., domain
65 * changes, stat updates etc.) ? */
66#define DEFAULT_COLLECTSCORES FALSE /**< should strong branching scores be collected ? */
67#define DEFAULT_DONOTBRANCH FALSE /**< should branching be done ? */
68
69
70/** branching rule data */
71struct SCIP_BranchruleData
72{
73 SCIP_Bool integralcands; /**< should integral variables in the current LP solution be considered
74 * as branching candidates ? */
75 SCIP_Bool scoreall; /**< should strong branching scores be computed for all candidates, or
76 * can we early stop when a node is detected infeasible ? */
77 SCIP_Bool idempotent; /**< should strong branching side-effects be prevented (e.g., domain
78 * changes, stat updates etc.) ? */
79 SCIP_Bool collectscores; /**< should strong branching scores be collected ? */
80 SCIP_Bool donotbranch; /**< should branching be done ? */
81 SCIP_VAR** cands; /**< candidate variables */
82 SCIP_Real* candscores; /**< candidate scores */
83 int ncands; /**< number of candidates */
84 int npriocands; /**< number of priority candidates */
85 int bestcand; /**< best branching candidate */
86 int candcapacity; /**< capacity of candidate arrays */
87};
88
89
90/*
91 * local methods
92 */
93
94
95/** selects a variable from a set of candidates by strong branching */
96static
98 SCIP* scip, /**< SCIP data structure */
99 SCIP_VAR** cands, /**< branching candidates */
100 int ncands, /**< number of branching candidates */
101 int npriocands, /**< number of branching candidates with highest priority */
102 SCIP_Bool scoreall, /**< should strong branching scores be computed for all candidates, or can
103 * we early stop when a node is detected infeasible ? */
104 SCIP_Bool idempotent, /**< should strong branching side-effects be prevented (e.g., domain
105 * changes, stat updates etc.) ? */
106 SCIP_Real* scores, /**< candidate scores */
107 int* bestcand, /**< best candidate for branching */
108 SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
109 SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
110 SCIP_Real* bestscore, /**< score for bestcand */
111 SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
112 SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
113 SCIP_Real* provedbound /**< proved dual bound for current subtree */
114 )
115{ /*lint --e{715}*/
116 SCIP_Real lpobjval;
117 int nsbcalls;
118 int c;
119
120 assert(scip != NULL);
121 assert(cands != NULL);
122 assert(bestcand != NULL);
123 assert(bestdown != NULL);
124 assert(bestup != NULL);
125 assert(bestscore != NULL);
126 assert(bestdownvalid != NULL);
127 assert(bestupvalid != NULL);
128 assert(provedbound != NULL);
129 assert(ncands > 0);
130
131 /* get current LP objective bound of the local sub problem and global cutoff bound */
132 lpobjval = SCIPgetLPObjval(scip);
133 *provedbound = lpobjval;
134
135 *bestcand = 0;
136 *bestdown = lpobjval;
137 *bestup = lpobjval;
138 *bestdownvalid = FALSE;
139 *bestupvalid = FALSE;
140 *bestscore = -SCIPinfinity(scip);
141
142 if( scores != NULL )
143 for( c = 0; c < ncands; ++c )
144 scores[c] = -SCIPinfinity(scip);
145
146 /* if only one candidate exists, choose this one without applying strong branching; also, when SCIP is about to be
147 * stopped, all strongbranching evaluations will be aborted anyway, thus we can return immediately
148 */
149 if( (!scoreall && ncands == 1) || SCIPisStopped(scip) )
150 return SCIP_OKAY;
151
152 /* this assert may not hold if SCIP is stopped, thus we only check it here */
154
155 /* initialize strong branching without propagation */
157
158 /* compute strong branching scores */
159 nsbcalls = 0;
160 for( c = 0; c < ncands ; ++c )
161 {
162 SCIP_VAR* var;
163 SCIP_Real val;
164 SCIP_Bool integral;
165 SCIP_Real down, up;
166 SCIP_Real downgain, upgain;
167 SCIP_Bool downvalid, upvalid;
168 SCIP_Bool downinf, upinf;
169 SCIP_Bool downconflict, upconflict;
170 SCIP_Bool lperror;
171 SCIP_Real gains[3];
172 SCIP_Real score;
173
174 var = cands[c];
175 assert(var != NULL);
176
177 val = SCIPvarGetLPSol(var);
178 integral = SCIPisFeasIntegral(scip, val);
179
180 up = -SCIPinfinity(scip);
181 down = -SCIPinfinity(scip);
182
183 SCIPdebugMsg(scip, "applying vanilla strong branching on variable <%s> with solution %g\n",
184 SCIPvarGetName(var), val);
185
186 /* apply strong branching */
187 if( integral )
188 {
189 SCIP_CALL( SCIPgetVarStrongbranchInt(scip, cands[c], INT_MAX, idempotent,
190 &down, &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
191 }
192 else
193 {
194 SCIP_CALL( SCIPgetVarStrongbranchFrac(scip, cands[c], INT_MAX, idempotent,
195 &down, &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
196 }
197 nsbcalls++;
198
199 /* check for an error in strong branching */
200 if( lperror )
201 {
203 "(node %" SCIP_LONGINT_FORMAT ") error in strong branching call for variable <%s> with solution %g\n",
204 SCIPgetNNodes(scip), SCIPvarGetName(var), val);
205 break;
206 }
207
208 /* evaluate strong branching */
209 down = MAX(down, lpobjval);
210 up = MAX(up, lpobjval);
211 downgain = down - lpobjval;
212 upgain = up - lpobjval;
213
214 assert(!SCIPallColsInLP(scip) || SCIPisExactSolve(scip) || !downvalid || downinf == SCIPisGE(scip, down, SCIPgetCutoffbound(scip)));
215 assert(!SCIPallColsInLP(scip) || SCIPisExactSolve(scip) || !upvalid || upinf == SCIPisGE(scip, up, SCIPgetCutoffbound(scip)));
216 assert(downinf || !downconflict);
217 assert(upinf || !upconflict);
218
219 if( !idempotent )
220 {
221 /* display node information line */
222 if( SCIPgetDepth(scip) == 0 && nsbcalls % 100 == 0 )
223 {
225 }
226 /* update variable pseudo cost values */
227 if( !downinf && downvalid )
228 {
229 SCIP_CALL( SCIPupdateVarPseudocost(scip, var, integral ? -1.0 : 0.0 - SCIPfrac(scip, val), downgain, 1.0) );
230 }
231 if( !upinf && upvalid )
232 {
233 SCIP_CALL( SCIPupdateVarPseudocost(scip, var, integral ? +1.0 : 1.0 - SCIPfrac(scip, val), upgain, 1.0) );
234 }
235 }
236
237 /* compute strong branching score */
238 gains[0] = downgain;
239 gains[1] = upgain;
240 gains[2] = 0.0;
241 score = SCIPgetBranchScoreMultiple(scip, var, integral ? 3 : 2, gains);
242
243 /* collect scores if requested */
244 if( scores != NULL )
245 scores[c] = score;
246
247 /* check for a better score */
248 if( score > *bestscore )
249 {
250 *bestcand = c;
251 *bestdown = down;
252 *bestup = up;
253 *bestdownvalid = downvalid;
254 *bestupvalid = upvalid;
255 *bestscore = score;
256 }
257
258 SCIPdebugMsg(scip, " -> cand %d/%d (prio:%d) var <%s> (solval=%g, downgain=%g, upgain=%g, score=%g) -- best: <%s> (%g)\n",
259 c, ncands, npriocands, SCIPvarGetName(var), val, downgain, upgain, score,
260 SCIPvarGetName(cands[*bestcand]), *bestscore);
261
262 /* node is infeasible -> early stopping (highest score) */
263 if( !integral && !scoreall && downinf && upinf )
264 {
265 /* we should only detect infeasibility if the LP is a valid relaxation */
266 assert(SCIPallColsInLP(scip));
267 assert(!SCIPisExactSolve(scip));
268 assert(*bestcand == c);
269
270 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in both directions\n", SCIPvarGetName(var));
271 break;
272 }
273 }
274
275 /* end strong branching */
277
278 /* update proved bound */
279 if( *bestdownvalid && *bestupvalid && !SCIPisFeasIntegral(scip, SCIPvarGetLPSol(cands[*bestcand])) )
280 {
281 SCIP_Real minbound = MIN(*bestdown, *bestup);
282
283 *provedbound = MAX(*provedbound, minbound);
284 }
285
286 return SCIP_OKAY;
287}
288
289/*
290 * Callback methods
291 */
292
293/** copy method for branchrule plugins (called when SCIP copies plugins) */
294static
295SCIP_DECL_BRANCHCOPY(branchCopyVanillafullstrong)
296{ /*lint --e{715}*/
297 assert(scip != NULL);
298 assert(branchrule != NULL);
299 assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
300
301 /* call inclusion method of branchrule */
303
304 return SCIP_OKAY;
305}
306
307/** destructor of branching rule to free user data (called when SCIP is exiting) */
308static
309SCIP_DECL_BRANCHFREE(branchFreeVanillafullstrong)
310{ /*lint --e{715}*/
311 SCIP_BRANCHRULEDATA* branchruledata;
312
313 /* free branching rule data */
314 branchruledata = SCIPbranchruleGetData(branchrule);
315 assert(branchruledata != NULL);
316
317 SCIPfreeBlockMemoryNull(scip, &branchruledata);
318
319 return SCIP_OKAY;
320}
321
322/** initialization method of branching rule (called after problem was transformed) */
323static
324SCIP_DECL_BRANCHINIT(branchInitVanillafullstrong)
325{ /*lint --e{715}*/
326#ifndef NDEBUG
327 SCIP_BRANCHRULEDATA* branchruledata;
328
329 /* initialize branching rule data */
330 branchruledata = SCIPbranchruleGetData(branchrule);
331#endif
332 assert(branchruledata != NULL);
333 assert(branchruledata->candscores == NULL);
334 assert(branchruledata->cands == NULL);
335
336 return SCIP_OKAY;
337}
338
339/** deinitialization method of branching rule (called before transformed problem is freed) */
340static
341SCIP_DECL_BRANCHEXIT(branchExitVanillafullstrong)
342{ /*lint --e{715}*/
343 SCIP_BRANCHRULEDATA* branchruledata;
344
345 /* initialize branching rule data */
346 branchruledata = SCIPbranchruleGetData(branchrule);
347 assert(branchruledata != NULL);
348
349 /* free candidate arrays if any */
350 if( branchruledata->candscores != NULL )
351 {
352 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->candscores, branchruledata->candcapacity);
353 }
354 if( branchruledata->cands != NULL )
355 {
356 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->cands, branchruledata->candcapacity);
357 }
358
359 branchruledata->candcapacity = -1;
360 branchruledata->ncands = -1;
361 branchruledata->npriocands = -1;
362 branchruledata->bestcand = -1;
363
364 return SCIP_OKAY;
365}
366
367/** branching execution method */
368static
369SCIP_DECL_BRANCHEXECLP(branchExeclpVanillafullstrong)
370{ /*lint --e{715}*/
371 SCIP_BRANCHRULEDATA* branchruledata;
372 SCIP_Real bestdown;
373 SCIP_Real bestup;
374 SCIP_Real bestscore;
375 SCIP_Real provedbound;
376 SCIP_Bool bestdownvalid;
377 SCIP_Bool bestupvalid;
378 SCIP_VAR** cands;
379 int ncands;
380 int npriocands;
381 int i;
382
383 assert(branchrule != NULL);
384 assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
385 assert(scip != NULL);
386 assert(result != NULL);
387
388 SCIPdebugMsg(scip, "Execlp method of vanilla fullstrong branching\n");
389
390 *result = SCIP_DIDNOTRUN;
391
392 /* get branching rule data */
393 branchruledata = SCIPbranchruleGetData(branchrule);
394 assert(branchruledata != NULL);
395
396 /* get branching candidates, either all non-fixed variables or only the
397 * fractional ones */
398 if( branchruledata->integralcands )
399 {
400 SCIP_CALL( SCIPgetPseudoBranchCands(scip, &cands, &ncands, &npriocands) );
401 }
402 else
403 {
404 SCIP_CALL( SCIPgetLPBranchCands(scip, &cands, NULL, NULL, &ncands, &npriocands, NULL) );
405 }
406
407 assert(ncands > 0);
408 assert(npriocands > 0);
409
410 /* increase candidate arrays capacity if needed */
411 if( ncands > branchruledata->candcapacity )
412 {
413 /* free previously allocated arrays if any */
414 if( branchruledata->candscores != NULL)
415 {
416 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->candscores, branchruledata->candcapacity);
417 branchruledata->candscores = NULL;
418 }
419 if( branchruledata->cands != NULL)
420 {
421 SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->cands, branchruledata->candcapacity);
422 branchruledata->cands = NULL;
423 }
424
425 /* update capacity */
426 branchruledata->candcapacity = SCIPgetNBinVars(scip) + SCIPgetNIntVars(scip) + SCIPgetNImplVars(scip);
427 }
428 assert(branchruledata->candcapacity >= ncands);
429
430 /* allocate new candidate arrays if needed */
431 if( branchruledata->cands == NULL )
432 {
433 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->cands, branchruledata->candcapacity) );
434 }
435 if( branchruledata->candscores == NULL && branchruledata->collectscores )
436 {
437 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->candscores, branchruledata->candcapacity) );
438 }
439
440 /* copy candidates */
441 branchruledata->ncands = ncands;
442 branchruledata->npriocands = npriocands;
443
444 for( i = 0; i < ncands; i++ )
445 branchruledata->cands[i] = cands[i];
446
447 SCIP_CALL( runVanillaStrongBranching(scip, branchruledata->cands, branchruledata->ncands, branchruledata->npriocands,
448 branchruledata->scoreall, branchruledata->idempotent, branchruledata->candscores,
449 &branchruledata->bestcand, &bestdown, &bestup, &bestscore, &bestdownvalid,
450 &bestupvalid, &provedbound) );
451
452 if( !branchruledata->donotbranch )
453 {
454 assert(0 <= branchruledata->bestcand && branchruledata->bestcand < branchruledata->ncands);
455
456 if( SCIPisGE(scip, provedbound, SCIPgetCutoffbound(scip)) )
457 {
458 SCIPdebugMsg(scip, " -> variable <%s> is infeasible in both directions\n",
459 SCIPvarGetName(branchruledata->cands[branchruledata->bestcand]));
460
461 *result = SCIP_CUTOFF;
462 }
463 else
464 {
465 SCIP_VAR* var;
466 SCIP_Real val;
467 SCIP_NODE* downchild;
468 SCIP_NODE* eqchild;
469 SCIP_NODE* upchild;
470 SCIP_Bool allcolsinlp;
471 SCIP_Bool exactsolve;
472
473 /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
474 * for cutting off sub problems and improving lower bounds of children
475 */
476 exactsolve = SCIPisExactSolve(scip);
477
478 /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
479 allcolsinlp = SCIPallColsInLP(scip);
480
481 if( !branchruledata->idempotent && allcolsinlp && !exactsolve )
482 {
484 }
485
486 assert(SCIPisLT(scip, provedbound, SCIPgetCutoffbound(scip)));
487
488 var = branchruledata->cands[branchruledata->bestcand];
489 val = SCIPvarGetLPSol(var);
490
491 /* perform the branching */
492 SCIPdebugMsg(scip, " -> %d candidates, selected candidate %d: variable <%s>[%g,%g] (solval=%g, down=%g, up=%g, score=%g)\n",
493 branchruledata->ncands, branchruledata->bestcand, SCIPvarGetName(var), SCIPvarGetLbLocal(var),
494 SCIPvarGetUbLocal(var), val, bestdown, bestup, bestscore);
495 SCIP_CALL( SCIPbranchVarVal(scip, var, val, &downchild, &eqchild, &upchild) );
496
497 /* update the lower bounds in the children */
498 if( !branchruledata->idempotent && allcolsinlp && !exactsolve )
499 {
500 if( downchild != NULL && bestdownvalid )
501 {
502 SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdown) );
503 SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
504 }
505 if( upchild != NULL && bestupvalid )
506 {
507 SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestup) );
508 SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));
509 }
510 }
511
512 *result = SCIP_BRANCHED;
513 }
514 }
515
516 return SCIP_OKAY;
517}
518
519
520/*
521 * branching specific interface methods
522 */
523
524/** creates the vanilla full strong LP branching rule and includes it in SCIP */
526 SCIP* scip /**< SCIP data structure */
527 )
528{
529 SCIP_BRANCHRULEDATA* branchruledata;
530 SCIP_BRANCHRULE* branchrule;
531
532 /* create fullstrong branching rule data */
533 SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata) );
534 branchruledata->cands = NULL;
535 branchruledata->candscores = NULL;
536 branchruledata->candcapacity = -1;
537 branchruledata->ncands = -1;
538 branchruledata->npriocands = -1;
539 branchruledata->bestcand = -1;
540
541 /* include branching rule */
544
545 assert(branchrule != NULL);
546
547 /* set non-fundamental callbacks via specific setter functions*/
548 SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyVanillafullstrong) );
549 SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeVanillafullstrong) );
550 SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitVanillafullstrong) );
551 SCIP_CALL( SCIPsetBranchruleExit(scip, branchrule, branchExitVanillafullstrong) );
552 SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpVanillafullstrong) );
553
554 /* fullstrong branching rule parameters */
556 "branching/vanillafullstrong/integralcands",
557 "should integral variables in the current LP solution be considered as branching candidates?",
558 &branchruledata->integralcands, FALSE, DEFAULT_INTEGRALCANDS, NULL, NULL) );
560 "branching/vanillafullstrong/idempotent",
561 "should strong branching side-effects be prevented (e.g., domain changes, stat updates etc.)?",
562 &branchruledata->idempotent, FALSE, DEFAULT_IDEMPOTENT, NULL, NULL) );
564 "branching/vanillafullstrong/scoreall",
565 "should strong branching scores be computed for all candidates, or can we early stop when a variable has infinite score?",
566 &branchruledata->scoreall, TRUE, DEFAULT_SCOREALL, NULL, NULL) );
568 "branching/vanillafullstrong/collectscores",
569 "should strong branching scores be collected?",
570 &branchruledata->collectscores, TRUE, DEFAULT_COLLECTSCORES, NULL, NULL) );
572 "branching/vanillafullstrong/donotbranch",
573 "should candidates only be scored, but no branching be performed?",
574 &branchruledata->donotbranch, TRUE, DEFAULT_DONOTBRANCH, NULL, NULL) );
575
576 return SCIP_OKAY;
577}
578
579
580/** recovers candidate variables and their scores from last vanilla full strong branching call */
582 SCIP* scip, /**< SCIP data structure */
583 SCIP_VAR*** cands, /**< pointer to store candidate variables; or NULL */
584 SCIP_Real** candscores, /**< pointer to store candidate scores; or NULL */
585 int* ncands, /**< pointer to store number of candidates; or NULL */
586 int* npriocands, /**< pointer to store number of priority candidates; or NULL */
587 int* bestcand /**< pointer to store best branching candidate; or NULL */
588 )
589{
590 SCIP_BRANCHRULEDATA* branchruledata;
591 SCIP_BRANCHRULE* branchrule;
592
593 assert(scip != NULL);
594
596 assert( branchrule != NULL );
597 branchruledata = SCIPbranchruleGetData(branchrule);
598 assert( branchruledata != NULL );
599
600 if( cands )
601 {
602 *cands = branchruledata->cands;
603 }
604 if( candscores && branchruledata->collectscores )
605 {
606 *candscores = branchruledata->candscores;
607 }
608 if( ncands )
609 {
610 *ncands = branchruledata->ncands;
611 }
612 if( npriocands )
613 {
614 *npriocands = branchruledata->npriocands;
615 }
616 if( bestcand )
617 {
618 *bestcand = branchruledata->bestcand;
619 }
620
621 return SCIP_OKAY;
622}
#define BRANCHRULE_DESC
#define DEFAULT_IDEMPOTENT
#define BRANCHRULE_PRIORITY
SCIP_RETCODE SCIPgetVanillafullstrongData(SCIP *scip, SCIP_VAR ***cands, SCIP_Real **candscores, int *ncands, int *npriocands, int *bestcand)
#define DEFAULT_SCOREALL
#define BRANCHRULE_NAME
static SCIP_DECL_BRANCHCOPY(branchCopyVanillafullstrong)
static SCIP_RETCODE runVanillaStrongBranching(SCIP *scip, SCIP_VAR **cands, int ncands, int npriocands, SCIP_Bool scoreall, SCIP_Bool idempotent, SCIP_Real *scores, int *bestcand, SCIP_Real *bestdown, SCIP_Real *bestup, SCIP_Real *bestscore, SCIP_Bool *bestdownvalid, SCIP_Bool *bestupvalid, SCIP_Real *provedbound)
#define DEFAULT_INTEGRALCANDS
#define DEFAULT_DONOTBRANCH
static SCIP_DECL_BRANCHFREE(branchFreeVanillafullstrong)
static SCIP_DECL_BRANCHEXIT(branchExitVanillafullstrong)
static SCIP_DECL_BRANCHEXECLP(branchExeclpVanillafullstrong)
static SCIP_DECL_BRANCHINIT(branchInitVanillafullstrong)
#define BRANCHRULE_MAXDEPTH
#define DEFAULT_COLLECTSCORES
#define BRANCHRULE_MAXBOUNDDIST
vanilla 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_RETCODE SCIPincludeBranchruleVanillafullstrong(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip_general.c:734
SCIP_Bool SCIPisExactSolve(SCIP *scip)
Definition: scip_general.c:621
int SCIPgetNIntVars(SCIP *scip)
Definition: scip_prob.c:2082
int SCIPgetNImplVars(SCIP *scip)
Definition: scip_prob.c:2127
int SCIPgetNBinVars(SCIP *scip)
Definition: scip_prob.c:2037
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
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 SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:57
SCIP_RETCODE SCIPsetBranchruleExit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: scip_branch.c:201
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
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
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 SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip_branch.c:395
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_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 SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:93
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip_mem.h:111
#define SCIPfreeBlockMemoryNull(scip, ptr)
Definition: scip_mem.h:109
#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_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfrac(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_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:18143
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 SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip_var.c:2686
memory allocation routines
public methods for branching rules
public methods for message output
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 SCIP parameter handling
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_BRANCHED
Definition: type_result.h:54
@ SCIP_OKAY
Definition: type_retcode.h:42
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63