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