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-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_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 "scip/debug.h"
36 #include "scip/pub_message.h"
37 #include "scip/pub_reopt.h"
38 #include "scip/pub_tree.h"
39 #include "scip/reopt.h"
40 #include "scip/scip_mem.h"
41 #include "scip/scip_reopt.h"
42 #include "scip/scip_tree.h"
43 #include "scip/struct_mem.h"
44 #include "scip/struct_prob.h"
45 #include "scip/struct_scip.h"
46 #include "scip/struct_set.h"
47 #include "scip/struct_stat.h"
48 
49 /** return the ids of child nodes stored in the reoptimization tree
50  *
51  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
52  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
53  *
54  * @pre This method can be called if @p scip is in one of the following stages:
55  * - \ref SCIP_STAGE_PRESOLVED
56  * - \ref SCIP_STAGE_SOLVING
57  * - \ref SCIP_STAGE_SOLVED
58  */
60  SCIP* scip, /**< SCIP data structure */
61  SCIP_NODE* node, /**< node of the search tree */
62  unsigned int* ids, /**< array of ids */
63  int idssize, /**< allocated memory */
64  int* nids /**< number of child nodes */
65  )
66 {
67  assert(scip != NULL);
68 
69  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetReoptChildIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
70 
71  (*nids) = 0;
72 
73  if( !scip->set->reopt_enable )
74  return SCIP_OKAY;
75 
76  SCIP_CALL( SCIPreoptGetChildIDs(scip->reopt, scip->set, scip->mem->probmem, node, ids, idssize, nids) );
77 
78  return SCIP_OKAY;
79 }
80 
81 /** return the ids of all leave nodes store in the reoptimization tree induced by the given node
82  *
83  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
84  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
85  *
86  * @pre This method can be called if @p scip is in one of the following stages:
87  * - \ref SCIP_STAGE_PRESOLVED
88  * - \ref SCIP_STAGE_SOLVING
89  * - \ref SCIP_STAGE_SOLVED
90  */
92  SCIP* scip, /**< SCIP data structure */
93  SCIP_NODE* node, /**< node of the search tree */
94  unsigned int* ids, /**< array of ids */
95  int idssize, /**< size of ids array */
96  int* nids /**< number of child nodes */
97  )
98 {
99  assert(scip != NULL);
100 
101  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetReoptLeaveIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
102 
103  (*nids) = 0;
104 
105  if( idssize == 0 || !scip->set->reopt_enable )
106  return SCIP_OKAY;
107 
108  SCIP_CALL( SCIPreoptGetLeaves(scip->reopt, node, ids, idssize, nids) );
109 
110  return SCIP_OKAY;
111 }
112 
113 /** returns the number of nodes in the reoptimization tree induced by @p node; if @p node == NULL the method
114  * returns the number of nodes of the whole reoptimization tree.
115  */
117  SCIP* scip, /**< SCIP data structure */
118  SCIP_NODE* node /**< node of the search tree */
119  )
120 {
121  assert(scip != NULL);
122  assert(scip->set->reopt_enable);
123  assert(scip->reopt != NULL);
124 
125  return SCIPreoptGetNNodes(scip->reopt, node);
126 }
127 
128 /** returns the number of leaf nodes of the subtree induced by @p node; if @p node == NULL, the method
129  * returns the number of leaf nodes of the whole reoptimization tree.
130  */
132  SCIP* scip, /**< SCIP data structure */
133  SCIP_NODE* node /**< node of the search tree */
134  )
135 {
136  assert(scip != NULL);
137  assert(scip->set->reopt_enable);
138  assert(scip->reopt != NULL);
139 
140  return SCIPreoptGetNLeaves(scip->reopt, node);
141 }
142 
143 /** gets the node of the reoptimization tree corresponding to the unique @p id */
145  SCIP* scip, /**< SCIP data structure */
146  unsigned int id /**< unique id */
147  )
148 {
149  assert(scip != NULL);
150  assert(scip->set->reopt_enable);
151  assert(scip->reopt != NULL);
152 
153  return SCIPreoptGetReoptnode(scip->reopt, id);
154 }
155 
156 /** add a variable bound change to a given reoptnode
157  *
158  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
159  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
160  *
161  * @pre This method can be called if @p scip is in one of the following stages:
162  * - \ref SCIP_STAGE_PRESOLVED
163  * - \ref SCIP_STAGE_SOLVING
164  * - \ref SCIP_STAGE_SOLVED
165  */
167  SCIP* scip, /**< SCIP data structure */
168  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
169  SCIP_VAR* var, /**< variable pointer */
170  SCIP_Real bound, /**< variable bound to add */
171  SCIP_BOUNDTYPE boundtype /**< bound type of the variable value */
172  )
173 {
174  assert(scip != NULL);
175  assert(reoptnode != NULL);
176  assert(scip->set->reopt_enable);
177  assert(scip->reopt != NULL);
178 
179  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddReoptnodeBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
180 
181  SCIP_CALL( SCIPreoptnodeAddBndchg(reoptnode, scip->set, scip->mem->probmem, var, bound, boundtype) );
182 
183  return SCIP_OKAY;
184 }
185 
186 /** set the @p representation as the new search frontier
187  *
188  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
189  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
190  *
191  * @pre This method can be called if @p scip is in one of the following stages:
192  * - \ref SCIP_STAGE_PRESOLVED
193  */
195  SCIP* scip, /**< SCIP data structure */
196  SCIP_REOPTNODE** representation, /**< array of representatives */
197  int nrepresentatives, /**< number of representatives */
198  SCIP_Bool* success /**< pointer to store the result */
199  )
200 {
201  assert(scip != NULL);
202  assert(representation != NULL);
203  assert(nrepresentatives > 0);
204  assert(scip->set->reopt_enable);
205  assert(scip->reopt != NULL);
206 
207  SCIP_CALL( SCIPcheckStage(scip, "SCIPsetReoptCompression", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
208 
209  SCIP_CALL( SCIPreoptApplyCompression(scip->reopt, scip->set, scip->mem->probmem, representation, nrepresentatives, success) );
210 
211  return SCIP_OKAY;
212 }
213 
214 /** add stored constraint to a reoptimization node
215  *
216  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
217  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
218  *
219  * @pre This method can be called if @p scip is in one of the following stages:
220  * - \ref SCIP_STAGE_PRESOLVED
221  */
223  SCIP* scip, /**< SCIP data structure */
224  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
225  SCIP_VAR** vars, /**< array of variables */
226  SCIP_Real* vals, /**< array of variable bounds */
227  SCIP_BOUNDTYPE* boundtypes, /**< array of variable boundtypes */
228  SCIP_Real lhs, /**< lhs of the constraint */
229  SCIP_Real rhs, /**< rhs of the constraint */
230  int nvars, /**< number of variables */
231  REOPT_CONSTYPE constype, /**< type of the constraint */
232  SCIP_Bool linear /**< the given constraint has a linear representation */
233  )
234 {
235  assert(scip != NULL);
236  assert(reoptnode != NULL);
237  assert(vars != NULL);
238  assert(vals != NULL);
239  assert(nvars >= 0);
240 
241  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddReoptnodeCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
242 
243  SCIP_CALL( SCIPreoptnodeAddCons(reoptnode, scip->set, scip->mem->probmem, vars, vals, boundtypes, lhs, rhs, nvars,
244  constype, linear) );
245 
246  return SCIP_OKAY;
247 }
248 
249 /** return the branching path stored in the reoptree at ID id */
251  SCIP* scip, /**< SCIP data structure */
252  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
253  SCIP_VAR** vars, /**< array of variables */
254  SCIP_Real* vals, /**< array of variable bounds */
255  SCIP_BOUNDTYPE* boundtypes, /**< array of bound types */
256  int mem, /**< allocated memory */
257  int* nvars, /**< number of variables */
258  int* nafterdualvars /**< number of variables directly after the first based on dual information */
259  )
260 {
261  assert(scip != NULL);
262  assert(vars != NULL);
263  assert(vals != NULL);
264  assert(boundtypes != NULL);
265  assert(scip->set->reopt_enable);
266  assert(scip->reopt != NULL);
267 
268  SCIPreoptnodeGetPath(scip->reopt, reoptnode, vars, vals, boundtypes, mem, nvars, nafterdualvars);
269 }
270 
271 /** initialize a set of empty reoptimization nodes
272  *
273  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
274  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
275  *
276  * @pre This method can be called if @p scip is in one of the following stages:
277  * - \ref SCIP_STAGE_PRESOLVED
278  */
280  SCIP* scip, /**< SCIP data structure */
281  SCIP_REOPTNODE** representatives, /**< array of representatives */
282  int nrepresentatives /**< number of representatives */
283  )
284 {
285  int r;
286 
287  assert(scip != NULL);
288  assert(representatives != NULL);
289 
290  SCIP_CALL( SCIPcheckStage(scip, "SCIPinitRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
291 
292  for( r = 0; r < nrepresentatives; r++ )
293  {
294  SCIP_CALL( SCIPallocBlockMemory(scip, &representatives[r]) ); /*lint !e866*/
295  SCIPreoptnodeInit(representatives[r], scip->set);
296  }
297 
298  return SCIP_OKAY;
299 }
300 
301 /** reset a set of initialized reoptimization nodes
302  *
303  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
304  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
305  *
306  * @pre This method can be called if @p scip is in one of the following stages:
307  * - \ref SCIP_STAGE_PRESOLVED
308  */
310  SCIP* scip, /**< SCIP data structure */
311  SCIP_REOPTNODE** representatives, /**< array of representatives */
312  int nrepresentatives /**< number of representatives */
313  )
314 {
315  int r;
316 
317  assert(scip != NULL);
318  assert(representatives != NULL);
319 
320  SCIP_CALL( SCIPcheckStage(scip, "SCIPresetRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
321 
322  for( r = 0; r < nrepresentatives; r++ )
323  {
324  SCIP_CALL( SCIPreoptnodeReset(scip->reopt, scip->set, scip->mem->probmem, representatives[r]) );
325  }
326 
327  return SCIP_OKAY;
328 }
329 
330 /** free a set of initialized reoptimization nodes
331  *
332  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
333  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
334  *
335  * @pre This method can be called if @p scip is in one of the following stages:
336  * - \ref SCIP_STAGE_PRESOLVED
337  */
339  SCIP* scip, /**< SCIP data structure */
340  SCIP_REOPTNODE** representatives, /**< array of representatives */
341  int nrepresentatives /**< number of representatives */
342  )
343 {
344  int r;
345 
346  assert(scip != NULL);
347  assert(representatives != NULL);
348 
349  SCIP_CALL( SCIPcheckStage(scip, "SCIPfreeRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
350 
351  for( r = 0; r < nrepresentatives; r++ )
352  {
353  if( representatives[r] != NULL )
354  {
355  SCIP_CALL( SCIPreoptnodeDelete(&representatives[r], scip->mem->probmem) );
356  assert(representatives[r] == NULL);
357  }
358  }
359 
360  return SCIP_OKAY;
361 }
362 
363 /** reactivate the given @p reoptnode and split them into several nodes if necessary
364  *
365  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
366  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
367  *
368  * @pre This method can be called if @p scip is in one of the following stages:
369  * - \ref SCIP_STAGE_SOLVING
370  * - \ref SCIP_STAGE_SOLVED
371  */
373  SCIP* scip, /**< SCIP data structure */
374  SCIP_REOPTNODE* reoptnode, /**< node to reactivate */
375  unsigned int id, /**< unique id of the reoptimization node */
376  SCIP_Real estimate, /**< estimate of the child nodes that should be created */
377  SCIP_NODE** childnodes, /**< array to store the created child nodes */
378  int* ncreatedchilds, /**< pointer to store number of created child nodes */
379  int* naddedconss, /**< pointer to store number of generated constraints */
380  int childnodessize, /**< available size of childnodes array */
381  SCIP_Bool* success /**< pointer store the result*/
382  )
383 {
384  assert(scip != NULL);
385  assert(reoptnode != NULL);
386 
387  SCIP_CALL( SCIPcheckStage(scip, "SCIPapplyReopt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
388 
389  SCIP_CALL( SCIPreoptApply(scip->reopt, scip, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
390  scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, scip->mem->probmem, reoptnode, id, estimate,
391  childnodes, ncreatedchilds, naddedconss, childnodessize, success) );
392 
393  return SCIP_OKAY;
394 }
395 
396 /** return the similarity between two objective functions */
398  SCIP* scip, /**< SCIP data structure */
399  int run1, /**< number of run */
400  int run2 /**< number of run */
401  )
402 {
403  assert(scip != NULL);
404  assert(run1 > 0 && run1 <= scip->stat->nreoptruns);
405  assert(run2 > 0 && run2 <= scip->stat->nreoptruns);
406 
407  if( (run1 == scip->stat->nreoptruns && run2 == run1-1) || (run2 == scip->stat->nreoptruns && run1 == run2-1) )
408  return SCIPreoptGetSimToPrevious(scip->reopt);
409  else
410  return SCIPreoptGetSimilarity(scip->reopt, scip->set, run1, run2, scip->origprob->vars, scip->origprob->nvars);
411 }
412 
413 /** returns if a node should be reoptimized */
415  SCIP* scip, /**< SCIP data structure */
416  SCIP_NODE* node /**< node of the search tree */
417  )
418 {
419  assert(scip != NULL);
420  assert(node != NULL);
421 
422  if( scip->set->reopt_enable )
423  {
424  SCIP_REOPTNODE* reoptnode;
425  unsigned int id;
426 
427  assert(scip->reopt != NULL);
428 
429  id = SCIPnodeGetReoptID(node);
430 
431  if( id == 0 && node != SCIPgetRootNode(scip) )
432  return FALSE;
433  else
434  {
435  reoptnode = SCIPgetReoptnode(scip, id);
436  assert(reoptnode != NULL);
437 
438  return SCIPreoptnodeGetNChildren(reoptnode) > 0;
439  }
440  }
441  else
442  return FALSE;
443 }
444 
445 /** deletes the given reoptimization node
446  *
447  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
448  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
449  *
450  * @pre This method can be called if @p scip is in one of the following stages:
451  * - \ref SCIP_STAGE_TRANSFORMED
452  * - \ref SCIP_STAGE_SOLVING
453  */
455  SCIP* scip, /**< SCIP data structure */
456  SCIP_REOPTNODE** reoptnode /**< node of the reoptimization tree */
457  )
458 {
459  assert(scip != NULL);
460  assert(scip->set->reopt_enable);
461  assert(scip->reopt != NULL);
462  assert((*reoptnode) != NULL);
463 
464  SCIP_CALL( SCIPcheckStage(scip, "SCIPdeleteReoptnode", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
465 
466  SCIP_CALL( SCIPreoptnodeDelete(reoptnode, scip->mem->probmem) );
467 
468  return SCIP_OKAY;
469 }
470 
471 /** splits the root into several nodes and moves the child nodes of the root to one of the created nodes
472  *
473  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
474  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
475  *
476  * @pre This method can be called if @p scip is in one of the following stages:
477  * - \ref SCIP_STAGE_SOLVING
478  */
480  SCIP* scip, /**< SCIP data structure */
481  int* ncreatedchilds, /**< pointer to store the number of created nodes */
482  int* naddedconss /**< pointer to store the number added constraints */
483  )
484 {
485  assert(scip != NULL);
486  assert(scip->set->reopt_enable);
487  assert(scip->reopt != NULL);
488 
489  SCIP_CALL( SCIPcheckStage(scip, "SCIPsplitReoptRoot", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
490 
491  SCIP_CALL( SCIPreoptSplitRoot(scip->reopt, scip->tree, scip->set, scip->stat, scip->mem->probmem, ncreatedchilds,
492  naddedconss) );
493 
494  return SCIP_OKAY;
495 }
496 
497 /** remove the stored information about bound changes based in dual information
498  *
499  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
500  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
501  *
502  * @pre This method can be called if @p scip is in one of the following stages:
503  * - \ref SCIP_STAGE_SOLVING
504  * - \ref SCIP_STAGE_SOLVED
505  */
507  SCIP* scip, /**< SCIP data structure */
508  SCIP_NODE* node /**< node of the search tree */
509  )
510 {
511  assert(scip != NULL);
512  assert(scip->set->reopt_enable);
513  assert(node != NULL);
514 
515  SCIP_CALL( SCIPcheckStage(scip, "SCIPresetReoptnodeDualcons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
516 
517  SCIP_CALL( SCIPreoptResetDualBndchgs(scip->reopt, node, scip->mem->probmem) );
518 
519  return SCIP_OKAY;
520 }
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_RETCODE SCIPfreeRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip_reopt.c:338
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
Definition: reopt.c:5616
#define NULL
Definition: def.h:253
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
public methods for branch and bound tree
SCIP_RETCODE SCIPinitRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip_reopt.c:279
public methods for memory management
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
Definition: reopt.c:5667
SCIP_Real SCIPgetReoptSimilarity(SCIP *scip, int run1, int run2)
Definition: scip_reopt.c:397
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
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
SCIP_RETCODE SCIPsetReoptCompression(SCIP *scip, SCIP_REOPTNODE **representation, int nrepresentatives, SCIP_Bool *success)
Definition: scip_reopt.c:194
#define FALSE
Definition: def.h:73
SCIP_RETCODE SCIPgetReoptChildIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip_reopt.c:59
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:250
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:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
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
SCIP_RETCODE SCIPgetReoptLeaveIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip_reopt.c:91
public methods for reoptimization
SCIP_EXPORT int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5835
SCIP_PROB * transprob
Definition: struct_scip.h:87
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:78
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_EXPORT unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
Definition: tree.c:7418
SCIP_RETCODE SCIPsplitReoptRoot(SCIP *scip, int *ncreatedchilds, int *naddedconss)
Definition: scip_reopt.c:479
SCIP_Bool reopt_enable
Definition: struct_set.h:468
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5762
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:222
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
public methods for reoptimization
SCIP_MEM * mem
Definition: struct_scip.h:61
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:2010
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
Definition: scip_tree.c:99
SCIP_REOPT * reopt
Definition: struct_scip.h:74
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
Definition: reopt.c:7912
#define SCIP_CALL(x)
Definition: def.h:365
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
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:86
data structures and methods for collecting reoptimization information
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:70
methods for debugging
datastructures for block memory pools and memory buffers
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
datastructures for problem statistics
int SCIPgetNReoptnodes(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:116
datastructures for storing and manipulating the main problem
SCIP_Real * r
Definition: circlepacking.c:50
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
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:372
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
#define SCIP_Real
Definition: def.h:164
SCIP_VAR ** vars
Definition: struct_prob.h:55
SCIP_RETCODE SCIPresetReoptnodeDualcons(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:506
SCIP_Bool SCIPreoptimizeNode(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:414
SCIP_TREE * tree
Definition: struct_scip.h:84
int SCIPgetNReoptLeaves(SCIP *scip, SCIP_NODE *node)
Definition: scip_reopt.c:131
SCIP_RETCODE SCIPdeleteReoptnode(SCIP *scip, SCIP_REOPTNODE **reoptnode)
Definition: scip_reopt.c:454
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:67
SCIP_REOPTNODE * SCIPgetReoptnode(SCIP *scip, unsigned int id)
Definition: scip_reopt.c:144
SCIP_LP * lp
Definition: struct_scip.h:80
SCIP_RETCODE SCIPresetRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip_reopt.c:309
datastructures for global SCIP settings
SCIP_RETCODE SCIPaddReoptnodeBndchg(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR *var, SCIP_Real bound, SCIP_BOUNDTYPE boundtype)
Definition: scip_reopt.c:166