Scippy

SCIP

Solving Constraint Integer Programs

type_prop.h
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-2016 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file type_prop.h
17  * @ingroup TYPEDEFINITIONS
18  * @brief type definitions for propagators
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_TYPE_PROP_H__
25 #define __SCIP_TYPE_PROP_H__
26 
27 #include "scip/def.h"
28 #include "scip/type_retcode.h"
29 #include "scip/type_result.h"
30 #include "scip/type_scip.h"
31 #include "scip/type_timing.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 typedef struct SCIP_Prop SCIP_PROP; /**< propagator */
38 typedef struct SCIP_PropData SCIP_PROPDATA; /**< locally defined propagator data */
39 
40 
41 /** copy method for propagator plugins (called when SCIP copies plugins)
42  *
43  * input:
44  * - scip : SCIP main data structure
45  * - prop : the propagator itself
46  */
47 #define SCIP_DECL_PROPCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
48 
49 /** destructor of propagator to free user data (called when SCIP is exiting)
50  *
51  * input:
52  * - scip : SCIP main data structure
53  * - prop : the propagator itself
54  */
55 #define SCIP_DECL_PROPFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
56 
57 /** initialization method of propagator (called after problem was transformed)
58  *
59  * input:
60  * - scip : SCIP main data structure
61  * - prop : the propagator itself
62  */
63 #define SCIP_DECL_PROPINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
64 
65 /** deinitialization method of propagator (called before transformed problem is freed)
66  *
67  * input:
68  * - scip : SCIP main data structure
69  * - prop : the propagator itself
70  */
71 #define SCIP_DECL_PROPEXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
72 
73 /** presolving initialization method of propagator (called when presolving is about to begin)
74  *
75  * This method is called when the presolving process is about to begin, even if presolving is turned off. The
76  * propagator may use this call to initialize its presolving data, before the presolving process begins.
77  *
78  * Necessary modifications that have to be performed even if presolving is turned off should be done here or in the
79  * presolving deinitialization call (SCIP_DECL_PROPEXITPRE()).
80  *
81  * input:
82  * - scip : SCIP main data structure
83  * - prop : the propagator itself
84  */
85 #define SCIP_DECL_PROPINITPRE(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
86 
87 /** presolving deinitialization method of propagator (called after presolving has been finished)
88  *
89  * This method is called after the presolving has been finished, even if presolving is turned off.
90  * The propagator may use this call e.g. to clean up its presolving data.
91  *
92  * Besides necessary modifications and clean up, no time consuming operations should be performed, especially if the
93  * problem has already been solved. Use the method SCIPgetStatus(), which in this case returns SCIP_STATUS_OPTIMAL,
94  * SCIP_STATUS_INFEASIBLE, SCIP_STATUS_UNBOUNDED, or SCIP_STATUS_INFORUNBD.
95  *
96  * input:
97  * - scip : SCIP main data structure
98  * - prop : the propagator itself
99  */
100 #define SCIP_DECL_PROPEXITPRE(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
101 
102 /** solving process initialization method of propagator (called when branch and bound process is about to begin)
103  *
104  * This method is called when the presolving was finished and the branch and bound process is about to begin.
105  * The propagator may use this call to initialize its branch and bound specific data.
106  *
107  * Besides necessary modifications and clean up, no time consuming operations should be performed, especially if the
108  * problem has already been solved. Use the method SCIPgetStatus(), which in this case returns SCIP_STATUS_OPTIMAL,
109  * SCIP_STATUS_INFEASIBLE, SCIP_STATUS_UNBOUNDED, or SCIP_STATUS_INFORUNBD.
110  *
111  * input:
112  * - scip : SCIP main data structure
113  * - prop : the propagator itself
114  */
115 #define SCIP_DECL_PROPINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop)
116 
117 /** solving process deinitialization method of propagator (called before branch and bound process data is freed)
118  *
119  * This method is called before the branch and bound process is freed.
120  * The propagator should use this call to clean up its branch and bound data.
121  *
122  * input:
123  * - scip : SCIP main data structure
124  * - prop : the propagator itself
125  * - restart : was this exit solve call triggered by a restart?
126  */
127 #define SCIP_DECL_PROPEXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop, SCIP_Bool restart)
128 
129 /** presolving method of propagator
130  *
131  * The presolver should go through the variables and constraints and tighten the domains or
132  * constraints. Each tightening should increase the given total numbers of changes.
133  *
134  * input:
135  * - scip : SCIP main data structure
136  * - prop : the propagator itself
137  * - nrounds : number of presolving rounds already done
138  * - presoltiming : current presolving timing
139  * - nnewfixedvars : number of variables fixed since the last call to the presolving method
140  * - nnewaggrvars : number of variables aggregated since the last call to the presolving method
141  * - nnewchgvartypes : number of variable type changes since the last call to the presolving method
142  * - nnewchgbds : number of variable bounds tightened since the last call to the presolving method
143  * - nnewholes : number of domain holes added since the last call to the presolving method
144  * - nnewdelconss : number of deleted constraints since the last call to the presolving method
145  * - nnewaddconss : number of added constraints since the last call to the presolving method
146  * - nnewupgdconss : number of upgraded constraints since the last call to the presolving method
147  * - nnewchgcoefs : number of changed coefficients since the last call to the presolving method
148  * - nnewchgsides : number of changed left or right hand sides since the last call to the presolving method
149  *
150  * @note the counters state the changes since the last call including the changes of this presolving method during its
151  * last call
152  *
153  * @note if the propagator uses dual information for presolving it is nesassary to check via calling SCIPallowDualReds
154  * if dual reductions are allowed.
155  *
156  * input/output:
157  * - nfixedvars : pointer to total number of variables fixed of all presolvers
158  * - naggrvars : pointer to total number of variables aggregated of all presolvers
159  * - nchgvartypes : pointer to total number of variable type changes of all presolvers
160  * - nchgbds : pointer to total number of variable bounds tightened of all presolvers
161  * - naddholes : pointer to total number of domain holes added of all presolvers
162  * - ndelconss : pointer to total number of deleted constraints of all presolvers
163  * - naddconss : pointer to total number of added constraints of all presolvers
164  * - nupgdconss : pointer to total number of upgraded constraints of all presolvers
165  * - nchgcoefs : pointer to total number of changed coefficients of all presolvers
166  * - nchgsides : pointer to total number of changed left/right hand sides of all presolvers
167  *
168  * output:
169  * - result : pointer to store the result of the presolving call
170  *
171  * possible return values for *result:
172  * - SCIP_UNBOUNDED : at least one variable is not bounded by any constraint in obj. direction -> problem is unbounded
173  * - SCIP_CUTOFF : at least one constraint is infeasible in the variable's bounds -> problem is infeasible
174  * - SCIP_SUCCESS : the presolving method found a reduction
175  * - SCIP_DIDNOTFIND : the presolving method searched, but did not find a presolving change
176  * - SCIP_DIDNOTRUN : the presolving method was skipped
177  * - SCIP_DELAYED : the presolving method was skipped, but should be called again
178  */
179 #define SCIP_DECL_PROPPRESOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop, int nrounds, SCIP_PRESOLTIMING presoltiming, \
180  int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, \
181  int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, \
182  int* nfixedvars, int* naggrvars, int* nchgvartypes, int* nchgbds, int* naddholes, \
183  int* ndelconss, int* naddconss, int* nupgdconss, int* nchgcoefs, int* nchgsides, SCIP_RESULT* result)
184 
185 /** execution method of propagator
186  *
187  * Searches for domain propagations. The method is called in the node processing loop.
188  *
189  * input:
190  * - scip : SCIP main data structure
191  * - prop : the propagator itself
192  * - proptiming : current point in the node solving loop
193  * - result : pointer to store the result of the propagation call
194  *
195  * possible return values for *result:
196  * - SCIP_CUTOFF : the current node is infeasible for the current domains
197  * - SCIP_REDUCEDDOM : at least one domain reduction was found
198  * - SCIP_DIDNOTFIND : the propagator searched, but did not find a domain reduction
199  * - SCIP_DIDNOTRUN : the propagator was skipped
200  * - SCIP_DELAYED : the propagator was skipped, but should be called again
201  */
202 #define SCIP_DECL_PROPEXEC(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop, SCIP_PROPTIMING proptiming, SCIP_RESULT* result)
203 
204 
205 /** propagation conflict resolving method of propagator
206  *
207  * This method is called during conflict analysis. If the propagator wants to support conflict analysis,
208  * it should call SCIPinferVarLbProp() or SCIPinferVarUbProp() in domain propagation instead of SCIPchgVarLb() or
209  * SCIPchgVarUb() in order to deduce bound changes on variables.
210  * In the SCIPinferVarLbProp() and SCIPinferVarUbProp() calls, the propagator provides a pointer to itself
211  * and an integer value "inferinfo" that can be arbitrarily chosen.
212  * The propagation conflict resolving method can then be implemented, to provide a "reasons" for the bound
213  * changes, i.e. the bounds of variables at the time of the propagation, that forced the propagator to set the
214  * conflict variable's bound to its current value. It can use the "inferinfo" tag to identify its own propagation
215  * rule and thus identify the "reason" bounds. The bounds that form the reason of the assignment must then be provided
216  * by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
217  * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and/or SCIPaddConflictBinvar() in the propagation conflict
218  * resolving method.
219  *
220  * See the description of the propagation conflict resolving method of constraint handlers for further details.
221  *
222  * @note if the propagtor uses dual information it is nesassary to check via calling SCIPallowDualReds and
223  * SCIPallowObjProp if dual reductions and propgation with the current cutoff bound, resp., are allowed.
224  *
225  * input:
226  * - scip : SCIP main data structure
227  * - prop : the propagator itself
228  * - infervar : the conflict variable whose bound change has to be resolved
229  * - inferinfo : the user information passed to the corresponding SCIPinferVarLbProp() or SCIPinferVarUbProp() call
230  * - boundtype : the type of the changed bound (lower or upper bound)
231  * - bdchgidx : the index of the bound change, representing the point of time where the change took place
232  * - relaxedbd : the relaxed bound which is sufficient to be explained
233  *
234  * output:
235  * - result : pointer to store the result of the propagation conflict resolving call
236  *
237  * possible return values for *result:
238  * - SCIP_SUCCESS : the conflicting bound change has been successfully resolved by adding all reason bounds
239  * - SCIP_DIDNOTFIND : the conflicting bound change could not be resolved and has to be put into the conflict set
240  *
241  * @note it is sufficient to explain/resolve the relaxed bound
242  */
243 #define SCIP_DECL_PROPRESPROP(x) SCIP_RETCODE x (SCIP* scip, SCIP_PROP* prop, SCIP_VAR* infervar, int inferinfo, \
244  SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX* bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT* result)
245 
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #endif
timing definitions for SCIP
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP