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-2017 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_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
68  SCIP_RESULT* result /**< pointer to store the result of the callback method */
69  )
70 {
71  SCIP_BRANCHRULEDATA* branchruledata;
72  SCIP_VAR** pseudocands;
73  SCIP_VAR** pseudocandscopy;
74  SCIP_Real bestdown;
75  SCIP_Real bestup;
76  SCIP_Real bestscore;
77  SCIP_Real provedbound;
78  SCIP_Bool exactsolve;
79  SCIP_Bool allcolsinlp;
80  SCIP_Bool bestdownvalid;
81  SCIP_Bool bestupvalid;
82  int npseudocands;
83  int npriopseudocands;
84  int bestpseudocand;
85 #ifndef NDEBUG
86  SCIP_Real cutoffbound;
87  cutoffbound = SCIPgetCutoffbound(scip);
88 #endif
89 
90  assert(branchrule != NULL);
91  assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
92  assert(scip != NULL);
93  assert(result != NULL);
94 
95  /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
96  allcolsinlp = SCIPallColsInLP(scip);
97 
98  /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
99  * for cutting off sub problems and improving lower bounds of children
100  */
101  exactsolve = SCIPisExactSolve(scip);
102 
103  /* get branching rule data */
104  branchruledata = SCIPbranchruleGetData(branchrule);
105  assert(branchruledata != NULL);
106 
107  if( branchruledata->skipdown == NULL )
108  {
109  assert(branchruledata->skipup == NULL);
110 
111  branchruledata->skipsize = SCIPgetNVars(scip);
112  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->skipdown, branchruledata->skipsize) );
113  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->skipup, branchruledata->skipsize) );
114  BMSclearMemoryArray(branchruledata->skipdown, branchruledata->skipsize);
115  BMSclearMemoryArray(branchruledata->skipup, branchruledata->skipsize);
116  }
117 
118  /* get all non-fixed variables (not only the fractional ones) */
119  SCIP_CALL( SCIPgetPseudoBranchCands(scip, &pseudocands, &npseudocands, &npriopseudocands) );
120  assert(npseudocands > 0);
121  assert(npriopseudocands > 0);
122 
123  SCIP_CALL( SCIPduplicateBufferArray(scip, &pseudocandscopy, pseudocands, npseudocands) );
124 
125  SCIP_CALL( SCIPselectVarPseudoStrongBranching(scip, pseudocandscopy, branchruledata->skipdown, branchruledata->skipup, npseudocands, npriopseudocands,
126  allowaddcons, &bestpseudocand, &bestdown, &bestup, &bestscore, &bestdownvalid, &bestupvalid, &provedbound, result) );
127 
128  if( *result != SCIP_CUTOFF && *result != SCIP_REDUCEDDOM && *result != SCIP_CONSADDED )
129  {
130  SCIP_NODE* downchild;
131  SCIP_NODE* eqchild;
132  SCIP_NODE* upchild;
133  SCIP_VAR* var;
134 
135  assert(*result == SCIP_DIDNOTRUN);
136  assert(0 <= bestpseudocand && bestpseudocand < npseudocands);
137  assert(SCIPisLT(scip, provedbound, cutoffbound));
138 
139  var = pseudocandscopy[bestpseudocand];
140 
141  /* perform the branching */
142  SCIPdebugMsg(scip, " -> %d candidates, selected candidate %d: variable <%s>[%g,%g] (solval=%g, down=%g, up=%g, score=%g)\n",
143  npseudocands, bestpseudocand, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), SCIPvarGetLPSol(var),
144  bestdown, bestup, bestscore);
145  SCIP_CALL( SCIPbranchVarVal(scip, var, SCIPvarGetLPSol(var), &downchild, &eqchild, &upchild) );
146 
147  /* update the lower bounds in the children */
148  if( allcolsinlp && !exactsolve )
149  {
150  if( downchild != NULL )
151  {
152  SCIP_CALL( SCIPupdateNodeLowerbound(scip, downchild, bestdownvalid ? MAX(bestdown, provedbound) : provedbound) );
153  SCIPdebugMsg(scip, " -> down child's lowerbound: %g\n", SCIPnodeGetLowerbound(downchild));
154  }
155  if( eqchild != NULL )
156  {
157  SCIP_CALL( SCIPupdateNodeLowerbound(scip, eqchild, provedbound) );
158  SCIPdebugMsg(scip, " -> eq child's lowerbound: %g\n", SCIPnodeGetLowerbound(eqchild));
159  }
160  if( upchild != NULL )
161  {
162  SCIP_CALL( SCIPupdateNodeLowerbound(scip, upchild, bestupvalid ? MAX(bestup, provedbound) : provedbound) );
163  SCIPdebugMsg(scip, " -> up child's lowerbound: %g\n", SCIPnodeGetLowerbound(upchild));
164  }
165  }
166 
167  *result = SCIP_BRANCHED;
168  }
169 
170  SCIPfreeBufferArray(scip, &pseudocandscopy);
171 
172  return SCIP_OKAY;
173 }
174 
175 
176 /*
177  * Callback methods
178  */
179 
180 /** copy method for branchrule plugins (called when SCIP copies plugins) */
181 static
182 SCIP_DECL_BRANCHCOPY(branchCopyAllfullstrong)
183 { /*lint --e{715}*/
184  assert(scip != NULL);
185  assert(branchrule != NULL);
186  assert(strcmp(SCIPbranchruleGetName(branchrule), BRANCHRULE_NAME) == 0);
187 
188  /* call inclusion method of branchrule */
190 
191  return SCIP_OKAY;
192 }
193 
194 /** destructor of branching rule to free user data (called when SCIP is exiting) */
195 static
196 SCIP_DECL_BRANCHFREE(branchFreeAllfullstrong)
197 { /*lint --e{715}*/
198  SCIP_BRANCHRULEDATA* branchruledata;
199 
200  /* free branching rule data */
201  branchruledata = SCIPbranchruleGetData(branchrule);
202  SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipdown, branchruledata->skipsize);
203  SCIPfreeBlockMemoryArrayNull(scip, &branchruledata->skipup, branchruledata->skipsize);
204 
205  SCIPfreeBlockMemory(scip, &branchruledata);
206  SCIPbranchruleSetData(branchrule, NULL);
207 
208  return SCIP_OKAY;
209 }
210 
211 
212 /** initialization method of branching rule (called after problem was transformed) */
213 static
214 SCIP_DECL_BRANCHINIT(branchInitAllfullstrong)
215 { /*lint --e{715}*/
216  SCIP_BRANCHRULEDATA* branchruledata;
217 
218  /* initialize branching rule data */
219  branchruledata = SCIPbranchruleGetData(branchrule);
220  branchruledata->lastcand = 0;
221 
222  return SCIP_OKAY;
223 }
224 
225 
226 /** branching execution method for fractional LP solutions */
227 static
228 SCIP_DECL_BRANCHEXECLP(branchExeclpAllfullstrong)
229 { /*lint --e{715}*/
230  assert(result != NULL);
231 
232  SCIPdebugMsg(scip, "Execlp method of allfullstrong branching\n");
233 
234  *result = SCIP_DIDNOTRUN;
235 
236  SCIP_CALL( branch(scip, branchrule, allowaddcons, result) );
237 
238  return SCIP_OKAY;
239 }
240 
241 
242 /** branching execution method for not completely fixed pseudo solutions */
243 static
244 SCIP_DECL_BRANCHEXECPS(branchExecpsAllfullstrong)
245 { /*lint --e{715}*/
246  assert(result != NULL);
247 
248  SCIPdebugMsg(scip, "Execps method of allfullstrong branching\n");
249 
250  *result = SCIP_DIDNOTRUN;
251 
253  {
254  SCIP_CALL( branch(scip, branchrule, allowaddcons, result) );
255  }
256 
257  return SCIP_OKAY;
258 }
259 
260 
261 /*
262  * branching specific interface methods
263  */
264 /**
265  * Selects a variable from a set of candidates by strong branching
266  *
267  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
268  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
269  *
270  * @note The variables in the lpcands array must have a fractional value in the current LP solution
271  */
273  SCIP* scip, /**< original SCIP data structure */
274  SCIP_VAR** pseudocands, /**< branching candidates */
275  SCIP_Bool* skipdown, /**< should down branchings be skipped? */
276  SCIP_Bool* skipup, /**< should up branchings be skipped? */
277  int npseudocands, /**< number of branching candidates */
278  int npriopseudocands, /**< number of priority branching candidates */
279  SCIP_Bool allowaddcons, /**< is the branching rule allowed to add constraints? */
280  int* bestpseudocand, /**< best candidate for branching */
281  SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
282  SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
283  SCIP_Real* bestscore, /**< score for bestcand */
284  SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
285  SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
286  SCIP_Real* provedbound, /**< proved dual bound for current subtree */
287  SCIP_RESULT* result /**< result pointer */
288  )
289 {
290  SCIP_Real lpobjval;
291  SCIP_Bool allcolsinlp;
292  SCIP_Bool exactsolve;
293 #ifndef NDEBUG
294  SCIP_Real cutoffbound;
295  cutoffbound = SCIPgetCutoffbound(scip);
296 #endif
297 
298 
299  assert(scip != NULL);
300  assert(pseudocands != NULL);
301  assert(bestpseudocand != NULL);
302  assert(skipdown != NULL);
303  assert(skipup != NULL);
304  assert(bestdown != NULL);
305  assert(bestup != NULL);
306  assert(bestscore != NULL);
307  assert(bestdownvalid != NULL);
308  assert(bestupvalid != NULL);
309  assert(provedbound != NULL);
310  assert(result != NULL);
311  assert(SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL);
312 
313  /* get current LP objective bound of the local sub problem and global cutoff bound */
314  lpobjval = SCIPgetLPObjval(scip);
315 
316  /* check, if we want to solve the problem exactly, meaning that strong branching information is not useful
317  * for cutting off sub problems and improving lower bounds of children
318  */
319  exactsolve = SCIPisExactSolve(scip);
320 
321  /* check, if all existing columns are in LP, and thus the strong branching results give lower bounds */
322  allcolsinlp = SCIPallColsInLP(scip);
323 
324  /* if only one candidate exists, choose this one without applying strong branching */
325  *bestpseudocand = 0;
326  *bestdown = lpobjval;
327  *bestup = lpobjval;
328  *bestdownvalid = TRUE;
329  *bestupvalid = TRUE;
330  *bestscore = -SCIPinfinity(scip);
331  *provedbound = lpobjval;
332  if( npseudocands > 1 )
333  {
334  SCIP_BRANCHRULE* branchrule;
335  SCIP_BRANCHRULEDATA* branchruledata;
336 
337  SCIP_Real solval;
338  SCIP_Real down;
339  SCIP_Real up;
340  SCIP_Real downgain;
341  SCIP_Real upgain;
342  SCIP_Real score;
343  SCIP_Bool integral;
344  SCIP_Bool lperror;
345  SCIP_Bool downvalid;
346  SCIP_Bool upvalid;
347  SCIP_Bool downinf;
348  SCIP_Bool upinf;
349  SCIP_Bool downconflict;
350  SCIP_Bool upconflict;
351  int nsbcalls;
352  int i;
353  int c;
354 
355  branchrule = SCIPfindBranchrule(scip, BRANCHRULE_NAME);
356  assert(branchrule != NULL);
357 
358  /* get branching rule data */
359  branchruledata = SCIPbranchruleGetData(branchrule);
360  assert(branchruledata != NULL);
361 
362 
363  /* initialize strong branching */
365 
366  /* search the full strong candidate:
367  * cycle through the candidates, starting with the position evaluated in the last run
368  */
369  nsbcalls = 0;
370  for( i = 0, c = branchruledata->lastcand; i < npseudocands; ++i, ++c )
371  {
372  c = c % npseudocands;
373  assert(pseudocands[c] != NULL);
374 
375  /* we can only apply strong branching on COLUMN variables that are in the current LP */
376  if( !SCIPvarIsInLP(pseudocands[c]) )
377  continue;
378 
379  solval = SCIPvarGetLPSol(pseudocands[c]);
380  integral = SCIPisFeasIntegral(scip, solval);
381 
382  SCIPdebugMsg(scip, "applying strong branching on %s variable <%s>[%g,%g] with solution %g\n",
383  integral ? "integral" : "fractional", SCIPvarGetName(pseudocands[c]), SCIPvarGetLbLocal(pseudocands[c]),
384  SCIPvarGetUbLocal(pseudocands[c]), solval);
385 
386  up = -SCIPinfinity(scip);
387  down = -SCIPinfinity(scip);
388 
389  if( integral )
390  {
391  SCIP_CALL( SCIPgetVarStrongbranchInt(scip, pseudocands[c], INT_MAX,
392  skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
393  }
394  else
395  {
396  SCIP_CALL( SCIPgetVarStrongbranchFrac(scip, pseudocands[c], INT_MAX,
397  skipdown[c] ? NULL : &down, skipup[c] ? NULL : &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
398  }
399  nsbcalls++;
400 
401  /* display node information line in root node */
402  if( SCIPgetDepth(scip) == 0 && nsbcalls % 100 == 0 )
403  {
405  }
406 
407  /* check for an error in strong branching */
408  if( lperror )
409  {
411  "(node %" SCIP_LONGINT_FORMAT ") error in strong branching call for variable <%s> with solution %g\n",
412  SCIPgetNNodes(scip), SCIPvarGetName(pseudocands[c]), solval);
413  break;
414  }
415 
416  /* evaluate strong branching */
417  down = MAX(down, lpobjval);
418  up = MAX(up, lpobjval);
419  downgain = down - lpobjval;
420  upgain = up - lpobjval;
421  assert(!allcolsinlp || exactsolve || !downvalid || downinf == SCIPisGE(scip, down, cutoffbound));
422  assert(!allcolsinlp || exactsolve || !upvalid || upinf == SCIPisGE(scip, up, cutoffbound));
423  assert(downinf || !downconflict);
424  assert(upinf || !upconflict);
425 
426  /* check if there are infeasible roundings */
427  if( downinf || upinf )
428  {
429  assert(allcolsinlp);
430  assert(!exactsolve);
431 
432  /* if for both infeasibilities, a conflict constraint was created, we don't need to fix the variable by hand,
433  * but better wait for the next propagation round to fix them as an inference, and potentially produce a
434  * cutoff that can be analyzed
435  */
436  if( allowaddcons && downinf == downconflict && upinf == upconflict )
437  {
438  *result = SCIP_CONSADDED;
439  SCIPdebugMsg(scip, " -> fractional variable <%s> is infeasible in %d directions - added conflict\n",
440  SCIPvarGetName(pseudocands[c]), downinf && upinf ? 2 : 1);
441  break; /* terminate initialization loop, because constraint was added */
442  }
443  else if( downinf && upinf )
444  {
445  if( integral )
446  {
447  SCIP_Bool infeasible;
448  SCIP_Bool fixed;
449 
450  /* both bound changes are infeasible: variable can be fixed to its current value */
451  SCIP_CALL( SCIPfixVar(scip, pseudocands[c], solval, &infeasible, &fixed) );
452  assert(!infeasible);
453  assert(fixed);
454  *result = SCIP_REDUCEDDOM;
455  SCIPdebugMsg(scip, " -> integral variable <%s> is infeasible in both directions\n",
456  SCIPvarGetName(pseudocands[c]));
457  break; /* terminate initialization loop, because LP was changed */
458  }
459  else
460  {
461  /* both roundings are infeasible: the node is infeasible */
462  *result = SCIP_CUTOFF;
463  SCIPdebugMsg(scip, " -> fractional variable <%s> is infeasible in both directions\n",
464  SCIPvarGetName(pseudocands[c]));
465  break; /* terminate initialization loop, because node is infeasible */
466  }
467  }
468  else if( downinf )
469  {
470  SCIP_Real newlb;
471 
472  /* downwards rounding is infeasible -> change lower bound of variable to upward rounding */
473  newlb = SCIPfeasCeil(scip, solval);
474  if( SCIPvarGetLbLocal(pseudocands[c]) < newlb - 0.5 )
475  {
476  SCIP_CALL( SCIPchgVarLb(scip, pseudocands[c], newlb) );
477  *result = SCIP_REDUCEDDOM;
478  SCIPdebugMsg(scip, " -> variable <%s> is infeasible in downward branch\n", SCIPvarGetName(pseudocands[c]));
479  break; /* terminate initialization loop, because LP was changed */
480  }
481  }
482  else
483  {
484  SCIP_Real newub;
485 
486  /* upwards rounding is infeasible -> change upper bound of variable to downward rounding */
487  assert(upinf);
488  newub = SCIPfeasFloor(scip, solval);
489  if( SCIPvarGetUbLocal(pseudocands[c]) > newub + 0.5 )
490  {
491  SCIP_CALL( SCIPchgVarUb(scip, pseudocands[c], newub) );
492  *result = SCIP_REDUCEDDOM;
493  SCIPdebugMsg(scip, " -> variable <%s> is infeasible in upward branch\n", SCIPvarGetName(pseudocands[c]));
494  break; /* terminate initialization loop, because LP was changed */
495  }
496  }
497  }
498  else if( allcolsinlp && !exactsolve && downvalid && upvalid )
499  {
500  SCIP_Real minbound;
501 
502  /* the minimal lower bound of both children is a proved lower bound of the current subtree */
503  minbound = MIN(down, up);
504  *provedbound = MAX(*provedbound, minbound);
505  }
506 
507  /* check for a better score, if we are within the maximum priority candidates */
508  if( c < npriopseudocands )
509  {
510  if( integral )
511  {
512 
513  if( skipdown[c] )
514  {
515  downgain = 0.0;
516  score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
517  }
518  else if( skipup[c] )
519  {
520  upgain = 0.0;
521  score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
522  }
523  else
524  {
525  SCIP_Real gains[3];
526 
527  gains[0] = downgain;
528  gains[1] = 0.0;
529  gains[2] = upgain;
530  score = SCIPgetBranchScoreMultiple(scip, pseudocands[c], 3, gains);
531  }
532  }
533  else
534  score = SCIPgetBranchScore(scip, pseudocands[c], downgain, upgain);
535 
536  if( score > *bestscore )
537  {
538  *bestpseudocand = c;
539  *bestdown = down;
540  *bestup = up;
541  *bestdownvalid = downvalid;
542  *bestupvalid = upvalid;
543  *bestscore = score;
544  }
545  }
546  else
547  {
548  SCIPdebug( score = 0.0; )
549  }
550 
551  /* update pseudo cost values */
552  if( !downinf )
553  {
554  SCIP_CALL( SCIPupdateVarPseudocost(scip, pseudocands[c],
555  solval-SCIPfeasCeil(scip, solval-1.0), downgain, 1.0) );
556  }
557  if( !upinf )
558  {
559  SCIP_CALL( SCIPupdateVarPseudocost(scip, pseudocands[c],
560  solval-SCIPfeasFloor(scip, solval+1.0), upgain, 1.0) );
561  }
562 
563  SCIPdebugMsg(scip, " -> var <%s> (solval=%g, downgain=%g, upgain=%g, score=%g) -- best: <%s> (%g)\n",
564  SCIPvarGetName(pseudocands[c]), solval, downgain, upgain, score,
565  SCIPvarGetName(pseudocands[*bestpseudocand]), *bestscore);
566  }
567 
568  /* remember last evaluated candidate */
569  branchruledata->lastcand = c;
570 
571  /* end strong branching */
573  }
574 
575  return SCIP_OKAY;
576 }
577 
578 /** creates the all variables full strong LP branching rule and includes it in SCIP */
580  SCIP* scip /**< SCIP data structure */
581  )
582 {
583  SCIP_BRANCHRULEDATA* branchruledata;
584  SCIP_BRANCHRULE* branchrule;
585 
586  /* create allfullstrong branching rule data */
587  SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata) );
588  branchruledata->lastcand = 0;
589  branchruledata->skipsize = 0;
590  branchruledata->skipup = NULL;
591  branchruledata->skipdown = NULL;
592 
593  /* include allfullstrong branching rule */
595  BRANCHRULE_MAXDEPTH, BRANCHRULE_MAXBOUNDDIST, branchruledata) );
596 
597  assert(branchrule != NULL);
598 
599  /* set non-fundamental callbacks via specific setter functions*/
600  SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyAllfullstrong) );
601  SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeAllfullstrong) );
602  SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitAllfullstrong) );
603  SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpAllfullstrong) );
604  SCIP_CALL( SCIPsetBranchruleExecPs(scip, branchrule, branchExecpsAllfullstrong) );
605 
606  return SCIP_OKAY;
607 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1780
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip.h:21958
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: scip.c:9203
#define BRANCHRULE_MAXBOUNDDIST
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:42726
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
Definition: tree.c:7192
static SCIP_DECL_BRANCHEXECPS(branchExecpsAllfullstrong)
#define BRANCHRULE_MAXDEPTH
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17225
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46037
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:9089
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
Definition: scip.c:44946
#define FALSE
Definition: def.h:64
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:46050
#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:9073
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:36779
#define BRANCHRULE_NAME
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:9219
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip.h:21973
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:9036
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip.h:21999
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21705
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:22003
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:21956
#define SCIPdebugMsg
Definition: scip.h:451
SCIP_RETCODE SCIPincludeBranchruleAllfullstrong(SCIP *scip)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:46457
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:46445
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: scip.c:9171
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: scip.c:25653
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip.c:36756
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45998
static SCIP_DECL_BRANCHFREE(branchFreeAllfullstrong)
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21795
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16555
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:20881
#define NULL
Definition: lpi_spx1.cpp:137
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:17543
#define SCIP_CALL(x)
Definition: def.h:316
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:36986
static SCIP_DECL_BRANCHEXECLP(branchExeclpAllfullstrong)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip.c:1353
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: scip.c:36640
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:28863
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip.c:19864
#define SCIP_Bool
Definition: def.h:61
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:28948
SCIP_Bool SCIPvarIsInLP(SCIP_VAR *var)
Definition: var.c:16894
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:42321
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:13443
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch.c:1790
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_RETCODE SCIPselectVarPseudoStrongBranching(SCIP *scip, SCIP_VAR **pseudocands, SCIP_Bool *skipdown, SCIP_Bool *skipup, int npseudocands, int npriopseudocands, SCIP_Bool allowaddcons, 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_DESC
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip.c:25235
static SCIP_RETCODE branch(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_Bool allowaddcons, SCIP_RESULT *result)
static SCIP_DECL_BRANCHCOPY(branchCopyAllfullstrong)
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:11680
all variables full strong LP branching rule
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:29027
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
Definition: scip.c:19923
#define SCIP_Real
Definition: def.h:145
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1902
#define MIN(x, y)
Definition: memory.c:75
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip.c:9105
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:29374
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17235
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip.h:21976
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:46421
#define BMSclearMemoryArray(ptr, num)
Definition: memory.h:89
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:20098
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:41409
SCIP_Bool SCIPisExactSolve(SCIP *scip)
Definition: scip.c:1025