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