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   reopt.h
26   	 * @ingroup INTERNALAPI
27   	 * @brief  data structures and methods for collecting reoptimization information
28   	 * @author Jakob Witzig
29   	 */
30   	
31   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32   	
33   	#ifndef __SCIP_REOPT_H__
34   	#define __SCIP_REOPT_H__
35   	
36   	#include "blockmemshell/memory.h"
37   	#include "scip/def.h"
38   	#include "scip/pub_reopt.h"
39   	#include "scip/type_branch.h"
40   	#include "scip/type_cutpool.h"
41   	#include "scip/type_misc.h"
42   	#include "scip/type_primal.h"
43   	#include "scip/type_prob.h"
44   	#include "scip/type_retcode.h"
45   	#include "scip/type_reopt.h"
46   	#include "scip/type_sepastore.h"
47   	#include "scip/type_set.h"
48   	#include "scip/type_stat.h"
49   	#include "scip/struct_reopt.h"
50   	#include "scip/struct_var.h"
51   	#include "scip/struct_history.h"
52   	
53   	#ifdef __cplusplus
54   	extern "C" {
55   	#endif
56   	
57   	/** creates reopt data */
58   	SCIP_RETCODE SCIPreoptCreate(
59   	   SCIP_REOPT**          reopt,              /**< pointer to reoptimization data structure */
60   	   SCIP_SET*             set,                /**< global SCIP settings */
61   	   BMS_BLKMEM*           blkmem              /**< block memory */
62   	   );
63   	
64   	/** frees reopt data */
65   	SCIP_RETCODE SCIPreoptFree(
66   	   SCIP_REOPT**          reopt,              /**< reoptimization data structure */
67   	   SCIP_SET*             set,                /**< global SCIP settings */
68   	   SCIP_PRIMAL*          origprimal,         /**< original primal */
69   	   BMS_BLKMEM*           blkmem              /**< block memory */
70   	   );
71   	
72   	/* release all variables and constraints captured during reoptimization */
73   	SCIP_RETCODE SCIPreoptReleaseData(
74   	   SCIP_REOPT*           reopt,              /**< pointer to reoptimization data structure */
75   	   SCIP_SET*             set,                /**< global SCIP settings */
76   	   BMS_BLKMEM*           blkmem              /**< block memory */
77   	    );
78   	
79   	/** returns the number of constraints added by the reoptimization plug-in */
80   	int SCIPreoptGetNAddedConss(
81   	   SCIP_REOPT*           reopt,              /**< reoptimization data */
82   	   SCIP_NODE*            node                /**< node of the search tree */
83   	   );
84   	
85   	/** add a solution to the solution tree */
86   	SCIP_RETCODE SCIPreoptAddSol(
87   	   SCIP_REOPT*           reopt,              /**< reoptimization data */
88   	   SCIP_SET*             set,                /**< global SCIP settings */
89   	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
90   	   SCIP_PRIMAL*          origprimal,         /**< original primal */
91   	   BMS_BLKMEM*           blkmem,             /**< block memory */
92   	   SCIP_SOL*             sol,                /**< solution to add */
93   	   SCIP_Bool             bestsol,            /**< is the current solution an optimal solution? */
94   	   SCIP_Bool*            added,              /**< pointer to store the information if the soltion was added */
95   	   SCIP_VAR**            vars,               /**< variable array */
96   	   int                   nvars,              /**< number of variables */
97   	   int                   run                 /**< number of the current run (1,2,...) */
98   	   );
99   	
100  	/** add optimal solution */
101  	SCIP_RETCODE SCIPreoptAddOptSol(
102  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
103  	   SCIP_SOL*             sol,                /**< solution to add */
104  	   BMS_BLKMEM*           blkmem,             /**< block memory */
105  	   SCIP_SET*             set,                /**< global SCIP settings */
106  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
107  	   SCIP_PRIMAL*          origprimal,         /**< original primal */
108  	   SCIP_VAR**            vars,               /**< original problem variables */
109  	   int                   nvars               /**< number of original problem variables */
110  	   );
111  	
112  	/** add a run */
113  	SCIP_RETCODE SCIPreoptAddRun(
114  	   SCIP_REOPT*           reopt,              /**< reoptimization data sturcture */
115  	   SCIP_SET*             set,                /**< global SCIP settings */
116  	   BMS_BLKMEM*           blkmem,             /**< block memory */
117  	   SCIP_VAR**            origvars,           /**< original problem variables */
118  	   int                   norigvars,          /**< number of original variables */
119  	   int                   size                /**< number of expected solutions */
120  	   );
121  	
122  	/** get the number of checked solutions during the reoptimization process */
123  	int SCIPreoptGetNCheckedSols(
124  	   SCIP_REOPT*           reopt               /**< reoptimization data */
125  	   );
126  	
127  	/** update the number of checked solutions during the reoptimization process */
128  	void SCIPreoptAddNCheckedSols(
129  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
130  	   int                   ncheckedsols        /**< number of updated solutions */
131  	   );
132  	
133  	/** get the number of checked solutions during the reoptimization process */
134  	int SCIPreoptGetNImprovingSols(
135  	   SCIP_REOPT*           reopt               /**< reoptimization data */
136  	   );
137  	
138  	/** update the number of checked solutions during the reoptimization process */
139  	void SCIPreoptAddNImprovingSols(
140  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
141  	   int                   nimprovingsols      /**< number of improving solutions */
142  	   );
143  	
144  	/** returns number of solutions stored in the solution tree of a given run */
145  	int SCIPreoptGetNSolsRun(
146  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
147  	   int                   run                 /**< number of the run (1,2,..) */
148  	   );
149  	
150  	/** returns number of all solutions of all runs */
151  	int SCIPreoptGetNSols(
152  	   SCIP_REOPT*           reopt               /**< reoptimization data */
153  	   );
154  	
155  	/** return the stored solutions of a given run */
156  	SCIP_RETCODE SCIPreoptGetSolsRun(
157  	   SCIP_REOPT*           reopt,              /**< reopt data */
158  	   int                   run,                /**< number of the run (1,2,...) */
159  	   SCIP_SOL**            sols,               /**< array of solutions to fill */
160  	   int                   solssize,           /**< length of the array */
161  	   int*                  nsols               /**< pointer to store the number of added solutions */
162  	   );
163  	
164  	/** returns the number of saved solutions overall runs */
165  	int SCIPreoptGetNSavedSols(
166  	   SCIP_REOPT*           reopt               /**< reoptimization data */
167  	   );
168  	
169  	/** Check if the reoptimization process should be (locally) restarted.
170  	 *
171  	 *  First, we check whether the current node is the root node, e.g., node == NULL. In this case, we do not need to calculate
172  	 *  the similarity again. We trigger a restart if
173  	 *    1. the objective function has changed too much, or
174  	 *    2. the number of stored nodes is exceeded, or
175  	 *    3. the last n optimal solutions were found by heur_reoptsols (in this case, the stored tree was only needed to
176  	 *       prove the optimality and this can probably be done faster by solving from scratch).
177  	 *
178  	 *  If the current node is different to the root node we calculate the local similarity, i.e., exclude all variables
179  	 *  that are already fixed at the given node.
180  	 */
181  	SCIP_RETCODE SCIPreoptCheckRestart(
182  	   SCIP_REOPT*           reopt,              /**< reopt data */
183  	   SCIP_SET*             set,                /**< global SCIP settings */
184  	   BMS_BLKMEM*           blkmem,             /**< block memory */
185  	   SCIP_NODE*            node,               /**< current node of the branch and bound tree (or NULL) */
186  	   SCIP_VAR**            transvars,          /**< transformed problem variables */
187  	   int                   ntransvars,         /**< number of transformed problem variables */
188  	   SCIP_Bool*            restart             /**< pointer to store if the reoptimization process should be restarted */
189  	   );
190  	
191  	/** returns the similarity to the previous objective function */
192  	SCIP_Real SCIPreoptGetSimToPrevious(
193  	   SCIP_REOPT*           reopt               /**< reoptimization data */
194  	   );
195  	
196  	/** returns the similarity to the first objective functions */
197  	SCIP_Real SCIPreoptGetSimToFirst(
198  	   SCIP_REOPT*           reopt               /**< reoptimization data */
199  	   );
200  	
201  	/** return the similarity between two of objective functions of two given runs */
202  	SCIP_Real SCIPreoptGetSimilarity(
203  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
204  	   SCIP_SET*             set,                /**< global SCIP settings */
205  	   int                   run1,               /**< number of the first run */
206  	   int                   run2,               /**< number of the second run */
207  	   SCIP_VAR**            origvars,           /**< original problem variables */
208  	   int                   norigvars           /**< number of original problem variables */
209  	   );
210  	
211  	/** returns the best solution of the last run */
212  	SCIP_SOL* SCIPreoptGetLastBestSol(
213  	   SCIP_REOPT*           reopt               /**< reoptimization data */
214  	   );
215  	
216  	/** returns the node of the reoptimization tree corresponding to the unique @p id */
217  	SCIP_REOPTNODE* SCIPreoptGetReoptnode(
218  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
219  	   unsigned int          id                  /**< unique id */
220  	   );
221  	
222  	/** returns the coefficent of variable with index @p idx in run @p run */
223  	SCIP_Real SCIPreoptGetOldObjCoef(
224  	   SCIP_REOPT*           reopt,              /**< reopt data */
225  	   int                   run,                /**< number of the run */
226  	   int                   idx                 /**< problem index of variable */
227  	   );
228  	
229  	/** return the best solution of a given run
230  	 *
231  	 *  @note the returned solution is part of the original space.
232  	 */
233  	SCIP_SOL* SCIPreoptGetBestSolRun(
234  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
235  	   int                   run                 /**< number of the run (1,2,...) */
236  	   );
237  	
238  	/** reset solving specific paramters */
239  	SCIP_RETCODE SCIPreoptReset(
240  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
241  	   SCIP_SET*             set,                /**< global SCIP settings */
242  	   BMS_BLKMEM*           blkmem              /**< block memory */
243  	   );
244  	
245  	/** reset marks of stored solutions to not updated */
246  	void SCIPreoptResetSolMarks(
247  	   SCIP_REOPT*           reopt               /**< reoptimization data */
248  	   );
249  	
250  	/** returns the number of stored nodes */
251  	int SCIPreoptGetNNodes(
252  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
253  	   SCIP_NODE*            node                /**< node of the search tree */
254  	   );
255  	
256  	/** save information that given node is infeasible */
257  	SCIP_RETCODE SCIPreoptAddInfNode(
258  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
259  	   SCIP_SET*             set,                /**< global SCIP settings */
260  	   BMS_BLKMEM*           blkmem,             /**< block memory */
261  	   SCIP_NODE*            node                /**< node of the search tree */
262  	   );
263  	
264  	/** check the reason for cut off a node and if necessary store the node */
265  	SCIP_RETCODE SCIPreoptCheckCutoff(
266  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
267  	   SCIP_SET*             set,                /**< global SCIP settings */
268  	   BMS_BLKMEM*           blkmem,             /**< block memery */
269  	   SCIP_NODE*            node,               /**< node of the search tree */
270  	   SCIP_EVENTTYPE        eventtype,          /**< eventtype */
271  	   SCIP_LP*              lp,                 /**< LP data */
272  	   SCIP_LPSOLSTAT        lpsolstat,          /**< solution status of the LP */
273  	   SCIP_Bool             isrootnode,         /**< the node is the root */
274  	   SCIP_Bool             isfocusnode,        /**< the node is the current focus node */
275  	   SCIP_Real             lowerbound,         /**< lower bound of the node */
276  	   int                   effectiverootdepth  /**< effective root depth */
277  	   );
278  	
279  	/** store bound change based on dual information */
280  	SCIP_RETCODE SCIPreoptAddDualBndchg(
281  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
282  	   SCIP_SET*             set,                /**< global SCIP settings */
283  	   BMS_BLKMEM*           blkmem,             /**< block memory */
284  	   SCIP_NODE*            node,               /**< node of the search tree */
285  	   SCIP_VAR*             var,                /**< variables */
286  	   SCIP_Real             newval,             /**< new bound */
287  	   SCIP_Real             oldval              /**< old bound */
288  	   );
289  	
290  	/** returns the number of bound changes based on dual information */
291  	int SCIPreoptGetNDualBndchgs(
292  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
293  	   SCIP_NODE*            node                /**< node of the search tree */
294  	   );
295  	
296  	/** returns the number of leaf nodes of the subtree induced by @p node (of the whole tree if node == NULL) */
297  	int SCIPreoptGetNLeaves(
298  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
299  	   SCIP_NODE*            node                /**< node of the search tree */
300  	   );
301  	
302  	/** returns the child nodes of @p node that need to be reoptimized next or NULL if @p node is a leaf */
303  	SCIP_RETCODE SCIPreoptGetChildIDs(
304  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
305  	   SCIP_SET*             set,                /**< global SCIP settings */
306  	   BMS_BLKMEM*           blkmem,             /**< block memory */
307  	   SCIP_NODE*            node,               /**< node of the search tree */
308  	   unsigned int*         childs,             /**< array to store the child ids */
309  	   int                   childssize,         /**< size of the childs array */
310  	   int*                  nchilds             /**< pointer to store the number of child nodes */
311  	   );
312  	
313  	/** returns all leaves of the subtree induced by @p node */
314  	SCIP_RETCODE SCIPreoptGetLeaves(
315  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
316  	   SCIP_NODE*            node,               /**< node of the search tree */
317  	   unsigned int*         leaves,             /**< array to the the ids */
318  	   int                   leavessize,         /**< size of leaves array */
319  	   int*                  nleaves             /**< pointer to store the number of leaf node */
320  	   );
321  	
322  	/** returns the time needed to store the nodes for reoptimization */
323  	SCIP_Real SCIPreoptGetSavingtime(
324  	   SCIP_REOPT*           reopt               /**< reoptimization data */
325  	   );
326  	
327  	/** store a global constraint that should be added at the beginning of the next iteration */
328  	SCIP_RETCODE SCIPreoptAddGlbCons(
329  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
330  	   SCIP_VAR**            vars,               /**< array to store the variables of the constraint */
331  	   SCIP_Real*            vals,               /**< array to store the coefficients of the variables */
332  	   int                   nvars,              /**< pointer to store the size of the constraints */
333  	   BMS_BLKMEM*           blkmem              /**< block memory */
334  	   );
335  	
336  	/** add the stored constraints globally to the problem */
337  	SCIP_RETCODE SCIPreoptApplyGlbConss(
338  	   SCIP*                 scip,               /**< SCIP data structure */
339  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
340  	   SCIP_SET*             set,                /**< global SCIP settings */
341  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
342  	   BMS_BLKMEM*           blkmem              /**< block memory */
343  	   );
344  	
345  	/** add the stored cuts to the separation storage */
346  	SCIP_RETCODE SCIPreoptApplyCuts(
347  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
348  	   SCIP_NODE*            node,               /**< current focus node */
349  	   SCIP_SEPASTORE*       sepastore,          /**< separation storage */
350  	   SCIP_CUTPOOL*         cutpool,            /**< global cutpool */
351  	   BMS_BLKMEM*           blkmem,             /**< block memory */
352  	   SCIP_SET*             set,                /**< global SCIP settings */
353  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
354  	   SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
355  	   SCIP_EVENTFILTER*     eventfilter,        /**< event filter */
356  	   SCIP_LP*              lp,                 /**< current LP */
357  	   SCIP_Bool             root                /**< bool whether the current node is the root */
358  	   );
359  	
360  	/** check if the LP of the given node should be solved or not */
361  	SCIP_Bool SCIPreoptGetSolveLP(
362  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
363  	   SCIP_SET*             set,                /**< global SCIP settings */
364  	   SCIP_NODE*            node                /**< node of the current search tree */
365  	   );
366  	
367  	/** reactivate the given @p reoptnode and split them into several nodes if necessary */
368  	SCIP_RETCODE SCIPreoptApply(
369  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
370  	   SCIP*                 scip,               /**< SCIP data structure */
371  	   SCIP_SET*             set,                /**< global SCIP settings */
372  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
373  	   SCIP_PROB*            transprob,          /**< transformed problem */
374  	   SCIP_PROB*            origprob,           /**< original problem */
375  	   SCIP_TREE*            tree,               /**< branching tree */
376  	   SCIP_LP*              lp,                 /**< current LP */
377  	   SCIP_BRANCHCAND*      branchcand,         /**< branching candidate */
378  	   SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
379  	   SCIP_CLIQUETABLE*     cliquetable,        /**< clique table */
380  	   BMS_BLKMEM*           blkmem,             /**< block memory */
381  	   SCIP_REOPTNODE*       reoptnode,          /**< node of the reoptimization tree to reactivate */
382  	   unsigned int          id,                 /**< id of the node to reactivate */
383  	   SCIP_Real             estimate,           /**< estimate of the child nodes that should be created */
384  	   SCIP_NODE**           childnodes,         /**< array to store the created child nodes */
385  	   int*                  ncreatedchilds,     /**< pointer to store number of created child nodes */
386  	   int*                  naddedconss,        /**< pointer to store number of generated constraints */
387  	   int                   childnodessize,     /**< available size of childnodes array */
388  	   SCIP_Bool*            success             /**< pointer store the result */
389  	   );
390  	
391  	/** delete a node stored in the reoptimization tree */
392  	SCIP_RETCODE SCIPreoptDeleteNode(
393  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
394  	   SCIP_SET*             set,                /**< global SCIP settings */
395  	   unsigned int          id,                 /**< id of the node */
396  	   BMS_BLKMEM*           blkmem              /**< block memory */
397  	   );
398  	
399  	/** reset the stored information abound bound changes based on dual information */
400  	SCIP_RETCODE SCIPreoptResetDualBndchgs(
401  	   SCIP_REOPT*           reopt,              /**< reoptimization data */
402  	   SCIP_NODE*            node,               /**< node of the search tree */
403  	   BMS_BLKMEM*           blkmem              /**< block memory */
404  	   );
405  	
406  	/** splits the root into several nodes and moves the child nodes of the root to one of the created nodes */
407  	SCIP_RETCODE SCIPreoptSplitRoot(
408  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
409  	   SCIP_TREE*            tree,               /**< branch and bound tree */
410  	   SCIP_SET*             set,                /**< global SCIP settings */
411  	   SCIP_STAT*            stat,               /**< dynamic SCIP statistics */
412  	   BMS_BLKMEM*           blkmem,             /**< block memory */
413  	   int*                  ncreatedchilds,     /**< pointer to store the number of created nodes */
414  	   int*                  naddedconss         /**< pointer to store the number added constraints */
415  	   );
416  	
417  	/** reset the complete tree and set the given search frontier */
418  	SCIP_RETCODE SCIPreoptApplyCompression(
419  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
420  	   SCIP_SET*             set,                /**< global SCIP settings */
421  	   BMS_BLKMEM*           blkmem,             /**< block memory */
422  	   SCIP_REOPTNODE**      representatives,    /**< array of representatives */
423  	   int                   nrepresentatives,   /**< number of representatives */
424  	   SCIP_Bool*            success             /**< pointer to store if the method was successful */
425  	   );
426  	
427  	/** add all unprocessed nodes to the reoptimization tree */
428  	SCIP_RETCODE SCIPreoptSaveOpenNodes(
429  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
430  	   SCIP_SET*             set,                /**< global SCIP settings */
431  	   SCIP_LP*              lp,                 /**< LP data */
432  	   BMS_BLKMEM*           blkmem,             /**< block memory */
433  	   SCIP_NODE**           leaves,             /**< array of open leave nodes */
434  	   int                   nleaves,            /**< number of open leave nodes */
435  	   SCIP_NODE**           childs,             /**< array of open children nodes */
436  	   int                   nchilds,            /**< number of open leave nodes */
437  	   SCIP_NODE**           siblings,           /**< array of open sibling nodes */
438  	   int                   nsiblings           /**< number of open leave nodes */
439  	   );
440  	
441  	/** merges the variable history of the current run with the stored history */
442  	SCIP_RETCODE SCIPreoptMergeVarHistory(
443  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
444  	   SCIP_SET*             set,                /**< global SCIP settings */
445  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
446  	   SCIP_VAR**            vars,               /**< original problem variables */
447  	   int                   nvars               /**< number of original problem variables */
448  	   );
449  	
450  	/** updates the variable history */
451  	SCIP_RETCODE SCIPreoptUpdateVarHistory(
452  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
453  	   SCIP_SET*             set,                /**< global SCIP settings */
454  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
455  	   BMS_BLKMEM*           blkmem,             /**< block memory */
456  	   SCIP_VAR**            vars,               /**< variable array */
457  	   int                   nvars               /**< number of variables */
458  	   );
459  	
460  	/*
461  	 * methods for reoptnode
462  	 */
463  	
464  	/** initialize an empty node */
465  	void SCIPreoptnodeInit(
466  	   SCIP_REOPTNODE*       reoptnode,          /**< node of the reopttree */
467  	   SCIP_SET*             set                 /**< global SCIP settings */
468  	   );
469  	
470  	/** reset the given reoptimization node */
471  	SCIP_RETCODE SCIPreoptnodeReset(
472  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
473  	   SCIP_SET*             set,                /**< global SCIP settings */
474  	   BMS_BLKMEM*           blkmem,             /**< block memory */
475  	   SCIP_REOPTNODE*       reoptnode           /**< reoptimization node */
476  	   );
477  	
478  	/** delete the given reoptimization node */
479  	SCIP_RETCODE SCIPreoptnodeDelete(
480  	   SCIP_REOPTNODE**      reoptnode,          /**< pointer of reoptnode */
481  	   BMS_BLKMEM*           blkmem              /**< block memory */
482  	   );
483  	
484  	/** add a variable to a given reoptnode */
485  	SCIP_RETCODE SCIPreoptnodeAddBndchg(
486  	   SCIP_REOPTNODE*       reoptnode,          /**< node of the reopttree */
487  	   SCIP_SET*             set,                /**< global SCIP settings */
488  	   BMS_BLKMEM*           blkmem,             /**< block memory */
489  	   SCIP_VAR*             var,                /**< variable to add */
490  	   SCIP_Real             val,                /**< value of the variable */
491  	   SCIP_BOUNDTYPE        boundtype           /**< boundtype of the variable */
492  	   );
493  	
494  	/** add a constraint to a given reoptnode */
495  	SCIP_RETCODE SCIPreoptnodeAddCons(
496  	   SCIP_REOPTNODE*       reoptnode,          /**< node of the reopttree */
497  	   SCIP_SET*             set,                /**< global SCIP settings */
498  	   BMS_BLKMEM*           blkmem,             /**< block memory */
499  	   SCIP_VAR**            vars,               /**< variables which are part of the constraint */
500  	   SCIP_Real*            bounds,             /**< bounds of the variables */
501  	   SCIP_BOUNDTYPE*       boundtypes,         /**< boundtypes of the varibales (or NULL is the constraint is a cut) */
502  	   SCIP_Real             lhs,                /**< lhs of the constraint */
503  	   SCIP_Real             rhs,                /**< rhs of the constraint */
504  	   int                   nvars,              /**< number of variables */
505  	   REOPT_CONSTYPE        constype,           /**< type of the constraint */
506  	   SCIP_Bool             linear              /**< the given constraint has a linear representation */
507  	   );
508  	
509  	/** return the branching path of the given node in the reoptimization tree */
510  	void SCIPreoptnodeGetPath(
511  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
512  	   SCIP_REOPTNODE*       reoptnode,          /**< node of the reoptimization tree */
513  	   SCIP_VAR**            vars,               /**< array for variables */
514  	   SCIP_Real*            vals,               /**< array for values */
515  	   SCIP_BOUNDTYPE*       boundtypes,         /**< array for bound types */
516  	   int                   varssize,           /**< size of arrays vars, vals, and boundtypes */
517  	   int*                  nbndchgs,           /**< pointer to store the number of bound changes */
518  	   int*                  nbndchgsafterdual   /**< pointer to store the number of bound changes applied after
519  	                                              *  the first dual reduction at the given node */
520  	   );
521  	
522  	/** add a constraint to the reoptimization data structure */
523  	SCIP_RETCODE SCIPreoptAddCons(
524  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
525  	   SCIP_SET*             set,                /**< global SCIP settings */
526  	   BMS_BLKMEM*           blkmem,             /**< block memory */
527  	   SCIP_CONS*            cons                /**< constraint to add */
528  	   );
529  	
530  	/** save global lower and upper bounds
531  	 *
532  	 *  @note this method can only called once, i.e., after fishing presolving of the first problem
533  	 */
534  	SCIP_RETCODE SCIPreoptSaveGlobalBounds(
535  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
536  	   SCIP_PROB*            transprob,          /**< transformed problem data */
537  	   BMS_BLKMEM*           blkmem              /**< block memory */
538  	   );
539  	
540  	/** save active constraints
541  	 *
542  	 *  @note this method can only called once, i.e., after fishing presolving of the first problem
543  	 */
544  	SCIP_RETCODE SCIPreoptSaveActiveConss(
545  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
546  	   SCIP_SET*             set,                /**< global SCIP settings */
547  	   SCIP_PROB*            transprob,          /**< transformed problem data */
548  	   BMS_BLKMEM*           blkmem              /**< block memory */
549  	   );
550  	
551  	/** installs global lower and upper bounds */
552  	SCIP_RETCODE SCIPreoptInstallBounds(
553  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
554  	   SCIP_SET*             set,                /**< global SCIP settings */
555  	   SCIP_STAT*            stat,               /**< dynamic SCIP statistics */
556  	   SCIP_PROB*            transprob,          /**< transformed problem data */
557  	   SCIP_LP*              lp,                 /**< current LP data */
558  	   SCIP_BRANCHCAND*      branchcand,         /**< branching candidate storage */
559  	   SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
560  	   SCIP_CLIQUETABLE*     cliquetable,        /**< clique table data structure */
561  	   BMS_BLKMEM*           blkmem              /**< block memory */
562  	   );
563  	
564  	/** reactivate globally valid constraints that were deactivated and necessary to ensure correctness */
565  	SCIP_RETCODE SCIPreoptResetActiveConss(
566  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
567  	   SCIP_SET*             set,                /**< global SCIP settings */
568  	   SCIP_STAT*            stat                /**< dynamic SCIP statistics */
569  	   );
570  	
571  	
572  	/** returns whether a constraint is necessary to ensure correctness and cannot be deleted */
573  	SCIP_Bool SCIPreoptConsCanBeDeleted(
574  	   SCIP_REOPT*           reopt,              /**< reoptimization data structure */
575  	   SCIP_CONS*            cons                /**< problem constraint */
576  	   );
577  	
578  	#ifdef __cplusplus
579  	}
580  	#endif
581  	
582  	#endif
583