Scippy

SCIP

Solving Constraint Integer Programs

scip_solve.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-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file scip_solve.c
26  * @ingroup OTHER_CFILES
27  * @brief public solving methods
28  * @author Tobias Achterberg
29  * @author Timo Berthold
30  * @author Gerald Gamrath
31  * @author Leona Gottwald
32  * @author Stefan Heinz
33  * @author Gregor Hendel
34  * @author Thorsten Koch
35  * @author Alexander Martin
36  * @author Marc Pfetsch
37  * @author Michael Winkler
38  * @author Kati Wolter
39  *
40  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
41  */
42 
43 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
44 
45 #include "blockmemshell/memory.h"
46 #include "scip/branch.h"
47 #include "scip/clock.h"
48 #include "scip/compr.h"
49 #include "scip/concsolver.h"
50 #include "scip/concurrent.h"
51 #include "scip/conflict.h"
52 #include "scip/conflictstore.h"
53 #include "scip/cons.h"
54 #include "scip/cutpool.h"
55 #include "scip/dcmp.h"
56 #include "scip/debug.h"
57 #include "scip/event.h"
58 #include "scip/implics.h"
59 #include "scip/interrupt.h"
60 #include "scip/lp.h"
61 #include "scip/nlp.h"
62 #include "scip/presol.h"
63 #include "scip/pricestore.h"
64 #include "scip/primal.h"
65 #include "scip/prob.h"
66 #include "scip/prop.h"
67 #include "scip/pub_branch.h"
68 #include "scip/pub_compr.h"
69 #include "scip/pub_cons.h"
70 #include "scip/pub_heur.h"
71 #include "scip/pub_message.h"
72 #include "scip/pub_misc.h"
73 #include "scip/pub_misc_select.h"
74 #include "scip/pub_presol.h"
75 #include "scip/pub_prop.h"
76 #include "scip/pub_sol.h"
77 #include "scip/pub_var.h"
78 #include "scip/relax.h"
79 #include "scip/reopt.h"
80 #include "scip/scip_benders.h"
81 #include "scip/scip_branch.h"
82 #include "scip/scip_concurrent.h"
83 #include "scip/scip_cons.h"
84 #include "scip/scip_general.h"
85 #include "scip/scip_lp.h"
86 #include "scip/scip_mem.h"
87 #include "scip/scip_message.h"
88 #include "scip/scip_numerics.h"
89 #include "scip/scip_param.h"
90 #include "scip/scip_prob.h"
91 #include "scip/scip_randnumgen.h"
92 #include "scip/scip_sol.h"
93 #include "scip/scip_solve.h"
94 #include "scip/scip_solvingstats.h"
95 #include "scip/scip_timing.h"
96 #include "scip/scip_tree.h"
97 #include "scip/scip_var.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/struct_event.h"
104 #include "scip/struct_mem.h"
105 #include "scip/struct_primal.h"
106 #include "scip/struct_prob.h"
107 #include "scip/struct_scip.h"
108 #include "scip/struct_set.h"
109 #include "scip/struct_stat.h"
110 #include "scip/struct_tree.h"
111 #include "scip/syncstore.h"
112 #include "scip/tree.h"
113 #include "scip/var.h"
114 #include "scip/visual.h"
115 
116 /** checks solution for feasibility in original problem without adding it to the solution store; to improve the
117  * performance we use the following order when checking for violations:
118  *
119  * 1. variable bounds
120  * 2. constraint handlers with positive or zero priority that don't need constraints (e.g. integral constraint handler)
121  * 3. original constraints
122  * 4. constraint handlers with negative priority that don't need constraints (e.g. Benders' decomposition constraint handler)
123  */
124 static
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_SOL* sol, /**< primal CIP solution */
128  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
129  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
130  SCIP_Bool completely, /**< Should all violations be checked? */
131  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
132  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
133  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
134  SCIP_Bool checkmodifiable /**< have modifiable constraint to be checked? */
135  )
136 {
137  SCIP_RESULT result;
138  int v;
139  int c;
140  int h;
141 
142  assert(scip != NULL);
143  assert(sol != NULL);
144  assert(feasible != NULL);
145 
146  SCIP_CALL( SCIPcheckStage(scip, "checkSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
147 
148  *feasible = TRUE;
149 
151 
152  if( !printreason )
153  completely = FALSE;
154 
155  /* check bounds */
156  if( checkbounds )
157  {
158  for( v = 0; v < scip->origprob->nvars; ++v )
159  {
160  SCIP_VAR* var;
161  SCIP_Real solval;
162  SCIP_Real lb;
163  SCIP_Real ub;
164 
165  var = scip->origprob->vars[v];
166  solval = SCIPsolGetVal(sol, scip->set, scip->stat, var);
167 
168  lb = SCIPvarGetLbOriginal(var);
169  ub = SCIPvarGetUbOriginal(var);
170 
171  SCIPupdateSolBoundViolation(scip, sol, lb - solval, SCIPrelDiff(lb, solval));
172  SCIPupdateSolBoundViolation(scip, sol, solval - ub, SCIPrelDiff(solval, ub));
173 
174  if( SCIPsetIsFeasLT(scip->set, solval, lb) || SCIPsetIsFeasGT(scip->set, solval, ub) )
175  {
176  *feasible = FALSE;
177 
178  if( printreason )
179  {
180  SCIPmessagePrintInfo(scip->messagehdlr, "solution violates original bounds of variable <%s> [%g,%g] solution value <%g>\n",
181  SCIPvarGetName(var), lb, ub, solval);
182  }
183 
184  if( !completely )
185  return SCIP_OKAY;
186  }
187  }
188  }
189 
190  /* call constraint handlers with positive or zero check priority that don't need constraints */
191  for( h = 0; h < scip->set->nconshdlrs; ++h )
192  {
193  if( SCIPconshdlrGetCheckPriority(scip->set->conshdlrs[h]) >= 0 )
194  {
195  if( !SCIPconshdlrNeedsCons(scip->set->conshdlrs[h]) )
196  {
197  SCIP_CALL( SCIPconshdlrCheck(scip->set->conshdlrs[h], scip->mem->probmem, scip->set, scip->stat, sol,
198  checkintegrality, checklprows, printreason, completely, &result) );
199 
200  if( result != SCIP_FEASIBLE )
201  {
202  *feasible = FALSE;
203 
204  if( !completely )
205  return SCIP_OKAY;
206  }
207  }
208  }
209  /* constraint handlers are sorted by priority, so we can break when reaching the first one with negative priority */
210  else
211  break;
212  }
213 
214  /* check original constraints
215  *
216  * in general modifiable constraints can not be checked, because the variables to fulfill them might be missing in
217  * the original problem; however, if the solution comes from a heuristic during presolving modifiable constraints
218  * have to be checked;
219  */
220  for( c = 0; c < scip->origprob->nconss; ++c )
221  {
222  if( SCIPconsIsChecked(scip->origprob->conss[c]) && (checkmodifiable || !SCIPconsIsModifiable(scip->origprob->conss[c])) )
223  {
224  /* check solution */
225  SCIP_CALL( SCIPconsCheck(scip->origprob->conss[c], scip->set, sol,
226  checkintegrality, checklprows, printreason, &result) );
227 
228  if( result != SCIP_FEASIBLE )
229  {
230  *feasible = FALSE;
231 
232  if( !completely )
233  return SCIP_OKAY;
234  }
235  }
236  }
237 
238  /* call constraint handlers with negative check priority that don't need constraints;
239  * continue with the first constraint handler with negative priority which caused us to break in the above loop */
240  for( ; h < scip->set->nconshdlrs; ++h )
241  {
242  assert(SCIPconshdlrGetCheckPriority(scip->set->conshdlrs[h]) < 0);
243  if( !SCIPconshdlrNeedsCons(scip->set->conshdlrs[h]) )
244  {
245  SCIP_CALL( SCIPconshdlrCheck(scip->set->conshdlrs[h], scip->mem->probmem, scip->set, scip->stat, sol,
246  checkintegrality, checklprows, printreason, completely, &result) );
247 
248  if( result != SCIP_FEASIBLE )
249  {
250  *feasible = FALSE;
251 
252  if( !completely )
253  return SCIP_OKAY;
254  }
255  }
256  }
257 
258  return SCIP_OKAY;
259 }
260 
261 /** calculates number of nonzeros in problem */
262 static
264  SCIP* scip, /**< SCIP data structure */
265  SCIP_Longint* nchecknonzeros, /**< pointer to store number of non-zeros in all check constraints */
266  SCIP_Longint* nactivenonzeros, /**< pointer to store number of non-zeros in all active constraints */
267  SCIP_Bool* approxchecknonzeros,/**< pointer to store if the number of non-zeros in all check constraints
268  * is only a lowerbound
269  */
270  SCIP_Bool* approxactivenonzeros/**< pointer to store if the number of non-zeros in all active constraints
271  * is only a lowerbound
272  */
273  )
274 {
275  SCIP_CONS** conss;
276  SCIP_Bool success;
277  SCIP_Bool ischeck;
278  int nconss;
279  int nvars;
280  int c;
281  int h;
282 
283  *nchecknonzeros = 0LL;
284  *nactivenonzeros = 0LL;
285  *approxchecknonzeros = FALSE;
286  *approxactivenonzeros = FALSE;
287 
288  /* computes number of non-zeros over all active constraints */
289  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
290  {
291  nconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
292 
293  if( nconss > 0 )
294  {
295  conss = SCIPconshdlrGetConss(scip->set->conshdlrs[h]);
296 
297  /* calculate all active constraints */
298  for( c = nconss - 1; c >= 0; --c )
299  {
300  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
301  ischeck = SCIPconsIsChecked(conss[c]);
302 
303  if( !success )
304  {
305  *approxactivenonzeros = TRUE;
306  if( ischeck )
307  *approxchecknonzeros = TRUE;
308  }
309  else
310  {
311  *nactivenonzeros += nvars;
312  if( ischeck )
313  *nchecknonzeros += nvars;
314  }
315  }
316  }
317 
318  /* add nonzeros on inactive check constraints */
319  nconss = SCIPconshdlrGetNCheckConss(scip->set->conshdlrs[h]);
320  if( nconss > 0 )
321  {
322  conss = SCIPconshdlrGetCheckConss(scip->set->conshdlrs[h]);
323 
324  for( c = nconss - 1; c >= 0; --c )
325  {
326  if( !SCIPconsIsActive(conss[c]) )
327  {
328  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
329 
330  if( !success )
331  *approxchecknonzeros = TRUE;
332  else
333  *nchecknonzeros += nvars;
334  }
335  }
336  }
337  }
338 
339  return SCIP_OKAY;
340 }
341 
342 
343 /** initializes solving data structures and transforms problem
344  *
345  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
346  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
347  *
348  * @pre This method can be called if @p scip is in one of the following stages:
349  * - \ref SCIP_STAGE_PROBLEM
350  * - \ref SCIP_STAGE_TRANSFORMED
351  * - \ref SCIP_STAGE_INITPRESOLVE
352  * - \ref SCIP_STAGE_PRESOLVING
353  * - \ref SCIP_STAGE_EXITPRESOLVE
354  * - \ref SCIP_STAGE_PRESOLVED
355  * - \ref SCIP_STAGE_INITSOLVE
356  * - \ref SCIP_STAGE_SOLVING
357  * - \ref SCIP_STAGE_SOLVED
358  * - \ref SCIP_STAGE_EXITSOLVE
359  * - \ref SCIP_STAGE_FREETRANS
360  * - \ref SCIP_STAGE_FREE
361  *
362  * @post When calling this method in the \ref SCIP_STAGE_PROBLEM stage, the \SCIP stage is changed to \ref
363  * SCIP_STAGE_TRANSFORMED; otherwise, the stage is not changed
364  *
365  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
366  */
368  SCIP* scip /**< SCIP data structure */
369  )
370 {
371  SCIP_Longint oldnsolsfound;
372  int nfeassols;
373  int ncandsols;
374  int h;
375  int s;
376 
377  SCIP_CALL( SCIPcheckStage(scip, "SCIPtransformProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
378 
379  /* check, if the problem was already transformed */
380  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
381  return SCIP_OKAY;
382 
383  assert(scip->stat->status == SCIP_STATUS_UNKNOWN);
384 
385  /* check, if a node selector exists */
386  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
387  {
388  SCIPerrorMessage("no node selector available\n");
389  return SCIP_PLUGINNOTFOUND;
390  }
391 
392  /* call garbage collector on original problem and parameter settings memory spaces */
395 
396  /* remember number of constraints */
398 
399  /* switch stage to TRANSFORMING */
401 
402  /* mark statistics before solving */
403  SCIPstatMark(scip->stat);
404 
405  /* init solve data structures */
409  SCIP_CALL( SCIPlpCreate(&scip->lp, scip->set, scip->messagehdlr, scip->stat, SCIPprobGetName(scip->origprob)) );
410  SCIP_CALL( SCIPprimalCreate(&scip->primal) );
411  SCIP_CALL( SCIPtreeCreate(&scip->tree, scip->mem->probmem, scip->set, SCIPsetGetNodesel(scip->set, scip->stat)) );
412  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree) );
413  SCIP_CALL( SCIPconflictCreate(&scip->conflict, scip->mem->probmem, scip->set) );
414  SCIP_CALL( SCIPcliquetableCreate(&scip->cliquetable, scip->set, scip->mem->probmem) );
415 
416  /* copy problem in solve memory */
417  SCIP_CALL( SCIPprobTransform(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree,
418  scip->reopt, scip->lp, scip->branchcand, scip->eventfilter, scip->eventqueue, scip->conflictstore,
419  &scip->transprob) );
420 
421  /* switch stage to TRANSFORMED */
423 
424  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
425  * cutoff bound if primal solution is already known
426  */
427  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
428  scip->tree, scip->reopt, scip->lp, scip->eventfilter, scip->eventqueue) );
429 
430  /* if possible, scale objective function such that it becomes integral with gcd 1 */
431  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
432  scip->tree, scip->reopt, scip->lp, scip->eventfilter, scip->eventqueue) );
433 
434  /* check solution of solution candidate storage */
435  nfeassols = 0;
436  ncandsols = scip->origprimal->nsols;
437  oldnsolsfound = 0;
438 
439  /* update upper bound and cutoff bound due to objective limit in primal data */
440  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter,
441  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
442 
443  if( !scip->set->reopt_enable && scip->set->nactivebenders == 0 )
444  {
445  oldnsolsfound = scip->primal->nsolsfound;
446  for( s = scip->origprimal->nsols - 1; s >= 0; --s )
447  {
448  SCIP_Bool feasible;
449  SCIP_SOL* sol;
450 
451  sol = scip->origprimal->sols[s];
452 
453  /* recompute objective function, since the objective might have changed in the meantime */
454  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
455 
456  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
457  * including modifiable constraints
458  */
459  SCIP_CALL( checkSolOrig(scip, sol, &feasible,
461  FALSE, TRUE, TRUE, TRUE, TRUE) );
462 
463  if( feasible )
464  {
465  SCIP_Real abssolobj;
466 
467  abssolobj = REALABS(SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
468 
469  /* we do not want to add solutions with objective value +infinity */
470  if( !SCIPisInfinity(scip, abssolobj) )
471  {
472  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
473  SCIP_Bool stored;
474 
475  /* add primal solution to solution storage by copying it */
476  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob,
477  scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, &stored) );
478 
479  if( stored )
480  {
481  nfeassols++;
482 
483  if( bestsol != SCIPgetBestSol(scip) )
484  SCIPstoreSolutionGap(scip);
485  }
486  }
487  }
488 
489  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->origprimal) );
490  scip->origprimal->nsols--;
491  }
492  }
493 
494  assert(scip->origprimal->nsols == 0);
495 
496  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
497 
498  if( nfeassols > 0 )
499  {
501  "%d/%d feasible solution%s given by solution candidate storage, new primal bound %.6e\n\n",
502  nfeassols, ncandsols, (nfeassols > 1 ? "s" : ""), SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
503  }
504  else if( ncandsols > 0 && !scip->set->reopt_enable )
505  {
507  "all %d solutions given by solution candidate storage are infeasible\n\n", ncandsols);
508  }
509 
510  /* print transformed problem statistics */
512  "transformed problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
513  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
514  scip->transprob->ncontvars, scip->transprob->nconss);
515 
516  for( h = 0; h < scip->set->nconshdlrs; ++h )
517  {
518  int nactiveconss;
519 
520  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
521  if( nactiveconss > 0 )
522  {
524  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
525  }
526  }
528 
529  {
530  SCIP_Real maxnonzeros;
531  SCIP_Longint nchecknonzeros;
532  SCIP_Longint nactivenonzeros;
533  SCIP_Bool approxchecknonzeros;
534  SCIP_Bool approxactivenonzeros;
535 
536  /* determine number of non-zeros */
537  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
538  maxnonzeros = MAX(maxnonzeros, 1.0);
539  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
540  scip->stat->nnz = nactivenonzeros;
541  scip->stat->avgnnz = (SCIPgetNConss(scip) == 0 ? 0.0 : (SCIP_Real) nactivenonzeros / ((SCIP_Real) SCIPgetNConss(scip)));
542 
544  "original problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
545  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
546  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
548  }
549 
550  /* call initialization methods of plugins */
551  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
552 
553  /* in case the permutation seed is different to 0, permute the transformed problem */
554  if( scip->set->random_permutationseed > 0 )
555  {
556  SCIP_Bool permuteconss;
557  SCIP_Bool permutevars;
558  int permutationseed;
559 
560  permuteconss = scip->set->random_permuteconss;
561  permutevars = scip->set->random_permutevars;
562  permutationseed = scip->set->random_permutationseed;
563 
564  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
565  }
566 
567  if( scip->set->misc_estimexternmem )
568  {
569  /* the following formula was estimated empirically using linear regression */
570  scip->stat->externmemestim = (SCIP_Longint) (MAX(1, 8.5e-04 * SCIPgetNConss(scip) + 7.6e-04 * SCIPgetNVars(scip) + 3.5e-05 * scip->stat->nnz) * 1048576.0); /*lint !e666*/
571  SCIPdebugMsg(scip, "external memory usage estimated to %" SCIP_LONGINT_FORMAT " byte\n", scip->stat->externmemestim);
572  }
573 
574  return SCIP_OKAY;
575 }
576 
577 /** initializes presolving */
578 static
580  SCIP* scip /**< SCIP data structure */
581  )
582 {
583 #ifndef NDEBUG
584  size_t nusedbuffers;
585  size_t nusedcleanbuffers;
586 #endif
587 
588  assert(scip != NULL);
589  assert(scip->mem != NULL);
590  assert(scip->set != NULL);
591  assert(scip->stat != NULL);
592  assert(scip->transprob != NULL);
593  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
594 
595  /* retransform all existing solutions to original problem space, because the transformed problem space may
596  * get modified in presolving and the solutions may become invalid for the transformed problem
597  */
598  SCIP_CALL( SCIPprimalRetransformSolutions(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter,
599  scip->eventqueue, scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp) );
600 
601  /* reset statistics for presolving and current branch and bound run */
602  SCIPstatResetPresolving(scip->stat, scip->set, scip->transprob, scip->origprob);
603 
604  /* increase number of branch and bound runs */
605  scip->stat->nruns++;
606 
607  /* remember problem size of previous run */
608  scip->stat->prevrunnvars = scip->transprob->nvars;
609 
610  /* switch stage to INITPRESOLVE */
612 
613  /* create temporary presolving root node */
614  SCIP_CALL( SCIPtreeCreatePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
615  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
616  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
617 
618  /* GCG wants to perform presolving during the reading process of a file reader;
619  * hence the number of used buffers does not need to be zero, however, it should not
620  * change by calling SCIPsetInitprePlugins()
621  */
622 #ifndef NDEBUG
623  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
624  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
625 #endif
626 
627  /* inform plugins that the presolving is abound to begin */
628  SCIP_CALL( SCIPsetInitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
629  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
630  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
631 
632  /* delete the variables from the problems that were marked to be deleted */
633  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
634 
635  /* switch stage to PRESOLVING */
637 
638  return SCIP_OKAY;
639 }
640 
641 /** deinitializes presolving */
642 static
644  SCIP* scip, /**< SCIP data structure */
645  SCIP_Bool solved, /**< is problem already solved? */
646  SCIP_Bool* infeasible /**< pointer to store if the clique clean up detects an infeasibility */
647  )
648 {
649 #ifndef NDEBUG
650  size_t nusedbuffers;
651  size_t nusedcleanbuffers;
652 #endif
653 
654  assert(scip != NULL);
655  assert(scip->mem != NULL);
656  assert(scip->set != NULL);
657  assert(scip->stat != NULL);
658  assert(scip->transprob != NULL);
659  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
660  assert(infeasible != NULL);
661 
662  *infeasible = FALSE;
663 
664  /* switch stage to EXITPRESOLVE */
666 
667  if( !solved )
668  {
669  SCIP_VAR** vars;
670  int nvars;
671  int v;
672 
673  /* flatten all variables */
674  vars = SCIPgetFixedVars(scip);
675  nvars = SCIPgetNFixedVars(scip);
676  assert(nvars == 0 || vars != NULL);
677 
678  for( v = nvars - 1; v >= 0; --v )
679  {
680  SCIP_VAR* var;
681 #ifndef NDEBUG
682  SCIP_VAR** multvars;
683  int i;
684 #endif
685  var = vars[v]; /*lint !e613*/
686  assert(var != NULL);
687 
689  {
690  /* flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later-on */
691  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set, scip->eventqueue) );
692 
693 #ifndef NDEBUG
694  multvars = SCIPvarGetMultaggrVars(var);
695  for( i = SCIPvarGetMultaggrNVars(var) - 1; i >= 0; --i)
696  assert(SCIPvarGetStatus(multvars[i]) != SCIP_VARSTATUS_MULTAGGR);
697 #endif
698  }
699  }
700  }
701 
702  /* exitPresolve() might be called during the reading process of a file reader;
703  * hence the number of used buffers does not need to be zero, however, it should not
704  * change by calling SCIPsetExitprePlugins() or SCIPprobExitPresolve()
705  */
706 #ifndef NDEBUG
707  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
708  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
709 #endif
710 
711  /* inform plugins that the presolving is finished, and perform final modifications */
712  SCIP_CALL( SCIPsetExitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
713  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
714  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
715 
716  /* remove empty and single variable cliques from the clique table, and convert all two variable cliques
717  * into implications
718  * delete the variables from the problems that were marked to be deleted
719  */
720  if( !solved )
721  {
722  int nlocalbdchgs = 0;
723 
724  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
725  scip->cliquetable, scip->lp, scip->branchcand) );
726 
727  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
728  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
729  infeasible) );
730 
732  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
733  }
734 
735  /* exit presolving */
736  SCIP_CALL( SCIPprobExitPresolve(scip->transprob, scip->set) );
737  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
738  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
739 
740  if( !solved )
741  {
742  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
743  * cutoff bound if primal solution is already known
744  */
745  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
746  scip->tree, scip->reopt, scip->lp, scip->eventfilter, scip->eventqueue) );
747 
748  /* if possible, scale objective function such that it becomes integral with gcd 1 */
749  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
750  scip->tree, scip->reopt, scip->lp, scip->eventfilter, scip->eventqueue) );
751 
752  scip->stat->lastlowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
753 
754  /* we need to update the primal dual integral here to update the last{upper/dual}bound values after a restart */
755  if( scip->set->misc_calcintegral )
756  {
758  }
759  }
760 
761  /* free temporary presolving root node */
762  SCIP_CALL( SCIPtreeFreePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
763  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
764  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
765 
766  /* switch stage to PRESOLVED */
767  scip->set->stage = SCIP_STAGE_PRESOLVED;
768 
769  return SCIP_OKAY;
770 }
771 
772 /** applies one round of presolving with the given presolving timing
773  *
774  * This method will always be called with presoltiming fast first. It iterates over all presolvers, propagators, and
775  * constraint handlers and calls their presolving callbacks with timing fast. If enough reductions are found, it
776  * returns and the next presolving round will be started (again with timing fast). If the fast presolving does not
777  * find enough reductions, this methods calls itself recursively with presoltiming medium. Again, it calls the
778  * presolving callbacks of all presolvers, propagators, and constraint handlers with timing medium. If enough
779  * reductions are found, it returns and the next presolving round will be started (with timing fast). Otherwise, it is
780  * called recursively with presoltiming exhaustive. In exhaustive presolving, presolvers, propagators, and constraint
781  * handlers are called w.r.t. their priority, but this time, we stop as soon as enough reductions were found and do not
782  * necessarily call all presolving methods. If we stop, we return and another presolving round is started with timing
783  * fast.
784  *
785  * @todo check if we want to do the following (currently disabled):
786  * In order to avoid calling the same expensive presolving methods again and again (which is possibly ineffective
787  * for the current instance), we continue the loop for exhaustive presolving where we stopped it the last time. The
788  * {presol/prop/cons}start pointers are used to this end: they provide the plugins to start the loop with in the
789  * current presolving round (if we reach exhaustive presolving), and are updated in this case to the next ones to be
790  * called in the next round. In case we reach the end of the loop in exhaustive presolving, we call the method again
791  * with exhaustive timing, now starting with the first presolving steps in the loop until we reach the ones we started
792  * the last call with. This way, we won't stop until all exhaustive presolvers were called without finding enough
793  * reductions (in sum).
794  */
795 static
797  SCIP* scip, /**< SCIP data structure */
798  SCIP_PRESOLTIMING* timing, /**< pointer to current presolving timing */
799  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
800  SCIP_Bool* infeasible, /**< pointer to store whether presolving detected infeasibility */
801  SCIP_Bool lastround, /**< is this the last presolving round due to a presolving round limit? */
802  int* presolstart, /**< pointer to get the presolver to start exhaustive presolving with in
803  * the current round and store the one to start with in the next round */
804  int presolend, /**< last presolver to treat in exhaustive presolving */
805  int* propstart, /**< pointer to get the propagator to start exhaustive presolving with in
806  * the current round and store the one to start with in the next round */
807  int propend, /**< last propagator to treat in exhaustive presolving */
808  int* consstart, /**< pointer to get the constraint handler to start exhaustive presolving with in
809  * the current round and store the one to start with in the next round */
810  int consend /**< last constraint handler to treat in exhaustive presolving */
811  )
812 {
813  SCIP_RESULT result;
814  SCIP_EVENT event;
815  SCIP_Bool aborted;
816  SCIP_Bool lastranpresol;
817 #if 0
818  int oldpresolstart = 0;
819  int oldpropstart = 0;
820  int oldconsstart = 0;
821 #endif
822  int priopresol;
823  int prioprop;
824  int i;
825  int j;
826  int k;
827 #ifndef NDEBUG
828  size_t nusedbuffers;
829  size_t nusedcleanbuffers;
830 #endif
831 
832  assert(scip != NULL);
833  assert(scip->set != NULL);
834  assert(unbounded != NULL);
835  assert(infeasible != NULL);
836  assert(presolstart != NULL);
837  assert(propstart != NULL);
838  assert(consstart != NULL);
839 
840  assert((presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs)
841  || (*presolstart == 0 && *propstart == 0 && *consstart == 0));
842 
843  *unbounded = FALSE;
844  *infeasible = FALSE;
845  aborted = FALSE;
846 
847  assert( scip->set->propspresolsorted );
848 
849  /* GCG wants to perform presolving during the reading process of a file reader;
850  * hence the number of used buffers does not need to be zero, however, it should not
851  * change by calling the presolving callbacks
852  */
853 #ifndef NDEBUG
854  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
855  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
856 #endif
857 
858  if( *timing == SCIP_PRESOLTIMING_EXHAUSTIVE )
859  {
860  /* In exhaustive presolving, we continue the loop where we stopped last time to avoid calling the same
861  * (possibly ineffective) presolving step again and again. If we reach the end of the arrays of presolvers,
862  * propagators, and constraint handlers without having made enough reductions, we start again from the beginning
863  */
864  i = *presolstart;
865  j = *propstart;
866  k = *consstart;
867 #if 0
868  oldpresolstart = i;
869  oldpropstart = j;
870  oldconsstart = k;
871 #endif
872  if( i >= presolend && j >= propend && k >= consend )
873  return SCIP_OKAY;
874 
875  if( i == 0 && j == 0 && k == 0 )
876  ++(scip->stat->npresolroundsext);
877  }
878  else
879  {
880  /* in fast and medium presolving, we always iterate over all presolvers, propagators, and constraint handlers */
881  assert(presolend == scip->set->npresols);
882  assert(propend == scip->set->nprops);
883  assert(consend == scip->set->nconshdlrs);
884 
885  i = 0;
886  j = 0;
887  k = 0;
888 
889  if( *timing == SCIP_PRESOLTIMING_FAST )
890  ++(scip->stat->npresolroundsfast);
891  if( *timing == SCIP_PRESOLTIMING_MEDIUM )
892  ++(scip->stat->npresolroundsmed);
893  }
894 
895  SCIPdebugMsg(scip, "starting presolving round %d (%d/%d/%d), timing = %u\n",
897  scip->stat->npresolroundsext, *timing);
898 
899  /* call included presolvers with nonnegative priority */
900  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
901  {
902  if( i < presolend )
903  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
904  else
905  priopresol = -1;
906 
907  if( j < propend )
908  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
909  else
910  prioprop = -1;
911 
912  /* call next propagator */
913  if( prioprop >= priopresol )
914  {
915  /* only presolving methods which have non-negative priority will be called before constraint handlers */
916  if( prioprop < 0 )
917  break;
918 
919  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
920  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
922  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
923  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
924  &scip->stat->npresolchgsides, &result) );
925  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
926  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
927 
928  lastranpresol = FALSE;
929  ++j;
930  }
931  /* call next presolver */
932  else
933  {
934  /* only presolving methods which have non-negative priority will be called before constraint handlers */
935  if( priopresol < 0 )
936  break;
937 
938  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
939  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
941  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
942  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
943  &scip->stat->npresolchgsides, &result) );
944  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
945  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
946 
947  lastranpresol = TRUE;
948  ++i;
949  }
950 
951  if( result == SCIP_CUTOFF )
952  {
953  *infeasible = TRUE;
954 
955  if( lastranpresol )
957  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
958  else
960  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
961  }
962  else if( result == SCIP_UNBOUNDED )
963  {
964  *unbounded = TRUE;
965 
966  if( lastranpresol )
968  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
969  else
971  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
972  }
973 
974  /* delete the variables from the problems that were marked to be deleted */
975  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
976  scip->branchcand) );
977 
978  SCIPdebugMsg(scip, "presolving callback returned result <%d>\n", result);
979 
980  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
981  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
982  {
983  assert(*consstart == 0);
984 
985  if( lastranpresol )
986  {
987  *presolstart = i + 1;
988  *propstart = j;
989  }
990  else
991  {
992  *presolstart = i;
993  *propstart = j + 1;
994  }
995  aborted = TRUE;
996 
997  break;
998  }
999  }
1000 
1001  /* call presolve methods of constraint handlers */
1002  while( k < consend && !(*unbounded) && !(*infeasible) && !aborted )
1003  {
1004  SCIPdebugMsg(scip, "executing presolve method of constraint handler <%s>\n",
1005  SCIPconshdlrGetName(scip->set->conshdlrs[k]));
1006  SCIP_CALL( SCIPconshdlrPresolve(scip->set->conshdlrs[k], scip->mem->probmem, scip->set, scip->stat,
1007  *timing, scip->stat->npresolrounds,
1009  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
1010  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
1011  &scip->stat->npresolchgsides, &result) );
1012  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
1013  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
1014 
1015  ++k;
1016 
1017  if( result == SCIP_CUTOFF )
1018  {
1019  *infeasible = TRUE;
1021  "constraint handler <%s> detected infeasibility\n", SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
1022  }
1023  else if( result == SCIP_UNBOUNDED )
1024  {
1025  *unbounded = TRUE;
1027  "constraint handler <%s> detected unboundedness (or infeasibility)\n",
1028  SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
1029  }
1030 
1031  /* delete the variables from the problems that were marked to be deleted */
1032  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
1033  scip->branchcand) );
1034 
1035  SCIPdebugMsg(scip, "presolving callback returned with result <%d>\n", result);
1036 
1037  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
1038  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
1039  {
1040  *presolstart = i;
1041  *propstart = j;
1042  *consstart = k + 1;
1043  aborted = TRUE;
1044 
1045  break;
1046  }
1047  }
1048 
1049  assert( scip->set->propspresolsorted );
1050 
1051  /* call included presolvers with negative priority */
1052  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
1053  {
1054  if( i < scip->set->npresols )
1055  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
1056  else
1057  priopresol = -INT_MAX;
1058 
1059  if( j < scip->set->nprops )
1060  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
1061  else
1062  prioprop = -INT_MAX;
1063 
1064  /* choose presolving */
1065  if( prioprop >= priopresol )
1066  {
1067  assert(prioprop <= 0);
1068 
1069  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
1070  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
1072  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
1073  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
1074  &scip->stat->npresolchgsides, &result) );
1075  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
1076  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
1077 
1078  lastranpresol = FALSE;
1079  ++j;
1080  }
1081  else
1082  {
1083  assert(priopresol < 0);
1084 
1085  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
1086  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
1088  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
1089  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
1090  &scip->stat->npresolchgsides, &result) );
1091  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
1092  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
1093 
1094  lastranpresol = TRUE;
1095  ++i;
1096  }
1097 
1098  if( result == SCIP_CUTOFF )
1099  {
1100  *infeasible = TRUE;
1101 
1102  if( lastranpresol )
1104  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
1105  else
1107  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
1108  }
1109  else if( result == SCIP_UNBOUNDED )
1110  {
1111  *unbounded = TRUE;
1112 
1113  if( lastranpresol )
1115  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
1116  else
1118  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
1119  }
1120 
1121  /* delete the variables from the problems that were marked to be deleted */
1122  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
1123  scip->branchcand) );
1124 
1125  SCIPdebugMsg(scip, "presolving callback return with result <%d>\n", result);
1126 
1127  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
1128  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
1129  {
1130  assert(k == consend);
1131 
1132  if( lastranpresol )
1133  {
1134  *presolstart = i + 1;
1135  *propstart = j;
1136  }
1137  else
1138  {
1139  *presolstart = i;
1140  *propstart = j + 1;
1141  }
1142  *consstart = k;
1143 
1144  break;
1145  }
1146  }
1147 
1148  /* remove empty and single variable cliques from the clique table */
1149  if( !(*unbounded) && !(*infeasible) )
1150  {
1151  int nlocalbdchgs = 0;
1152 
1153  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
1154  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
1155  infeasible) );
1156 
1157  if( nlocalbdchgs > 0 || *infeasible )
1159  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
1160 
1161  scip->stat->npresolfixedvars += nlocalbdchgs;
1162 
1163  if( !*infeasible && scip->set->nheurs > 0 )
1164  {
1165  /* call primal heuristics that are applicable during presolving */
1166  SCIP_Bool foundsol;
1167 
1168  SCIPdebugMsg(scip, "calling primal heuristics during presolving\n");
1169 
1170  /* call primal heuristics */
1171  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
1172  SCIP_HEURTIMING_DURINGPRESOLLOOP, FALSE, &foundsol, unbounded) );
1173 
1174  /* output a message, if a solution was found */
1175  if( foundsol )
1176  {
1177  SCIP_SOL* sol;
1178 
1179  assert(SCIPgetNSols(scip) > 0);
1180  sol = SCIPgetBestSol(scip);
1181  assert(sol != NULL);
1182  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
1183 
1185  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
1187  }
1188  }
1189  }
1190 
1191  if( !(*unbounded) && !(*infeasible) )
1192  {
1193  /* call more expensive presolvers */
1194  if( (SCIPisPresolveFinished(scip) || lastround) )
1195  {
1196  if( *timing != SCIP_PRESOLTIMING_FINAL )
1197  {
1198  assert((*timing == SCIP_PRESOLTIMING_FAST) || (*timing == SCIP_PRESOLTIMING_MEDIUM) || (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE));
1199 
1200  SCIPdebugMsg(scip, "not enough reductions in %s presolving, running %s presolving now...\n",
1201  *timing == SCIP_PRESOLTIMING_FAST ? "fast" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "medium" : "exhaustive",
1202  *timing == SCIP_PRESOLTIMING_FAST ? "medium" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "exhaustive" : "final");
1203 
1204  /* increase timing */
1206 
1207  /* computational experiments showed that always starting the loop of exhaustive presolvers from the beginning
1208  * performs better than continuing from the last processed presolver. Therefore, we start from 0, but keep
1209  * the mechanisms to possibly change this back later.
1210  * @todo try starting from the last processed exhaustive presolver
1211  */
1212  *presolstart = 0;
1213  *propstart = 0;
1214  *consstart = 0;
1215 
1216  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend,
1217  propstart, propend, consstart, consend) );
1218  }
1219 #if 0
1220  /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */
1221  else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols
1222  && propend == scip->set->nprops && consend == scip->set->nconshdlrs )
1223  {
1224  int newpresolstart = 0;
1225  int newpropstart = 0;
1226  int newconsstart = 0;
1227 
1228  SCIPdebugMsg(scip, "reached end of exhaustive presolving loop, starting from the beginning...\n");
1229 
1230  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, &newpresolstart,
1231  oldpresolstart, &newpropstart, oldpropstart, &newconsstart, oldconsstart) );
1232 
1233  *presolstart = newpresolstart;
1234  *propstart = newpropstart;
1235  *consstart = newconsstart;
1236  }
1237 #endif
1238  }
1239  }
1240 
1241  /* issue PRESOLVEROUND event */
1243  SCIP_CALL( SCIPeventProcess(&event, scip->set, NULL, NULL, NULL, scip->eventfilter) );
1244 
1245  return SCIP_OKAY;
1246 }
1247 
1248 
1249 /** loops through the included presolvers and constraint's presolve methods, until changes are too few */
1250 static
1252  SCIP* scip, /**< SCIP data structure */
1253  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
1254  SCIP_Bool* infeasible, /**< pointer to store whether presolving detected infeasibility */
1255  SCIP_Bool* vanished /**< pointer to store whether the problem vanished in presolving */
1256  )
1257 {
1258  SCIP_PRESOLTIMING presoltiming;
1259  SCIP_Bool finished;
1260  SCIP_Bool stopped;
1261  SCIP_Bool lastround;
1262  int presolstart = 0;
1263  int propstart = 0;
1264  int consstart = 0;
1265 #ifndef NDEBUG
1266  size_t nusedbuffers;
1267  size_t nusedcleanbuffers;
1268 #endif
1269 
1270  assert(scip != NULL);
1271  assert(scip->mem != NULL);
1272  assert(scip->primal != NULL);
1273  assert(scip->set != NULL);
1274  assert(scip->stat != NULL);
1275  assert(scip->transprob != NULL);
1276  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
1277  assert(unbounded != NULL);
1278  assert(infeasible != NULL);
1279 
1280  *unbounded = FALSE;
1281  *vanished = FALSE;
1282 
1283  /* GCG wants to perform presolving during the reading process of a file reader;
1284  * hence the number of used buffers does not need to be zero, however, it should
1285  * be the same again after presolve is finished
1286  */
1287 #ifndef NDEBUG
1288  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
1289  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
1290 #endif
1291 
1292  /* switch status to unknown */
1293  scip->stat->status = SCIP_STATUS_UNKNOWN;
1294 
1295  /* update upper bound and cutoff bound due to objective limit in primal data */
1296  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter,
1297  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
1298 
1299  /* start presolving timer */
1300  SCIPclockStart(scip->stat->presolvingtime, scip->set);
1302 
1303  /* initialize presolving */
1304  if( scip->set->stage == SCIP_STAGE_TRANSFORMED )
1305  {
1306  SCIP_CALL( initPresolve(scip) );
1307  }
1308  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
1309 
1310  /* call primal heuristics that are applicable before presolving */
1311  if( scip->set->nheurs > 0 )
1312  {
1313  SCIP_Bool foundsol;
1314 
1315  SCIPdebugMsg(scip, "calling primal heuristics before presolving\n");
1316 
1317  /* call primal heuristics */
1318  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
1319  SCIP_HEURTIMING_BEFOREPRESOL, FALSE, &foundsol, unbounded) );
1320 
1321  /* output a message, if a solution was found */
1322  if( foundsol )
1323  {
1324  SCIP_SOL* sol;
1325 
1326  assert(SCIPgetNSols(scip) > 0);
1327  sol = SCIPgetBestSol(scip);
1328  assert(sol != NULL);
1329  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
1330 
1332  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
1334  }
1335  }
1336 
1338 
1339  *infeasible = FALSE;
1340  *unbounded = (*unbounded) || (SCIPgetNSols(scip) > 0 && SCIPisInfinity(scip, -SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip))));
1341  *vanished = scip->transprob->nvars == 0 && scip->transprob->nconss == 0 && scip->set->nactivepricers == 0;
1342 
1343  finished = (scip->set->presol_maxrounds != -1 && scip->stat->npresolrounds >= scip->set->presol_maxrounds)
1344  || (*unbounded) || (*vanished) || (scip->set->reopt_enable && scip->stat->nreoptruns >= 1);
1345  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
1346 
1347  /* perform presolving rounds */
1348  while( !finished && !stopped )
1349  {
1350  /* store current number of reductions */
1352  scip->stat->lastnpresolaggrvars = scip->stat->npresolaggrvars;
1354  scip->stat->lastnpresolchgbds = scip->stat->npresolchgbds;
1355  scip->stat->lastnpresoladdholes = scip->stat->npresoladdholes;
1356  scip->stat->lastnpresoldelconss = scip->stat->npresoldelconss;
1357  scip->stat->lastnpresoladdconss = scip->stat->npresoladdconss;
1359  scip->stat->lastnpresolchgcoefs = scip->stat->npresolchgcoefs;
1360  scip->stat->lastnpresolchgsides = scip->stat->npresolchgsides;
1361 #ifdef SCIP_DISABLED_CODE
1362  scip->stat->lastnpresolimplications = scip->stat->nimplications;
1363  scip->stat->lastnpresolcliques = SCIPcliquetableGetNCliques(scip->cliquetable);
1364 #endif
1365 
1366  /* set presolving flag */
1367  scip->stat->performpresol = TRUE;
1368 
1369  /* sort propagators */
1370  SCIPsetSortPropsPresol(scip->set);
1371 
1372  /* sort presolvers by priority */
1373  SCIPsetSortPresols(scip->set);
1374 
1375  /* check if this will be the last presolving round (in that case, we want to run all presolvers) */
1376  lastround = (scip->set->presol_maxrounds == -1 ? FALSE : (scip->stat->npresolrounds + 1 >= scip->set->presol_maxrounds));
1377 
1378  presoltiming = SCIP_PRESOLTIMING_FAST;
1379 
1380  /* perform the presolving round by calling the presolvers, propagators, and constraint handlers */
1381  assert(!(*unbounded));
1382  assert(!(*infeasible));
1383  SCIP_CALL( presolveRound(scip, &presoltiming, unbounded, infeasible, lastround,
1384  &presolstart, scip->set->npresols, &propstart, scip->set->nprops, &consstart, scip->set->nconshdlrs) );
1385 
1386  /* check, if we should abort presolving due to not enough changes in the last round */
1387  finished = SCIPisPresolveFinished(scip) || presoltiming == SCIP_PRESOLTIMING_FINAL;
1388 
1389  SCIPdebugMsg(scip, "presolving round %d returned with unbounded = %u, infeasible = %u, finished = %u\n", scip->stat->npresolrounds, *unbounded, *infeasible, finished);
1390 
1391  /* check whether problem is infeasible or unbounded or vanished */
1392  *vanished = scip->transprob->nvars == 0 && scip->transprob->nconss == 0 && scip->set->nactivepricers == 0;
1393  finished = finished || *unbounded || *infeasible || *vanished;
1394 
1395  /* increase round number */
1396  scip->stat->npresolrounds++;
1397 
1398  if( !finished )
1399  {
1400  /* print presolving statistics */
1402  "(round %d, %-11s %d del vars, %d del conss, %d add conss, %d chg bounds, %d chg sides, %d chg coeffs, %d upgd conss, %d impls, %d clqs\n",
1403  scip->stat->npresolrounds, ( presoltiming == SCIP_PRESOLTIMING_FAST ? "fast)" :
1404  (presoltiming == SCIP_PRESOLTIMING_MEDIUM ? "medium)" :
1405  (presoltiming == SCIP_PRESOLTIMING_EXHAUSTIVE ?"exhaustive)" :
1406  "final)")) ),
1407  scip->stat->npresolfixedvars + scip->stat->npresolaggrvars,
1408  scip->stat->npresoldelconss, scip->stat->npresoladdconss,
1409  scip->stat->npresolchgbds, scip->stat->npresolchgsides,
1410  scip->stat->npresolchgcoefs, scip->stat->npresolupgdconss,
1412  }
1413 
1414  /* abort if time limit was reached or user interrupted */
1415  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
1416  }
1417 
1418  /* first change status of scip, so that all plugins in their exitpre callbacks can ask SCIP for the correct status */
1419  if( *infeasible )
1420  {
1421  /* switch status to OPTIMAL */
1422  if( scip->primal->nlimsolsfound > 0 )
1423  {
1424  scip->stat->status = SCIP_STATUS_OPTIMAL;
1425  }
1426  else /* switch status to INFEASIBLE */
1428  }
1429  else if( *unbounded )
1430  {
1431  if( scip->primal->nsols >= 1 ) /* switch status to UNBOUNDED */
1433  else /* switch status to INFORUNBD */
1435  }
1436  /* if no variables and constraints are present, we try to add the empty solution (constraint handlers with needscons
1437  * flag FALSE could theoretically reject it); if no active pricers could create variables later, we conclude
1438  * optimality or infeasibility */
1439  else if( scip->transprob->nvars == 0 && scip->transprob->nconss == 0 )
1440  {
1441  SCIP_SOL* sol;
1442  SCIP_Bool stored;
1443 
1444  SCIP_CALL( SCIPcreateSol(scip, &sol, NULL) );
1445  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, FALSE, FALSE, &stored) );
1446 
1447  if( scip->set->nactivepricers == 0 )
1448  {
1449  assert(*vanished);
1450 
1451  if( scip->primal->nlimsolsfound > 0 )
1452  scip->stat->status = SCIP_STATUS_OPTIMAL;
1453  else
1455  }
1456  }
1457 
1458  /* deinitialize presolving */
1459  if( finished && (!stopped || *unbounded || *infeasible || *vanished) )
1460  {
1461  SCIP_Real maxnonzeros;
1462  SCIP_Longint nchecknonzeros;
1463  SCIP_Longint nactivenonzeros;
1464  SCIP_Bool approxchecknonzeros;
1465  SCIP_Bool approxactivenonzeros;
1466  SCIP_Bool infeas;
1467 
1468  SCIP_CALL( exitPresolve(scip, *unbounded || *infeasible || *vanished, &infeas) );
1469  *infeasible = *infeasible || infeas;
1470 
1471  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
1472 
1473  /* resort variables if we are not already done (unless variable permutation was explicitly activated) */
1474  if( !scip->set->random_permutevars && !(*infeasible) && !(*unbounded) && !(*vanished) )
1475  {
1476  /* (Re)Sort the variables, which appear in the four categories (binary, integer, implicit, continuous) after
1477  * presolve with respect to their original index (within their categories). Adjust the problem index afterwards
1478  * which is supposed to reflect the position in the variable array. This additional (re)sorting is supposed to
1479  * get more robust against the order presolving fixed variables. (We also reobtain a possible block structure
1480  * induced by the user model)
1481  */
1483  }
1484 
1485  /* determine number of non-zeros */
1486  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
1487  maxnonzeros = MAX(maxnonzeros, 1.0);
1488  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
1489  scip->stat->nnz = nactivenonzeros;
1490 
1493  "presolved problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
1494  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
1495  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
1497  }
1498  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
1499  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
1500 
1501  /* stop presolving time */
1502  SCIPclockStop(scip->stat->presolvingtime, scip->set);
1504 
1505  /* print presolving statistics */
1507  "presolving (%d rounds: %d fast, %d medium, %d exhaustive):\n", scip->stat->npresolrounds,
1510  " %d deleted vars, %d deleted constraints, %d added constraints, %d tightened bounds, %d added holes, %d changed sides, %d changed coefficients\n",
1514  " %d implications, %d cliques\n", scip->stat->nimplications, SCIPcliquetableGetNCliques(scip->cliquetable));
1515 
1516  /* remember number of constraints */
1518 
1519  return SCIP_OKAY;
1520 }
1521 
1522 /** tries to transform original solutions to the transformed problem space */
1523 static
1525  SCIP* scip /**< SCIP data structure */
1526  )
1527 {
1528  SCIP_SOL** sols;
1529  SCIP_SOL** scipsols;
1530  SCIP_SOL* sol;
1531  SCIP_Real* solvals;
1532  SCIP_Bool* solvalset;
1533  SCIP_Bool added;
1534  SCIP_Longint oldnsolsfound;
1535  int nsols;
1536  int ntransvars;
1537  int naddedsols;
1538  int s;
1539 
1540  nsols = SCIPgetNSols(scip);
1541  oldnsolsfound = scip->primal->nsolsfound;
1542 
1543  /* no solution to transform */
1544  if( nsols == 0 )
1545  return SCIP_OKAY;
1546 
1547  SCIPdebugMsg(scip, "try to transfer %d original solutions into the transformed problem space\n", nsols);
1548 
1549  ntransvars = scip->transprob->nvars;
1550  naddedsols = 0;
1551 
1552  /* It might happen, that the added transferred solution does not equal the corresponding original one, which might
1553  * result in the array of solutions being changed. Thus we temporarily copy the array and traverse it in reverse
1554  * order to ensure that the regarded solution in the copied array was not already freed when new solutions were added
1555  * and the worst solutions were freed.
1556  */
1557  scipsols = SCIPgetSols(scip);
1558  SCIP_CALL( SCIPduplicateBufferArray(scip, &sols, scipsols, nsols) );
1559  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, ntransvars) );
1560  SCIP_CALL( SCIPallocBufferArray(scip, &solvalset, ntransvars) );
1561 
1562  for( s = nsols-1; s >= 0; --s )
1563  {
1564  sol = sols[s];
1565 
1566  /* it might happen that a transferred original solution has a better objective than its original counterpart
1567  * (e.g., because multi-aggregated variables get another value, but the solution is still feasible);
1568  * in this case, it might happen that the solution is not an original one and we just skip this solution
1569  */
1570  if( !SCIPsolIsOriginal(sol) )
1571  continue;
1572 
1573  SCIP_CALL( SCIPprimalTransformSol(scip->primal, sol, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
1574  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, solvals,
1575  solvalset, ntransvars, &added) );
1576 
1577  if( added )
1578  ++naddedsols;
1579  }
1580 
1581  if( naddedsols > 0 )
1582  {
1584  "transformed %d/%d original solutions to the transformed problem space\n",
1585  naddedsols, nsols);
1586 
1587  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
1588  }
1589 
1590  SCIPfreeBufferArray(scip, &solvalset);
1591  SCIPfreeBufferArray(scip, &solvals);
1592  SCIPfreeBufferArray(scip, &sols);
1593 
1594  return SCIP_OKAY;
1595 }
1596 
1597 /** initializes solution process data structures */
1598 static
1600  SCIP* scip, /**< SCIP data structure */
1601  SCIP_Bool solved /**< is problem already solved? */
1602  )
1603 {
1604  assert(scip != NULL);
1605  assert(scip->mem != NULL);
1606  assert(scip->set != NULL);
1607  assert(scip->stat != NULL);
1608  assert(scip->nlp == NULL);
1609  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
1610 
1611  /**@todo check whether other methodscan be skipped if problem has been solved */
1612  /* if problem has been solved, several time consuming tasks must not be performed */
1613  if( !solved )
1614  {
1615  /* reset statistics for current branch and bound run */
1616  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, solved);
1618 
1619  /* LP is empty anyway; mark empty LP to be solved and update validsollp counter */
1620  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->transprob, scip->stat, scip->eventqueue, scip->eventfilter) );
1621 
1622  /* update upper bound and cutoff bound due to objective limit in primal data */
1623  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter,
1624  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
1625  }
1626 
1627  /* switch stage to INITSOLVE */
1628  scip->set->stage = SCIP_STAGE_INITSOLVE;
1629 
1630  /* initialize NLP if there are nonlinearities */
1631  if( scip->transprob->nlpenabled && !scip->set->nlp_disable )
1632  {
1633  SCIPdebugMsg(scip, "constructing empty NLP\n");
1634 
1635  SCIP_CALL( SCIPnlpCreate(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, SCIPprobGetName(scip->transprob), scip->transprob->nvars) );
1636  assert(scip->nlp != NULL);
1637 
1638  SCIP_CALL( SCIPnlpAddVars(scip->nlp, scip->mem->probmem, scip->set, scip->transprob->nvars, scip->transprob->vars) );
1639 
1640  /* Adjust estimation of external memory: SCIPtransformProb() estimated the memory used for the LP-solver. As a
1641  * very crude approximation just double this number. Only do this once in the first run. */
1642  if( scip->set->misc_estimexternmem && scip->stat->nruns <= 1 )
1643  {
1644  scip->stat->externmemestim *= 2;
1645  SCIPdebugMsg(scip, "external memory usage estimated to %" SCIP_LONGINT_FORMAT " byte\n", scip->stat->externmemestim);
1646  }
1647  }
1648 
1649  /* possibly create visualization output file */
1650  SCIP_CALL( SCIPvisualInit(scip->stat->visual, scip->mem->probmem, scip->set, scip->messagehdlr) );
1651 
1652  /* initialize solution process data structures */
1654  SCIP_CALL( SCIPsepastoreCreate(&scip->sepastore, scip->mem->probmem, scip->set) );
1655  SCIP_CALL( SCIPsepastoreCreate(&scip->sepastoreprobing, scip->mem->probmem, scip->set) );
1656  SCIP_CALL( SCIPcutpoolCreate(&scip->cutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, TRUE) );
1657  SCIP_CALL( SCIPcutpoolCreate(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, FALSE) );
1658  SCIP_CALL( SCIPtreeCreateRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter, scip->eventqueue,
1659  scip->lp) );
1660 
1661  /* update dual bound of the root node if a valid dual bound is at hand */
1662  if( scip->transprob->dualbound < SCIP_INVALID )
1663  {
1664  SCIP_Real internobjval = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
1665 
1666  scip->stat->lastlowerbound = internobjval;
1667 
1668  SCIPnodeUpdateLowerbound(SCIPtreeGetRootNode(scip->tree), scip->stat, scip->set, scip->tree, scip->transprob,
1669  scip->origprob, internobjval);
1670  }
1671 
1672  /* try to transform original solutions to the transformed problem space */
1673  if( scip->set->misc_transorigsols )
1674  {
1675  SCIP_CALL( transformSols(scip) );
1676  }
1677 
1678  /* inform the transformed problem that the branch and bound process starts now */
1679  SCIP_CALL( SCIPprobInitSolve(scip->transprob, scip->set) );
1680 
1681  /* transform the decomposition storage */
1683 
1684  /* inform plugins that the branch and bound process starts now */
1685  SCIP_CALL( SCIPsetInitsolPlugins(scip->set, scip->mem->probmem, scip->stat) );
1686 
1687  /* remember number of constraints */
1689 
1690  /* if all variables are known, calculate a trivial primal bound by setting all variables to their worst bound */
1691  if( scip->set->nactivepricers == 0 )
1692  {
1693  SCIP_VAR* var;
1694  SCIP_Real obj;
1695  SCIP_Real objbound;
1696  SCIP_Real bd;
1697  int v;
1698 
1699  objbound = 0.0;
1700  for( v = 0; v < scip->transprob->nvars && !SCIPsetIsInfinity(scip->set, objbound); ++v )
1701  {
1702  var = scip->transprob->vars[v];
1703  obj = SCIPvarGetObj(var);
1704  if( !SCIPsetIsZero(scip->set, obj) )
1705  {
1706  bd = SCIPvarGetWorstBoundGlobal(var);
1707  if( SCIPsetIsInfinity(scip->set, REALABS(bd)) )
1708  objbound = SCIPsetInfinity(scip->set);
1709  else
1710  objbound += obj * bd;
1711  }
1712  }
1713 
1714  /* adjust primal bound, such that solution with worst bound may be found */
1715  if( objbound + SCIPsetCutoffbounddelta(scip->set) != objbound ) /*lint !e777*/
1716  objbound += SCIPsetCutoffbounddelta(scip->set);
1717  /* if objbound is very large, adding the cutoffbounddelta may not change the number; in this case, we are using
1718  * SCIPnextafter to ensure that the cutoffbound is really larger than the best possible solution value
1719  */
1720  else
1721  objbound = SCIPnextafter(objbound, SCIP_REAL_MAX);
1722 
1723  /* update cutoff bound */
1724  if( !SCIPsetIsInfinity(scip->set, objbound) && SCIPsetIsLT(scip->set, objbound, scip->primal->cutoffbound) )
1725  {
1726  /* adjust cutoff bound */
1727  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter,
1728  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, objbound, FALSE) );
1729  }
1730  }
1731 
1732  /* switch stage to SOLVING */
1733  scip->set->stage = SCIP_STAGE_SOLVING;
1734 
1735  return SCIP_OKAY;
1736 }
1737 
1738 /** frees solution process data structures */
1739 static
1741  SCIP* scip, /**< SCIP data structure */
1742  SCIP_Bool restart /**< was this free solve call triggered by a restart? */
1743  )
1744 {
1745  assert(scip != NULL);
1746  assert(scip->mem != NULL);
1747  assert(scip->set != NULL);
1748  assert(scip->stat != NULL);
1749  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
1750 
1751  /* mark that we are currently restarting */
1752  if( restart )
1753  {
1754  scip->stat->inrestart = TRUE;
1755 
1756  /* copy the current dual bound into the problem data structure such that it can be used initialize the new search
1757  * tree
1758  */
1760  }
1761 
1762  /* remove focus from the current focus node */
1763  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
1764  {
1765  SCIP_NODE* node = NULL;
1766  SCIP_Bool cutoff;
1767 
1768  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
1769  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
1770  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
1771  assert(!cutoff);
1772  }
1773 
1774  /* switch stage to EXITSOLVE */
1775  scip->set->stage = SCIP_STAGE_EXITSOLVE;
1776 
1777  /* cleanup the conflict storage */
1778  SCIP_CALL( SCIPconflictstoreClean(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
1779 
1780  /* inform plugins that the branch and bound process is finished */
1781  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, restart) );
1782 
1783  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
1784  if( scip->nlp != NULL )
1785  {
1786  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
1787  }
1788  scip->transprob->nlpenabled = FALSE;
1789 
1790  /* clear the LP, and flush the changes to clear the LP of the solver */
1791  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->transprob, scip->stat, scip->eventqueue, scip->eventfilter) );
1793 
1794  /* resets the debug environment */
1795  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
1796 
1797  /* clear all row references in internal data structures */
1798  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
1799  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
1800 
1801  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
1802  * subroots have to be released
1803  */
1804  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter, scip->eventqueue, scip->lp) );
1805 
1807 
1808  /* deinitialize transformed problem */
1809  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, restart) );
1810 
1811  /* free solution process data structures */
1812  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
1813  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
1815  SCIP_CALL( SCIPsepastoreFree(&scip->sepastore, scip->mem->probmem) );
1817 
1818  /* possibly close visualization output file */
1819  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
1820 
1821  /* reset statistics for current branch and bound run */
1823  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, TRUE);
1824  else
1825  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
1826 
1827  /* switch stage to TRANSFORMED */
1828  scip->set->stage = SCIP_STAGE_TRANSFORMED;
1829 
1830  /* restart finished */
1831  assert( ! restart || scip->stat->inrestart );
1832  scip->stat->inrestart = FALSE;
1833 
1834  return SCIP_OKAY;
1835 }
1836 
1837 /** frees solution process data structures when reoptimization is used
1838  *
1839  * in contrast to a freeSolve() this method will preserve the transformed problem such that another presolving round
1840  * after changing the problem (modifying the objective function) is not necessary.
1841  */
1842 static
1844  SCIP* scip /**< SCIP data structure */
1845  )
1846 {
1847  assert(scip != NULL);
1848  assert(scip->mem != NULL);
1849  assert(scip->set != NULL);
1850  assert(scip->stat != NULL);
1851  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
1852 
1853  /* remove focus from the current focus node */
1854  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
1855  {
1856  SCIP_NODE* node = NULL;
1857  SCIP_Bool cutoff;
1858 
1859  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
1860  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
1861  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
1862  assert(!cutoff);
1863  }
1864 
1865  /* mark current stats, such that new solve begins with the var/col/row indices from the previous run */
1866  SCIPstatMark(scip->stat);
1867 
1868  /* switch stage to EXITSOLVE */
1869  scip->set->stage = SCIP_STAGE_EXITSOLVE;
1870 
1871  /* deinitialize conflict store */
1872  SCIP_CALL( SCIPconflictstoreClear(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
1873 
1874  /* invalidate the dual bound */
1876 
1877  /* inform plugins that the branch and bound process is finished */
1878  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, FALSE) );
1879 
1880  /* call exit methods of plugins */
1881  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
1882 
1883  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
1884  if( scip->nlp != NULL )
1885  {
1886  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
1887  }
1888  scip->transprob->nlpenabled = FALSE;
1889 
1890  /* clear the LP, and flush the changes to clear the LP of the solver */
1891  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->transprob, scip->stat, scip->eventqueue, scip->eventfilter) );
1893 
1894  /* resets the debug environment */
1895  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
1896 
1897  /* clear all row references in internal data structures */
1898  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
1899  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
1900 
1901  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
1902  * subroots have to be released
1903  */
1904  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter, scip->eventqueue, scip->lp) );
1905 
1906  /* deinitialize transformed problem */
1907  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, FALSE) );
1908 
1909  /* free solution process data structures */
1911 
1912  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
1913  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
1915  SCIP_CALL( SCIPsepastoreFree(&scip->sepastore, scip->mem->probmem) );
1917 
1918  /* possibly close visualization output file */
1919  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
1920 
1921  /* reset statistics for current branch and bound run */
1922  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
1923 
1924  /* switch stage to PRESOLVED */
1925  scip->set->stage = SCIP_STAGE_PRESOLVED;
1926 
1927  /* restart finished */
1928  scip->stat->inrestart = FALSE;
1929 
1930  /* reset solving specific paramters */
1931  if( scip->set->reopt_enable )
1932  {
1933  assert(scip->reopt != NULL);
1934  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
1935  }
1936 
1937  /* free the debug solution which might live in transformed primal data structure */
1938  SCIP_CALL( SCIPprimalClear(&scip->primal, scip->mem->probmem) );
1939 
1940  if( scip->set->misc_resetstat )
1941  {
1942  /* reset statistics to the point before the problem was transformed */
1943  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
1944  }
1945  else
1946  {
1947  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
1949  }
1950 
1951  /* reset objective limit */
1953 
1954  return SCIP_OKAY;
1955 }
1956 
1957 /** free transformed problem */
1958 static
1960  SCIP* scip /**< SCIP data structure */
1961  )
1962 {
1963  SCIP_Bool reducedfree;
1964 
1965  assert(scip != NULL);
1966  assert(scip->mem != NULL);
1967  assert(scip->stat != NULL);
1968  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING ||
1969  (scip->set->stage == SCIP_STAGE_PRESOLVED && scip->set->reopt_enable));
1970 
1971  /* If the following evaluates to true, SCIPfreeReoptSolve() has already called the exit-callbacks of the plugins.
1972  * We can skip calling some of the following methods. This can happen if a new objective function was
1973  * installed but the solve was not started.
1974  */
1975  reducedfree = (scip->set->stage == SCIP_STAGE_PRESOLVED && scip->set->reopt_enable);
1976 
1977  if( !reducedfree )
1978  {
1979  /* call exit methods of plugins */
1980  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
1981  }
1982 
1983  /* copy best primal solutions to original solution candidate list */
1984  if( !scip->set->reopt_enable && scip->set->limit_maxorigsol > 0 && scip->set->misc_transsolsorig && scip->set->nactivebenders == 0 )
1985  {
1986  SCIP_Bool stored;
1987  SCIP_Bool hasinfval;
1988  int maxsols;
1989  int nsols;
1990  int s;
1991 
1992  assert(scip->origprimal->nsols == 0);
1993 
1994  nsols = scip->primal->nsols;
1995  maxsols = scip->set->limit_maxorigsol;
1996  stored = TRUE;
1997  s = 0;
1998 
1999  /* iterate over all solutions as long as the original solution candidate store size limit is not reached */
2000  while( s < nsols && scip->origprimal->nsols < maxsols )
2001  {
2002  SCIP_SOL* sol;
2003 
2004  sol = scip->primal->sols[s];
2005  assert(sol != NULL);
2006 
2007  if( !SCIPsolIsOriginal(sol) )
2008  {
2009  /* retransform solution into the original problem space */
2010  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
2011  }
2012  else
2013  hasinfval = FALSE;
2014 
2015  /* removing infinite fixings is turned off by the corresponding parameter */
2016  if( !scip->set->misc_finitesolstore )
2017  hasinfval = FALSE;
2018 
2019  if( !hasinfval )
2020  {
2021  /* add solution to original candidate solution storage */
2022  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, &stored) );
2023  }
2024  else
2025  {
2026  SCIP_SOL* newsol;
2027  SCIP_Bool success;
2028 
2029  SCIP_CALL( SCIPcreateFiniteSolCopy(scip, &newsol, sol, &success) );
2030 
2031  /* infinite fixing could be removed */
2032  if( newsol != NULL )
2033  {
2034  /* add solution to original candidate solution storage; we must not use SCIPprimalAddOrigSolFree()
2035  * because we want to create a copy of the solution in the origprimal solution store, but newsol was
2036  * created in the (transformed) primal
2037  */
2038  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, newsol, &stored) );
2039 
2040  /* free solution in (transformed) primal where it was created */
2041  SCIP_CALL( SCIPsolFree(&newsol, scip->mem->probmem, scip->primal) );
2042  }
2043  }
2044  ++s;
2045  }
2046 
2047  if( scip->origprimal->nsols > 1 )
2048  {
2050  "stored the %d best primal solutions in the original solution candidate list\n", scip->origprimal->nsols);
2051  }
2052  else if( scip->origprimal->nsols == 1 )
2053  {
2055  "stored the best primal solution in the original solution candidate list\n");
2056  }
2057  }
2058 
2059  /* switch stage to FREETRANS */
2060  scip->set->stage = SCIP_STAGE_FREETRANS;
2061 
2062  /* reset solving specific paramters */
2063  assert(!scip->set->reopt_enable || scip->reopt != NULL);
2064  if( scip->set->reopt_enable && scip->reopt != NULL )
2065  {
2066  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
2067  }
2068 
2069  if( !reducedfree )
2070  {
2071  /* clear the conflict store
2072  *
2073  * since the conflict store can contain transformed constraints we need to remove them. the store will be finally
2074  * freed in SCIPfreeProb().
2075  */
2076  SCIP_CALL( SCIPconflictstoreClear(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
2077  }
2078 
2079  /* free transformed problem data structures */
2080  SCIP_CALL( SCIPprobFree(&scip->transprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
2082  SCIP_CALL( SCIPconflictFree(&scip->conflict, scip->mem->probmem) );
2083 
2084  if( !reducedfree )
2085  {
2087  }
2088  SCIP_CALL( SCIPtreeFree(&scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter, scip->eventqueue, scip->lp) );
2089 
2090  /* free the debug solution which might live in transformed primal data structure */
2091  SCIP_CALL( SCIPdebugFreeSol(scip->set) ); /*lint !e506 !e774*/
2092  SCIP_CALL( SCIPprimalFree(&scip->primal, scip->mem->probmem) );
2093 
2094  SCIP_CALL( SCIPlpFree(&scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter) );
2096  SCIP_CALL( SCIPeventfilterFree(&scip->eventfilter, scip->mem->probmem, scip->set) );
2098 
2099  if( scip->set->misc_resetstat && !reducedfree )
2100  {
2101  /* reset statistics to the point before the problem was transformed */
2102  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
2103  }
2104  else
2105  {
2106  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
2108  }
2109 
2110  /* switch stage to PROBLEM */
2111  scip->set->stage = SCIP_STAGE_PROBLEM;
2112 
2113  /* reset objective limit */
2115 
2116  /* reset original variable's local and global bounds to their original values */
2117  SCIP_CALL( SCIPprobResetBounds(scip->origprob, scip->mem->probmem, scip->set, scip->stat) );
2118 
2119  return SCIP_OKAY;
2120 }
2121 
2122 /** free transformed problem in case an error occurs during transformation and return to SCIP_STAGE_PROBLEM */
2123 static
2125  SCIP* scip /**< SCIP data structure */
2126  )
2127 {
2128 
2129  assert(scip != NULL);
2130  assert(scip->mem != NULL);
2131  assert(scip->stat != NULL);
2132  assert(scip->set->stage == SCIP_STAGE_TRANSFORMING);
2133 
2134  /* switch stage to FREETRANS */
2135  scip->set->stage = SCIP_STAGE_FREETRANS;
2136 
2137  /* free transformed problem data structures */
2138  SCIP_CALL( SCIPprobFree(&scip->transprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
2140  SCIP_CALL( SCIPconflictFree(&scip->conflict, scip->mem->probmem) );
2142  SCIP_CALL( SCIPtreeFree(&scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter, scip->eventqueue, scip->lp) );
2143 
2144  /* free the debug solution which might live in transformed primal data structure */
2145  SCIP_CALL( SCIPdebugFreeSol(scip->set) ); /*lint !e506 !e774*/
2146  SCIP_CALL( SCIPprimalFree(&scip->primal, scip->mem->probmem) );
2147 
2148  SCIP_CALL( SCIPlpFree(&scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter) );
2150  SCIP_CALL( SCIPeventfilterFree(&scip->eventfilter, scip->mem->probmem, scip->set) );
2152 
2153  if( scip->set->misc_resetstat )
2154  {
2155  /* reset statistics to the point before the problem was transformed */
2156  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
2157  }
2158  else
2159  {
2160  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
2162  }
2163 
2164  /* switch stage to PROBLEM */
2165  scip->set->stage = SCIP_STAGE_PROBLEM;
2166 
2167  return SCIP_OKAY;
2168 }
2169 
2170 /** displays most relevant statistics after problem was solved */
2171 static
2173  SCIP* scip /**< SCIP data structure */
2174  )
2175 {
2176  assert(scip != NULL);
2177 
2178  /* display most relevant statistics */
2180  {
2181  SCIP_Bool objlimitreached = FALSE;
2182 
2183  /* We output that the objective limit has been reached if the problem has been solved, no solution respecting the
2184  * objective limit has been found (nlimsolsfound == 0) and the primal bound is finite. Note that it still might be
2185  * that the original problem is infeasible, even without the objective limit, i.e., we cannot be sure that we
2186  * actually reached the objective limit. */
2187  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0 && ! SCIPisInfinity(scip, SCIPgetPrimalbound(scip)) )
2188  objlimitreached = TRUE;
2189 
2190  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
2191  SCIPmessagePrintInfo(scip->messagehdlr, "SCIP Status : ");
2192  SCIP_CALL( SCIPprintStage(scip, NULL) );
2193  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
2194  if( scip->set->reopt_enable )
2195  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f (over %d runs: %.2f)\n", SCIPclockGetTime(scip->stat->solvingtime), scip->stat->nreoptruns, SCIPclockGetTime(scip->stat->solvingtimeoverall));
2196  else
2197  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f\n", SCIPclockGetTime(scip->stat->solvingtime));
2198  if( scip->stat->nruns > 1 )
2199  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (total of %" SCIP_LONGINT_FORMAT " nodes in %d runs)\n",
2200  scip->stat->nnodes, scip->stat->ntotalnodes, scip->stat->nruns);
2201  else if( scip->set->reopt_enable )
2202  {
2203  SCIP_BRANCHRULE* branchrule;
2204 
2205  branchrule = SCIPfindBranchrule(scip, "nodereopt");
2206  assert(branchrule != NULL);
2207 
2208  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " reactivated)\n", scip->stat->nnodes, SCIPbranchruleGetNChildren(branchrule));
2209  }
2210  else
2211  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT "\n", scip->stat->nnodes);
2212  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED && scip->set->stage <= SCIP_STAGE_EXITSOLVE )
2213  {
2214  if( objlimitreached )
2215  {
2216  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (objective limit, %" SCIP_LONGINT_FORMAT " solutions",
2217  SCIPgetPrimalbound(scip), scip->primal->nsolsfound);
2218  if( scip->primal->nsolsfound > 0 )
2219  {
2220  SCIPmessagePrintInfo(scip->messagehdlr, ", best solution %+.14e", SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
2221  }
2222  SCIPmessagePrintInfo(scip->messagehdlr, ")\n");
2223  }
2224  else
2225  {
2226  char limsolstring[SCIP_MAXSTRLEN];
2227  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
2228  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
2229  else
2230  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN,"");
2231 
2232  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions%s)\n",
2233  SCIPgetPrimalbound(scip), scip->primal->nsolsfound, limsolstring);
2234  }
2235  }
2236  if( scip->set->stage >= SCIP_STAGE_SOLVING && scip->set->stage <= SCIP_STAGE_SOLVED )
2237  {
2238  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", SCIPgetDualbound(scip));
2239 
2240  SCIPmessagePrintInfo(scip->messagehdlr, "Gap : ");
2241  if( SCIPsetIsInfinity(scip->set, SCIPgetGap(scip)) )
2242  SCIPmessagePrintInfo(scip->messagehdlr, "infinite\n");
2243  else
2244  SCIPmessagePrintInfo(scip->messagehdlr, "%.2f %%\n", 100.0*SCIPgetGap(scip));
2245  }
2246 
2247  /* check solution for feasibility in original problem */
2248  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
2249  {
2250  SCIP_SOL* sol;
2251 
2252  sol = SCIPgetBestSol(scip);
2253  if( sol != NULL )
2254  {
2255  SCIP_Real checkfeastolfac;
2256  SCIP_Real oldfeastol;
2257  SCIP_Bool dispallviols;
2258  SCIP_Bool feasible;
2259 
2260  oldfeastol = SCIPfeastol(scip);
2261  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
2262  SCIP_CALL( SCIPgetBoolParam(scip, "display/allviols", &dispallviols) );
2263 
2264  /* scale feasibility tolerance by set->num_checkfeastolfac */
2265  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
2266  {
2267  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
2268  }
2269 
2270  SCIP_CALL( SCIPcheckSolOrig(scip, sol, &feasible, TRUE, dispallviols) );
2271 
2272  /* restore old feasibilty tolerance */
2273  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
2274  {
2275  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
2276  }
2277 
2278  if( !feasible )
2279  {
2280  SCIPmessagePrintInfo(scip->messagehdlr, "best solution is not feasible in original problem\n");
2281  }
2282  }
2283  }
2284  }
2285 
2286  return SCIP_OKAY;
2287 }
2288 
2289 /** calls compression based on the reoptimization structure after the presolving */
2290 static
2292  SCIP* scip /**< global SCIP settings */
2293  )
2294 {
2295  SCIP_RESULT result;
2296  int c;
2297  int noldnodes;
2298  int nnewnodes;
2299 
2300  result = SCIP_DIDNOTFIND;
2301 
2302  noldnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
2303 
2304  /* do not run if there exists only the root node */
2305  if( noldnodes <= 1 )
2306  return SCIP_OKAY;
2307 
2308  /* do not run a tree compression if the problem contains (implicit) integer variables */
2309  if( scip->transprob->nintvars > 0 || scip->transprob->nimplvars > 0 )
2310  return SCIP_OKAY;
2311 
2313  "tree compression:\n");
2315  " given tree has %d nodes.\n", noldnodes);
2316 
2317  /* sort compressions by priority */
2318  SCIPsetSortComprs(scip->set);
2319 
2320  for(c = 0; c < scip->set->ncomprs; c++)
2321  {
2322  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
2323 
2324  /* call tree compression technique */
2325  SCIP_CALL( SCIPcomprExec(scip->set->comprs[c], scip->set, scip->reopt, &result) );
2326 
2327  if( result == SCIP_SUCCESS )
2328  {
2329  nnewnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
2331  " <%s> compressed the search tree to %d nodes (rate %g).\n", SCIPcomprGetName(scip->set->comprs[c]),
2332  nnewnodes, ((SCIP_Real)nnewnodes)/noldnodes);
2333 
2334  break;
2335  }
2336  }
2337 
2338  if( result != SCIP_SUCCESS )
2339  {
2340  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
2342  " search tree could not be compressed.\n");
2343  }
2344 
2345  return SCIP_OKAY;
2346 }
2347 
2348 /* prepare all plugins and data structures for a reoptimization run */
2349 static
2351  SCIP* scip /**< SCIP data structure */
2352  )
2353 {
2354  SCIP_Bool reoptrestart;
2355 
2356  assert(scip != NULL);
2357  assert(scip->set->reopt_enable);
2358 
2359  /* @ todo: we could check if the problem is feasible, eg, by backtracking */
2360 
2361  /* increase number of reopt_runs */
2362  ++scip->stat->nreoptruns;
2363 
2364  /* inform the reoptimization plugin that a new iteration starts */
2365  SCIP_CALL( SCIPreoptAddRun(scip->reopt, scip->set, scip->mem->probmem, scip->origprob->vars,
2366  scip->origprob->nvars, scip->set->limit_maxsol) );
2367 
2368  /* check whether we need to add globally valid constraints */
2369  if( scip->set->reopt_sepaglbinfsubtrees || scip->set->reopt_sepabestsol )
2370  {
2371  SCIP_CALL( SCIPreoptApplyGlbConss(scip, scip->reopt, scip->set, scip->stat, scip->mem->probmem) );
2372  }
2373 
2374  /* after presolving the problem the first time we remember all global bounds and active constraints. bounds and
2375  * constraints will be restored within SCIPreoptInstallBounds() and SCIPreoptResetActiveConss().
2376  */
2377  if( scip->stat->nreoptruns == 1 )
2378  {
2379  assert(scip->set->stage == SCIP_STAGE_PRESOLVED || scip->set->stage == SCIP_STAGE_SOLVED);
2380 
2381  SCIP_CALL( SCIPreoptSaveGlobalBounds(scip->reopt, scip->transprob, scip->mem->probmem) );
2382 
2383  SCIP_CALL( SCIPreoptSaveActiveConss(scip->reopt, scip->set, scip->transprob, scip->mem->probmem) );
2384  }
2385  /* we are at least in the second run */
2386  else
2387  {
2388  assert(scip->transprob != NULL);
2389 
2390  SCIP_CALL( SCIPreoptMergeVarHistory(scip->reopt, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
2391 
2392  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal,
2393  scip->tree) );
2394 
2395  /* mark statistics before solving */
2396  SCIPstatMark(scip->stat);
2397 
2399 
2400  SCIP_CALL( SCIPreoptResetActiveConss(scip->reopt, scip->set, scip->stat) );
2401 
2402  /* check whether we want to restart the tree search */
2403  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, NULL, scip->transprob->vars,
2404  scip->transprob->nvars, &reoptrestart) );
2405 
2406  /* call initialization methods of plugins */
2407  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
2408 
2409  /* install globally valid lower and upper bounds */
2410  SCIP_CALL( SCIPreoptInstallBounds(scip->reopt, scip->set, scip->stat, scip->transprob, scip->lp, scip->branchcand,
2411  scip->eventqueue, scip->cliquetable, scip->mem->probmem) );
2412 
2413  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
2414  * cutoff bound if primal solution is already known
2415  */
2416  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat,
2417  scip->primal, scip->tree, scip->reopt, scip->lp, scip->eventfilter, scip->eventqueue) );
2418 
2419  /* if possible, scale objective function such that it becomes integral with gcd 1 */
2420  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
2421  scip->tree, scip->reopt, scip->lp, scip->eventfilter, scip->eventqueue) );
2422 
2424  }
2425 
2426  /* try to compress the search tree */
2427  if( scip->set->compr_enable )
2428  {
2429  SCIP_CALL( compressReoptTree(scip) );
2430  }
2431 
2432  return SCIP_OKAY;
2433 }
2434 
2435 /** transforms and presolves problem
2436  *
2437  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2438  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2439  *
2440  * @pre This method can be called if @p scip is in one of the following stages:
2441  * - \ref SCIP_STAGE_PROBLEM
2442  * - \ref SCIP_STAGE_TRANSFORMED
2443  * - \ref SCIP_STAGE_PRESOLVING
2444  * - \ref SCIP_STAGE_PRESOLVED
2445  * - \ref SCIP_STAGE_SOLVED
2446  *
2447  * @post After calling this method \SCIP reaches one of the following stages:
2448  * - \ref SCIP_STAGE_PRESOLVING if the presolving process was interrupted
2449  * - \ref SCIP_STAGE_PRESOLVED if the presolving process was finished and did not solve the problem
2450  * - \ref SCIP_STAGE_SOLVED if the problem was solved during presolving
2451  *
2452  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2453  */
2455  SCIP* scip /**< SCIP data structure */
2456  )
2457 {
2458  SCIP_Bool unbounded;
2459  SCIP_Bool infeasible;
2460  SCIP_Bool vanished;
2461  SCIP_RETCODE retcode;
2462 
2463  SCIP_CALL( SCIPcheckStage(scip, "SCIPpresolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE) );
2464 
2465  /* start solving timer */
2466  SCIPclockStart(scip->stat->solvingtime, scip->set);
2467  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
2468 
2469  /* capture the CTRL-C interrupt */
2470  if( scip->set->misc_catchctrlc )
2472 
2473  /* reset the user interrupt flag */
2474  scip->stat->userinterrupt = FALSE;
2475  SCIP_CALL( SCIPinterruptLP(scip, FALSE) );
2476 
2477  switch( scip->set->stage )
2478  {
2479  case SCIP_STAGE_PROBLEM:
2480  /* initialize solving data structures and transform problem */
2481  retcode = SCIPtransformProb(scip);
2482  if( retcode != SCIP_OKAY )
2483  {
2484  SCIP_CALL( SCIPfreeTransform(scip) );
2485  return retcode;
2486  }
2487 
2488  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
2489 
2490  /*lint -fallthrough*/
2491 
2493  case SCIP_STAGE_PRESOLVING:
2494  /* presolve problem */
2495  SCIP_CALL( presolve(scip, &unbounded, &infeasible, &vanished) );
2496  assert(scip->set->stage == SCIP_STAGE_PRESOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING);
2497 
2498  if( infeasible || unbounded || vanished )
2499  {
2500  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
2501 
2502  /* initialize solving process data structures to be able to switch to SOLVED stage */
2503  SCIP_CALL( initSolve(scip, TRUE) );
2504 
2505  /* switch stage to SOLVED */
2506  scip->set->stage = SCIP_STAGE_SOLVED;
2507 
2508  /* print solution message */
2509  switch( scip->stat->status )/*lint --e{788}*/
2510  {
2511  case SCIP_STATUS_OPTIMAL:
2512  /* remove the root node from the tree, s.t. the lower bound is set to +infinity ???????????? (see initSolve())*/
2513  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventfilter, scip->eventqueue, scip->lp) );
2514  break;
2515 
2518  "presolving detected infeasibility\n");
2519  break;
2520 
2521  case SCIP_STATUS_UNBOUNDED:
2523  "presolving detected unboundedness\n");
2524  break;
2525 
2526  case SCIP_STATUS_INFORUNBD:
2528  "presolving detected unboundedness (or infeasibility)\n");
2529  break;
2530 
2531  default:
2532  /* note that this is in an internal SCIP error since the status is corrupted */
2533  SCIPerrorMessage("invalid SCIP status <%d>\n", scip->stat->status);
2534  SCIPABORT();
2535  return SCIP_ERROR; /*lint !e527*/
2536  }
2537  }
2538  else if( scip->set->stage == SCIP_STAGE_PRESOLVED )
2539  {
2540  int h;
2541 
2542  /* print presolved problem statistics */
2544  "presolved problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
2545  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
2546  scip->transprob->ncontvars, scip->transprob->nconss);
2547 
2548  for( h = 0; h < scip->set->nconshdlrs; ++h )
2549  {
2550  int nactiveconss;
2551 
2552  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
2553  if( nactiveconss > 0 )
2554  {
2556  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
2557  }
2558  }
2559 
2560  if( SCIPprobIsObjIntegral(scip->transprob) )
2561  {
2563  "transformed objective value is always integral (scale: %.15g)\n", scip->transprob->objscale);
2564  }
2565  }
2566  else
2567  {
2568  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
2569  SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH, "presolving was interrupted.\n");
2570  }
2571 
2572  /* display timing statistics */
2574  "Presolving Time: %.2f\n", SCIPclockGetTime(scip->stat->presolvingtime));
2575  break;
2576 
2577  case SCIP_STAGE_PRESOLVED:
2578  case SCIP_STAGE_SOLVED:
2579  break;
2580 
2581  default:
2582  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
2583  return SCIP_INVALIDCALL;
2584  } /*lint !e788*/
2585 
2586  /* release the CTRL-C interrupt */
2587  if( scip->set->misc_catchctrlc )
2589 
2590  /* stop solving timer */
2591  SCIPclockStop(scip->stat->solvingtime, scip->set);
2592  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
2593 
2594  if( scip->set->stage == SCIP_STAGE_SOLVED )
2595  {
2596  /* display most relevant statistics */
2598  }
2599 
2600  return SCIP_OKAY;
2601 }
2602 
2603 /** transforms, presolves, and solves problem
2604  *
2605  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2606  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2607  *
2608  * @pre This method can be called if @p scip is in one of the following stages:
2609  * - \ref SCIP_STAGE_PROBLEM
2610  * - \ref SCIP_STAGE_TRANSFORMED
2611  * - \ref SCIP_STAGE_PRESOLVING
2612  * - \ref SCIP_STAGE_PRESOLVED
2613  * - \ref SCIP_STAGE_SOLVING
2614  * - \ref SCIP_STAGE_SOLVED
2615  *
2616  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
2617  * process was interrupted:
2618  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
2619  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
2620  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
2621  *
2622  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2623  */
2625  SCIP* scip /**< SCIP data structure */
2626  )
2627 {
2628  SCIP_Longint cutpoolncutsfoundbeforerestart = 0;
2629  SCIP_Longint cutpoolncutsaddedbeforerestart = 0;
2630  SCIP_Longint cutpoolncallsbeforerestart = 0;
2631  SCIP_Longint cutpoolnrootcallsbeforerestart = 0;
2632  SCIP_Longint cutpoolmaxncutsbeforerestart = 0;
2633  SCIP_Real cutpooltimebeforerestart = 0;
2634  SCIP_Bool statsprinted = FALSE;
2635  SCIP_Bool restart;
2636  SCIP_Bool transferstatistics = FALSE;
2637 
2638  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2639 
2640  /* if the stage is already SCIP_STAGE_SOLVED do nothing */
2641  if( scip->set->stage == SCIP_STAGE_SOLVED )
2642  return SCIP_OKAY;
2643 
2645  {
2646  SCIPwarningMessage(scip, "SCIPsolve() was called, but problem is already solved\n");
2647  return SCIP_OKAY;
2648  }
2649 
2650  /* check, if a node selector exists */
2651  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
2652  {
2653  SCIPerrorMessage("no node selector available\n");
2654  return SCIP_PLUGINNOTFOUND;
2655  }
2656 
2657  /* check, if an integrality constraint handler exists if there are integral variables */
2658  if( (SCIPgetNBinVars(scip) >= 0 || SCIPgetNIntVars(scip) >= 0) && SCIPfindConshdlr(scip, "integral") == NULL )
2659  {
2660  SCIPwarningMessage(scip, "integrality constraint handler not available\n");
2661  }
2662 
2663  /* initialize presolving flag (may be modified in SCIPpresolve()) */
2664  scip->stat->performpresol = FALSE;
2665 
2666  /* if a decomposition exists and Benders' decomposition has been enabled, then a decomposition is performed */
2668  && scip->set->decomp_applybenders && SCIPgetNActiveBenders(scip) == 0 )
2669  {
2670  int decompindex = 0;
2671 
2672  /* applying the Benders' decomposition */
2673  SCIP_CALL( SCIPapplyBendersDecomposition(scip, decompindex) );
2674  }
2675 
2676  /* start solving timer */
2677  SCIPclockStart(scip->stat->solvingtime, scip->set);
2678  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
2679 
2680  /* capture the CTRL-C interrupt */
2681  if( scip->set->misc_catchctrlc )
2683 
2684  /* reset the user interrupt flag */
2685  scip->stat->userinterrupt = FALSE;
2686  SCIP_CALL( SCIPinterruptLP(scip, FALSE) );
2687 
2688  /* automatic restarting loop */
2689  restart = scip->stat->userrestart;
2690 
2691  do
2692  {
2693  if( restart )
2694  {
2695  transferstatistics = TRUE;
2696  cutpoolncutsfoundbeforerestart = SCIPcutpoolGetNCutsFound(scip->cutpool);
2697  cutpoolncutsaddedbeforerestart = SCIPcutpoolGetNCutsAdded(scip->cutpool);
2698  cutpooltimebeforerestart = SCIPcutpoolGetTime(scip->cutpool);
2699  cutpoolncallsbeforerestart = SCIPcutpoolGetNCalls(scip->cutpool);
2700  cutpoolnrootcallsbeforerestart = SCIPcutpoolGetNRootCalls(scip->cutpool);
2701  cutpoolmaxncutsbeforerestart = SCIPcutpoolGetMaxNCuts(scip->cutpool);
2702 
2703  /* free the solving process data in order to restart */
2704  assert(scip->set->stage == SCIP_STAGE_SOLVING);
2705  if( scip->stat->userrestart )
2707  "(run %d, node %" SCIP_LONGINT_FORMAT ") performing user restart\n",
2708  scip->stat->nruns, scip->stat->nnodes);
2709  else
2711  "(run %d, node %" SCIP_LONGINT_FORMAT ") restarting after %d global fixings of integer variables\n",
2712  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
2713  /* an extra blank line should be printed separately since the buffer message handler only handles up to one line
2714  * correctly */
2716  /* reset relaxation solution, so that the objective value is recomputed from scratch next time, using the new
2717  * fixings which may be produced during the presolving after the restart */
2719 
2720  SCIP_CALL( freeSolve(scip, TRUE) );
2721  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
2722  }
2723  restart = FALSE;
2724  scip->stat->userrestart = FALSE;
2725 
2726  switch( scip->set->stage )
2727  {
2728  case SCIP_STAGE_PROBLEM:
2730  case SCIP_STAGE_PRESOLVING:
2731  /* initialize solving data structures, transform and problem */
2732 
2733  SCIP_CALL( SCIPpresolve(scip) );
2734  /* remember that we already printed the relevant statistics */
2735  if( scip->set->stage == SCIP_STAGE_SOLVED )
2736  statsprinted = TRUE;
2737 
2738  if( scip->set->stage == SCIP_STAGE_SOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING )
2739  {
2740  if ( scip->set->reopt_enable )
2741  {
2743  }
2744  break;
2745  }
2746  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
2747 
2748  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
2749  break;
2750  /*lint -fallthrough*/
2751 
2752  case SCIP_STAGE_PRESOLVED:
2753  /* check if reoptimization is enabled and global constraints are saved */
2754  if( scip->set->reopt_enable )
2755  {
2757  }
2758 
2759  /* initialize solving process data structures */
2760  SCIP_CALL( initSolve(scip, FALSE) );
2761  assert(scip->set->stage == SCIP_STAGE_SOLVING);
2763 
2764  /*lint -fallthrough*/
2765 
2766  case SCIP_STAGE_SOLVING:
2767  /* reset display */
2768  SCIPstatResetDisplay(scip->stat);
2769 
2770  /* remember cutpool statistics after restart */
2771  if( transferstatistics )
2772  {
2773  SCIPcutpoolAddNCutsFound(scip->cutpool, cutpoolncutsfoundbeforerestart);
2774  SCIPcutpoolAddNCutsAdded(scip->cutpool, cutpoolncutsaddedbeforerestart);
2775  SCIPcutpoolSetTime(scip->cutpool, cutpooltimebeforerestart);
2776  SCIPcutpoolAddNCalls(scip->cutpool, cutpoolncallsbeforerestart);
2777  SCIPcutpoolAddNRootCalls(scip->cutpool, cutpoolnrootcallsbeforerestart);
2778  SCIPcutpoolAddMaxNCuts(scip->cutpool, cutpoolmaxncutsbeforerestart);
2779  }
2780 
2781  /* continue solution process */
2782  SCIP_CALL( SCIPsolveCIP(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->mem, scip->origprob, scip->transprob,
2783  scip->primal, scip->tree, scip->reopt, scip->lp, scip->relaxation, scip->pricestore, scip->sepastore,
2784  scip->cutpool, scip->delayedcutpool, scip->branchcand, scip->conflict, scip->conflictstore,
2785  scip->eventfilter, scip->eventqueue, scip->cliquetable, &restart) );
2786 
2787  /* detect, whether problem is solved */
2788  if( SCIPtreeGetNNodes(scip->tree) == 0 && SCIPtreeGetCurrentNode(scip->tree) == NULL )
2789  {
2790  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
2791  || scip->stat->status == SCIP_STATUS_INFEASIBLE
2792  || scip->stat->status == SCIP_STATUS_UNBOUNDED
2793  || scip->stat->status == SCIP_STATUS_INFORUNBD);
2794  assert(!restart);
2795 
2796  /* tree is empty, and no current node exists -> problem is solved */
2797  scip->set->stage = SCIP_STAGE_SOLVED;
2798  }
2799  break;
2800 
2801  case SCIP_STAGE_SOLVED:
2802  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
2803  || scip->stat->status == SCIP_STATUS_INFEASIBLE
2804  || scip->stat->status == SCIP_STATUS_UNBOUNDED
2805  || scip->stat->status == SCIP_STATUS_INFORUNBD);
2806 
2807  break;
2808 
2809  default:
2810  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
2811  return SCIP_INVALIDCALL;
2812  } /*lint !e788*/
2813  }
2814  while( restart && !SCIPsolveIsStopped(scip->set, scip->stat, TRUE) );
2815 
2816  /* we have to store all unprocessed nodes if reoptimization is enabled */
2817  if( scip->set->reopt_enable && scip->set->stage != SCIP_STAGE_PRESOLVING
2818  && SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
2819  {
2820  /* save unprocessed nodes */
2821  if( SCIPgetNNodesLeft(scip) > 0 )
2822  {
2823  SCIP_NODE** leaves;
2824  SCIP_NODE** children;
2825  SCIP_NODE** siblings;
2826  int nleaves;
2827  int nchildren;
2828  int nsiblings;
2829 
2830  /* get all open leave nodes */
2831  SCIP_CALL( SCIPgetLeaves(scip, &leaves, &nleaves) );
2832 
2833  /* get all open children nodes */
2834  SCIP_CALL( SCIPgetChildren(scip, &children, &nchildren) );
2835 
2836  /* get all open sibling nodes */
2837  SCIP_CALL( SCIPgetSiblings(scip, &siblings, &nsiblings) );
2838 
2839  /* add all open node to the reoptimization tree */
2840  SCIP_CALL( SCIPreoptSaveOpenNodes(scip->reopt, scip->set, scip->lp, scip->mem->probmem, leaves, nleaves,
2841  children, nchildren, siblings, nsiblings) );
2842  }
2843  }
2844 
2845  /* release the CTRL-C interrupt */
2846  if( scip->set->misc_catchctrlc )
2848 
2849  if( scip->set->reopt_enable )
2850  {
2851  /* save found solutions */
2852  int nsols;
2853  int s;
2854 
2855  nsols = scip->set->reopt_savesols == -1 ? INT_MAX : MAX(scip->set->reopt_savesols, 1);
2856  nsols = MIN(scip->primal->nsols, nsols);
2857 
2858  for( s = 0; s < nsols; s++ )
2859  {
2860  SCIP_SOL* sol;
2861  SCIP_Bool added;
2862 
2863  sol = scip->primal->sols[s];
2864  assert(sol != NULL);
2865 
2866  if( !SCIPsolIsOriginal(sol) )
2867  {
2868  SCIP_Bool hasinfval;
2869 
2870  /* retransform solution into the original problem space */
2871  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
2872  }
2873 
2874  if( SCIPsolGetNodenum(sol) > 0 || SCIPsolGetHeur(sol) != NULL || (s == 0 && scip->set->reopt_sepabestsol) )
2875  {
2876  /* if the best solution should be separated, we must not store it in the solution tree */
2877  if( s == 0 && scip->set->reopt_sepabestsol )
2878  {
2879  SCIP_CALL( SCIPreoptAddOptSol(scip->reopt, sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal,
2880  scip->origprob->vars, scip->origprob->nvars) );
2881  }
2882  /* add solution to solution tree */
2883  else
2884  {
2885  SCIPdebugMsg(scip, "try to add solution to the solution tree:\n");
2886  SCIPdebug( SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, \
2887  scip->transprob, NULL, FALSE, FALSE) ); );
2888 
2889  SCIP_CALL( SCIPreoptAddSol(scip->reopt, scip->set, scip->stat, scip->origprimal, scip->mem->probmem,
2890  sol, s == 0, &added, scip->origprob->vars, scip->origprob->nvars, scip->stat->nreoptruns) );
2891  }
2892  }
2893  }
2894 
2895  SCIPdebugMsg(scip, "-> saved %d solution.\n", nsols);
2896 
2897  /* store variable history */
2898  if( scip->set->reopt_storevarhistory )
2899  {
2900  SCIP_CALL( SCIPreoptUpdateVarHistory(scip->reopt, scip->set, scip->stat, scip->mem->probmem,
2901  scip->origprob->vars, scip->origprob->nvars) );
2902  }
2903  }
2904 
2905  /* stop solving timer */
2906  SCIPclockStop(scip->stat->solvingtime, scip->set);
2907  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
2908 
2909  /* decrease time limit during reoptimization */
2910  if( scip->set->reopt_enable && scip->set->reopt_commontimelimit )
2911  {
2912  SCIP_Real timelimit;
2913  SCIP_Real usedtime;
2914 
2915  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
2916  usedtime = SCIPgetSolvingTime(scip);
2917  timelimit = timelimit - usedtime;
2918  timelimit = MAX(0, timelimit);
2919 
2920  SCIP_CALL( SCIPsetRealParam(scip, "limits/time", timelimit) );
2921  }
2922 
2923  if( !statsprinted )
2924  {
2925  /* display most relevant statistics */
2927  }
2928 
2929  return SCIP_OKAY;
2930 }
2931 
2932 /** transforms, presolves, and solves problem using the configured concurrent solvers
2933  *
2934  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2935  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2936  *
2937  * @pre This method can be called if @p scip is in one of the following stages:
2938  * - \ref SCIP_STAGE_PROBLEM
2939  * - \ref SCIP_STAGE_TRANSFORMED
2940  * - \ref SCIP_STAGE_PRESOLVING
2941  * - \ref SCIP_STAGE_PRESOLVED
2942  * - \ref SCIP_STAGE_SOLVING
2943  * - \ref SCIP_STAGE_SOLVED
2944  *
2945  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
2946  * process was interrupted:
2947  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
2948  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
2949  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
2950  *
2951  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2952  *
2953  * @deprecated Please use SCIPsolveConcurrent() instead.
2954  */
2956  SCIP* scip /**< SCIP data structure */
2957  )
2958 {
2959  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveParallel", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2960 
2961  return SCIPsolveConcurrent(scip);
2962 }
2963 
2964 /** transforms, presolves, and solves problem using the configured concurrent solvers
2965  *
2966  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2967  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2968  *
2969  * @pre This method can be called if @p scip is in one of the following stages:
2970  * - \ref SCIP_STAGE_PROBLEM
2971  * - \ref SCIP_STAGE_TRANSFORMED
2972  * - \ref SCIP_STAGE_PRESOLVING
2973  * - \ref SCIP_STAGE_PRESOLVED
2974  * - \ref SCIP_STAGE_SOLVING
2975  * - \ref SCIP_STAGE_SOLVED
2976  *
2977  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
2978  * process was interrupted:
2979  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
2980  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
2981  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
2982  *
2983  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2984  */
2986  SCIP* scip /**< SCIP data structure */
2987  )
2988 {
2989 #ifdef TPI_NONE
2990  SCIPinfoMessage(scip, NULL, "SCIP was compiled without task processing interface. Parallel solve not possible\n");
2991  return SCIP_OKAY;
2992 #else
2993  SCIP_RETCODE retcode;
2994  int i;
2995  SCIP_RANDNUMGEN* rndgen;
2996  int minnthreads;
2997  int maxnthreads;
2998 
2999  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveConcurrent", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3000 
3001  SCIP_CALL( SCIPsetIntParam(scip, "timing/clocktype", SCIP_CLOCKTYPE_WALL) );
3002 
3003  minnthreads = scip->set->parallel_minnthreads;
3004  maxnthreads = scip->set->parallel_maxnthreads;
3005 
3006  if( minnthreads > maxnthreads )
3007  {
3008  SCIPerrorMessage("minimum number of threads greater than maximum number of threads\n");
3009  return SCIP_INVALIDDATA;
3010  }
3011  if( scip->concurrent == NULL )
3012  {
3013  int nconcsolvertypes;
3014  SCIP_CONCSOLVERTYPE** concsolvertypes;
3015  SCIP_Longint nthreads;
3016  SCIP_Real memorylimit;
3017  int* solvertypes;
3018  SCIP_Longint* weights;
3019  SCIP_Real* prios;
3020  int ncandsolvertypes;
3021  SCIP_Real prefpriosum;
3022 
3023  /* check if concurrent solve is configured to presolve the problem
3024  * before setting up the concurrent solvers
3025  */
3026  if( scip->set->concurrent_presolvebefore )
3027  {
3028  /* if yes, then presolve the problem */
3029  SCIP_CALL( SCIPpresolve(scip) );
3030  if( SCIPgetStatus(scip) >= SCIP_STATUS_OPTIMAL )
3031  return SCIP_OKAY;
3032  }
3033  else
3034  {
3035  SCIP_Bool infeas;
3036 
3037  /* if not, transform the problem and switch stage to presolved */
3038  SCIP_CALL( SCIPtransformProb(scip) );
3039  SCIP_CALL( initPresolve(scip) );
3040  SCIP_CALL( exitPresolve(scip, TRUE, &infeas) );
3041  assert(!infeas);
3042  }
3043 
3044  /* the presolving must have run into a limit, so we stop here */
3045  if( scip->set->stage < SCIP_STAGE_PRESOLVED )
3046  {
3048  return SCIP_OKAY;
3049  }
3050 
3051  nthreads = INT_MAX;
3052  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
3053  memorylimit = scip->set->limit_memory;
3054  if( memorylimit < SCIP_MEM_NOLIMIT )
3055  {
3056  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
3057  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
3058  /* estimate maximum number of copies that be created based on memory limit */
3059  if( !scip->set->misc_avoidmemout )
3060  {
3061  nthreads = MAX(1, memorylimit / (4.0*SCIPgetMemExternEstim(scip)/1048576.0));
3062  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "estimated a maximum of %lli threads based on memory limit\n", nthreads);
3063  }
3064  else
3065  {
3066  nthreads = minnthreads;
3067  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "ignoring memory limit; all threads can be created\n");
3068  }
3069  }
3070  nconcsolvertypes = SCIPgetNConcsolverTypes(scip);
3071  concsolvertypes = SCIPgetConcsolverTypes(scip);
3072 
3073  if( minnthreads > nthreads )
3074  {
3075  SCIP_CALL( initSolve(scip, TRUE) );
3076  scip->stat->status = SCIP_STATUS_MEMLIMIT;
3078  SCIPwarningMessage(scip, "requested minimum number of threads could not be satisfied with given memory limit\n");
3080  return SCIP_OKAY;
3081  }
3082 
3083  if( nthreads == 1 )
3084  {
3085  SCIPwarningMessage(scip, "can only use 1 thread, doing sequential solve instead\n");
3086  SCIP_CALL( SCIPfreeConcurrent(scip) );
3087  return SCIPsolve(scip);
3088  }
3089  nthreads = MIN(nthreads, maxnthreads);
3090  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "using %lli threads for concurrent solve\n", nthreads);
3091 
3092  /* now set up nthreads many concurrent solvers that will be used for the concurrent solve
3093  * using the preferred priorities of each concurrent solver
3094  */
3095  prefpriosum = 0.0;
3096  for( i = 0; i < nconcsolvertypes; ++i )
3097  prefpriosum += SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]);
3098 
3099  ncandsolvertypes = 0;
3100  SCIP_CALL( SCIPallocBufferArray(scip, &solvertypes, nthreads + nconcsolvertypes) );
3101  SCIP_CALL( SCIPallocBufferArray(scip, &weights, nthreads + nconcsolvertypes) );
3102  SCIP_CALL( SCIPallocBufferArray(scip, &prios, nthreads + nconcsolvertypes) );
3103  for( i = 0; i < nconcsolvertypes; ++i )
3104  {
3105  int j;
3106  SCIP_Real prio;
3107  prio = nthreads * SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]) / prefpriosum;
3108  while( prio > 0.0 )
3109  {
3110  j = ncandsolvertypes++;
3111  assert(j < 2*nthreads);
3112  weights[j] = 1;
3113  solvertypes[j] = i;
3114  prios[j] = MIN(1.0, prio);
3115  prio = prio - 1.0;
3116  }
3117  }
3118  /* select nthreads many concurrent solver types to create instances
3119  * according to the preferred prioriteis the user has set
3120  * This basically corresponds to a knapsack problem
3121  * with unit weights and capacity nthreads, where the profits are
3122  * the unrounded fraction of the total number of threads to be used.
3123  */
3124  SCIPselectDownRealInt(prios, solvertypes, nthreads, ncandsolvertypes);
3125 
3126  SCIP_CALL( SCIPcreateRandom(scip, &rndgen, (unsigned) scip->set->concurrent_initseed, TRUE) );
3127  for( i = 0; i < nthreads; ++i )
3128  {
3129  SCIP_CONCSOLVER* concsolver;
3130 
3131  SCIP_CALL( SCIPconcsolverCreateInstance(scip->set, concsolvertypes[solvertypes[i]], &concsolver) );
3132  if( scip->set->concurrent_changeseeds && SCIPgetNConcurrentSolvers(scip) > 1 )
3133  SCIP_CALL( SCIPconcsolverInitSeeds(concsolver, SCIPrandomGetInt(rndgen, 0, INT_MAX)) );
3134  }
3135  SCIPfreeRandom(scip, &rndgen);
3136  SCIPfreeBufferArray(scip, &prios);
3137  SCIPfreeBufferArray(scip, &weights);
3138  SCIPfreeBufferArray(scip, &solvertypes);
3139 
3140  assert(SCIPgetNConcurrentSolvers(scip) == nthreads);
3141 
3142  SCIP_CALL( SCIPsyncstoreInit(scip) );
3143  }
3144 
3145  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVED )
3146  {
3147  /* switch stage to solving */
3148  SCIP_CALL( initSolve(scip, TRUE) );
3149  }
3150 
3151  SCIPclockStart(scip->stat->solvingtime, scip->set);
3152  retcode = SCIPconcurrentSolve(scip);
3153  SCIPclockStop(scip->stat->solvingtime, scip->set);
3155 
3156  return retcode;
3157 #endif
3158 }
3159 
3160 /** include specific heuristics and branching rules for reoptimization
3161  *
3162  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3163  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3164  *
3165  * @pre This method can be called if @p scip is in one of the following stages:
3166  * - \ref SCIP_STAGE_PROBLEM
3167  */
3169  SCIP* scip, /**< SCIP data structure */
3170  SCIP_Bool enable /**< enable reoptimization (TRUE) or disable it (FALSE) */
3171  )
3172 {
3173  assert(scip != NULL);
3174 
3175  /* we want to skip if nothing has changed */
3176  if( (enable && scip->set->reopt_enable && scip->reopt != NULL)
3177  || (!enable && !scip->set->reopt_enable && scip->reopt == NULL) )
3178  return SCIP_OKAY;
3179 
3180  /* check stage and throw an error if we try to disable reoptimization during the solving process.
3181  *
3182  * @note the case that we will disable the reoptimization and have already performed presolving can only happen if
3183  * we are try to solve a general MIP
3184  *
3185  * @note this fix is only for the bugfix release 3.2.1, in the next major release reoptimization can be used for
3186  * general MIPs, too.
3187  */
3188  if( scip->set->stage > SCIP_STAGE_PROBLEM && !(!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
3189  {
3190  SCIPerrorMessage("Reoptimization cannot be %s after starting the (pre)solving process.\n", enable ? "enabled" : "disabled");
3191  return SCIP_INVALIDCALL;
3192  }
3193 
3194  /* if the current stage is SCIP_STAGE_PROBLEM we have to include the heuristics and branching rule */
3195  if( scip->set->stage == SCIP_STAGE_PROBLEM || (!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
3196  {
3197  /* initialize all reoptimization data structures */
3198  if( enable && scip->reopt == NULL )
3199  {
3200  /* set enable flag */
3201  scip->set->reopt_enable = enable;
3202 
3203  SCIP_CALL( SCIPreoptCreate(&scip->reopt, scip->set, scip->mem->probmem) );
3205  }
3206  /* disable all reoptimization plugins and free the structure if necessary */
3207  else if( (!enable && scip->reopt != NULL) || (!enable && scip->set->reopt_enable && scip->reopt == NULL) )
3208  {
3209  /* set enable flag */
3210  scip->set->reopt_enable = enable;
3211 
3212  if( scip->reopt != NULL )
3213  {
3214  SCIP_CALL( SCIPreoptFree(&(scip->reopt), scip->set, scip->origprimal, scip->mem->probmem) );
3215  assert(scip->reopt == NULL);
3216  }
3218  }
3219  }
3220  else
3221  {
3222  /* set enable flag */
3223  scip->set->reopt_enable = enable;
3224  }
3225 
3226  return SCIP_OKAY;
3227 }
3228 
3229 /** save bound change based on dual information in the reoptimization tree
3230  *
3231  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3232  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3233  *
3234  * @pre This method can be called if @p scip is in one of the following stages:
3235  * - \ref SCIP_STAGE_SOLVING
3236  * - \ref SCIP_STAGE_SOLVED
3237  */
3239  SCIP* scip, /**< SCIP data structure */
3240  SCIP_NODE* node, /**< node of the search tree */
3241  SCIP_VAR* var, /**< variable whose bound changed */
3242  SCIP_Real newbound, /**< new bound of the variable */
3243  SCIP_Real oldbound /**< old bound of the variable */
3244  )
3245 {
3246  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddReoptDualBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3247 
3248  assert(SCIPsetIsFeasLT(scip->set, newbound, oldbound) || SCIPsetIsFeasGT(scip->set, newbound, oldbound));
3249 
3250  SCIP_CALL( SCIPreoptAddDualBndchg(scip->reopt, scip->set, scip->mem->probmem, node, var, newbound, oldbound) );
3251 
3252  return SCIP_OKAY;
3253 }
3254 
3255 /** returns the optimal solution of the last iteration or NULL of none exists */
3257  SCIP* scip /**< SCIP data structure */
3258  )
3259 {
3260  SCIP_SOL* sol;
3261 
3262  assert(scip != NULL);
3263 
3264  sol = NULL;
3265 
3266  if( scip->set->reopt_enable && scip->stat->nreoptruns > 1 )
3267  {
3268  sol = SCIPreoptGetLastBestSol(scip->reopt);
3269  }
3270 
3271  return sol;
3272 }
3273 
3274 /** returns the objective coefficent of a given variable in a previous iteration
3275  *
3276  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3277  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3278  *
3279  * @pre This method can be called if @p scip is in one of the following stages:
3280  * - \ref SCIP_STAGE_PRESOLVING
3281  * - \ref SCIP_STAGE_SOLVING
3282  */
3284  SCIP* scip, /**< SCIP data structure */
3285  SCIP_VAR* var, /**< variable */
3286  int run, /**< number of the run */
3287  SCIP_Real* objcoef /**< pointer to store the objective coefficient */
3288  )
3289 {
3290  assert(scip != NULL);
3291  assert(var != NULL);
3292  assert(0 < run && run <= scip->stat->nreoptruns);
3293 
3294  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetReoptOldObjCoef", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3295 
3296  if( SCIPvarIsOriginal(var) )
3297  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(var));
3298  else
3299  {
3300  SCIP_VAR* origvar;
3301  SCIP_Real constant;
3302  SCIP_Real scalar;
3303 
3304  assert(SCIPvarIsActive(var));
3305 
3306  origvar = var;
3307  constant = 0.0;
3308  scalar = 1.0;
3309 
3310  SCIP_CALL( SCIPvarGetOrigvarSum(&origvar, &scalar, &constant) );
3311  assert(origvar != NULL);
3312  assert(SCIPvarIsOriginal(origvar));
3313 
3314  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(origvar));
3315  }
3316  return SCIP_OKAY;
3317 }
3318 
3319 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
3320  * preserved
3321  *
3322  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3323  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3324  *
3325  * @pre This method can be called if @p scip is in one of the following stages:
3326  * - \ref SCIP_STAGE_INIT
3327  * - \ref SCIP_STAGE_PROBLEM
3328  * - \ref SCIP_STAGE_TRANSFORMED
3329  * - \ref SCIP_STAGE_PRESOLVING
3330  * - \ref SCIP_STAGE_PRESOLVED
3331  * - \ref SCIP_STAGE_SOLVING
3332  * - \ref SCIP_STAGE_SOLVED
3333  *
3334  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT or \ref SCIP_STAGE_PROBLEM, the stage of
3335  * \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_TRANSFORMED
3336  *
3337  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3338  */
3340  SCIP* scip, /**< SCIP data structure */
3341  SCIP_Bool restart /**< should certain data be preserved for improved restarting? */
3342  )
3343 {
3344  SCIP_CALL( SCIPcheckStage(scip, "SCIPfreeSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3345 
3346  switch( scip->set->stage )
3347  {
3348  case SCIP_STAGE_INIT:
3350  case SCIP_STAGE_PROBLEM:
3351  return SCIP_OKAY;
3352 
3353  case SCIP_STAGE_PRESOLVING:
3354  {
3355  SCIP_Bool infeasible;
3356 
3357  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
3358  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
3359  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
3360  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
3361 
3362  /* exit presolving */
3363  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
3364  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
3365  }
3366 
3367  /*lint -fallthrough*/
3368  case SCIP_STAGE_PRESOLVED:
3369  /* switch stage to TRANSFORMED */
3370  scip->set->stage = SCIP_STAGE_TRANSFORMED;
3371  return SCIP_OKAY;
3372 
3373  case SCIP_STAGE_SOLVING:
3374  case SCIP_STAGE_SOLVED:
3375  /* free solution process data structures */
3376  SCIP_CALL( freeSolve(scip, restart) );
3377  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
3378  return SCIP_OKAY;
3379 
3380  default:
3381  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
3382  return SCIP_INVALIDCALL;
3383  } /*lint !e788*/
3384 }
3385 
3386 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
3387  * preserved
3388  *
3389  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3390  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3391  *
3392  * @pre This method can be called if @p scip is in one of the following stages:
3393  * - \ref SCIP_STAGE_INIT
3394  * - \ref SCIP_STAGE_PROBLEM
3395  * - \ref SCIP_STAGE_TRANSFORMED
3396  * - \ref SCIP_STAGE_PRESOLVING
3397  * - \ref SCIP_STAGE_PRESOLVED
3398  * - \ref SCIP_STAGE_SOLVING
3399  * - \ref SCIP_STAGE_SOLVED
3400  *
3401  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT, \ref SCIP_STAGE_TRANSFORMED or \ref SCIP_STAGE_PROBLEM,
3402  * the stage of \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_PRESOLVED.
3403  *
3404  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3405  */
3407  SCIP* scip /**< SCIP data structure */
3408  )
3409 {
3410  SCIP_CALL( SCIPcheckStage(scip, "SCIPfreeReoptSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3411 
3412  switch( scip->set->stage )
3413  {
3414  case SCIP_STAGE_INIT:
3416  case SCIP_STAGE_PRESOLVED:
3417  case SCIP_STAGE_PROBLEM:
3418  return SCIP_OKAY;
3419 
3420  case SCIP_STAGE_PRESOLVING:
3421  {
3422  SCIP_Bool infeasible;
3423 
3424  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
3425  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
3426  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
3427  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
3428 
3429  /* exit presolving */
3430  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
3431  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
3432 
3433  return SCIP_OKAY;
3434  }
3435 
3436  case SCIP_STAGE_SOLVING:
3437  case SCIP_STAGE_SOLVED:
3438  /* free solution process data structures */
3439  SCIP_CALL( freeReoptSolve(scip) );
3440  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
3441  return SCIP_OKAY;
3442 
3443  default:
3444  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
3445  return SCIP_INVALIDCALL;
3446  } /*lint !e788*/
3447 }
3448 
3449 /** frees all solution process data including presolving and transformed problem, only original problem is kept
3450  *
3451  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3452  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3453  *
3454  * @pre This method can be called if @p scip is in one of the following stages:
3455  * - \ref SCIP_STAGE_INIT
3456  * - \ref SCIP_STAGE_PROBLEM
3457  * - \ref SCIP_STAGE_TRANSFORMED
3458  * - \ref SCIP_STAGE_PRESOLVING
3459  * - \ref SCIP_STAGE_PRESOLVED
3460  * - \ref SCIP_STAGE_SOLVING
3461  * - \ref SCIP_STAGE_SOLVED
3462  *
3463  * @post After calling this method \SCIP reaches one of the following stages:
3464  * - \ref SCIP_STAGE_INIT if the method was called from \SCIP stage \ref SCIP_STAGE_INIT
3465  * - \ref SCIP_STAGE_PROBLEM if the method was called from any other of the allowed stages
3466  *
3467  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3468  */
3470  SCIP* scip /**< SCIP data structure */
3471  )
3472 {
3473  SCIP_CALL( SCIPcheckStage(scip, "SCIPfreeTransform", TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3474 
3475  /* release variables and constraints captured by reoptimization */
3476  if( scip->reopt != NULL )
3477  {
3478  SCIP_CALL( SCIPreoptReleaseData(scip->reopt, scip->set, scip->mem->probmem) );
3479  }
3480 
3481  switch( scip->set->stage )
3482  {
3483  case SCIP_STAGE_INIT:
3484  case SCIP_STAGE_PROBLEM:
3485  return SCIP_OKAY;
3486 
3487  case SCIP_STAGE_PRESOLVING:
3488  {
3489  SCIP_Bool infeasible;
3490 
3491  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
3492  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
3493  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
3494  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
3495 
3496  /* exit presolving */
3497  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
3498  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
3499  }
3500 
3501  /*lint -fallthrough*/
3502  case SCIP_STAGE_PRESOLVED:
3503  case SCIP_STAGE_SOLVING:
3504  case SCIP_STAGE_SOLVED:
3505  /* the solve was already freed, we directly go to freeTransform() */
3506  if( !scip->set->reopt_enable || scip->set->stage != SCIP_STAGE_PRESOLVED )
3507  {
3508  /* free solution process data */
3509  SCIP_CALL( SCIPfreeSolve(scip, FALSE) );
3510  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
3511  }
3512  /*lint -fallthrough*/
3513 
3515  /* free transformed problem data structures */
3516  SCIP_CALL( freeTransform(scip) );
3517  assert(scip->set->stage == SCIP_STAGE_PROBLEM);
3518  return SCIP_OKAY;
3519 
3521  assert(scip->set->stage == SCIP_STAGE_TRANSFORMING);
3522  SCIP_CALL( freeTransforming(scip) );
3523  assert(scip->set->stage == SCIP_STAGE_PROBLEM);
3524  return SCIP_OKAY;
3525 
3526  default:
3527  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
3528  return SCIP_INVALIDCALL;
3529  } /*lint !e788*/
3530 }
3531 
3532 /** informs \SCIP that the solving process should be interrupted as soon as possible (e.g., after the current node has
3533  * been solved)
3534  *
3535  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3536  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3537  *
3538  * @pre This method can be called if @p scip is in one of the following stages:
3539  * - \ref SCIP_STAGE_PROBLEM
3540  * - \ref SCIP_STAGE_TRANSFORMING
3541  * - \ref SCIP_STAGE_TRANSFORMED
3542  * - \ref SCIP_STAGE_INITPRESOLVE
3543  * - \ref SCIP_STAGE_PRESOLVING
3544  * - \ref SCIP_STAGE_EXITPRESOLVE
3545  * - \ref SCIP_STAGE_PRESOLVED
3546  * - \ref SCIP_STAGE_SOLVING
3547  * - \ref SCIP_STAGE_SOLVED
3548  * - \ref SCIP_STAGE_EXITSOLVE
3549  * - \ref SCIP_STAGE_FREETRANS
3550  *
3551  * @note the \SCIP stage does not get changed
3552  */
3554  SCIP* scip /**< SCIP data structure */
3555  )
3556 {
3557  SCIP_CALL( SCIPcheckStage(scip, "SCIPinterruptSolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE) );
3558 
3559  /* set the userinterrupt flag */
3560  scip->stat->userinterrupt = TRUE;
3561 
3562  return SCIP_OKAY;
3563 }
3564 
3565 /** indicates whether \SCIP has been informed that the solving process should be interrupted as soon as possible
3566  *
3567  * This function returns whether SCIPinterruptSolve() has been called, which is different from SCIPinterrupted(),
3568  * which returns whether a SIGINT signal has been received by the SCIP signal handler.
3569  *
3570  * @pre This method can be called if @p scip is in one of the following stages:
3571  * - \ref SCIP_STAGE_PROBLEM
3572  * - \ref SCIP_STAGE_TRANSFORMING
3573  * - \ref SCIP_STAGE_TRANSFORMED
3574  * - \ref SCIP_STAGE_INITPRESOLVE
3575  * - \ref SCIP_STAGE_PRESOLVING
3576  * - \ref SCIP_STAGE_EXITPRESOLVE
3577  * - \ref SCIP_STAGE_PRESOLVED
3578  * - \ref SCIP_STAGE_SOLVING
3579  * - \ref SCIP_STAGE_SOLVED
3580  * - \ref SCIP_STAGE_EXITSOLVE
3581  * - \ref SCIP_STAGE_FREETRANS
3582  *
3583  * @note the \SCIP stage does not get changed
3584  */
3586  SCIP* scip /**< SCIP data structure */
3587  )
3588 {
3589  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisSolveInterrupted", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE) );
3590 
3591  return scip->stat->userinterrupt;
3592 }
3593 
3594 /** informs SCIP that the solving process should be restarted as soon as possible (e.g., after the current node has
3595  * been solved)
3596  *
3597  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3598  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3599  *
3600  * @pre This method can be called if @p scip is in one of the following stages:
3601  * - \ref SCIP_STAGE_INITPRESOLVE
3602  * - \ref SCIP_STAGE_PRESOLVING
3603  * - \ref SCIP_STAGE_EXITPRESOLVE
3604  * - \ref SCIP_STAGE_SOLVING
3605  *
3606  * @note the \SCIP stage does not get changed
3607  */
3609  SCIP* scip /**< SCIP data structure */
3610  )
3611 {
3612  SCIP_CALL( SCIPcheckStage(scip, "SCIPrestartSolve", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3613 
3614  /* set the userrestart flag */
3615  scip->stat->userrestart = TRUE;
3616 
3617  return SCIP_OKAY;
3618 }
3619 
3620 /** returns whether reoptimization is enabled or not */
3622  SCIP* scip /**< SCIP data structure */
3623  )
3624 {
3625  assert(scip != NULL);
3626 
3627  return scip->set->reopt_enable;
3628 }
3629 
3630 /** returns the stored solutions corresponding to a given run */
3632  SCIP* scip, /**< SCIP data structure */
3633  int run, /**< number of the run */
3634  SCIP_SOL** sols, /**< array to store solutions */
3635  int solssize, /**< size of the array */
3636  int* nsols /**< pointer to store number of solutions */
3637  )
3638 {
3639  assert(scip != NULL);
3640  assert(sols != NULL);
3641  assert(solssize > 0);
3642 
3643  if( scip->set->reopt_enable )
3644  {
3645  assert(run > 0 && run <= scip->stat->nreoptruns);
3646  SCIP_CALL( SCIPreoptGetSolsRun(scip->reopt, run, sols, solssize, nsols) );
3647  }
3648  else
3649  {
3650  *nsols = 0;
3651  }
3652 
3653  return SCIP_OKAY;
3654 }
3655 
3656 /** mark all stored solutions as not updated */
3658  SCIP* scip /**< SCIP data structure */
3659  )
3660 {
3661  assert(scip != NULL);
3662  assert(scip->set->reopt_enable);
3663  assert(scip->reopt != NULL);
3664 
3665  if( scip->set->reopt_enable )
3666  {
3667  assert(scip->reopt != NULL);
3669  }
3670 }
3671 
3672 /** check if the reoptimization process should be restarted
3673  *
3674  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3675  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3676  *
3677  * @pre This method can be called if @p scip is in one of the following stages:
3678  * - \ref SCIP_STAGE_TRANSFORMED
3679  * - \ref SCIP_STAGE_SOLVING
3680  */
3682  SCIP* scip, /**< SCIP data structure */
3683  SCIP_NODE* node, /**< current node of the branch and bound tree (or NULL) */
3684  SCIP_Bool* restart /**< pointer to store of the reoptimitation process should be restarted */
3685  )
3686 {
3687  assert(scip != NULL);
3688  assert(scip->set->reopt_enable);
3689  assert(scip->reopt != NULL);
3690 
3691  SCIP_CALL( SCIPcheckStage(scip, "SCIPcheckReoptRestart", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3692 
3693  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, node, scip->transprob->vars,
3694  scip->transprob->nvars, restart) );
3695 
3696  return SCIP_OKAY;
3697 }
3698 
3699 /** returns whether we are in the restarting phase
3700  *
3701  * @return TRUE, if we are in the restarting phase; FALSE, otherwise
3702  *
3703  * @pre This method can be called if @p scip is in one of the following stages:
3704  * - \ref SCIP_STAGE_INITPRESOLVE
3705  * - \ref SCIP_STAGE_PRESOLVING
3706  * - \ref SCIP_STAGE_EXITPRESOLVE
3707  * - \ref SCIP_STAGE_PRESOLVED
3708  * - \ref SCIP_STAGE_INITSOLVE
3709  * - \ref SCIP_STAGE_SOLVING
3710  * - \ref SCIP_STAGE_SOLVED
3711  * - \ref SCIP_STAGE_EXITSOLVE
3712  * - \ref SCIP_STAGE_FREETRANS
3713  */
3715  SCIP* scip /**< SCIP data structure */
3716  )
3717 {
3718  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisInRestart", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
3719 
3720  /* return the restart status */
3721  return scip->stat->inrestart;
3722 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
SCIP_Real cutoffbound
Definition: struct_primal.h:55
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2530
SCIP_RETCODE SCIPsetInitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:5508
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
SCIP_RETCODE SCIPprobCheckObjIntegral(SCIP_PROB *transprob, SCIP_PROB *origprob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue)
Definition: prob.c:1487
SCIP_RETCODE SCIPsetExitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_Bool restart)
Definition: set.c:5693
SCIP_STAT * stat
Definition: struct_scip.h:79
SCIP_RETCODE SCIPenableReoptimization(SCIP *scip, SCIP_Bool enable)
Definition: scip_solve.c:3168
SCIP_RETCODE SCIPeventfilterCreate(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem)
Definition: event.c:1821
int SCIPgetNIntVars(SCIP *scip)
Definition: scip_prob.c:2090
static SCIP_RETCODE prepareReoptimization(SCIP *scip)
Definition: scip_solve.c:2350
static SCIP_RETCODE compressReoptTree(SCIP *scip)
Definition: scip_solve.c:2291
SCIP_RETCODE SCIPreoptReleaseData(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:5124
SCIP_RETCODE SCIPtreeCreatePresolvingRoot(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_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable)
Definition: tree.c:5006
void SCIPlpInvalidateRootObjval(SCIP_LP *lp)
Definition: lp.c:13194
SCIP_RETCODE SCIPreoptApplyGlbConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
Definition: reopt.c:7608
SCIP_Bool SCIPsolveIsStopped(SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool checknodelimits)
Definition: solve.c:102
void SCIPcutpoolAddNCalls(SCIP_CUTPOOL *cutpool, SCIP_Longint ncalls)
Definition: cutpool.c:1180
int npresoladdconss
Definition: struct_stat.h:252
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6215
SCIP_RETCODE SCIPprimalClear(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
Definition: primal.c:203
SCIP_RETCODE SCIPreoptAddDualBndchg(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newval, SCIP_Real oldval)
Definition: reopt.c:6257
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:378
int npresolroundsfast
Definition: struct_stat.h:243
internal methods for managing events
SCIP_Real SCIPfeastol(SCIP *scip)
void SCIPinterruptCapture(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:114
internal methods for storing primal CIP solutions
SCIP_Bool misc_estimexternmem
Definition: struct_set.h:400
SCIP_STATUS status
Definition: struct_stat.h:186
SCIP_Bool compr_enable
Definition: struct_set.h:601
public methods for SCIP parameter handling
int sepa_cutagelimit
Definition: struct_set.h:566
int random_permutationseed
Definition: struct_set.h:420
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip_general.c:365
SCIP_Longint externmemestim
Definition: struct_stat.h:125
internal methods for branch and bound tree
SCIP_CONFLICT * conflict
Definition: struct_scip.h:96
SCIP_RETCODE SCIPcheckReoptRestart(SCIP *scip, SCIP_NODE *node, SCIP_Bool *restart)
Definition: scip_solve.c:3681
int SCIPdecompstoreGetNOrigDecomps(SCIP_DECOMPSTORE *decompstore)
Definition: dcmp.c:639
SCIP_RETCODE SCIPclearRelaxSolVals(SCIP *scip, SCIP_RELAX *relax)
Definition: scip_var.c:2364
int SCIPgetNConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:116
SCIP_Bool misc_finitesolstore
Definition: struct_set.h:406
public methods for memory management
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip_cons.c:886
SCIP_RETCODE SCIPgetReoptSolsRun(SCIP *scip, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: scip_solve.c:3631
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Real SCIPvarGetWorstBoundGlobal(SCIP_VAR *var)
Definition: var.c:17966
SCIP_Longint SCIPcutpoolGetNCutsFound(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1135
methods for implications, variable bounds, and cliques
SCIP_Longint SCIPbranchruleGetNChildren(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2163
int presol_maxrounds
Definition: struct_set.h:451
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip_param.c:307
#define SCIP_MAXSTRLEN
Definition: def.h:302
SCIP_RETCODE SCIPconflictstoreClean(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt)
SCIP_RETCODE SCIPgetLeaves(SCIP *scip, SCIP_NODE ***leaves, int *nleaves)
Definition: scip_tree.c:248
int concurrent_initseed
Definition: struct_set.h:580
SCIP_RETCODE SCIPeventChgType(SCIP_EVENT *event, SCIP_EVENTTYPE eventtype)
Definition: event.c:1040
SCIP_Real SCIPconcsolverTypeGetPrefPrio(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:200
SCIP_PRIMAL * origprimal
Definition: struct_scip.h:81
internal methods for clocks and timing issues
SCIP_Longint ntotalnodes
Definition: struct_stat.h:87
int npresolaggrvars
Definition: struct_stat.h:247
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
Definition: var.c:17703
SCIP_RETCODE SCIPpropPresol(SCIP_PROP *prop, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: prop.c:519
static SCIP_RETCODE calcNonZeros(SCIP *scip, SCIP_Longint *nchecknonzeros, SCIP_Longint *nactivenonzeros, SCIP_Bool *approxchecknonzeros, SCIP_Bool *approxactivenonzeros)
Definition: scip_solve.c:263
SCIP_Bool concurrent_changeseeds
Definition: struct_set.h:576
int nprops
Definition: struct_set.h:132
SCIP_RETCODE SCIPprobScaleObj(SCIP_PROB *transprob, SCIP_PROB *origprob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue)
Definition: prob.c:1605
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:89
public solving methods
SCIP_RETCODE SCIPtreeCreate(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: tree.c:4769
int nintvars
Definition: struct_prob.h:72
int npresolfixedvars
Definition: struct_stat.h:246
public methods for timing
SCIP_RETCODE SCIPbranchcandCreate(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:143
SCIP_PRIMAL * primal
Definition: struct_scip.h:94
SCIP_CUTPOOL * delayedcutpool
Definition: struct_scip.h:106
SCIP_RETCODE SCIPreoptAddSol(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_SOL *sol, SCIP_Bool bestsol, SCIP_Bool *added, SCIP_VAR **vars, int nvars, int run)
Definition: reopt.c:5301
SCIP_RETCODE SCIPreoptAddOptSol(SCIP_REOPT *reopt, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, SCIP_VAR **vars, int nvars)
Definition: reopt.c:5354
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:6080
SCIP_CONCURRENT * concurrent
Definition: struct_scip.h:110
SCIP_RETCODE SCIPprimalAddOrigSol(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: primal.c:1319
int nreoptruns
Definition: struct_stat.h:274
SCIP_SOL ** sols
Definition: struct_primal.h:57
int npresoldelconss
Definition: struct_stat.h:251
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:90
int lastnpresolchgvartypes
Definition: struct_stat.h:258
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:360
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4554
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip_sol.c:2263
#define FALSE
Definition: def.h:96
void SCIPselectDownRealInt(SCIP_Real *realarray, int *intarray, int k, int len)
SCIP_RETCODE SCIPeventProcess(SCIP_EVENT *event, SCIP_SET *set, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter)
Definition: event.c:1574
datastructures for managing events
SCIP_NODESEL * SCIPsetGetNodesel(SCIP_SET *set, SCIP_STAT *stat)
Definition: set.c:4853
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
Definition: misc.c:11096
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:290
int limit_maxorigsol
Definition: struct_set.h:319
SCIP_RETCODE SCIPtransformDecompstore(SCIP *scip)
Definition: dcmp.c:648
int parallel_maxnthreads
Definition: struct_set.h:573
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10788
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6327
SCIP_STAGE stage
Definition: struct_set.h:74
#define TRUE
Definition: def.h:95
#define SCIPdebug(x)
Definition: pub_message.h:93
void SCIPprobMarkNConss(SCIP_PROB *prob)
Definition: prob.c:1414
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPnlpCreate(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, int nvars_estimate)
Definition: nlp.c:3451
SCIP_RETCODE SCIPcliquetableCreate(SCIP_CLIQUETABLE **cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: implics.c:1786
#define SCIP_PRESOLTIMING_EXHAUSTIVE
Definition: type_timing.h:54
SCIP_Longint SCIPcutpoolGetNCalls(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1115
#define SCIP_MEM_NOLIMIT
Definition: def.h:324
SCIP_Real SCIPprobInternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:2138
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip_branch.c:297
internal methods for branching rules and branching candidate storage
SCIP_RETCODE SCIPpricestoreCreate(SCIP_PRICESTORE **pricestore)
Definition: pricestore.c:107
SCIP_RETCODE SCIPcliquetableCleanup(SCIP_CLIQUETABLE *cliquetable, 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, int *nchgbds, SCIP_Bool *infeasible)
Definition: implics.c:2917
SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
Definition: reopt.c:5151
SCIP_Real SCIPsetCutoffbounddelta(SCIP_SET *set)
Definition: set.c:6180
datastructures for concurrent solvers
void SCIPreoptResetSolMarks(SCIP_REOPT *reopt)
Definition: reopt.c:5760
SCIP_Longint SCIPcutpoolGetNCutsAdded(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1145
SCIP_RETCODE SCIPprobInitSolve(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1871
SCIP_NODE * SCIPtreeGetFocusNode(SCIP_TREE *tree)
Definition: tree.c:8304
int SCIPgetNNodesLeft(SCIP *scip)
Definition: scip_tree.c:644
public methods for problem variables
SCIP_RETCODE SCIPeventqueueFree(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2200
SCIP_Longint nsolsfound
Definition: struct_primal.h:48
int nheurs
Definition: struct_set.h:134
SCIP_Real SCIPreoptGetOldObjCoef(SCIP_REOPT *reopt, int run, int idx)
Definition: reopt.c:5698
SCIP_RETCODE SCIPcliquetableFree(SCIP_CLIQUETABLE **cliquetable, BMS_BLKMEM *blkmem)
Definition: implics.c:1822
SCIP_RETCODE SCIPconflictFree(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem)
Definition: conflict.c:4008
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
Definition: misc.c:10019
public methods for branching rules
int nimplvars
Definition: struct_prob.h:73
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip_mem.h:132
int limit_maxsol
Definition: struct_set.h:318
SCIP_RETCODE SCIPcomprExec(SCIP_COMPR *compr, SCIP_SET *set, SCIP_REOPT *reopt, SCIP_RESULT *result)
Definition: compr.c:299
SCIP_PROB * transprob
Definition: struct_scip.h:98
int npresolroundsext
Definition: struct_stat.h:245
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_PRESOL ** presols
Definition: struct_set.h:86
methods for creating output for visualization tools (VBC, BAK)
SCIP_RETCODE SCIPprimalSetCutoffbound(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_Real cutoffbound, SCIP_Bool useforobjlimit)
Definition: primal.c:307
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:136
static SCIP_RETCODE displayRelevantStats(SCIP *scip)
Definition: scip_solve.c:2172
SCIP_RETCODE SCIPconcsolverCreateInstance(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:210
SCIP_RETCODE SCIPcutpoolFree(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:468
public methods for SCIP variables
int nactivebenders
Definition: struct_set.h:159
void SCIPvisualExit(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:189
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip_param.c:603
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:120
#define SCIPdebugMsg
Definition: scip_message.h:78
SCIP_VISUAL * visual
Definition: struct_stat.h:184
int lastnpresoladdconss
Definition: struct_stat.h:262
SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
Definition: concurrent.c:483
SCIP_RETCODE SCIPprimalUpdateObjlimit(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp)
Definition: primal.c:448
internal methods for LP management
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
Definition: cons.c:8151
Definition: heur_padm.c:132
SCIP_PROB * origprob
Definition: struct_scip.h:80
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:208
SCIP_Longint nexternalsolsfound
Definition: struct_stat.h:109
void SCIPstatEnforceLPUpdates(SCIP_STAT *stat)
Definition: stat.c:687
#define SCIP_PRESOLTIMING_FAST
Definition: type_timing.h:52
SCIP_RETCODE SCIPgetSiblings(SCIP *scip, SCIP_NODE ***siblings, int *nsiblings)
Definition: scip_tree.c:206
public methods for numerical tolerances
internal methods for collecting primal CIP solutions and primal informations
SCIP_Real SCIPsolGetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
Definition: sol.c:1347
int SCIPgetNActiveBenders(SCIP *scip)
Definition: scip_benders.c:532
SCIP_Bool reopt_enable
Definition: struct_set.h:513
SCIP_RETCODE SCIPreoptResetActiveConss(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat)
Definition: reopt.c:8269
void SCIPupdateSolBoundViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip_sol.c:249
public methods for querying solving statistics
internal methods for propagators
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5781
SCIP_Bool reopt_storevarhistory
Definition: struct_set.h:524
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
Definition: scip_solve.c:3621
SCIP_Real dualbound
Definition: struct_prob.h:54
SCIP_PRICESTORE * pricestore
Definition: struct_scip.h:101
public methods for the branch-and-bound tree
SCIP_RETCODE SCIPprobFree(SCIP_PROB **prob, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: prob.c:409
void SCIPresetReoptSolMarks(SCIP *scip)
Definition: scip_solve.c:3657
int SCIPgetNFixedVars(SCIP *scip)
Definition: scip_prob.c:2317
SCIP_RETCODE SCIPsetInitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:5275
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
Definition: scip_prob.c:2274
SCIP_Real avgnnz
Definition: struct_stat.h:129
int SCIPconshdlrGetCheckPriority(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:5081
SCIP_RETCODE SCIPsolveCIP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_MEM *mem, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_RELAXATION *relaxation, SCIP_PRICESTORE *pricestore, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, SCIP_CUTPOOL *delayedcutpool, SCIP_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *restart)
Definition: solve.c:4828
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6255
static SCIP_RETCODE checkSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool checkmodifiable)
Definition: scip_solve.c:125
int SCIPcliquetableGetNCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3503
int npresolchgcoefs
Definition: struct_stat.h:254
int npresolchgvartypes
Definition: struct_stat.h:248
SCIP_RETCODE SCIPreoptGetSolsRun(SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: reopt.c:5497
SCIP_MEM * mem
Definition: struct_scip.h:71
public methods for managing constraints
SCIP_RETCODE SCIPprobPerformVarDeletions(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand)
Definition: prob.c:1071
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
Definition: scip_mem.c:72
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
Definition: scip_general.c:612
int lastnpresolfixedvars
Definition: struct_stat.h:256
void SCIPnodeUpdateLowerbound(SCIP_NODE *node, SCIP_STAT *stat, SCIP_SET *set, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Real newbound)
Definition: tree.c:2365
SCIP_Longint SCIPcutpoolGetNRootCalls(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1125
SCIP_RETCODE SCIPnlpAddVars(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, int nvars, SCIP_VAR **vars)
Definition: nlp.c:3742
SCIP_Real SCIPsolGetObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: sol.c:1546
#define SCIP_PRESOLTIMING_MEDIUM
Definition: type_timing.h:53
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip_solve.c:2624
SCIP_RETCODE SCIPconflictstoreClear(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1450
int npresolroundsmed
Definition: struct_stat.h:244
int lastnpresoladdholes
Definition: struct_stat.h:260
int prevrunnvars
Definition: struct_stat.h:226
SCIP_SOL * SCIPgetReoptLastOptSol(SCIP *scip)
Definition: scip_solve.c:3256
public methods for Benders decomposition
internal methods for storing and manipulating the main problem
#define SCIPerrorMessage
Definition: pub_message.h:64
static SCIP_RETCODE freeTransforming(SCIP *scip)
Definition: scip_solve.c:2124
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4182
void SCIPmessagePrintVerbInfo(SCIP_MESSAGEHDLR *messagehdlr, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, const char *formatstr,...)
Definition: message.c:678
void SCIPstatResetCurrentRun(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Bool solved)
Definition: stat.c:615
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
Definition: var.c:17869
SCIP_EVENTFILTER * eventfilter
Definition: struct_scip.h:88
void SCIPstoreSolutionGap(SCIP *scip)
SCIP_RETCODE SCIPpresolExec(SCIP_PRESOL *presol, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: presol.c:388
SCIP_RETCODE SCIPprobExitSolve(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Bool restart)
Definition: prob.c:1906
SCIP_INTERRUPT * interrupt
Definition: struct_scip.h:73
SCIP_Bool misc_resetstat
Definition: struct_set.h:394
SCIP_Bool misc_printreason
Definition: struct_set.h:399
SCIP_RETCODE SCIPnodeFocus(SCIP_NODE **node, 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_BRANCHCAND *branchcand, SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *cutoff, SCIP_Bool postponed, SCIP_Bool exitsolve)
Definition: tree.c:4344
SCIP_Bool propspresolsorted
Definition: struct_set.h:177
SCIP_RETCODE SCIPtreeCreateRoot(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4960
SCIP_RETCODE SCIPsepastoreCreate(SCIP_SEPASTORE **sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: sepastore.c:87
SCIP_RETCODE SCIPeventqueueCreate(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2184
int npresolchgsides
Definition: struct_stat.h:255
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
Definition: scip_tree.c:164
void SCIPstatReset(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: stat.c:188
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
Definition: var.c:17889
static SCIP_RETCODE freeTransform(SCIP *scip)
Definition: scip_solve.c:1959
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_Bool random_permutevars
Definition: struct_set.h:424
void SCIPinterruptRelease(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:144
int lastnpresolchgbds
Definition: struct_stat.h:259
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:2187
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip_general.c:483
SCIP_RETCODE SCIPpresolve(SCIP *scip)
Definition: scip_solve.c:2454
SCIP_CONSHDLR ** conshdlrs
Definition: struct_set.h:81
internal methods for presolvers
SCIP_CONFLICTSTORE * conflictstore
Definition: struct_scip.h:104
SCIP_CLOCK * solvingtimeoverall
Definition: struct_stat.h:161
void SCIPsetSortComprs(SCIP_SET *set)
Definition: set.c:4729
SCIP_RETCODE SCIPsetInitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:5584
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
Definition: scip_sol.c:3507
SCIP_RETCODE SCIPprintStage(SCIP *scip, FILE *file)
Definition: scip_general.c:387
SCIP_RETCODE SCIPreoptCreate(SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:5043
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:17264
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool *vanished)
Definition: scip_solve.c:1251
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:438
SCIP_REOPT * reopt
Definition: struct_scip.h:85
internal methods for NLP management
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip_param.c:250
#define NULL
Definition: lpi_spx1.cpp:164
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2613
int SCIPpresolGetPriority(SCIP_PRESOL *presol)
Definition: presol.c:619
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:310
data structures for branch and bound tree
SCIP_Bool userinterrupt
Definition: struct_stat.h:278
#define REALABS(x)
Definition: def.h:210
SCIP_Bool SCIPprobIsObjIntegral(SCIP_PROB *prob)
Definition: prob.c:2297
public methods for primal CIP solutions
int npresolchgbds
Definition: struct_stat.h:249
SCIP_Bool misc_avoidmemout
Definition: struct_set.h:401
internal methods for global SCIP settings
internal methods for storing conflicts
#define SCIP_CALL(x)
Definition: def.h:394
int npresoladdholes
Definition: struct_stat.h:250
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_RETCODE SCIPsetSetReoptimizationParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:815
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:61
void SCIPcutpoolAddNCutsAdded(SCIP_CUTPOOL *cutpool, SCIP_Longint ncutsadded)
Definition: cutpool.c:1216
#define SCIP_HEURTIMING_DURINGPRESOLLOOP
Definition: type_timing.h:96
SCIP main data structure.
SCIP_RETCODE SCIPprobResetBounds(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: prob.c:628
BMS_BLKMEM * setmem
Definition: struct_mem.h:48
SCIP_RETCODE SCIPrelaxationCreate(SCIP_RELAXATION **relaxation, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree)
Definition: relax.c:734
SCIP_VAR * h
Definition: circlepacking.c:68
void SCIPmessagePrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
Definition: message.c:594
SCIP_RETCODE SCIPcutpoolClear(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:494
BMS_BUFMEM * SCIPcleanbuffer(SCIP *scip)
Definition: scip_mem.c:86
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:225
#define SCIP_HEURTIMING_BEFOREPRESOL
Definition: type_timing.h:95
internal methods for storing priced variables
internal methods for relaxators
static SCIP_RETCODE freeReoptSolve(SCIP *scip)
Definition: scip_solve.c:1843
static SCIP_RETCODE freeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip_solve.c:1740
void SCIPprobResortVars(SCIP_PROB *prob)
Definition: prob.c:654
internal methods for storing separated cuts
int lastnpresoldelconss
Definition: struct_stat.h:261
void SCIPstatResetDisplay(SCIP_STAT *stat)
Definition: stat.c:676
void SCIPsetSortPropsPresol(SCIP_SET *set)
Definition: set.c:4450
SCIP_DECOMPSTORE * decompstore
Definition: struct_scip.h:82
SCIP_Bool SCIPconshdlrNeedsCons(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:5121
SCIP_CLOCK * presolvingtimeoverall
Definition: struct_stat.h:163
public methods for constraint handler plugins and constraints
void SCIPsolRecomputeObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob)
Definition: sol.c:1995
SCIP_RETCODE SCIPpricestoreFree(SCIP_PRICESTORE **pricestore)
Definition: pricestore.c:136
SCIP_CUTPOOL * cutpool
Definition: struct_scip.h:105
SCIP_RETCODE SCIPlpReset(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PROB *prob, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:9419
methods for catching the user CTRL-C interrupt
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:97
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
internal methods for problem variables
data structures and methods for collecting reoptimization information
the function declarations for the synchronization store
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
Definition: var.c:17393
static SCIP_RETCODE initPresolve(SCIP *scip)
Definition: scip_solve.c:579
SCIP_RETCODE SCIPreoptInstallBounds(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem)
Definition: reopt.c:8220
SCIP_RETCODE SCIPreoptSaveOpenNodes(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_NODE **leaves, int nleaves, SCIP_NODE **childs, int nchilds, SCIP_NODE **siblings, int nsiblings)
Definition: reopt.c:6481
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:124
SCIP_Bool userrestart
Definition: struct_stat.h:279
SCIP_SEPASTORE * sepastore
Definition: struct_scip.h:102
public data structures and miscellaneous methods
SCIP_Bool reopt_sepabestsol
Definition: struct_set.h:523
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
Definition: cons.c:6323
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
Definition: scip_solve.c:3469
SCIP_RETCODE SCIPrelaxationFree(SCIP_RELAXATION **relaxation)
Definition: relax.c:762
SCIP_RETCODE SCIPpermuteProb(SCIP *scip, unsigned int randseed, SCIP_Bool permuteconss, SCIP_Bool permutebinvars, SCIP_Bool permuteintvars, SCIP_Bool permuteimplvars, SCIP_Bool permutecontvars)
Definition: scip_prob.c:789
SCIP_SOL * SCIPreoptGetLastBestSol(SCIP_REOPT *reopt)
Definition: reopt.c:5670
SCIP_RETCODE SCIPnlpFree(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:3571
SCIP_RETCODE SCIPconshdlrPresolve(SCIP_CONSHDLR *conshdlr, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: cons.c:3978
#define SCIP_Bool
Definition: def.h:93
void SCIPlpRecomputeLocalAndGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:13205
SCIP_CLOCK * presolvingtime
Definition: struct_stat.h:162
static SCIP_RETCODE presolveRound(SCIP *scip, SCIP_PRESOLTIMING *timing, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool lastround, int *presolstart, int presolend, int *propstart, int propend, int *consstart, int consend)
Definition: scip_solve.c:796
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2593
int ncontvars
Definition: struct_prob.h:74
SCIP_RETCODE SCIPreoptCheckRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *restart)
Definition: reopt.c:5564
int nbinvars
Definition: struct_prob.h:71
SCIP_RETCODE SCIPlpFree(SCIP_LP **lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:9374
int npresolrounds
Definition: struct_stat.h:242
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip_prob.c:1430
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
Definition: scip_solve.c:3238
SCIP_RETCODE SCIPtreeFree(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4850
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
SCIP_Real lastlowerbound
Definition: struct_stat.h:153
SCIP_RETCODE SCIPsyncstoreInit(SCIP *scip)
Definition: syncstore.c:136
public methods for concurrent solving mode
SCIP_Real SCIPgetGap(SCIP *scip)
SCIP_RETCODE SCIPapplyBendersDecomposition(SCIP *scip, int decompindex)
void SCIPsolResetViolations(SCIP_SOL *sol)
Definition: sol.c:2343
#define MAX(x, y)
Definition: tclique_def.h:92
SCIP_RETCODE SCIPsolRetransform(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_Bool *hasinfval)
Definition: sol.c:1868
#define BMSgarbagecollectBlockMemory(mem)
Definition: memory.h:474
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip_sol.c:3241
SCIP_RETCODE SCIPsolPrint(SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PROB *transprob, FILE *file, SCIP_Bool mipstart, SCIP_Bool printzeros)
Definition: sol.c:2095
SCIP_RETCODE SCIPfreeConcurrent(SCIP *scip)
Definition: concurrent.c:151
methods for debugging
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:487
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
Definition: presol.c:599
void SCIPcutpoolAddNRootCalls(SCIP_CUTPOOL *cutpool, SCIP_Longint nrootcalls)
Definition: cutpool.c:1192
int lastnpresolchgcoefs
Definition: struct_stat.h:264
datastructures for block memory pools and memory buffers
SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
Definition: misc.c:9275
SCIP_RETCODE SCIPtreeClear(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4899
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition: cons.c:8289
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:17771
int parallel_minnthreads
Definition: struct_set.h:572
SCIP_RETCODE SCIPcutpoolCreate(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, int agelimit, SCIP_Bool globalcutpool)
Definition: cutpool.c:427
SCIP_RETCODE SCIPvarFlattenAggregationGraph(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue)
Definition: var.c:4418
int SCIPgetNSols(SCIP *scip)
Definition: scip_sol.c:2214
SCIP_Real limit_memory
Definition: struct_set.h:307
SCIP_RETCODE SCIPlpCreate(SCIP_LP **lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, const char *name)
Definition: lp.c:9082
SCIP_RETCODE SCIPprobTransform(SCIP_PROB *source, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_CONFLICTSTORE *conflictstore, SCIP_PROB **target)
Definition: prob.c:527
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip_sol.c:1444
internal methods for storing cuts in a cut pool
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
datastructures for problem statistics
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
Definition: var.c:17691
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
int reopt_savesols
Definition: struct_set.h:509
static SCIP_RETCODE initSolve(SCIP *scip, SCIP_Bool solved)
Definition: scip_solve.c:1599
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:12786
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6635
void SCIPbranchcandInvalidate(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:202
void SCIPexitSolveDecompstore(SCIP *scip)
Definition: dcmp.c:542
int SCIPgetNConcsolverTypes(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
Definition: scip_prob.c:2045
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4631
SCIP_Longint nnz
Definition: struct_stat.h:189
helper functions for concurrent scip solvers
public methods for the LP relaxation, rows and columns
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:941
SCIP_RETCODE SCIPbranchcandFree(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:183
SCIP_CONCSOLVERTYPE ** SCIPgetConcsolverTypes(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:2000
void SCIPstatResetPrimalDualIntegrals(SCIP_STAT *stat, SCIP_SET *set, SCIP_Bool partialreset)
Definition: stat.c:391
#define SCIP_REAL_MAX
Definition: def.h:187
SCIP_Bool reopt_sepaglbinfsubtrees
Definition: struct_set.h:522
SCIP_COMPR ** comprs
Definition: struct_set.h:93
datastructures for storing and manipulating the main problem
internal methods for decompositions and the decomposition store
void SCIPstatUpdatePrimalDualIntegrals(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Real upperbound, SCIP_Real lowerbound)
Definition: stat.c:459
#define SCIPdebugReset(set)
Definition: debug.h:280
public methods for branching rule plugins and branching
int SCIPpropGetPresolPriority(SCIP_PROP *prop)
Definition: prop.c:971
void SCIPcutpoolAddNCutsFound(SCIP_CUTPOOL *cutpool, SCIP_Longint ncutsfound)
Definition: cutpool.c:1204
SCIP_RETCODE SCIPprimalHeuristics(SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_NODE *nextnode, SCIP_HEURTIMING heurtiming, SCIP_Bool nodeinfeasible, SCIP_Bool *foundsol, SCIP_Bool *unbounded)
Definition: solve.c:214
void SCIPcutpoolSetTime(SCIP_CUTPOOL *cutpool, SCIP_Real time)
Definition: cutpool.c:1168
public methods for presolvers
const char * SCIPcomprGetName(SCIP_COMPR *compr)
Definition: compr.c:456
SCIP_RETCODE SCIPconflictCreate(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: conflict.c:3918
general public methods
SCIP_Bool disp_relevantstats
Definition: struct_set.h:295
BMS_BLKMEM * probmem
Definition: struct_mem.h:49
SCIP_RETCODE SCIPinterruptLP(SCIP *scip, SCIP_Bool interrupt)
Definition: scip_lp.c:874
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip_sol.c:2313
void SCIPstatResetPresolving(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: stat.c:363
SCIP_Bool nlpenabled
Definition: struct_prob.h:89
SCIP_Bool misc_catchctrlc
Definition: struct_set.h:389
SCIP_RETCODE SCIPsolveConcurrent(SCIP *scip)
Definition: scip_solve.c:2985
public methods for solutions
internal methods for conflict analysis
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip_mem.c:100
void SCIPsetSortPresols(SCIP_SET *set)
Definition: set.c:4152
SCIP_NODE * SCIPtreeGetRootNode(SCIP_TREE *tree)
Definition: tree.c:8446
internal methods for tree compressions
public methods for random numbers
internal methods for main solving loop and node processing </