Scippy

SCIP

Solving Constraint Integer Programs

scip_reopt.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-2018 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_reopt.c
17  * @brief public methods for reoptimization
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include <stdarg.h>
37 #include <assert.h>
38 #include <string.h>
39 #if defined(_WIN32) || defined(_WIN64)
40 #else
41 #include <strings.h> /*lint --e{766}*/
42 #endif
43 
44 
45 #include "lpi/lpi.h"
46 #include "nlpi/exprinterpret.h"
47 #include "nlpi/nlpi.h"
48 #include "scip/benders.h"
49 #include "scip/benderscut.h"
50 #include "scip/branch.h"
51 #include "scip/branch_nodereopt.h"
52 #include "scip/clock.h"
53 #include "scip/compr.h"
54 #include "scip/concsolver.h"
55 #include "scip/concurrent.h"
56 #include "scip/conflict.h"
57 #include "scip/conflictstore.h"
58 #include "scip/cons.h"
59 #include "scip/cons_linear.h"
60 #include "scip/cutpool.h"
61 #include "scip/cuts.h"
62 #include "scip/debug.h"
63 #include "scip/def.h"
64 #include "scip/dialog.h"
65 #include "scip/dialog_default.h"
66 #include "scip/disp.h"
67 #include "scip/event.h"
68 #include "scip/heur.h"
69 #include "scip/heur_ofins.h"
70 #include "scip/heur_reoptsols.h"
72 #include "scip/heuristics.h"
73 #include "scip/history.h"
74 #include "scip/implics.h"
75 #include "scip/interrupt.h"
76 #include "scip/lp.h"
77 #include "scip/mem.h"
78 #include "scip/message_default.h"
79 #include "scip/misc.h"
80 #include "scip/nlp.h"
81 #include "scip/nodesel.h"
82 #include "scip/paramset.h"
83 #include "scip/presol.h"
84 #include "scip/presolve.h"
85 #include "scip/pricer.h"
86 #include "scip/pricestore.h"
87 #include "scip/primal.h"
88 #include "scip/prob.h"
89 #include "scip/prop.h"
90 #include "scip/reader.h"
91 #include "scip/relax.h"
92 #include "scip/reopt.h"
93 #include "scip/retcode.h"
94 #include "scip/scipbuildflags.h"
95 #include "scip/scipcoreplugins.h"
96 #include "scip/scipgithash.h"
97 #include "scip/sepa.h"
98 #include "scip/sepastore.h"
99 #include "scip/set.h"
100 #include "scip/sol.h"
101 #include "scip/solve.h"
102 #include "scip/stat.h"
103 #include "scip/syncstore.h"
104 #include "scip/table.h"
105 #include "scip/tree.h"
106 #include "scip/var.h"
107 #include "scip/visual.h"
108 #include "xml/xml.h"
109 
110 #include "scip/scip_reopt.h"
111 #include "scip/scip_tree.h"
112 
113 #include "scip/pub_message.h"
114 #include "scip/pub_reopt.h"
115 #include "scip/pub_tree.h"
116 
117 
118 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
119  * this structure except the interface methods in scip.c.
120  * In optimized mode, the structure is included in scip.h, because some of the methods
121  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
122  */
123 #ifndef NDEBUG
124 #include "scip/struct_scip.h"
125 #endif
126 
127 /** return the ids of child nodes stored in the reoptimization tree
128  *
129  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
130  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
131  *
132  * @pre This method can be called if @p scip is in one of the following stages:
133  * - \ref SCIP_STAGE_PRESOLVED
134  * - \ref SCIP_STAGE_SOLVING
135  * - \ref SCIP_STAGE_SOLVED
136  */
138  SCIP* scip, /**< SCIP data structure */
139  SCIP_NODE* node, /**< node of the search tree */
140  unsigned int* ids, /**< array of ids */
141  int idssize, /**< allocated memory */
142  int* nids /**< number of child nodes */
143  )
144 {
145  assert(scip != NULL);
146 
147  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetReoptChildIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
148 
149  (*nids) = 0;
150 
151  if( !scip->set->reopt_enable )
152  return SCIP_OKAY;
153 
154  SCIP_CALL( SCIPreoptGetChildIDs(scip->reopt, scip->set, scip->mem->probmem, node, ids, idssize, nids) );
155 
156  return SCIP_OKAY;
157 }
158 
159 /** return the ids of all leave nodes store in the reoptimization tree induced by the given node
160  *
161  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
162  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
163  *
164  * @pre This method can be called if @p scip is in one of the following stages:
165  * - \ref SCIP_STAGE_PRESOLVED
166  * - \ref SCIP_STAGE_SOLVING
167  * - \ref SCIP_STAGE_SOLVED
168  */
170  SCIP* scip, /**< SCIP data structure */
171  SCIP_NODE* node, /**< node of the search tree */
172  unsigned int* ids, /**< array of ids */
173  int idssize, /**< size of ids array */
174  int* nids /**< number of child nodes */
175  )
176 {
177  assert(scip != NULL);
178 
179  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetReoptLeaveIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
180 
181  (*nids) = 0;
182 
183  if( idssize == 0 || !scip->set->reopt_enable )
184  return SCIP_OKAY;
185 
186  SCIP_CALL( SCIPreoptGetLeaves(scip->reopt, node, ids, idssize, nids) );
187 
188  return SCIP_OKAY;
189 }
190 
191 /** returns the number of nodes in the reoptimization tree induced by @p node; if @p node == NULL the method
192  * returns the number of nodes of the whole reoptimization tree.
193  */
195  SCIP* scip, /**< SCIP data structure */
196  SCIP_NODE* node /**< node of the search tree */
197  )
198 {
199  assert(scip != NULL);
200  assert(scip->set->reopt_enable);
201  assert(scip->reopt != NULL);
202 
203  return SCIPreoptGetNNodes(scip->reopt, node);
204 }
205 
206 /** returns the number of leaf nodes of the subtree induced by @p node; if @p node == NULL, the method
207  * returns the number of leaf nodes of the whole reoptimization tree.
208  */
210  SCIP* scip, /**< SCIP data structure */
211  SCIP_NODE* node /**< node of the search tree */
212  )
213 {
214  assert(scip != NULL);
215  assert(scip->set->reopt_enable);
216  assert(scip->reopt != NULL);
217 
218  return SCIPreoptGetNLeaves(scip->reopt, node);
219 }
220 
221 /** gets the node of the reoptimization tree corresponding to the unique @p id */
223  SCIP* scip, /**< SCIP data structure */
224  unsigned int id /**< unique id */
225  )
226 {
227  assert(scip != NULL);
228  assert(scip->set->reopt_enable);
229  assert(scip->reopt != NULL);
230 
231  return SCIPreoptGetReoptnode(scip->reopt, id);
232 }
233 
234 /** add a variable bound change to a given reoptnode
235  *
236  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
237  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
238  *
239  * @pre This method can be called if @p scip is in one of the following stages:
240  * - \ref SCIP_STAGE_PRESOLVED
241  * - \ref SCIP_STAGE_SOLVING
242  * - \ref SCIP_STAGE_SOLVED
243  */
245  SCIP* scip, /**< SCIP data structure */
246  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
247  SCIP_VAR* var, /**< variable pointer */
248  SCIP_Real bound, /**< variable bound to add */
249  SCIP_BOUNDTYPE boundtype /**< bound type of the variable value */
250  )
251 {
252  assert(scip != NULL);
253  assert(reoptnode != NULL);
254  assert(scip->set->reopt_enable);
255  assert(scip->reopt != NULL);
256 
257  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddReoptnodeBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
258 
259  SCIP_CALL( SCIPreoptnodeAddBndchg(reoptnode, scip->set, scip->mem->probmem, var, bound, boundtype) );
260 
261  return SCIP_OKAY;
262 }
263 
264 /** set the @p representation as the new search frontier
265  *
266  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
267  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
268  *
269  * @pre This method can be called if @p scip is in one of the following stages:
270  * - \ref SCIP_STAGE_PRESOLVED
271  */
273  SCIP* scip, /**< SCIP data structure */
274  SCIP_REOPTNODE** representation, /**< array of representatives */
275  int nrepresentatives, /**< number of representatives */
276  SCIP_Bool* success /**< pointer to store the result */
277  )
278 {
279  assert(scip != NULL);
280  assert(representation != NULL);
281  assert(nrepresentatives > 0);
282  assert(scip->set->reopt_enable);
283  assert(scip->reopt != NULL);
284 
285  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetReoptCompression", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
286 
287  SCIP_CALL( SCIPreoptApplyCompression(scip->reopt, scip->set, scip->mem->probmem, representation, nrepresentatives, success) );
288 
289  return SCIP_OKAY;
290 }
291 
292 /** add stored constraint to a reoptimization node
293  *
294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
296  *
297  * @pre This method can be called if @p scip is in one of the following stages:
298  * - \ref SCIP_STAGE_PRESOLVED
299  */
301  SCIP* scip, /**< SCIP data structure */
302  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
303  SCIP_VAR** vars, /**< array of variables */
304  SCIP_Real* vals, /**< array of variable bounds */
305  SCIP_BOUNDTYPE* boundtypes, /**< array of variable boundtypes */
306  SCIP_Real lhs, /**< lhs of the constraint */
307  SCIP_Real rhs, /**< rhs of the constraint */
308  int nvars, /**< number of variables */
309  REOPT_CONSTYPE constype, /**< type of the constraint */
310  SCIP_Bool linear /**< the given constraint has a linear representation */
311  )
312 {
313  assert(scip != NULL);
314  assert(reoptnode != NULL);
315  assert(vars != NULL);
316  assert(vals != NULL);
317  assert(nvars >= 0);
318 
319  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddReoptnodeCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
320 
321  SCIP_CALL( SCIPreoptnodeAddCons(reoptnode, scip->set, scip->mem->probmem, vars, vals, boundtypes, lhs, rhs, nvars,
322  constype, linear) );
323 
324  return SCIP_OKAY;
325 }
326 
327 /** return the branching path stored in the reoptree at ID id */
329  SCIP* scip, /**< SCIP data structure */
330  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
331  SCIP_VAR** vars, /**< array of variables */
332  SCIP_Real* vals, /**< array of variable bounds */
333  SCIP_BOUNDTYPE* boundtypes, /**< array of bound types */
334  int mem, /**< allocated memory */
335  int* nvars, /**< number of variables */
336  int* nafterdualvars /**< number of variables directly after the first based on dual information */
337  )
338 {
339  assert(scip != NULL);
340  assert(vars != NULL);
341  assert(vals != NULL);
342  assert(boundtypes != NULL);
343  assert(scip->set->reopt_enable);
344  assert(scip->reopt != NULL);
345 
346  SCIPreoptnodeGetPath(scip->reopt, reoptnode, vars, vals, boundtypes, mem, nvars, nafterdualvars);
347 }
348 
349 /** initialize a set of empty reoptimization nodes
350  *
351  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
352  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
353  *
354  * @pre This method can be called if @p scip is in one of the following stages:
355  * - \ref SCIP_STAGE_PRESOLVED
356  */
358  SCIP* scip, /**< SCIP data structure */
359  SCIP_REOPTNODE** representatives, /**< array of representatives */
360  int nrepresentatives /**< number of representatives */
361  )
362 {
363  int r;
364 
365  assert(scip != NULL);
366  assert(representatives != NULL);
367 
368  SCIP_CALL( SCIPcheckStage(scip, "SCIPinitRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
369 
370  for( r = 0; r < nrepresentatives; r++ )
371  {
372  SCIP_CALL( SCIPallocBlockMemory(scip, &representatives[r]) ); /*lint !e866*/
373  SCIPreoptnodeInit(representatives[r], scip->set);
374  }
375 
376  return SCIP_OKAY;
377 }
378 
379 /** reset a set of initialized reoptimization nodes
380  *
381  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
382  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
383  *
384  * @pre This method can be called if @p scip is in one of the following stages:
385  * - \ref SCIP_STAGE_PRESOLVED
386  */
388  SCIP* scip, /**< SCIP data structure */
389  SCIP_REOPTNODE** representatives, /**< array of representatives */
390  int nrepresentatives /**< number of representatives */
391  )
392 {
393  int r;
394 
395  assert(scip != NULL);
396  assert(representatives != NULL);
397 
398  SCIP_CALL( SCIPcheckStage(scip, "SCIPresetRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
399 
400  for( r = 0; r < nrepresentatives; r++ )
401  {
402  SCIP_CALL( SCIPreoptnodeReset(scip->reopt, scip->set, scip->mem->probmem, representatives[r]) );
403  }
404 
405  return SCIP_OKAY;
406 }
407 
408 /** free a set of initialized reoptimization nodes
409  *
410  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
411  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
412  *
413  * @pre This method can be called if @p scip is in one of the following stages:
414  * - \ref SCIP_STAGE_PRESOLVED
415  */
417  SCIP* scip, /**< SCIP data structure */
418  SCIP_REOPTNODE** representatives, /**< array of representatives */
419  int nrepresentatives /**< number of representatives */
420  )
421 {
422  int r;
423 
424  assert(scip != NULL);
425  assert(representatives != NULL);
426 
427  SCIP_CALL( SCIPcheckStage(scip, "SCIPfreeRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
428 
429  for( r = 0; r < nrepresentatives; r++ )
430  {
431  if( representatives[r] != NULL )
432  {
433  SCIP_CALL( SCIPreoptnodeDelete(&representatives[r], scip->mem->probmem) );
434  assert(representatives[r] == NULL);
435  }
436  }
437 
438  return SCIP_OKAY;
439 }
440 
441 /** reactivate the given @p reoptnode and split them into several nodes if necessary
442  *
443  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
444  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
445  *
446  * @pre This method can be called if @p scip is in one of the following stages:
447  * - \ref SCIP_STAGE_SOLVING
448  * - \ref SCIP_STAGE_SOLVED
449  */
451  SCIP* scip, /**< SCIP data structure */
452  SCIP_REOPTNODE* reoptnode, /**< node to reactivate */
453  unsigned int id, /**< unique id of the reoptimization node */
454  SCIP_Real estimate, /**< estimate of the child nodes that should be created */
455  SCIP_NODE** childnodes, /**< array to store the created child nodes */
456  int* ncreatedchilds, /**< pointer to store number of created child nodes */
457  int* naddedconss, /**< pointer to store number of generated constraints */
458  int childnodessize, /**< available size of childnodes array */
459  SCIP_Bool* success /**< pointer store the result*/
460  )
461 {
462  assert(scip != NULL);
463  assert(reoptnode != NULL);
464 
465  SCIP_CALL( SCIPcheckStage(scip, "SCIPapplyReopt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
466 
467  SCIP_CALL( SCIPreoptApply(scip->reopt, scip, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
468  scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, scip->mem->probmem, reoptnode, id, estimate,
469  childnodes, ncreatedchilds, naddedconss, childnodessize, success) );
470 
471  return SCIP_OKAY;
472 }
473 
474 /** return the similarity between two objective functions */
476  SCIP* scip, /**< SCIP data structure */
477  int run1, /**< number of run */
478  int run2 /**< number of run */
479  )
480 {
481  assert(scip != NULL);
482  assert(run1 > 0 && run1 <= scip->stat->nreoptruns);
483  assert(run2 > 0 && run2 <= scip->stat->nreoptruns);
484 
485  if( (run1 == scip->stat->nreoptruns && run2 == run1-1) || (run2 == scip->stat->nreoptruns && run1 == run2-1) )
486  return SCIPreoptGetSimToPrevious(scip->reopt);
487  else
488  return SCIPreoptGetSimilarity(scip->reopt, scip->set, run1, run2, scip->origprob->vars, scip->origprob->nvars);
489 }
490 
491 /** returns if a node should be reoptimized */
493  SCIP* scip, /**< SCIP data structure */
494  SCIP_NODE* node /**< node of the search tree */
495  )
496 {
497  assert(scip != NULL);
498  assert(node != NULL);
499 
500  if( scip->set->reopt_enable )
501  {
502  SCIP_REOPTNODE* reoptnode;
503  unsigned int id;
504 
505  assert(scip->reopt != NULL);
506 
507  id = SCIPnodeGetReoptID(node);
508 
509  if( id == 0 && node != SCIPgetRootNode(scip) )
510  return FALSE;
511  else
512  {
513  reoptnode = SCIPgetReoptnode(scip, id);
514  assert(reoptnode != NULL);
515 
516  return SCIPreoptnodeGetNChildren(reoptnode) > 0;
517  }
518  }
519  else
520  return FALSE;
521 }
522 
523 /** deletes the given reoptimization node
524  *
525  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
526  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
527  *
528  * @pre This method can be called if @p scip is in one of the following stages:
529  * - \ref SCIP_STAGE_TRANSFORMED
530  * - \ref SCIP_STAGE_SOLVING
531  */
533  SCIP* scip, /**< SCIP data structure */
534  SCIP_REOPTNODE** reoptnode /**< node of the reoptimization tree */
535  )
536 {
537  assert(scip != NULL);
538  assert(scip->set->reopt_enable);
539  assert(scip->reopt != NULL);
540  assert((*reoptnode) != NULL);
541 
542  SCIP_CALL( SCIPcheckStage(scip, "SCIPdeleteReoptnode", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
543 
544  SCIP_CALL( SCIPreoptnodeDelete(reoptnode, scip->mem->probmem) );
545 
546  return SCIP_OKAY;
547 }
548 
549 /** splits the root into several nodes and moves the child nodes of the root to one of the created nodes
550  *
551  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
552  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
553  *
554  * @pre This method can be called if @p scip is in one of the following stages:
555  * - \ref SCIP_STAGE_SOLVING
556  */
558  SCIP* scip, /**< SCIP data structure */
559  int* ncreatedchilds, /**< pointer to store the number of created nodes */
560  int* naddedconss /**< pointer to store the number added constraints */
561  )
562 {
563  assert(scip != NULL);
564  assert(scip->set->reopt_enable);
565  assert(scip->reopt != NULL);
566 
567  SCIP_CALL( SCIPcheckStage(scip, "SCIPsplitReoptRoot", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
568 
569  SCIP_CALL( SCIPreoptSplitRoot(scip->reopt, scip->tree, scip->set, scip->stat, scip->mem->probmem, ncreatedchilds,
570  naddedconss) );
571 
572  return SCIP_OKAY;
573 }
574 
575 /** remove the stored information about bound changes based in dual information
576  *
577  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
578  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
579  *
580  * @pre This method can be called if @p scip is in one of the following stages:
581  * - \ref SCIP_STAGE_SOLVING
582  * - \ref SCIP_STAGE_SOLVED
583  */
585  SCIP* scip, /**< SCIP data structure */
586  SCIP_NODE* node /**< node of the search tree */
587  )
588 {
589  assert(scip != NULL);
590  assert(scip->set->reopt_enable);
591  assert(node != NULL);
592 
593  SCIP_CALL( SCIPcheckStage(scip, "SCIPresetReoptnodeDualcons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
594 
595  SCIP_CALL( SCIPreoptResetDualBndchgs(scip->reopt, node, scip->mem->probmem) );
596 
597  return SCIP_OKAY;
598 }
internal methods for separators
SCIP_STAT * stat
Definition: struct_scip.h:69
SCIP_RETCODE SCIPreoptSplitRoot(SCIP_REOPT *reopt, SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, int *ncreatedchilds, int *naddedconss)
Definition: reopt.c:6899
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
Definition: reopt.c:5616
#define NULL
Definition: def.h:239
internal methods for managing events
int SCIPreoptGetNLeaves(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5914
SCIP_RETCODE SCIPreoptApply(SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
Definition: reopt.c:7297
default message handler
trivialnegation primal heuristic
internal methods for storing primal CIP solutions
methods to interpret (evaluate) an expression tree "fast"
public methods for branch and bound tree
internal methods for branch and bound tree
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
Definition: reopt.c:5667
methods for implications, variable bounds, and cliques
internal methods for clocks and timing issues
static long bound
SCIP_RETCODE SCIPreoptGetLeaves(SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
Definition: reopt.c:6404
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:78
internal methods for NLPI solver interfaces
SCIP_Bool SCIPreoptimizeNode(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:492
interface methods for specific LP solvers
internal methods for displaying statistics tables
int nreoptruns
Definition: struct_stat.h:257
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
Definition: reopt.c:7963
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:79
#define FALSE
Definition: def.h:65
methods for the aggregation rows
internal methods for Benders&#39; decomposition
SCIP_RETCODE SCIPreoptApplyCompression(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
Definition: reopt.c:6672
#define TRUE
Definition: def.h:64
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
methods commonly used by primal heuristics
int SCIPgetNReoptnodes(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:194
internal methods for branching rules and branching candidate storage
SCIP_RETCODE SCIPreoptnodeAddCons(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, SCIP_Real lhs, SCIP_Real rhs, int nvars, REOPT_CONSTYPE constype, SCIP_Bool linear)
Definition: reopt.c:8005
datastructures for concurrent solvers
public methods for reoptimization
SCIP_RETCODE SCIPinitRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip_reopt.c:357
internal methods for handling parameter settings
SCIP_PROB * transprob
Definition: struct_scip.h:87
methods for creating output for visualization tools (VBC, BAK)
nodereopt branching rule
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:97
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
Definition: scip_tree.c:177
internal methods for LP management
SCIP_PROB * origprob
Definition: struct_scip.h:70
internal methods for branching and inference history
SCIP_RETCODE SCIPdeleteReoptnode(SCIP *scip, SCIP_REOPTNODE **reoptnode)
Definition: scip_reopt.c:532
internal methods for collecting primal CIP solutions and primal informations
SCIP_Bool reopt_enable
Definition: struct_set.h:468
internal methods for propagators
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5762
SCIP_RETCODE SCIPfreeRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip_reopt.c:416
public methods for the branch-and-bound tree
SCIP_Real SCIPreoptGetSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int run1, int run2, SCIP_VAR **origvars, int norigvars)
Definition: reopt.c:5634
SCIP_RETCODE SCIPsetReoptCompression(SCIP *scip, SCIP_REOPTNODE **representation, int nrepresentatives, SCIP_Bool *success)
Definition: scip_reopt.c:272
public methods for reoptimization
SCIP_MEM * mem
Definition: struct_scip.h:61
git hash methods
internal methods for storing and manipulating the main problem
SCIP_RETCODE SCIPgetReoptChildIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip_reopt.c:137
methods for block memory pools and memory buffers
register additional core functionality that is designed as plugins
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:1933
internal methods for presolvers
SCIP_REOPT * reopt
Definition: struct_scip.h:74
internal methods for NLP management
internal miscellaneous methods
internal methods for node selectors and node priority queues
internal methods for variable pricers
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
Definition: reopt.c:7912
internal methods for global SCIP settings
internal methods for storing conflicts
#define SCIP_CALL(x)
Definition: def.h:351
SCIP main data structure.
SCIP_RETCODE SCIPreoptResetDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node, BMS_BLKMEM *blkmem)
Definition: reopt.c:7193
void SCIPreoptnodeGetPath(SCIP_REOPT *reopt, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int varssize, int *nbndchgs, int *nbndchgsafterdual)
Definition: reopt.c:7218
internal methods for storing priced variables
internal methods for relaxators
internal methods for storing separated cuts
methods commonly used for presolving
methods for catching the user CTRL-C interrupt
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:86
internal methods for problem variables
data structures and methods for collecting reoptimization information
the function declarations for the synchronization store
SCIP_RETCODE SCIPresetReoptnodeDualcons(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:584
internal methods for user interface dialog
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5835
SCIP_RETCODE SCIPreoptGetChildIDs(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int *childs, int childssize, int *nchilds)
Definition: reopt.c:6351
#define SCIP_Bool
Definition: def.h:62
SCIP_RETCODE SCIPaddReoptnodeCons(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, SCIP_Real lhs, SCIP_Real rhs, int nvars, REOPT_CONSTYPE constype, SCIP_Bool linear)
Definition: scip_reopt.c:300
internal methods for input file readers
methods for debugging
SCIP_RETCODE SCIPaddReoptnodeBndchg(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR *var, SCIP_Real bound, SCIP_BOUNDTYPE boundtype)
Definition: scip_reopt.c:244
SCIP_Real SCIPgetReoptSimilarity(SCIP *scip, int run1, int run2)
Definition: scip_reopt.c:475
void SCIPgetReoptnodePath(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int mem, int *nvars, int *nafterdualvars)
Definition: scip_reopt.c:328
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
Definition: reopt.c:7977
reoptsols primal heuristic
internal methods for storing cuts in a cut pool
Constraint handler for linear constraints in their most general form, .
helper functions for concurrent scip solvers
internal methods for return codes for SCIP methods
SCIP_Real * r
Definition: circlepacking.c:50
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
internal methods for conflict analysis
internal methods for tree compressions
internal methods for main solving loop and node processing
unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
Definition: tree.c:7415
SCIP_RETCODE SCIPreoptnodeReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:7945
SCIP_SET * set
Definition: struct_scip.h:62
public methods for message output
SCIP_RETCODE SCIPsplitReoptRoot(SCIP *scip, int *ncreatedchilds, int *naddedconss)
Definition: scip_reopt.c:557
SCIP_RETCODE SCIPapplyReopt(SCIP *scip, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
Definition: scip_reopt.c:450
default user interface dialog
#define SCIP_Real
Definition: def.h:150
internal methods for problem statistics
SCIP_VAR ** vars
Definition: struct_prob.h:55
SCIP_RETCODE SCIPgetReoptLeaveIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip_reopt.c:169
internal methods for constraints and constraint handlers
SCIP_TREE * tree
Definition: struct_scip.h:84
declarations for XML parsing
build flags methods
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:67
common defines and data types used in all packages of SCIP
internal methods for primal heuristics
SCIP_REOPTNODE * SCIPgetReoptnode(SCIP *scip, unsigned int id)
Definition: scip_reopt.c:222
SCIP_LP * lp
Definition: struct_scip.h:80
int SCIPgetNReoptLeaves(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:209
SCIP_RETCODE SCIPresetRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip_reopt.c:387
internal methods for Benders&#39; decomposition cuts
internal methods for displaying runtime statistics
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.