Scippy

SCIP

Solving Constraint Integer Programs

scip_probing.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-2019 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 visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_probing.c
17  * @brief public methods for the probing mode
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include "blockmemshell/memory.h"
36 #include "scip/conflict.h"
37 #include "scip/cons.h"
38 #include "scip/debug.h"
39 #include "scip/heur.h"
40 #include "scip/lp.h"
41 #include "scip/prob.h"
42 #include "scip/pub_message.h"
43 #include "scip/pub_misc.h"
44 #include "scip/pub_relax.h"
45 #include "scip/pub_tree.h"
46 #include "scip/pub_var.h"
47 #include "scip/relax.h"
48 #include "scip/scip_general.h"
49 #include "scip/scip_lp.h"
50 #include "scip/scip_mem.h"
51 #include "scip/scip_message.h"
52 #include "scip/scip_numerics.h"
53 #include "scip/scip_prob.h"
54 #include "scip/scip_probing.h"
55 #include "scip/scip_solvingstats.h"
56 #include "scip/scip_tree.h"
57 #include "scip/sepastore.h"
58 #include "scip/set.h"
59 #include "scip/solve.h"
60 #include "scip/stat.h"
61 #include "scip/struct_lp.h"
62 #include "scip/struct_mem.h"
63 #include "scip/struct_scip.h"
64 #include "scip/struct_set.h"
65 #include "scip/struct_stat.h"
66 #include "scip/struct_tree.h"
67 #include "scip/struct_var.h"
68 #include "scip/tree.h"
69 #include "scip/var.h"
70 
71 /** returns whether we are in probing mode; probing mode is activated via SCIPstartProbing() and stopped
72  * via SCIPendProbing()
73  *
74  * @return TRUE, if SCIP is currently in probing mode, otherwise FALSE
75  *
76  * @pre This method can be called if @p scip is in one of the following stages:
77  * - \ref SCIP_STAGE_TRANSFORMED
78  * - \ref SCIP_STAGE_INITPRESOLVE
79  * - \ref SCIP_STAGE_PRESOLVING
80  * - \ref SCIP_STAGE_EXITPRESOLVE
81  * - \ref SCIP_STAGE_PRESOLVED
82  * - \ref SCIP_STAGE_INITSOLVE
83  * - \ref SCIP_STAGE_SOLVING
84  * - \ref SCIP_STAGE_SOLVED
85  * - \ref SCIP_STAGE_EXITSOLVE
86  */
88  SCIP* scip /**< SCIP data structure */
89  )
90 {
91  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPinProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
92 
93  return SCIPtreeProbing(scip->tree);
94 }
95 
96 /** initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(),
97  * SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), and SCIPsolveProbingLP() available
98  *
99  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
100  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
101  *
102  * @pre This method can be called if @p scip is in one of the following stages:
103  * - \ref SCIP_STAGE_PRESOLVING
104  * - \ref SCIP_STAGE_SOLVING
105  *
106  * @note The collection of variable statistics is turned off during probing. If these statistics should be collected
107  * during probing use the method SCIPenableVarHistory() to turn the collection explicitly on.
108  */
110  SCIP* scip /**< SCIP data structure */
111  )
112 {
113  SCIP_CALL( SCIPcheckStage(scip, "SCIPstartProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
114 
115  if( SCIPtreeProbing(scip->tree) )
116  {
117  SCIPerrorMessage("already in probing mode\n");
118  return SCIP_INVALIDCALL;
119  }
120 
121  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
122  {
123  SCIPerrorMessage("cannot start probing while in diving mode\n");
124  return SCIP_INVALIDCALL;
125  }
126 
127  /* use a different separation storage for probing mode; otherwise SCIP will remove the cuts that are currently in the
128  * separation storage after solving an LP in probing mode
129  */
130  if( scip->sepastore != NULL )
131  {
132  assert(scip->sepastoreprobing != NULL);
133  SCIPswapPointers((void**)&scip->sepastore, (void**)&scip->sepastoreprobing);
134  }
135 
136  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, scip->relaxation, scip->transprob, FALSE) );
137 
138  /* disables the collection of any statistic for a variable */
140 
141  return SCIP_OKAY;
142 }
143 
144 /** creates a new probing sub node, whose changes can be undone by backtracking to a higher node in the probing path
145  * with a call to SCIPbacktrackProbing();
146  * using a sub node for each set of probing bound changes can improve conflict analysis
147  *
148  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
149  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
150  *
151  * @pre This method can be called if @p scip is in one of the following stages:
152  * - \ref SCIP_STAGE_PRESOLVING
153  * - \ref SCIP_STAGE_SOLVING
154  */
156  SCIP* scip /**< SCIP data structure */
157  )
158 {
159  SCIP_RETCODE retcode;
160 
161  SCIP_CALL( SCIPcheckStage(scip, "SCIPnewProbingNode", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
162 
163  if( !SCIPtreeProbing(scip->tree) )
164  {
165  SCIPerrorMessage("not in probing mode\n");
166  return SCIP_INVALIDCALL;
167  }
168 
169  retcode = SCIPtreeCreateProbingNode(scip->tree, scip->mem->probmem, scip->set, scip->lp);
170 
171  if( retcode == SCIP_MAXDEPTHLEVEL )
172  {
173  SCIPwarningMessage(scip, "probing reached maximal depth; it should be stopped\n");
174  }
175  SCIP_CALL( retcode );
176 
177  return SCIP_OKAY;
178 }
179 
180 /** returns the current probing depth
181  *
182  * @return the probing depth, i.e. the number of probing sub nodes existing in the probing path
183  *
184  * @pre This method can be called if @p scip is in one of the following stages:
185  * - \ref SCIP_STAGE_PRESOLVING
186  * - \ref SCIP_STAGE_SOLVING
187  */
189  SCIP* scip /**< SCIP data structure */
190  )
191 {
192  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetProbingDepth", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
193 
194  if( !SCIPtreeProbing(scip->tree) )
195  {
196  SCIPerrorMessage("not in probing mode\n");
197  SCIPABORT();
198  return -1; /*lint !e527*/
199  }
200 
201  return SCIPtreeGetProbingDepth(scip->tree);
202 }
203 
204 /** undoes all changes to the problem applied in probing up to the given probing depth;
205  * the changes of the probing node of the given probing depth are the last ones that remain active;
206  * changes that were applied before calling SCIPnewProbingNode() cannot be undone
207  *
208  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
209  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
210  *
211  * @pre This method can be called if @p scip is in one of the following stages:
212  * - \ref SCIP_STAGE_PRESOLVING
213  * - \ref SCIP_STAGE_SOLVING
214  */
216  SCIP* scip, /**< SCIP data structure */
217  int probingdepth /**< probing depth of the node in the probing path that should be reactivated */
218  )
219 {
220  SCIP_CALL( SCIPcheckStage(scip, "SCIPbacktrackProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
221 
222  if( !SCIPtreeProbing(scip->tree) )
223  {
224  SCIPerrorMessage("not in probing mode\n");
225  return SCIP_INVALIDCALL;
226  }
227  if( probingdepth < 0 || probingdepth > SCIPtreeGetProbingDepth(scip->tree) )
228  {
229  SCIPerrorMessage("backtracking probing depth %d out of current probing range [0,%d]\n",
230  probingdepth, SCIPtreeGetProbingDepth(scip->tree));
231  return SCIP_INVALIDDATA;
232  }
233 
234  SCIP_CALL( SCIPtreeBacktrackProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
235  scip->origprob, scip->lp, scip->primal, scip->branchcand, scip->eventqueue, scip->eventfilter,
236  scip->cliquetable, probingdepth) );
237 
238  return SCIP_OKAY;
239 }
240 
241 /** quits probing and resets bounds and constraints to the focus node's environment
242  *
243  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
244  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
245  *
246  * @pre This method can be called if @p scip is in one of the following stages:
247  * - \ref SCIP_STAGE_PRESOLVING
248  * - \ref SCIP_STAGE_SOLVING
249  */
251  SCIP* scip /**< SCIP data structure */
252  )
253 {
254  SCIP_CALL( SCIPcheckStage(scip, "SCIPendProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
255 
256  if( !SCIPtreeProbing(scip->tree) )
257  {
258  SCIPerrorMessage("not in probing mode\n");
259  return SCIP_INVALIDCALL;
260  }
261 
262  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
263  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
264  scip->transprob, scip->origprob, scip->lp, scip->relaxation, scip->primal,
265  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
266 
267  /* enables the collection of statistics for a variable */
269 
270  /* switch to the original separation storage */
271  if( scip->sepastore != NULL )
272  {
273  assert(scip->sepastoreprobing != NULL);
274  SCIPswapPointers((void**)&scip->sepastore, (void**)&scip->sepastoreprobing);
275  assert(SCIPsepastoreGetNCuts(scip->sepastoreprobing) == 0);
276  }
277 
278  return SCIP_OKAY;
279 }
280 
281 /** injects a change of variable's lower bound into current probing node; the same can also be achieved with a call to
282  * SCIPchgVarLb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
283  *
284  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
285  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
286  *
287  * @pre This method can be called if @p scip is in one of the following stages:
288  * - \ref SCIP_STAGE_PRESOLVING
289  * - \ref SCIP_STAGE_SOLVING
290  */
292  SCIP* scip, /**< SCIP data structure */
293  SCIP_VAR* var, /**< variable to change the bound for */
294  SCIP_Real newbound /**< new value for bound */
295  )
296 {
297  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarLbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
298 
299  if( !SCIPtreeProbing(scip->tree) )
300  {
301  SCIPerrorMessage("not in probing mode\n");
302  return SCIP_INVALIDCALL;
303  }
305 
306  SCIPvarAdjustLb(var, scip->set, &newbound);
307 
308  /* ignore tightenings of lower bounds to +infinity during solving process */
309  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
310  {
311 #ifndef NDEBUG
312  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
313  SCIPvarGetLbLocal(var));
314 #endif
315  return SCIP_OKAY;
316  }
317 
319  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
320  var, newbound, SCIP_BOUNDTYPE_LOWER, TRUE) );
321 
322  return SCIP_OKAY;
323 }
324 
325 /** injects a change of variable's upper bound into current probing node; the same can also be achieved with a call to
326  * SCIPchgVarUb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
327  *
328  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
329  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
330  *
331  * @pre This method can be called if @p scip is in one of the following stages:
332  * - \ref SCIP_STAGE_PRESOLVING
333  * - \ref SCIP_STAGE_SOLVING
334  */
336  SCIP* scip, /**< SCIP data structure */
337  SCIP_VAR* var, /**< variable to change the bound for */
338  SCIP_Real newbound /**< new value for bound */
339  )
340 {
341  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarUbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
342 
343  if( !SCIPtreeProbing(scip->tree) )
344  {
345  SCIPerrorMessage("not in probing mode\n");
346  return SCIP_INVALIDCALL;
347  }
349 
350  SCIPvarAdjustUb(var, scip->set, &newbound);
351 
352  /* ignore tightenings of upper bounds to -infinity during solving process */
353  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
354  {
355 #ifndef NDEBUG
356  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
357  SCIPvarGetUbLocal(var));
358 #endif
359  return SCIP_OKAY;
360  }
361 
363  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
364  var, newbound, SCIP_BOUNDTYPE_UPPER, TRUE) );
365 
366  return SCIP_OKAY;
367 }
368 
369 /** gets variable's objective value in current probing
370  *
371  * @return the variable's objective value in current probing.
372  *
373  * @pre This method can be called if @p scip is in one of the following stages:
374  * - \ref SCIP_STAGE_SOLVING
375  *
376  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
377  */
379  SCIP* scip, /**< SCIP data structure */
380  SCIP_VAR* var /**< variable to get the bound for */
381  )
382 {
383  assert(scip != NULL);
384  assert(var != NULL);
385 
386  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
387 
388  if( !SCIPtreeProbing(scip->tree) )
389  {
390  SCIPerrorMessage("not in probing mode\n");
391  return SCIP_INVALID;
392  }
393 
394  return SCIPvarGetObjLP(var);
395 }
396 
397 /** injects a change of variable's bounds into current probing node to fix the variable to the specified value;
398  * the same can also be achieved with a call to SCIPfixVar(), but in this case, the bound changes would be treated
399  * like deductions instead of branching decisions
400  *
401  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
402  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
403  *
404  * @pre This method can be called if @p scip is in one of the following stages:
405  * - \ref SCIP_STAGE_PRESOLVING
406  * - \ref SCIP_STAGE_SOLVING
407  */
409  SCIP* scip, /**< SCIP data structure */
410  SCIP_VAR* var, /**< variable to change the bound for */
411  SCIP_Real fixedval /**< value to fix variable to */
412  )
413 {
414  SCIP_Real fixlb;
415  SCIP_Real fixub;
416 
417  SCIP_CALL( SCIPcheckStage(scip, "SCIPfixVarProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
418 
419  if( !SCIPtreeProbing(scip->tree) )
420  {
421  SCIPerrorMessage("not in probing mode\n");
422  return SCIP_INVALIDCALL;
423  }
425 
426  /* we adjust the fixing value here and compare the old bound with the adjusted values because otherwise,
427  * it might happen that the unadjusted value is better and we add the boundchange,
428  * but within SCIPnodeAddBoundchg() the bounds are adjusted - using the feasibility epsilon for integer variables -
429  * and it is asserted, that the bound is still better than the old one which might then be incorrect.
430  */
431  fixlb = fixedval;
432  fixub = fixedval;
433  SCIPvarAdjustLb(var, scip->set, &fixlb);
434  SCIPvarAdjustUb(var, scip->set, &fixub);
435  assert(SCIPsetIsEQ(scip->set, fixlb, fixub));
436 
437  if( SCIPsetIsGT(scip->set, fixlb, SCIPvarGetLbLocal(var)) )
438  {
440  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
441  scip->cliquetable, var, fixlb, SCIP_BOUNDTYPE_LOWER, TRUE) );
442  }
443  if( SCIPsetIsLT(scip->set, fixub, SCIPvarGetUbLocal(var)) )
444  {
446  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
447  var, fixub, SCIP_BOUNDTYPE_UPPER, TRUE) );
448  }
449 
450  return SCIP_OKAY;
451 }
452 
453 /** changes (column) variable's objective value during probing mode
454  *
455  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
456  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
457  *
458  * @pre This method can be called if @p scip is in one of the following stages:
459  * - \ref SCIP_STAGE_PRESOLVING
460  * - \ref SCIP_STAGE_SOLVING
461  *
462  * @pre The variable needs to be a column variable.
463  */
465  SCIP* scip, /**< SCIP data structure */
466  SCIP_VAR* var, /**< variable to change the objective for */
467  SCIP_Real newobj /**< new objective function value */
468  )
469 {
470  SCIP_NODE* node;
471  SCIP_Real oldobj;
472 
473  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
474 
475  if( !SCIPtreeProbing(scip->tree) )
476  {
477  SCIPerrorMessage("not in probing mode\n");
478  return SCIP_INVALIDCALL;
479  }
480 
481  /* get current probing node */
482  node = SCIPtreeGetCurrentNode(scip->tree);
484 
485  /* get old objective function value */
486  oldobj = SCIPvarGetObj(var);
487 
488  if( SCIPisEQ(scip, oldobj, newobj) )
489  return SCIP_OKAY;
490 
491  if( node->data.probingnode->nchgdobjs == 0 )
492  {
493  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvars, 1) ); /*lint !e506*/
494  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvals, 1) ); /*lint !e506*/
495  }
496  else
497  {
498  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvars, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
499  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvals, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
500  }
501 
502  node->data.probingnode->origobjvars[node->data.probingnode->nchgdobjs] = var;
503  node->data.probingnode->origobjvals[node->data.probingnode->nchgdobjs] = oldobj;
504  ++node->data.probingnode->nchgdobjs;
505  ++scip->tree->probingsumchgdobjs;
506 
507  assert(SCIPtreeProbingObjChanged(scip->tree) == SCIPlpDivingObjChanged(scip->lp));
508 
509  /* inform tree and LP that the objective was changed and invalidate the LP's cutoff bound, since this has nothing to
510  * do with the current objective value anymore; the cutoff bound is reset in SCIPendProbing()
511  */
512  if( !SCIPtreeProbingObjChanged(scip->tree) )
513  {
514  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
515 
518  }
519  assert(SCIPisInfinity(scip, scip->lp->cutoffbound));
520 
521  /* perform the objective change */
522  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
523 
524  return SCIP_OKAY;
525 }
526 
527 /** returns whether the objective function has changed during probing mode
528  *
529  * @return \ref TRUE if objective has changed, \ref FALSE otherwise
530  *
531  * @pre This method can be called if @p scip is in one of the following stages:
532  * - \ref SCIP_STAGE_TRANSFORMED
533  * - \ref SCIP_STAGE_INITPRESOLVE
534  * - \ref SCIP_STAGE_PRESOLVING
535  * - \ref SCIP_STAGE_EXITPRESOLVE
536  * - \ref SCIP_STAGE_PRESOLVED
537  * - \ref SCIP_STAGE_INITSOLVE
538  * - \ref SCIP_STAGE_SOLVING
539  * - \ref SCIP_STAGE_SOLVED
540  * - \ref SCIP_STAGE_EXITSOLVE
541  */
543  SCIP* scip /**< SCIP data structure */
544  )
545 {
546  assert(scip != NULL);
547 
548  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisObjChangedProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
549 
550  return scip->tree != NULL && SCIPinProbing(scip) && SCIPtreeProbingObjChanged(scip->tree);
551 }
552 
553 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
554  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
555  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
556  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
557  *
558  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
559  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
560  *
561  * @pre This method can be called if @p scip is in one of the following stages:
562  * - \ref SCIP_STAGE_PRESOLVING
563  * - \ref SCIP_STAGE_SOLVING
564  */
566  SCIP* scip, /**< SCIP data structure */
567  int maxproprounds, /**< maximal number of propagation rounds (-1: no limit, 0: parameter settings) */
568  SCIP_Bool* cutoff, /**< pointer to store whether the probing node can be cut off */
569  SCIP_Longint* ndomredsfound /**< pointer to store the number of domain reductions found, or NULL */
570  )
571 {
572  SCIP_VAR** objchgvars;
573  SCIP_Real* objchgvals;
574  SCIP_Bool changedobj;
575  int nobjchg;
576 
577  SCIP_CALL( SCIPcheckStage(scip, "SCIPpropagateProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
578 
579  if( !SCIPtreeProbing(scip->tree) )
580  {
581  SCIPerrorMessage("not in probing mode\n");
582  return SCIP_INVALIDCALL;
583  }
584 
585  objchgvars = NULL;
586  objchgvals = NULL;
587  changedobj = FALSE;
588  nobjchg = 0;
589 
590  /* undo objective changes if we want to propagate during probing */
591  if( scip->tree->probingobjchanged )
592  {
593  SCIP_VAR** vars;
594  int nvars;
595  int i;
596 
597  vars = SCIPgetVars(scip);
598  nvars = SCIPgetNVars(scip);
599 
600  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvals, MIN(nvars, scip->tree->probingsumchgdobjs)) );
601  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvars, MIN(nvars, scip->tree->probingsumchgdobjs)) );
602  nobjchg = 0;
603 
604  for( i = 0; i < nvars; ++i )
605  {
606  if( !SCIPisEQ(scip, vars[i]->unchangedobj, SCIPgetVarObjProbing(scip, vars[i])) )
607  {
608  objchgvars[nobjchg] = vars[i];
609  objchgvals[nobjchg] = SCIPgetVarObjProbing(scip, vars[i]);
610  ++nobjchg;
611 
612  SCIP_CALL( SCIPvarChgObj(vars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp,
613  scip->eventqueue, vars[i]->unchangedobj) );
614  }
615  }
616  assert(nobjchg <= scip->tree->probingsumchgdobjs);
617 
619  scip->tree->probingobjchanged = FALSE;
620  changedobj = TRUE;
621  }
622 
623  if( ndomredsfound != NULL )
624  *ndomredsfound = -(scip->stat->nprobboundchgs + scip->stat->nprobholechgs);
625 
626  SCIP_CALL( SCIPpropagateDomains(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
627  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->conflict, scip->cliquetable,
628  SCIPgetDepth(scip), maxproprounds, SCIP_PROPTIMING_ALWAYS, cutoff) );
629 
630  if( ndomredsfound != NULL )
631  *ndomredsfound += scip->stat->nprobboundchgs + scip->stat->nprobholechgs;
632 
633  /* restore old objective function */
634  if( changedobj )
635  {
636  int i;
637 
638  assert(objchgvars != NULL);
639  assert(objchgvals != NULL);
640 
642  scip->tree->probingobjchanged = TRUE;
643 
644  for( i = 0; i < nobjchg; ++i )
645  {
646  SCIP_CALL( SCIPvarChgObj(objchgvars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal,
647  scip->lp, scip->eventqueue, objchgvals[i]) );
648  }
649 
650  SCIPfreeBufferArray(scip, &objchgvars);
651  SCIPfreeBufferArray(scip, &objchgvals);
652  }
653 
654  return SCIP_OKAY;
655 }
656 
657 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
658  * only propagations of the binary variables fixed at the current probing node that are triggered by the implication
659  * graph and the clique table are applied;
660  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
661  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
662  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
663  *
664  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
665  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
666  *
667  * @pre This method can be called if @p scip is in one of the following stages:
668  * - \ref SCIP_STAGE_PRESOLVING
669  * - \ref SCIP_STAGE_SOLVING
670  */
672  SCIP* scip, /**< SCIP data structure */
673  SCIP_Bool* cutoff /**< pointer to store whether the probing node can be cut off */
674  )
675 {
676  SCIP_CALL( SCIPcheckStage(scip, "SCIPpropagateProbingImplications", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
677 
678  if( !SCIPtreeProbing(scip->tree) )
679  {
680  SCIPerrorMessage("not in probing mode\n");
681  return SCIP_INVALIDCALL;
682  }
683 
685  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, cutoff) );
686 
687  return SCIP_OKAY;
688 }
689 
690 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) with or without pricing */
691 static
693  SCIP* scip, /**< SCIP data structure */
694  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
695  SCIP_Bool pricing, /**< should pricing be applied? */
696  SCIP_Bool pretendroot, /**< should the pricers be called as if we are at the root node? */
697  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
698  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit) */
699  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
700  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
701  * limit was reached (or NULL, if not needed) */
702  )
703 {
704  SCIP_Bool initcutoff;
705 
706  assert(lperror != NULL);
707  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
708 
709  if( !SCIPtreeProbing(scip->tree) )
710  {
711  SCIPerrorMessage("not in probing mode\n");
712  return SCIP_INVALIDCALL;
713  }
714  assert(SCIPtreeGetCurrentDepth(scip->tree) > 0);
715 
716  SCIP_CALL( SCIPinitConssLP(scip->mem->probmem, scip->set, scip->sepastore, scip->cutpool, scip->stat, scip->transprob,
717  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
718  scip->cliquetable, FALSE, FALSE, &initcutoff) );
719 
720  if( initcutoff )
721  {
722  if( cutoff != NULL )
723  *cutoff = TRUE;
724 
725  return SCIP_OKAY;
726  }
727  else if( cutoff != NULL )
728  *cutoff = FALSE;
729 
730  /* load the LP state (if necessary) */
731  SCIP_CALL( SCIPtreeLoadProbingLPState(scip->tree, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
732 
733  SCIPlpSetIsRelax(scip->lp, TRUE);
734 
735  /* solve probing LP */
736  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
737  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
738 
739  assert((*lperror) || SCIPlpGetSolstat(scip->lp) != SCIP_LPSOLSTAT_NOTSOLVED);
740 
741  /* mark the probing node to have a solved LP */
742  if( !(*lperror) )
743  {
744  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
745 
746  /* call pricing */
747  if( pricing )
748  {
749  SCIP_Bool mustsepa;
750  int npricedcolvars;
751  SCIP_Bool result;
752 
753  mustsepa = FALSE;
754  SCIP_CALL( SCIPpriceLoop(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
755  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool,
756  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable, pretendroot, displayinfo,
757  maxpricerounds, &npricedcolvars, &mustsepa, lperror, &result) );
758 
759  /* mark the probing node again to update the LP size in the node and the tree path */
760  if( !(*lperror) )
761  {
762  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
763  }
764  }
765  }
766 
767  /* remember that probing might have changed the LPi state; this holds even if solving returned with an LP error */
768  scip->tree->probingsolvedlp = TRUE;
769 
770  /* the LP is infeasible or the objective limit was reached */
771  if( !(*lperror) && (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_INFEASIBLE
774  && SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)))) )
775  {
776  /* analyze the infeasible LP (only if all columns are in the LP and no external pricers exist) */
777  if( !scip->set->misc_exactsolve && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->tree->probingobjchanged )
778  {
779  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
780  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
781  }
782 
783  if( cutoff != NULL )
784  *cutoff = TRUE;
785  }
786 
787  return SCIP_OKAY;
788 }
789 
790 /** solves the LP at the current probing node (cannot be applied at preprocessing stage);
791  * no separation or pricing is applied
792  *
793  * The LP has to be constructed before (you can use SCIPisLPConstructed() or SCIPconstructLP()).
794  *
795  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
796  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
797  *
798  * @pre This method can be called if @p scip is in one of the following stages:
799  * - \ref SCIP_STAGE_SOLVING
800  */
802  SCIP* scip, /**< SCIP data structure */
803  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
804  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
805  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
806  * limit was reached (or NULL, if not needed) */
807  )
808 {
809  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveProbingLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
810 
811  SCIP_CALL( solveProbingLP(scip, itlim, FALSE, FALSE, FALSE, -1, lperror, cutoff) );
812 
813  return SCIP_OKAY;
814 }
815 
816 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) and applies pricing
817  * until the LP is solved to optimality; no separation is applied
818  *
819  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
820  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
821  *
822  * @pre This method can be called if @p scip is in one of the following stages:
823  * - \ref SCIP_STAGE_SOLVING
824  */
826  SCIP* scip, /**< SCIP data structure */
827  SCIP_Bool pretendroot, /**< should the pricers be called as if we were at the root node? */
828  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
829  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit);
830  * a finite limit means that the LP might not be solved to optimality! */
831  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
832  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
833  * limit was reached (or NULL, if not needed) */
834  )
835 {
836  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveProbingLPWithPricing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
837 
838  SCIP_CALL( solveProbingLP(scip, -1, TRUE, pretendroot, displayinfo, maxpricerounds, lperror, cutoff) );
839 
840  return SCIP_OKAY;
841 }
842 
843 /** sets the LP state for the current probing node
844  *
845  * @note state and norms are stored at the node and later released by SCIP; therefore, the pointers are set
846  * to NULL by the method
847  *
848  * @note the pointers to state and norms must not be NULL; however, they may point to a NULL pointer if the
849  * respective information should not be set
850  *
851  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
852  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
853  *
854  * @pre This method can be called if @p scip is in one of the following stages:
855  * - \ref SCIP_STAGE_PRESOLVING
856  * - \ref SCIP_STAGE_SOLVING
857  */
859  SCIP* scip, /**< SCIP data structure */
860  SCIP_LPISTATE** lpistate, /**< pointer to LP state information (like basis information) */
861  SCIP_LPINORMS** lpinorms, /**< pointer to LP pricing norms information */
862  SCIP_Bool primalfeas, /**< primal feasibility when LP state information was stored */
863  SCIP_Bool dualfeas /**< dual feasibility when LP state information was stored */
864  )
865 {
866  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetProbingLPState", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
867 
868  if( !SCIPtreeProbing(scip->tree) )
869  {
870  SCIPerrorMessage("not in probing mode\n");
871  return SCIP_INVALIDCALL;
872  }
873 
874  SCIP_CALL( SCIPtreeSetProbingLPState(scip->tree, scip->mem->probmem, scip->lp, lpistate, lpinorms, primalfeas, dualfeas) );
875 
876  return SCIP_OKAY;
877 }
878 
879 /** adds a row to the LP in the current probing node
880  *
881  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
882  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
883  *
884  * @pre This method can be called if @p scip is in one of the following stages:
885  * - \ref SCIP_STAGE_SOLVING
886  *
887  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
888  */
890  SCIP* scip, /**< SCIP data structure */
891  SCIP_ROW* row /**< row to be added */
892  )
893 {
894  SCIP_NODE* node;
895  int depth;
896 
897  assert(scip != NULL);
898  assert(row != NULL);
899 
900  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddRowProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
901 
902  if( !SCIPtreeProbing(scip->tree) )
903  {
904  SCIPerrorMessage("not in probing mode\n");
905  return SCIP_INVALIDCALL;
906  }
907 
908  /* get depth of current node */
909  node = SCIPtreeGetCurrentNode(scip->tree);
910  assert(node != NULL);
911  depth = SCIPnodeGetDepth(node);
912 
913  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
914 
915  return SCIP_OKAY;
916 }
917 
918 
919 /** applies the cuts in the separation storage to the LP and clears the storage afterwards;
920  * this method can only be applied during probing; the user should resolve the probing LP afterwards
921  * in order to get a new solution
922  *
923  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
924  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
925  *
926  * @pre This method can be called if @p scip is in one of the following stages:
927  * - \ref SCIP_STAGE_SOLVING
928  */
930  SCIP* scip, /**< SCIP data structure */
931  SCIP_Bool* cutoff /**< pointer to store whether an empty domain was created */
932  )
933 {
934  SCIP_CALL( SCIPcheckStage(scip, "SCIPapplyCutsProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
935 
936  if( !SCIPtreeProbing(scip->tree) )
937  {
938  SCIPerrorMessage("not in probing mode\n");
939  return SCIP_INVALIDCALL;
940  }
941 
942  SCIP_CALL( SCIPsepastoreApplyCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
943  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
944  scip->cliquetable, FALSE, SCIP_EFFICIACYCHOICE_LP, cutoff) );
945 
946  return SCIP_OKAY;
947 }
948 
949 /** solves relaxation(s) at the current probing node (cannot be applied at preprocessing stage);
950  * no separation or pricing is applied
951  *
952  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
953  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
954  *
955  * @pre This method can be called if @p scip is in one of the following stages:
956  * - \ref SCIP_STAGE_SOLVING
957  */
959  SCIP* scip, /**< SCIP data structure */
960  SCIP_Bool* cutoff /**< pointer to store whether a relaxation was infeasible or the objective
961  * limit was reached (or NULL, if not needed) */
962  )
963 {
964  SCIP_SET* set;
965  int r;
966 
967  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveProbingRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
968 
969  if ( ! SCIPtreeProbing(scip->tree) )
970  {
971  SCIPerrorMessage("not in probing mode\n");
972  return SCIP_INVALIDCALL;
973  }
974  assert( SCIPtreeGetCurrentDepth(scip->tree) > 0 );
975 
976  assert( cutoff != NULL );
977  *cutoff = FALSE;
978 
979  set = scip->set;
980 
981  /* sort relaxators by priority */
982  SCIPsetSortRelaxs(set);
983 
984  /* solve relaxations */
985  for (r = 0; r < set->nrelaxs && !(*cutoff); ++r)
986  {
987  SCIP_RELAX* relax;
988  SCIP_Real lowerbound;
989  SCIP_RESULT result;
990 
991  lowerbound = -SCIPinfinity(scip);
992 
993  relax = set->relaxs[r];
994  assert( relax != NULL );
995 
996  SCIP_CALL( SCIPrelaxExec(relax, set, scip->stat, SCIPtreeGetCurrentDepth(scip->tree), &lowerbound, &result) );
997 
998  switch( result )
999  {
1000  case SCIP_CUTOFF:
1001  *cutoff = TRUE;
1002  SCIPdebugMsg(scip, " -> relaxator <%s> detected cutoff\n", SCIPrelaxGetName(relax));
1003  break;
1004 
1005  case SCIP_CONSADDED:
1006  case SCIP_REDUCEDDOM:
1007  case SCIP_SEPARATED:
1008  case SCIP_SUSPENDED:
1009  SCIPerrorMessage("The relaxator should not return <%d> within probing mode.\n", result);
1010  break;
1011 
1012  case SCIP_SUCCESS:
1013  case SCIP_DIDNOTRUN:
1014  break;
1015 
1016  default:
1017  SCIPerrorMessage("Invalid result code <%d> of relaxator <%s>\n", result, SCIPrelaxGetName(relax));
1018  return SCIP_INVALIDRESULT;
1019  } /*lint !e788*/
1020  }
1021 
1022  return SCIP_OKAY;
1023 }
1024 
1025 /** gets the candidate score and preferred rounding direction for a candidate variable */
1027  SCIP* scip, /**< SCIP data structure */
1028  SCIP_DIVESET* diveset, /**< general diving settings */
1029  SCIP_DIVETYPE divetype, /**< represents different methods for a dive set to explore the next children */
1030  SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
1031  SCIP_Real divecandsol, /**< LP solution value of the candidate */
1032  SCIP_Real divecandfrac, /**< fractionality of the candidate */
1033  SCIP_Real* candscore, /**< pointer to store the candidate score */
1034  SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
1035  )
1036 {
1037  assert(scip != NULL);
1038  assert(candscore != NULL);
1039  assert(roundup != NULL);
1040  assert(divecand != NULL);
1041 
1042  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetDivesetScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1043 
1044  SCIP_CALL( SCIPdivesetGetScore(diveset, scip->set, divetype, divecand, divecandsol, divecandfrac, candscore,
1045  roundup) );
1046 
1047  return SCIP_OKAY;
1048 }
1049 
1050 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
1052  SCIP* scip, /**< SCIP data structure */
1053  SCIP_DIVESET* diveset, /**< diving settings */
1054  SCIP_Longint niterstoadd /**< additional number of LP iterations to be added */
1055  )
1056 {
1057  assert(scip != NULL);
1058  assert(diveset != NULL);
1059 
1060  SCIPdivesetUpdateLPStats(diveset, scip->stat, niterstoadd);
1061 }
1062 
1063 /** update diveset statistics and global diveset statistics */
1065  SCIP* scip, /**< SCIP data structure */
1066  SCIP_DIVESET* diveset, /**< diveset to be reset */
1067  int nprobingnodes, /**< the number of probing nodes explored this time */
1068  int nbacktracks, /**< the number of backtracks during probing this time */
1069  SCIP_Longint nsolsfound, /**< the number of solutions found */
1070  SCIP_Longint nbestsolsfound, /**< the number of best solutions found */
1071  SCIP_Longint nconflictsfound, /**< number of new conflicts found this time */
1072  SCIP_Bool leavewassol /**< was a solution found at the leaf? */
1073  )
1074 {
1075  assert(scip != NULL);
1076  assert(diveset != NULL);
1077  assert(SCIPinProbing(scip));
1078 
1079  SCIPdivesetUpdateStats(diveset, scip->stat, SCIPgetDepth(scip), nprobingnodes, nbacktracks, nsolsfound,
1080  nbestsolsfound, nconflictsfound, leavewassol);
1081 }
1082 
1083 /** enforces a probing/diving solution by suggesting bound changes that maximize the score w.r.t. the current diving settings
1084  *
1085  * the process is guided by the enforcement priorities of the constraint handlers and the scoring mechanism provided by
1086  * the dive set.
1087  * Constraint handlers may suggest diving bound changes in decreasing order of their enforcement priority, based on the
1088  * solution values in the solution @p sol and the current local bounds of the variables. A diving bound change
1089  * is a triple (variable,branching direction,value) and is used inside SCIPperformGenericDivingAlgorithm().
1090  *
1091  * After a successful call, SCIP holds two arrays of suggested dive bound changes, one for the preferred child
1092  * and one for the alternative.
1093  *
1094  * @see SCIPgetDiveBoundChangeData() for retrieving the dive bound change suggestions.
1095  *
1096  * The method stops after the first constraint handler was successful
1097  *
1098  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1099  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1100  *
1101  * @pre This method can be called if @p scip is in one of the following stages:
1102  * - \ref SCIP_STAGE_SOLVING
1103  *
1104  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1105  */
1107  SCIP* scip, /**< SCIP data structure */
1108  SCIP_DIVESET* diveset, /**< diving settings to control scoring */
1109  SCIP_SOL* sol, /**< current solution of diving mode */
1110  SCIP_Bool* success, /**< pointer to store whether constraint handler successfully found a variable */
1111  SCIP_Bool* infeasible /**< pointer to store whether the current node was detected to be infeasible */
1112  )
1113 {
1114  int i;
1115 
1116  assert(scip != NULL);
1117  assert(diveset != NULL);
1118  assert(SCIPinProbing(scip));
1119  assert(infeasible != NULL);
1120  assert(success != NULL);
1121 
1122  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1123 
1124  *success = FALSE;
1125  *infeasible = FALSE;
1126 
1127  /* we invalidate the previously stored bound changes */
1129 
1130  /* loop over constraint handlers until a constraint handler successfully found a variable/value assignment for proceeding
1131  * or a constraint handler detected the infeasibility of the local node
1132  */
1133  for( i = 0; i < scip->set->nconshdlrs && !(*success || *infeasible); ++i )
1134  {
1135  SCIP_CALL( SCIPconshdlrGetDiveBoundChanges(scip->set->conshdlrs_enfo[i], scip->set, diveset, sol,
1136  success, infeasible) );
1137  }
1138 
1139 #ifndef NDEBUG
1140  /* check if the constraint handler correctly assigned values to the dive set */
1141  if( *success )
1142  {
1143  SCIP_VAR** bdchgvars;
1144  SCIP_BRANCHDIR* bdchgdirs;
1145  SCIP_Real* values;
1146  int nbdchanges;
1147  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, TRUE);
1148  assert(nbdchanges > 0);
1149  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, FALSE);
1150  assert(nbdchanges > 0);
1151  }
1152 #endif
1153 
1154  return SCIP_OKAY;
1155 }
1156 
1157 /** adds a diving bound change to the diving bound change storage of SCIP together with the information if this is a
1158  * bound change for the preferred direction or not
1159  *
1160  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1161  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1162  *
1163  * @pre This method can be called if @p scip is in one of the following stages:
1164  * - \ref SCIP_STAGE_SOLVING
1165  *
1166  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1167  */
1169  SCIP* scip, /**< SCIP data structure */
1170  SCIP_VAR* var, /**< variable to apply the bound change to */
1171  SCIP_BRANCHDIR dir, /**< direction of the bound change */
1172  SCIP_Real value, /**< value to adjust this variable bound to */
1173  SCIP_Bool preferred /**< is this a bound change for the preferred child? */
1174  )
1175 {
1176  assert(scip->tree != NULL);
1177  assert(scip->mem->probmem != NULL);
1178  assert(SCIPinProbing(scip));
1179 
1180  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddDiveBoundChange", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1181 
1182  SCIP_CALL( SCIPtreeAddDiveBoundChange(scip->tree, scip->mem->probmem, var, dir, value, preferred) );
1183 
1184  return SCIP_OKAY;
1185 }
1186 
1187 /** get the dive bound change data for the preferred or the alternative direction
1188  *
1189  * @pre This method can be called if @p scip is in one of the following stages:
1190  * - \ref SCIP_STAGE_SOLVING
1191  *
1192  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1193  */
1195  SCIP* scip, /**< SCIP data structure */
1196  SCIP_VAR*** variables, /**< pointer to store variables for the specified direction */
1197  SCIP_BRANCHDIR** directions, /**< pointer to store the branching directions */
1198  SCIP_Real** values, /**< pointer to store bound change values */
1199  int* ndivebdchgs, /**< pointer to store the number of dive bound changes */
1200  SCIP_Bool preferred /**< should the dive bound changes for the preferred child be output? */
1201  )
1202 {
1203  assert(variables != NULL);
1204  assert(directions != NULL);
1205  assert(values != NULL);
1206  assert(ndivebdchgs != NULL);
1207  assert(SCIPinProbing(scip));
1208 
1209  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetDiveBoundChangeData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1210 
1211  SCIPtreeGetDiveBoundChangeData(scip->tree, variables, directions, values, ndivebdchgs, preferred);
1212 }
1213 
1214 /** clear the dive bound change data structures
1215  *
1216  * @pre This method can be called if @p scip is in one of the following stages:
1217  * - \ref SCIP_STAGE_SOLVING
1218  *
1219  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1220  */
1222  SCIP* scip /**< SCIP data structure */
1223  )
1224 {
1225  assert(scip->tree != NULL);
1226 
1227  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPclearDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1228 
1230 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_STAT * stat
Definition: struct_scip.h:69
SCIP_RETCODE SCIPtreeAddDiveBoundChange(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: tree.c:6193
SCIP_RETCODE SCIPconflictAnalyzeLP(SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *success)
Definition: conflict.c:8102
SCIP_RETCODE SCIPtreeEndProbing(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_RELAXATION *relaxation, SCIP_PRIMAL *primal, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:6780
SCIP_RETCODE SCIPapplyCutsProbing(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip_probing.c:929
#define NULL
Definition: def.h:253
SCIP_RETCODE SCIPtreeSetProbingLPState(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_LP *lp, SCIP_LPISTATE **lpistate, SCIP_LPINORMS **lpinorms, SCIP_Bool primalfeas, SCIP_Bool dualfeas)
Definition: tree.c:6437
void SCIPstatEnableVarHistory(SCIP_STAT *stat)
Definition: stat.c:163
SCIP_Bool SCIPlpDiving(SCIP_LP *lp)
Definition: lp.c:17474
SCIP_Real * origobjvals
Definition: struct_tree.h:55
void SCIPlpSetIsRelax(SCIP_LP *lp, SCIP_Bool relax)
Definition: lp.c:17411
public methods for branch and bound tree
SCIP_RETCODE SCIPdivesetGetScore(SCIP_DIVESET *diveset, SCIP_SET *set, SCIP_DIVETYPE divetype, SCIP_VAR *divecand, SCIP_Real divecandsol, SCIP_Real divecandfrac, SCIP_Real *candscore, SCIP_Bool *roundup)
Definition: heur.c:660
internal methods for branch and bound tree
SCIP_CONFLICT * conflict
Definition: struct_scip.h:85
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
Definition: scip_probing.c:408
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip_probing.c:155
public methods for memory management
SCIP_RETCODE SCIPsolveProbingRelax(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip_probing.c:958
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:122
SCIP_RETCODE SCIPpropagateProbingImplications(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip_probing.c:671
int SCIPtreeGetProbingDepth(SCIP_TREE *tree)
Definition: tree.c:8335
#define SCIPallocMemoryArray(scip, ptr, num)
Definition: scip_mem.h:53
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:78
SCIP_PROBINGNODE * probingnode
Definition: struct_tree.h:139
SCIP_PRIMAL * primal
Definition: struct_scip.h:83
void SCIPstatDisableVarHistory(SCIP_STAT *stat)
Definition: stat.c:153
SCIP_RETCODE SCIPtreeBacktrackProbing(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp, SCIP_PRIMAL *primal, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, int probingdepth)
Definition: tree.c:6746
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5813
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:79
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1987
#define FALSE
Definition: def.h:73
SCIP_EXPORT SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:17200
struct SCIP_LPiNorms SCIP_LPINORMS
Definition: type_lpi.h:98
SCIP_EXPORT int SCIPnodeGetDepth(SCIP_NODE *node)
Definition: tree.c:7357
SCIP_RETCODE SCIPgetDiveBoundChanges(SCIP *scip, SCIP_DIVESET *diveset, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *infeasible)
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
int SCIPtreeGetCurrentDepth(SCIP_TREE *tree)
Definition: tree.c:8307
public methods for problem variables
SCIP_RETCODE SCIPlpSolveAndEval(SCIP_LP *lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_Longint itlim, SCIP_Bool limitresolveiters, SCIP_Bool aging, SCIP_Bool keepsol, SCIP_Bool *lperror)
Definition: lp.c:12222
unsigned int SCIP_DIVETYPE
Definition: type_heur.h:48
SCIP_RETCODE SCIPsolveProbingLPWithPricing(SCIP *scip, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_probing.c:825
SCIP_Bool probingsolvedlp
Definition: struct_tree.h:232
SCIP_PROB * transprob
Definition: struct_scip.h:87
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:123
void SCIPvarAdjustLb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *lb)
Definition: var.c:6235
#define SCIPdebugMsg
Definition: scip_message.h:69
SCIP_RETCODE SCIPaddDiveBoundChange(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:12902
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_RETCODE SCIPgetDivesetScore(SCIP *scip, SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype, SCIP_VAR *divecand, SCIP_Real divecandsol, SCIP_Real divecandfrac, SCIP_Real *candscore, SCIP_Bool *roundup)
internal methods for LP management
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:8270
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
public methods for numerical tolerances
public methods for querying solving statistics
SCIP_PRICESTORE * pricestore
Definition: struct_scip.h:90
public methods for the branch-and-bound tree
void SCIPdivesetUpdateLPStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, SCIP_Longint niterstoadd)
Definition: heur.c:628
enum SCIP_BranchDir SCIP_BRANCHDIR
Definition: type_history.h:39
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5993
SCIP_Real SCIPvarGetObjLP(SCIP_VAR *var)
Definition: var.c:12380
SCIP_MEM * mem
Definition: struct_scip.h:61
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
Definition: tree.c:8189
SCIP_RETCODE SCIPconshdlrGetDiveBoundChanges(SCIP_CONSHDLR *conshdlr, SCIP_SET *set, SCIP_DIVESET *diveset, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *infeasible)
Definition: cons.c:3531
SCIP_Bool probingobjchanged
Definition: struct_tree.h:234
SCIP_EXPORT const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16738
SCIP_CONSHDLR ** conshdlrs_enfo
Definition: struct_set.h:72
internal methods for storing and manipulating the main problem
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_EVENTFILTER * eventfilter
Definition: struct_scip.h:77
SCIP_Bool SCIPisObjChangedProbing(SCIP *scip)
Definition: scip_probing.c:542
SCIP_RETCODE SCIPvarChgObj(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newobj)
Definition: var.c:5984
SCIP_RETCODE SCIPsetProbingLPState(SCIP *scip, SCIP_LPISTATE **lpistate, SCIP_LPINORMS **lpinorms, SCIP_Bool primalfeas, SCIP_Bool dualfeas)
Definition: scip_probing.c:858
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip_prob.c:1942
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:2010
static SCIP_RETCODE pricing(SCIP *scip, SCIP_PRICER *pricer, SCIP_Real *lowerbound, SCIP_Bool farkas)
Definition: pricer_stp.c:176
int SCIPgetProbingDepth(SCIP *scip)
Definition: scip_probing.c:188
SCIP_CONFLICTSTORE * conflictstore
Definition: struct_scip.h:93
int SCIPsepastoreGetNCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1086
#define SCIPreallocMemoryArray(scip, ptr, newnum)
Definition: scip_mem.h:59
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip_probing.c:87
SCIP_REOPT * reopt
Definition: struct_scip.h:74
struct SCIP_LPiState SCIP_LPISTATE
Definition: type_lpi.h:97
SCIP_Real cutoffbound
Definition: struct_lp.h:274
SCIP_RETCODE SCIPlpAddRow(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_ROW *row, int depth)
Definition: lp.c:9401
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip_probing.c:250
data structures for branch and bound tree
SCIP_Real unchangedobj
Definition: struct_var.h:204
#define SCIP_PROPTIMING_ALWAYS
Definition: type_timing.h:64
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:365
SCIP main data structure.
SCIP_RETCODE SCIPaddRowProbing(SCIP *scip, SCIP_ROW *row)
Definition: scip_probing.c:889
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17494
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
Definition: scip_probing.c:215
internal methods for relaxators
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5975
internal methods for storing separated cuts
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip_lp.c:237
SCIP_Longint nprobboundchgs
Definition: struct_stat.h:108
void SCIPsetSortRelaxs(SCIP_SET *set)
Definition: set.c:4091
SCIP_CUTPOOL * cutpool
Definition: struct_scip.h:94
void SCIPtreeClearDiveBoundChanges(SCIP_TREE *tree)
Definition: tree.c:6248
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:86
internal methods for problem variables
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:111
SCIP_SEPASTORE * sepastore
Definition: struct_scip.h:91
SCIP_Real SCIPinfinity(SCIP *scip)
public data structures and miscellaneous methods
SCIP_Real SCIPgetVarObjProbing(SCIP *scip, SCIP_VAR *var)
Definition: scip_probing.c:378
int SCIPgetDepth(SCIP *scip)
Definition: scip_tree.c:637
#define SCIP_Bool
Definition: def.h:70
void SCIPdivesetUpdateStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, int depth, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Longint nconflictsfound, SCIP_Bool leavesol)
Definition: heur.c:117
SCIP_VAR ** origobjvars
Definition: struct_tree.h:54
SCIP_RETCODE SCIPtreeStartProbing(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob, SCIP_Bool strongbranching)
Definition: tree.c:6347
void SCIPtreeGetDiveBoundChangeData(SCIP_TREE *tree, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
Definition: tree.c:6225
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip_probing.c:565
SCIP_Bool SCIPlpDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17484
int probingsumchgdobjs
Definition: struct_tree.h:223
#define MIN(x, y)
Definition: def.h:223
methods for debugging
datastructures for block memory pools and memory buffers
SCIP_Bool SCIPprobAllColsInLP(SCIP_PROB *prob, SCIP_SET *set, SCIP_LP *lp)
Definition: prob.c:2267
SCIP_RETCODE SCIPpropagateDomains(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CONFLICT *conflict, SCIP_CLIQUETABLE *cliquetable, int depth, int maxproprounds, SCIP_PROPTIMING timingmask, SCIP_Bool *cutoff)
Definition: solve.c:636
datastructures for problem statistics
static SCIP_RETCODE solveProbingLP(SCIP *scip, int itlim, SCIP_Bool pricing, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_probing.c:692
SCIP_EXPORT SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17408
void SCIPswapPointers(void **pointer1, void **pointer2)
Definition: misc.c:9891
public methods for the LP relaxation, rows and columns
SCIP_Real * r
Definition: circlepacking.c:50
SCIP_EXPORT SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17418
SCIP_Bool misc_exactsolve
Definition: struct_set.h:361
general public methods
SCIP_Bool SCIPtreeProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8368
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
void SCIPupdateDivesetStats(SCIP *scip, SCIP_DIVESET *diveset, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Longint nconflictsfound, SCIP_Bool leavewassol)
void SCIPclearDiveBoundChanges(SCIP *scip)
internal methods for conflict analysis
SCIP_RETCODE SCIPlpSetCutoffbound(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real cutoffbound)
Definition: lp.c:10076
SCIP_RETCODE SCIPpriceLoop(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, int *npricedcolvars, SCIP_Bool *mustsepa, SCIP_Bool *lperror, SCIP_Bool *aborted)
Definition: solve.c:2009
internal methods for main solving loop and node processing
SCIP_RETCODE SCIPnodeAddBoundchg(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool probingchange)
Definition: tree.c:2021
public methods for the probing mode
SCIP_RETCODE SCIPtreeMarkProbingNodeHasLP(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_LP *lp)
Definition: tree.c:6572
SCIP_NODE * SCIPtreeGetCurrentNode(SCIP_TREE *tree)
Definition: tree.c:8290
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip_probing.c:109
SCIP_SET * set
Definition: struct_scip.h:62
SCIP_RETCODE SCIPsepastoreApplyCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool root, SCIP_EFFICIACYCHOICE efficiacychoice, SCIP_Bool *cutoff)
Definition: sepastore.c:860
public methods for message output
data structures for LP management
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_probing.c:291
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6029
datastructures for problem variables
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
SCIP_EXPORT const char * SCIPrelaxGetName(SCIP_RELAX *relax)
Definition: relax.c:480
#define SCIP_Real
Definition: def.h:164
internal methods for problem statistics
public methods for relaxation handlers
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_probing.c:335
SCIP_RETCODE SCIPtreeLoadProbingLPState(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:6491
public methods for message handling
#define SCIP_INVALID
Definition: def.h:184
internal methods for constraints and constraint handlers
#define SCIP_Longint
Definition: def.h:149
void SCIPupdateDivesetLPStats(SCIP *scip, SCIP_DIVESET *diveset, SCIP_Longint niterstoadd)
SCIP_TREE * tree
Definition: struct_scip.h:84
SCIP_RELAXATION * relaxation
Definition: struct_scip.h:82
SCIP_EXPORT SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
Definition: tree.c:7337
void SCIPvarAdjustUb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *ub)
Definition: var.c:6252
int nconshdlrs
Definition: struct_set.h:102
#define SCIP_CALL_ABORT(x)
Definition: def.h:344
internal methods for primal heuristics
SCIP_RETCODE SCIPnodePropagateImplics(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *cutoff)
Definition: tree.c:2409
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip_general.c:355
SCIP_LP * lp
Definition: struct_scip.h:80
SCIP_SEPASTORE * sepastoreprobing
Definition: struct_scip.h:92
#define SCIPABORT()
Definition: def.h:337
public methods for global and local (sub)problems
SCIP_Longint nprobholechgs
Definition: struct_stat.h:109
SCIP_RETCODE SCIPinitConssLP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool root, SCIP_Bool firstsubtreeinit, SCIP_Bool *cutoff)
Definition: solve.c:1101
void SCIPgetDiveBoundChangeData(SCIP *scip, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
union SCIP_Node::@10 data
datastructures for global SCIP settings
SCIP_RETCODE SCIPtreeCreateProbingNode(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: tree.c:6412
void SCIPlpUnmarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17505
SCIP_RETCODE SCIPrelaxExec(SCIP_RELAX *relax, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Real *lowerbound, SCIP_RESULT *result)
Definition: relax.c:329
void SCIPtreeMarkProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8379
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_probing.c:801
SCIP_RETCODE SCIPchgVarObjProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip_probing.c:464
memory allocation routines