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