SCIP Doxygen Documentation
Loading...
Searching...
No Matches
type_cons.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-2026 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 type_cons.h
26 * @ingroup TYPEDEFINITIONS
27 * @brief type definitions for constraints and constraint handlers
28 * @author Tobias Achterberg
29 * @author Stefan Heinz
30 *
31 * This file defines the interface for constraint handlers implemented in C.
32 *
33 * - \ref CONS "Instructions for implementing a constraint handler"
34 * - \ref CONSHDLRS "List of available constraint handlers"
35 * - \ref scip::ObjConshdlr "C++ wrapper class"
36 */
37
38/** @defgroup DEFPLUGINS_CONS Default constraint handlers
39 * @ingroup DEFPLUGINS
40 * @brief implementation files (.c files) of the default constraint handlers of SCIP
41 */
42
43/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
44
45#ifndef __SCIP_TYPE_CONS_H__
46#define __SCIP_TYPE_CONS_H__
47
48#include "scip/def.h"
49#include "scip/type_lp.h"
50#include "scip/type_retcode.h"
51#include "scip/type_result.h"
52#include "scip/type_var.h"
53#include "scip/type_sol.h"
54#include "scip/type_scip.h"
55#include "scip/type_timing.h"
56#include "scip/type_heur.h"
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62typedef struct SCIP_Conshdlr SCIP_CONSHDLR; /**< constraint handler for a specific constraint type */
63typedef struct SCIP_Cons SCIP_CONS; /**< constraint data structure */
64typedef struct SCIP_ConshdlrData SCIP_CONSHDLRDATA; /**< constraint handler data */
65typedef struct SCIP_ConsData SCIP_CONSDATA; /**< locally defined constraint type specific data */
66typedef struct SCIP_ConsSetChg SCIP_CONSSETCHG; /**< tracks additions and removals of the set of active constraints */
67typedef struct SCIP_LinConsStats SCIP_LINCONSSTATS; /**< linear constraint classification statistics used for MIPLIB */
68typedef struct SYM_Graph SYM_GRAPH; /**< data to encode a symmetry detection graph */
69
70/** linear constraint types recognizable */
72{
73 SCIP_LINCONSTYPE_EMPTY = 0, /**< linear constraints with no variables */
74 SCIP_LINCONSTYPE_FREE = 1, /**< linear constraints with no finite side */
75 SCIP_LINCONSTYPE_SINGLETON = 2, /**< linear constraints with a single variable */
76 SCIP_LINCONSTYPE_AGGREGATION = 3, /**< linear constraints of the type \f$ ax + by = c\f$ */
77 SCIP_LINCONSTYPE_PRECEDENCE = 4, /**< linear constraints of the type \f$ a x - a y \leq b\f$ where \f$x\f$ and \f$y\f$ must have the same type */
78 SCIP_LINCONSTYPE_VARBOUND = 5, /**< linear constraints of the form \f$ ax + by \leq c \, x \in \{0,1\} \f$ */
79 SCIP_LINCONSTYPE_SETPARTITION = 6, /**< linear constraints of the form \f$ \sum x_i = 1\, x_i \in \{0,1\} \forall i \f$ */
80 SCIP_LINCONSTYPE_SETPACKING = 7, /**< linear constraints of the form \f$ \sum x_i \leq 1\, x_i \in \{0,1\} \forall i \f$ */
81 SCIP_LINCONSTYPE_SETCOVERING = 8, /**< linear constraints of the form \f$ \sum x_i \geq 1\, x_i \in \{0,1\} \forall i \f$ */
82 SCIP_LINCONSTYPE_CARDINALITY = 9, /**< linear constraints of the form \f$ \sum x_i = k\, x_i \in \{0,1\} \forall i, \, k\geq 2 \f$ */
83 SCIP_LINCONSTYPE_INVKNAPSACK = 10, /**< linear constraints of the form \f$ \sum x_i \leq b\, x_i \in \{0,1\} \forall i, \, b\in \mathbb{n} \geq 2 \f$ */
84 SCIP_LINCONSTYPE_EQKNAPSACK = 11, /**< linear constraints of the form \f$ \sum a_i x_i = b\, x_i \in \{0,1\} \forall i, \, b\in \mathbb{n} \geq 2 \f$ */
85 SCIP_LINCONSTYPE_BINPACKING = 12, /**< linear constraints of the form \f$ \sum a_i x_i + a x \leq a\, x, x_i \in \{0,1\} \forall i, \, a\in \mathbb{n} \geq 2 \f$ */
86 SCIP_LINCONSTYPE_KNAPSACK = 13, /**< linear constraints of the form \f$ \sum a_k x_k \leq b\, x_i \in \{0,1\} \forall i, \, b\in \mathbb{n} \geq 2 \f$ */
87 SCIP_LINCONSTYPE_INTKNAPSACK = 14, /**< linear constraints of the form \f$ \sum a_k x_k \leq b\, x_i \in \mathbb{Z} \forall i, \, b\in \mathbb{n} \f$ */
88 SCIP_LINCONSTYPE_MIXEDBINARY = 15, /**< linear constraints of the form \f$ \sum a_k x_k + \sum p_j s_j \leq/= b\, x_i \in \{0,1\} \forall i, s_j \in \text{ cont. } \forall j\f$ */
89 SCIP_LINCONSTYPE_GENERAL = 16 /**< general linear constraints with no special structure */
90};
92
93#define SCIP_NLINCONSTYPES ((int)SCIP_LINCONSTYPE_GENERAL+1)
94
95/** copy method for constraint handler plugins (called when SCIP copies plugins)
96 *
97 * If the copy process was one to one, the valid pointer can be set to TRUE. Otherwise, this pointer has to be set to
98 * FALSE. If all problem defining objects (constraint handlers and variable pricers) return valid = TRUE for all
99 * their copying calls, SCIP assumes that it is an overall one to one copy of the original instance. In this case any
100 * reductions made in the copied SCIP instance can be transfered to the original SCIP instance. If the valid pointer is
101 * set to TRUE and it was not a one to one copy, it might happen that optimal solutions are cut off.
102 *
103 * input:
104 * - scip : SCIP main data structure
105 * - conshdlr : the constraint handler itself
106 * - valid : was the copying process valid?
107 */
108#define SCIP_DECL_CONSHDLRCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_Bool* valid)
109
110/** destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
111 *
112 * input:
113 * - scip : SCIP main data structure
114 * - conshdlr : the constraint handler itself
115 */
116#define SCIP_DECL_CONSFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr)
117
118/** initialization method of constraint handler (called after problem was transformed)
119 *
120 * input:
121 * - scip : SCIP main data structure
122 * - conshdlr : the constraint handler itself
123 * - conss : array of constraints in transformed problem
124 * - nconss : number of constraints in transformed problem
125 */
126#define SCIP_DECL_CONSINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
127
128/** deinitialization method of constraint handler (called before transformed problem is freed)
129 *
130 * input:
131 * - scip : SCIP main data structure
132 * - conshdlr : the constraint handler itself
133 * - conss : array of constraints in transformed problem
134 * - nconss : number of constraints in transformed problem
135 */
136#define SCIP_DECL_CONSEXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
137
138/** presolving initialization method of constraint handler (called when presolving is about to begin)
139 *
140 * This method is called when the presolving process is about to begin, even if presolving is turned off.
141 * The constraint handler may use this call to initialize its data structures.
142 *
143 * Necessary modifications that have to be performed even if presolving is turned off should be done here or in the
144 * presolving deinitialization call (SCIP_DECL_CONSEXITPRE()).
145 *
146 * @note Note that the constraint array might contain constraints that were created but not added to the problem.
147 * Constraints that are not added, i.e., for which SCIPconsIsAdded() returns FALSE, cannot be used for problem
148 * reductions.
149 *
150 * input:
151 * - scip : SCIP main data structure
152 * - conshdlr : the constraint handler itself
153 * - conss : array of constraints in transformed problem
154 * - nconss : number of constraints in transformed problem
155 */
156#define SCIP_DECL_CONSINITPRE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
157
158/** presolving deinitialization method of constraint handler (called after presolving has been finished)
159 *
160 * This method is called after the presolving has been finished, even if presolving is turned off.
161 * The constraint handler may use this call e.g. to clean up or modify its data structures.
162 *
163 * Necessary modifications that have to be performed even if presolving is turned off should be done here or in the
164 * presolving initialization call (SCIP_DECL_CONSINITPRE()).
165 *
166 * Besides necessary modifications and clean up, no time consuming operations should be performed, especially if the
167 * problem has already been solved. Use the method SCIPgetStatus(), which in this case returns SCIP_STATUS_OPTIMAL,
168 * SCIP_STATUS_INFEASIBLE, SCIP_STATUS_UNBOUNDED, or SCIP_STATUS_INFORUNBD.
169 *
170 * @note Note that the constraint array might contain constraints that were created but not added to the problem.
171 * Constraints that are not added, i.e., for which SCIPconsIsAdded() returns FALSE, cannot be used for problem
172 * reductions.
173 *
174 * input:
175 * - scip : SCIP main data structure
176 * - conshdlr : the constraint handler itself
177 * - conss : final array of constraints in transformed problem
178 * - nconss : final number of constraints in transformed problem
179 */
180#define SCIP_DECL_CONSEXITPRE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
181
182/** solving process initialization method of constraint handler (called when branch and bound process is about to begin)
183 *
184 * This method is called when the presolving was finished and the branch and bound process is about to begin.
185 * The constraint handler may use this call to initialize its branch and bound specific data.
186 *
187 * Besides necessary modifications and clean up, no time consuming operations should be performed, especially if the
188 * problem has already been solved. Use the method SCIPgetStatus(), which in this case returns SCIP_STATUS_OPTIMAL,
189 * SCIP_STATUS_INFEASIBLE, SCIP_STATUS_UNBOUNDED, or SCIP_STATUS_INFORUNBD.
190 *
191 * @note Note that the constraint array might contain constraints that were created but not added to the problem.
192 * Constraints that are not added, i.e., for which SCIPconsIsAdded() returns FALSE, cannot be used for problem
193 * reductions.
194 *
195 * input:
196 * - scip : SCIP main data structure
197 * - conshdlr : the constraint handler itself
198 * - conss : array of constraints of the constraint handler
199 * - nconss : number of constraints of the constraint handler
200 */
201#define SCIP_DECL_CONSINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
202
203/** solving process deinitialization method of constraint handler (called before branch and bound process data is freed)
204 *
205 * This method is called before the branch and bound process is freed.
206 * The constraint handler should use this call to clean up its branch and bound data, in particular to release
207 * all LP rows that he has created or captured.
208 *
209 * input:
210 * - scip : SCIP main data structure
211 * - conshdlr : the constraint handler itself
212 * - conss : array of constraints of the constraint handler
213 * - nconss : number of constraints of the constraint handler
214 * - restart : was this exit solve call triggered by a restart?
215 */
216#define SCIP_DECL_CONSEXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_Bool restart)
217
218/** frees specific constraint data
219 *
220 * @warning There may exist unprocessed events. For example, a variable's bound may have been already changed, but the
221 * corresponding bound change event was not yet processed.
222 *
223 * input:
224 * - scip : SCIP main data structure
225 * - conshdlr : the constraint handler itself
226 * - cons : the constraint belonging to the constraint data
227 * - consdata : pointer to the constraint data to free
228 */
229#define SCIP_DECL_CONSDELETE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, SCIP_CONSDATA** consdata)
230
231/** transforms constraint data into data belonging to the transformed problem
232 *
233 * input:
234 * - scip : SCIP main data structure
235 * - conshdlr : the constraint handler itself
236 * - sourcecons : source constraint to transform
237 * - targetcons : pointer to store created target constraint
238 */
239#define SCIP_DECL_CONSTRANS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* sourcecons, SCIP_CONS** targetcons)
240
241/** LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)
242 *
243 * Puts the LP relaxations of all "initial" constraints into the LP. The method should put a canonic LP relaxation
244 * of all given constraints to the LP with calls to SCIPaddRow().
245 *
246 * @warning It is not guaranteed that the problem is going to be declared infeasible if the infeasible pointer is set
247 * to TRUE. Therefore, it is recommended that users do not end this method prematurely when an infeasiblity
248 * is detected.
249 *
250 * input:
251 * - scip : SCIP main data structure
252 * - conshdlr : the constraint handler itself
253 * - conss : array of constraints to process
254 * - nconss : number of constraints to process
255 *
256 * output:
257 * - infeasible : pointer to store whether an infeasibility was detected while building the LP
258 */
259#define SCIP_DECL_CONSINITLP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_Bool* infeasible)
260
261/** separation method of constraint handler for LP solution
262 *
263 * Separates all constraints of the constraint handler. The method is called in the LP solution loop,
264 * which means that a valid LP solution exists.
265 *
266 * The first nusefulconss constraints are the ones, that are identified to likely be violated. The separation
267 * method should process only the useful constraints in most runs, and only occasionally the remaining
268 * nconss - nusefulconss constraints.
269 *
270 * input:
271 * - scip : SCIP main data structure
272 * - conshdlr : the constraint handler itself
273 * - conss : array of constraints to process
274 * - nconss : number of constraints to process
275 * - nusefulconss : number of useful (non-obsolete) constraints to process
276 * - result : pointer to store the result of the separation call
277 *
278 * possible return values for *result (if more than one applies, the first in the list should be used):
279 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
280 * - SCIP_CONSADDED : an additional constraint was generated
281 * - SCIP_REDUCEDDOM : a variable's domain was reduced
282 * - SCIP_SEPARATED : a cutting plane was generated
283 * - SCIP_NEWROUND : a cutting plane was generated and a new separation round should immediately start
284 * - SCIP_DIDNOTFIND : the separator searched, but did not find domain reductions, cutting planes, or cut constraints
285 * - SCIP_DIDNOTRUN : the separator was skipped
286 * - SCIP_DELAYED : the separator was skipped, but should be called again
287 */
288#define SCIP_DECL_CONSSEPALP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, \
289 int nconss, int nusefulconss, SCIP_RESULT* result)
290
291/** separation method of constraint handler for arbitrary primal solution
292 *
293 * Separates all constraints of the constraint handler. The method is called outside the LP solution loop (e.g., by
294 * a relaxator or a primal heuristic), which means that there is no valid LP solution.
295 * Instead, the method should produce cuts that separate the given solution.
296 *
297 * The first nusefulconss constraints are the ones, that are identified to likely be violated. The separation
298 * method should process only the useful constraints in most runs, and only occasionally the remaining
299 * nconss - nusefulconss constraints.
300 *
301 * input:
302 * - scip : SCIP main data structure
303 * - conshdlr : the constraint handler itself
304 * - conss : array of constraints to process
305 * - nconss : number of constraints to process
306 * - nusefulconss : number of useful (non-obsolete) constraints to process
307 * - sol : primal solution that should be separated
308 * - result : pointer to store the result of the separation call
309 *
310 * possible return values for *result (if more than one applies, the first in the list should be used):
311 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
312 * - SCIP_CONSADDED : an additional constraint was generated
313 * - SCIP_REDUCEDDOM : a variable's domain was reduced
314 * - SCIP_SEPARATED : a cutting plane was generated
315 * - SCIP_NEWROUND : a cutting plane was generated and a new separation round should immediately start
316 * - SCIP_DIDNOTFIND : the separator searched, but did not find domain reductions, cutting planes, or cut constraints
317 * - SCIP_DIDNOTRUN : the separator was skipped
318 * - SCIP_DELAYED : the separator was skipped, but should be called again
319 */
320#define SCIP_DECL_CONSSEPASOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, \
321 int nconss, int nusefulconss, SCIP_SOL* sol, SCIP_RESULT* result)
322
323/** constraint enforcing method of constraint handler for LP solutions
324 *
325 * The method is called at the end of the node processing loop for a node where the LP was solved.
326 * The LP solution has to be checked for feasibility. If possible, an infeasibility should be resolved by
327 * branching, reducing a variable's domain to exclude the solution or separating the solution with a valid
328 * cutting plane.
329 *
330 * The enforcing methods of the active constraint handlers are called in decreasing order of their enforcing
331 * priorities until the first constraint handler returned with the value SCIP_CUTOFF, SCIP_SEPARATED,
332 * SCIP_REDUCEDDOM, SCIP_CONSADDED, or SCIP_BRANCHED.
333 * The integrality constraint handler has an enforcing priority of zero. A constraint handler which can
334 * (or wants) to enforce its constraints only for integral solutions should have a negative enforcing priority
335 * (e.g. the alldiff-constraint can only operate on integral solutions).
336 * A constraint handler which wants to incorporate its own branching strategy even on non-integral
337 * solutions must have an enforcing priority greater than zero (e.g. the SOS-constraint incorporates
338 * SOS-branching on non-integral solutions).
339 *
340 * The first nusefulconss constraints are the ones, that are identified to likely be violated. The enforcing
341 * method should process the useful constraints first. The other nconss - nusefulconss constraints should only
342 * be enforced, if no violation was found in the useful constraints.
343 *
344 * input:
345 * - scip : SCIP main data structure
346 * - conshdlr : the constraint handler itself
347 * - conss : array of constraints to process
348 * - nconss : number of constraints to process
349 * - nusefulconss : number of useful (non-obsolete) constraints to process
350 * - solinfeasible : was the solution already declared infeasible by a constraint handler?
351 * - result : pointer to store the result of the enforcing call
352 *
353 * possible return values for *result (if more than one applies, the first in the list should be used):
354 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
355 * - SCIP_CONSADDED : an additional constraint was generated (added constraints must have initial flag = TRUE)
356 * - SCIP_REDUCEDDOM : a variable's domain was reduced
357 * - SCIP_SEPARATED : a cutting plane was generated
358 * - SCIP_SOLVELP : the LP should be solved again because the LP primal feasibility tolerance has been tightened
359 * - SCIP_BRANCHED : no changes were made to the problem, but a branching was applied to resolve an infeasibility
360 * - SCIP_INFEASIBLE : at least one constraint is infeasible, but it was not resolved
361 * - SCIP_FEASIBLE : all constraints of the handler are feasible
362 */
363#define SCIP_DECL_CONSENFOLP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
364 SCIP_Bool solinfeasible, SCIP_RESULT* result)
365
366/** constraint enforcing method of constraint handler for relaxation solutions
367 *
368 * input:
369 * - scip : SCIP main data structure
370 * - sol : relaxation solution
371 * - conshdlr : the constraint handler itself
372 * - conss : array of constraints to process
373 * - nconss : number of constraints to process
374 * - nusefulconss : number of useful (non-obsolete) constraints to process
375 * - solinfeasible : was the solution already declared infeasible by a constraint handler?
376 * - result : pointer to store the result of the enforcing call
377 *
378 * possible return values for *result (if more than one applies, the first in the list should be used):
379 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
380 * - SCIP_CONSADDED : an additional constraint was generated (added constraints must have initial flag = TRUE)
381 * - SCIP_REDUCEDDOM : a variable's domain was reduced
382 * - SCIP_SEPARATED : a cutting plane was generated
383 * - SCIP_BRANCHED : no changes were made to the problem, but a branching was applied to resolve an infeasibility
384 * - SCIP_SOLVELP : at least one constraint is infeasible, and this can only be resolved by solving the LP
385 * - SCIP_INFEASIBLE : at least one constraint is infeasible, but it was not resolved
386 * - SCIP_FEASIBLE : all constraints of the handler are feasible
387 */
388#define SCIP_DECL_CONSENFORELAX(x) SCIP_RETCODE x (SCIP* scip, SCIP_SOL* sol, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
389 SCIP_Bool solinfeasible, SCIP_RESULT* result)
390
391/** constraint enforcing method of constraint handler for pseudo solutions
392 *
393 * The method is called at the end of the node processing loop for a node where the LP was not solved.
394 * The pseudo solution has to be checked for feasibility. If possible, an infeasibility should be resolved by
395 * branching, reducing a variable's domain to exclude the solution or adding an additional constraint.
396 * Separation is not possible, since the LP is not processed at the current node. All LP informations like
397 * LP solution, slack values, or reduced costs are invalid and must not be accessed.
398 *
399 * Like in the enforcing method for LP solutions, the enforcing methods of the active constraint handlers are
400 * called in decreasing order of their enforcing priorities until the first constraint handler returned with
401 * the value SCIP_CUTOFF, SCIP_REDUCEDDOM, SCIP_CONSADDED, SCIP_BRANCHED, or SCIP_SOLVELP.
402 *
403 * The first nusefulconss constraints are the ones, that are identified to likely be violated. The enforcing
404 * method should process the useful constraints first. The other nconss - nusefulconss constraints should only
405 * be enforced, if no violation was found in the useful constraints.
406 *
407 * If the pseudo solution's objective value is lower than the lower bound of the node, it cannot be feasible
408 * and the enforcing method may skip it's check and set *result to SCIP_DIDNOTRUN. However, it can also process
409 * its constraints and return any other possible result code.
410 *
411 * input:
412 * - scip : SCIP main data structure
413 * - conshdlr : the constraint handler itself
414 * - conss : array of constraints to process
415 * - nconss : number of constraints to process
416 * - nusefulconss : number of useful (non-obsolete) constraints to process
417 * - solinfeasible : was the solution already declared infeasible by a constraint handler?
418 * - objinfeasible : is the solution infeasible anyway due to violating lower objective bound?
419 * - result : pointer to store the result of the enforcing call
420 *
421 * possible return values for *result (if more than one applies, the first in the list should be used):
422 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
423 * - SCIP_CONSADDED : an additional constraint was generated
424 * - SCIP_REDUCEDDOM : a variable's domain was reduced
425 * - SCIP_BRANCHED : no changes were made to the problem, but a branching was applied to resolve an infeasibility
426 * - SCIP_SOLVELP : at least one constraint is infeasible, and this can only be resolved by solving the LP
427 * - SCIP_INFEASIBLE : at least one constraint is infeasible, but it was not resolved
428 * - SCIP_FEASIBLE : all constraints of the handler are feasible
429 * - SCIP_DIDNOTRUN : the enforcement was skipped (only possible, if objinfeasible is true)
430 */
431#define SCIP_DECL_CONSENFOPS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
432 SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT* result)
433
434/** feasibility check method of constraint handler for integral solutions
435 *
436 * The given solution has to be checked for feasibility.
437 *
438 * The check methods of the active constraint handlers are called in decreasing order of their check
439 * priorities until the first constraint handler returned with the result SCIP_INFEASIBLE.
440 * The integrality constraint handler has a check priority of zero. A constraint handler which can
441 * (or wants) to check its constraints only for integral solutions should have a negative check priority
442 * (e.g. the alldiff-constraint can only operate on integral solutions).
443 * A constraint handler which wants to check feasibility even on non-integral solutions must have a
444 * check priority greater than zero (e.g. if the check is much faster than testing all variables for
445 * integrality).
446 *
447 * In some cases, integrality conditions or rows of the current LP don't have to be checked, because their
448 * feasibility is already checked or implicitly given. In these cases, 'checkintegrality' or
449 * 'checklprows' is FALSE.
450 *
451 * If the solution is not NULL, SCIP should also be informed about the constraint violation with a call to
452 * SCIPupdateSolConsViolation() and additionally SCIPupdateSolLPRowViolation() for every row of the constraint's current
453 * representation in the LP relaxation, if any such rows exist.
454 * As a convenience method, SCIPupdateSolLPConsViolation() can be used if the constraint
455 * is represented completely by a set of LP rows, meaning that the current constraint violation is equal to the maximum
456 * of the constraint violations of the corresponding LP rows.
457 *
458 * input:
459 * - scip : SCIP main data structure
460 * - conshdlr : the constraint handler itself
461 * - conss : array of constraints to process
462 * - nconss : number of constraints to process
463 * - sol : the solution to check feasibility for
464 * - checkintegrality: Has integrality to be checked?
465 * - checklprows : Do constraints represented by rows in the current LP have to be checked?
466 * - printreason : Should the reason for the violation be printed?
467 * - completely : Should all violations be checked?
468 * - result : pointer to store the result of the feasibility checking call
469 *
470 * possible return values for *result:
471 * - SCIP_INFEASIBLE : at least one constraint of the handler is infeasible
472 * - SCIP_FEASIBLE : all constraints of the handler are feasible
473 */
474#define SCIP_DECL_CONSCHECK(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_SOL* sol, \
475 SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool completely, SCIP_RESULT* result)
476
477/** domain propagation method of constraint handler
478 *
479 * The first nusefulconss constraints are the ones, that are identified to likely be violated. The propagation
480 * method should process only the useful constraints in most runs, and only occasionally the remaining
481 * nconss - nusefulconss constraints.
482 *
483 * @note if the constraint handler uses dual information in propagation it is nesassary to check via calling
484 * SCIPallowWeakDualReds and SCIPallowStrongDualReds if dual reductions and propgation with the current cutoff bound, resp.,
485 * are allowed.
486 *
487 * input:
488 * - scip : SCIP main data structure
489 * - conshdlr : the constraint handler itself
490 * - conss : array of constraints to process
491 * - nconss : number of constraints to process
492 * - nusefulconss : number of useful (non-obsolete) constraints to process
493 * - nmarkedconss : number of constraints which are marked to be definitely propagated
494 * - proptiming : current point in the node solving loop
495 * - result : pointer to store the result of the propagation call
496 *
497 * possible return values for *result:
498 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
499 * - SCIP_CONSADDED : an additional constraint was generated
500 * - SCIP_REDUCEDDOM : at least one domain reduction was found
501 * - SCIP_DIDNOTFIND : the propagator searched but did not find any domain reductions
502 * - SCIP_DIDNOTRUN : the propagator was skipped
503 * - SCIP_DELAYED : the propagator was skipped, but should be called again
504 * - SCIP_DELAYNODE : the current node should be postponed (return value only valid for BEFORELP propagation)
505 */
506#define SCIP_DECL_CONSPROP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, \
507 int nmarkedconss, SCIP_PROPTIMING proptiming, SCIP_RESULT* result)
508
509/** presolving method of constraint handler
510 *
511 * The presolver should go through the variables and constraints and tighten the domains or
512 * constraints. Each tightening should increase the given total number of changes.
513 *
514 * input:
515 * - scip : SCIP main data structure
516 * - conshdlr : the constraint handler itself
517 * - conss : array of constraints to process
518 * - nconss : number of constraints to process
519 * - nrounds : number of presolving rounds already done
520 * - presoltiming : current presolving timing
521 * - nnewfixedvars : number of variables fixed since the last call to the presolving method
522 * - nnewaggrvars : number of variables aggregated since the last call to the presolving method
523 * - nnewchgvartypes : number of variable type changes since the last call to the presolving method
524 * - nnewchgbds : number of variable bounds tightened since the last call to the presolving method
525 * - nnewholes : number of domain holes added since the last call to the presolving method
526 * - nnewdelconss : number of deleted constraints since the last call to the presolving method
527 * - nnewaddconss : number of added constraints since the last call to the presolving method
528 * - nnewupgdconss : number of upgraded constraints since the last call to the presolving method
529 * - nnewchgcoefs : number of changed coefficients since the last call to the presolving method
530 * - nnewchgsides : number of changed left or right hand sides since the last call to the presolving method
531 *
532 * @note the counters state the changes since the last call including the changes of this presolving method during its
533 * call
534 *
535 * @note if the constraint handler performs dual presolving it is nesassary to check via calling SCIPallowWeakDualReds
536 * and SCIPallowStrongDualReds if dual reductions are allowed.
537 *
538 * input/output:
539 * - nfixedvars : pointer to count total number of variables fixed of all presolvers
540 * - naggrvars : pointer to count total number of variables aggregated of all presolvers
541 * - nchgvartypes : pointer to count total number of variable type changes of all presolvers
542 * - nchgbds : pointer to count total number of variable bounds tightened of all presolvers
543 * - naddholes : pointer to count total number of domain holes added of all presolvers
544 * - ndelconss : pointer to count total number of deleted constraints of all presolvers
545 * - naddconss : pointer to count total number of added constraints of all presolvers
546 * - nupgdconss : pointer to count total number of upgraded constraints of all presolvers
547 * - nchgcoefs : pointer to count total number of changed coefficients of all presolvers
548 * - nchgsides : pointer to count total number of changed left/right hand sides of all presolvers
549 *
550 * output:
551 * - result : pointer to store the result of the presolving call
552 *
553 * possible return values for *result:
554 * - SCIP_UNBOUNDED : at least one variable is not bounded by any constraint in obj. direction -> problem is unbounded
555 * - SCIP_CUTOFF : at least one constraint is infeasible in the variable's bounds -> problem is infeasible
556 * - SCIP_SUCCESS : the presolving method found a reduction
557 * - SCIP_DIDNOTFIND : the presolving method searched, but did not find a presolving change
558 * - SCIP_DIDNOTRUN : the presolving method was skipped
559 * - SCIP_DELAYED : the presolving method was skipped, but should be called again
560 */
561#define SCIP_DECL_CONSPRESOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nrounds, \
562 SCIP_PRESOLTIMING presoltiming, int nnewfixedvars, int nnewaggrvars, int nnewchgvartypes, int nnewchgbds, int nnewholes, \
563 int nnewdelconss, int nnewaddconss, int nnewupgdconss, int nnewchgcoefs, int nnewchgsides, \
564 int* nfixedvars, int* naggrvars, int* nchgvartypes, int* nchgbds, int* naddholes, \
565 int* ndelconss, int* naddconss, int* nupgdconss, int* nchgcoefs, int* nchgsides, SCIP_RESULT* result)
566
567/** propagation conflict resolving method of constraint handler
568 *
569 * This method is called during conflict analysis. If the constraint handler wants to support conflict analysis,
570 * it should call SCIPinferVarLbCons() or SCIPinferVarUbCons() in domain propagation instead of SCIPchgVarLb() or
571 * SCIPchgVarUb() in order to deduce bound changes on variables.
572 * In the SCIPinferVarLbCons() and SCIPinferVarUbCons() calls, the handler provides the constraint, that deduced the
573 * variable's bound change, and an integer value "inferinfo" that can be arbitrarily chosen.
574 * The propagation conflict resolving method can then be implemented, to provide a "reason" for the bound
575 * changes, i.e., the bounds of variables at the time of the propagation, that forced the constraint to set the
576 * conflict variable's bound to its current value. It can use the "inferinfo" tag to identify its own propagation
577 * rule and thus identify the "reason" bounds. The bounds that form the reason of the assignment must then be provided
578 * by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
579 * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and/or SCIPaddConflictBinvar() in the propagation conflict
580 * resolving method.
581 *
582 * For example, the logicor constraint c = "x or y or z" fixes variable z to TRUE (i.e. changes the lower bound of z
583 * to 1.0), if both, x and y, are assigned to FALSE (i.e. if the upper bounds of these variables are 0.0). It uses
584 * SCIPinferVarLbCons(scip, z, 1.0, c, 0) to apply this assignment (an inference information tag is not needed by the
585 * constraint handler and is set to 0).
586 * In the conflict analysis, the constraint handler may be asked to resolve the lower bound change on z with
587 * constraint c, that was applied at a time given by a bound change index "bdchgidx".
588 * With a call to SCIPgetVarLbAtIndex(scip, z, bdchgidx, TRUE), the handler can find out, that the lower bound of
589 * variable z was set to 1.0 at the given point of time, and should call SCIPaddConflictUb(scip, x, bdchgidx) and
590 * SCIPaddConflictUb(scip, y, bdchgidx) to tell SCIP, that the upper bounds of x and y at this point of time were
591 * the reason for the deduction of the lower bound of z.
592 *
593 * input:
594 * - scip : SCIP main data structure
595 * - conshdlr : the constraint handler itself
596 * - cons : the constraint that deduced the bound change of the conflict variable
597 * - infervar : the conflict variable whose bound change has to be resolved
598 * - inferinfo : the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call
599 * - boundtype : the type of the changed bound (lower or upper bound)
600 * - bdchgidx : the index of the bound change, representing the point of time where the change took place
601 * - relaxedbd : the relaxed bound which is sufficient to be explained
602 *
603 * output:
604 * - result : pointer to store the result of the propagation conflict resolving call
605 *
606 * possible return values for *result:
607 * - SCIP_SUCCESS : the conflicting bound change has been successfully resolved by adding all reason bounds
608 * - SCIP_DIDNOTFIND : the conflicting bound change could not be resolved and has to be put into the conflict set
609 *
610 * @note it is sufficient to explain/resolve the relaxed bound
611 */
612#define SCIP_DECL_CONSRESPROP(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
613 SCIP_VAR* infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX* bdchgidx, SCIP_Real relaxedbd, \
614 SCIP_RESULT* result)
615
616/** variable rounding lock method of constraint handler
617 *
618 * This method is called, after a constraint is added or removed from the transformed problem.
619 * It should update the rounding locks of the given type of all associated variables with calls to
620 * SCIPaddVarLocksType(), depending on the way, the variable is involved in the constraint:
621 * - If the constraint may get violated by decreasing the value of a variable, it should call
622 * SCIPaddVarLocksType(scip, var, locktype, nlockspos, nlocksneg), saying that rounding down is
623 * potentially rendering the (positive) constraint infeasible and rounding up is potentially rendering the
624 * negation of the constraint infeasible.
625 * - If the constraint may get violated by increasing the value of a variable, it should call
626 * SCIPaddVarLocksType(scip, var, locktype, nlocksneg, nlockspos), saying that rounding up is
627 * potentially rendering the constraint's negation infeasible and rounding up is potentially rendering the
628 * constraint itself infeasible.
629 * - If the constraint may get violated by changing the variable in any direction, it should call
630 * SCIPaddVarLocksType(scip, var, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg).
631 *
632 * Consider the linear constraint "3x -5y +2z <= 7" as an example. The variable rounding lock method of the
633 * linear constraint handler should call SCIPaddVarLocksType(scip, x, locktype, nlocksneg, nlockspos),
634 * SCIPaddVarLocksType(scip, y, locktype, nlockspos, nlocksneg) and
635 * SCIPaddVarLocksType(scip, z, type, nlocksneg, nlockspos) to tell SCIP, that rounding up of x and z and rounding
636 * down of y can destroy the feasibility of the constraint, while rounding down of x and z and rounding up of y can
637 * destroy the feasibility of the constraint's negation "3x -5y +2z > 7".
638 * A linear constraint "2 <= 3x -5y +2z <= 7" should call
639 * SCIPaddVarLocksType(scip, ..., nlockspos + nlocksneg, nlockspos + nlocksneg) on all variables, since rounding in both
640 * directions of each variable can destroy both the feasibility of the constraint and it's negation
641 * "3x -5y +2z < 2 or 3x -5y +2z > 7".
642 *
643 * If the constraint itself contains other constraints as sub constraints (e.g. the "or" constraint concatenation
644 * "c(x) or d(x)"), the rounding lock methods of these constraints should be called in a proper way.
645 * - If the constraint may get violated by the violation of the sub constraint c, it should call
646 * SCIPaddConsLocksType(scip, c, locktype, nlockspos, nlocksneg), saying that infeasibility of c may lead to
647 * infeasibility of the (positive) constraint, and infeasibility of c's negation (i.e. feasibility of c) may lead
648 * to infeasibility of the constraint's negation (i.e. feasibility of the constraint).
649 * - If the constraint may get violated by the feasibility of the sub constraint c, it should call
650 * SCIPaddConsLocksType(scip, c, locktype, nlocksneg, nlockspos), saying that infeasibility of c may lead to
651 * infeasibility of the constraint's negation (i.e. feasibility of the constraint), and infeasibility of c's negation
652 * (i.e. feasibility of c) may lead to infeasibility of the (positive) constraint.
653 * - If the constraint may get violated by any change in the feasibility of the sub constraint c, it should call
654 * SCIPaddConsLocksType(scip, c, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg).
655 *
656 * Consider the or concatenation "c(x) or d(x)". The variable rounding lock method of the or constraint handler
657 * should call SCIPaddConsLocksType(scip, c, locktype, nlockspos, nlocksneg) and
658 * SCIPaddConsLocksType(scip, d, locktype, nlockspos, nlocksneg) to tell SCIP, that infeasibility of c and d can lead
659 * to infeasibility of "c(x) or d(x)".
660 *
661 * As a second example, consider the equivalence constraint "y <-> c(x)" with variable y and constraint c. The
662 * constraint demands, that y == 1 if and only if c(x) is satisfied. The variable lock method of the corresponding
663 * constraint handler should call SCIPaddVarLocksType(scip, y, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg) and
664 * SCIPaddConsLocksType(scip, c, locktype, nlockspos + nlocksneg, nlockspos + nlocksneg), because any modification to the
665 * value of y or to the feasibility of c can alter the feasibility of the equivalence constraint.
666 *
667 * input:
668 * - scip : SCIP main data structure
669 * - conshdlr : the constraint handler itself
670 * - cons : the constraint that should lock rounding of its variables, or NULL if the constraint handler
671 * does not need constraints
672 * - locktype : type of rounding locks, i.e., SCIP_LOCKTYPE_MODEL or SCIP_LOCKTYPE_CONFLICT
673 * - nlockspos : number of times, the roundings should be locked for the constraint (may be negative)
674 * - nlocksneg : number of times, the roundings should be locked for the constraint's negation (may be negative)
675 */
676#define SCIP_DECL_CONSLOCK(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
677
678/** constraint activation notification method of constraint handler
679 *
680 * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
681 * the corresponding bound change event was not yet processed.
682 *
683 * This method is always called after a constraint of the constraint handler was activated. The constraint
684 * handler may use this call to update his own (statistical) data.
685 *
686 * input:
687 * - scip : SCIP main data structure
688 * - conshdlr : the constraint handler itself
689 * - cons : the constraint that has been activated
690 */
691#define SCIP_DECL_CONSACTIVE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
692
693/** constraint deactivation notification method of constraint handler
694 *
695 * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
696 * the corresponding bound change event was not yet processed.
697 *
698 * This method is always called before a constraint of the constraint handler is deactivated. The constraint
699 * handler may use this call to update his own (statistical) data.
700 *
701 * input:
702 * - scip : SCIP main data structure
703 * - conshdlr : the constraint handler itself
704 * - cons : the constraint that will be deactivated
705 */
706#define SCIP_DECL_CONSDEACTIVE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
707
708/** constraint enabling notification method of constraint handler
709 *
710 * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
711 * the corresponding bound change event was not yet processed.
712 *
713 * This method is always called after a constraint of the constraint handler was enabled. The constraint
714 * handler may use this call to update his own (statistical) data.
715 *
716 * input:
717 * - scip : SCIP main data structure
718 * - conshdlr : the constraint handler itself
719 * - cons : the constraint that has been enabled
720 */
721#define SCIP_DECL_CONSENABLE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
722
723/** constraint disabling notification method of constraint handler
724 *
725 * WARNING! There may exist unprocessed events. For example, a variable's bound may have been already changed, but
726 * the corresponding bound change event was not yet processed.
727 *
728 * This method is always called before a constraint of the constraint handler is disabled. The constraint
729 * handler may use this call to update his own (statistical) data.
730 *
731 * input:
732 * - scip : SCIP main data structure
733 * - conshdlr : the constraint handler itself
734 * - cons : the constraint that will be disabled
735 */
736#define SCIP_DECL_CONSDISABLE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons)
737
738/** variable deletion method of constraint handler
739 *
740 * This method is optinal and only of interest if you are using SCIP as a branch-and-price framework. That means, you
741 * are generating new variables during the search. If you are not doing that just define the function pointer to be
742 * NULL.
743 *
744 * If this method gets implemented you should iterate over all constraints of the constraint handler and delete all
745 * variables that were marked for deletion by SCIPdelVar().
746 *
747 * input:
748 * - scip : SCIP main data structure
749 * - conshdlr : the constraint handler itself
750 * - conss : array of constraints in transformed problem
751 * - nconss : number of constraints in transformed problem
752 */
753#define SCIP_DECL_CONSDELVARS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss)
754
755/** constraint display method of constraint handler
756 *
757 * The constraint handler can store a representation of the constraint into the given text file. Use the method
758 * SCIPinfoMessage() to push a string into the file stream.
759 *
760 * @note There are several methods which help to display variables. These are SCIPwriteVarName(), SCIPwriteVarsList(),
761 * SCIPwriteVarsLinearsum(), and SCIPwriteVarsPolynomial().
762 *
763 * input:
764 * - scip : SCIP main data structure
765 * - conshdlr : the constraint handler itself
766 * - cons : the constraint that should be displayed
767 * - file : the text file to store the information into
768 */
769#define SCIP_DECL_CONSPRINT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, FILE* file)
770
771/** constraint copying method of constraint handler
772 *
773 * The constraint handler can provide a copy method which copies a constraint from one SCIP data structure into an other
774 * SCIP data structure. If a copy of a constraint is created, the constraint has to be captured. (The capture is usually
775 * already done due to the creation of the constraint).
776 *
777 * If the copy process was one to one, the valid pointer can be set to TRUE. Otherwise, you have to set this pointer to
778 * FALSE. In case all problem defining objects (constraint handlers and variable pricers) return a TRUE valid for all
779 * their copying calls, SCIP assumes that it is a overall one to one copy of the original instance. In this case any
780 * reductions made in the copied SCIP instance can be transfered to the original SCIP instance. If the valid pointer is
781 * set to TRUE and it was not a one to one copy, it might happen that optimal solutions are cut off.
782 *
783 * To get a copy of a variable in the target SCIP you should use the function SCIPgetVarCopy().
784 *
785 * input:
786 * - scip : target SCIP data structure
787 * - cons : pointer to store the created target constraint
788 * - name : name of constraint, or NULL if the name of the source constraint should be used
789 * - sourcescip : source SCIP data structure
790 * - sourceconshdlr : source constraint handler of the source SCIP
791 * - sourcecons : source constraint of the source SCIP
792 * - varmap : a SCIP_HASHMAP mapping variables of the source SCIP to corresponding variables of the target SCIP
793 * - consmap : a SCIP_HASHMAP mapping constraints of the source SCIP to corresponding constraints of the target SCIP
794 * - initial : should the LP relaxation of constraint be in the initial LP?
795 * - separate : should the constraint be separated during LP processing?
796 * - enforce : should the constraint be enforced during node processing?
797 * - check : should the constraint be checked for feasibility?
798 * - propagate : should the constraint be propagated during node processing?
799 * - local : is constraint only valid locally?
800 * - modifiable : is constraint modifiable (subject to column generation)?
801 * - dynamic : is constraint subject to aging?
802 * - removable : should the relaxation be removed from the LP due to aging or cleanup?
803 * - stickingatnode : should the constraint always be kept at the node where it was added, even
804 * if it may be moved to a more global node?
805 * - global : should a global or a local copy be created?
806 *
807 * output:
808 * - valid : pointer to store whether the copying was valid or not
809 */
810#define SCIP_DECL_CONSCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONS** cons, const char* name, \
811 SCIP* sourcescip, SCIP_CONSHDLR* sourceconshdlr, SCIP_CONS* sourcecons, SCIP_HASHMAP* varmap, SCIP_HASHMAP* consmap, \
812 SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, \
813 SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, \
814 SCIP_Bool global, SCIP_Bool* valid)
815
816/** constraint parsing method of constraint handler
817 *
818 * The constraint handler can provide a callback to parse the output created by the display method
819 * (\ref SCIP_DECL_CONSPRINT) and to create a constraint out of it.
820 *
821 * @note For parsing there are several methods which are handy. Have a look at: SCIPparseVarName(),
822 * SCIPparseVarsList(), SCIPparseVarsLinearsum(), SCIPparseVarsPolynomial(), SCIPstrToRealValue(), and
823 * SCIPstrCopySection().
824 *
825 * input:
826 * - scip : SCIP main data structure
827 * - conshdlr : the constraint handler itself
828 * - cons : pointer to store the created constraint
829 * - name : name of the constraint
830 * - str : string to parse
831 * - initial : should the LP relaxation of constraint be in the initial LP?
832 * - separate : should the constraint be separated during LP processing?
833 * - enforce : should the constraint be enforced during node processing?
834 * - check : should the constraint be checked for feasibility?
835 * - propagate : should the constraint be propagated during node processing?
836 * - local : is constraint only valid locally?
837 * - modifiable : is constraint modifiable (subject to column generation)?
838 * - dynamic : is constraint subject to aging?
839 * - removable : should the relaxation be removed from the LP due to aging or cleanup?
840 * - stickingatnode : should the constraint always be kept at the node where it was added, even
841 * if it may be moved to a more global node?
842 * output:
843 * - success : pointer to store whether the parsing was successful or not
844 */
845#define SCIP_DECL_CONSPARSE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** cons, \
846 const char* name, const char* str, \
847 SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, \
848 SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool* success)
849
850/** constraint method of constraint handler which returns the variables (if possible)
851 *
852 * The constraint handler can (this callback is optional) provide this callback to return the variables which are
853 * involved in that particular constraint. If this is possible, the variables should be copyied into the variables
854 * array and the success pointers has to be set to TRUE. Otherwise the success has to be set FALSE or the callback
855 * should not be implemented.
856 *
857 * input:
858 * - scip : SCIP main data structure
859 * - conshdlr : the constraint handler itself
860 * - cons : the constraint that should return its variable data
861 * - varssize : available slots in vars array which is needed to check if the array is large enough
862 *
863 * output:
864 * - vars : array to store/copy the involved variables of the constraint
865 * - success : pointer to store whether the variables are successfully copied
866 */
867#define SCIP_DECL_CONSGETVARS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
868 SCIP_VAR** vars, int varssize, SCIP_Bool* success)
869
870/** constraint method of constraint handler which returns the number of variables (if possible)
871 *
872 * The constraint handler can (this callback is optional) provide this callback to return the number variable which are
873 * involved in that particular constraint. If this is not possible, the success pointers has to be set to FALSE or the
874 * callback should not be implemented.
875 *
876 * input:
877 * - scip : SCIP main data structure
878 * - conshdlr : the constraint handler itself
879 * - cons : constraint for which the number of variables is wanted
880 *
881 * output:
882 * - nvars : pointer to store the number of variables
883 * - success : pointer to store whether the constraint successfully returned the number of variables
884 */
885#define SCIP_DECL_CONSGETNVARS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
886 int* nvars, SCIP_Bool* success)
887
888/** constraint handler method to suggest dive bound changes during the generic diving algorithm
889 *
890 * This callback is used inside the various diving heuristics of SCIP and does not affect the normal branching of the
891 * actual search. The constraint handler can provide this callback to render the current solution (even more)
892 * infeasible by suggesting one or several variable bound changes. In fact, since diving heuristics do not necessarily
893 * solve LP relaxations at every probing depth, some of the variable local bounds might already be conflicting with the
894 * solution values. The solution is rendered infeasible by determining bound changes that should be applied to the
895 * next explored search node via SCIPaddDiveBoundChange(). An alternative in case that the preferred bound change(s)
896 * were detected infeasible must be provided.
897 *
898 * The constraint handler must take care to only add bound changes that further shrink the variable domain.
899 *
900 * The success pointer must be used to indicate whether the constraint handler succeeded in selecting diving bound
901 * changes. The infeasible pointer should be set to TRUE if the constraint handler found a local infeasibility. If the
902 * constraint handler needs to select between several candidates, it may use the scoring mechanism of the diveset
903 * argument to control its choice.
904 *
905 * This callback is optional.
906 *
907 * @note: @p sol is usually the LP relaxation solution unless the caller of the method, usually a diving heuristic,
908 * does not solve LP relaxations at every depth
909 *
910 * input:
911 * - scip : SCIP main data structure
912 * - conshdlr : the constraint handler itself
913 * - diveset : diving settings for scoring
914 * - sol : current diving solution, usually the LP relaxation solution
915 *
916 * output:
917 * - success : pointer to store whether the constraint handler succeeded to determine dive bound changes
918 * - infeasible : pointer to store whether the constraint handler detected an infeasibility in the local node
919 */
920#define SCIP_DECL_CONSGETDIVEBDCHGS(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_DIVESET* diveset, \
921 SCIP_SOL* sol, SCIP_Bool* success, SCIP_Bool* infeasible)
922
923/** constraint handler method which returns the permutation symmetry detection graph of a constraint (if possible)
924 *
925 * The constraint handler can (this callback is optional) provide this callback to return a graph that encodes the
926 * permutation symmetries of a constraint. If this is not possible, the success pointer has to be set to FALSE or the
927 * callback should not be implemented.
928 *
929 * input:
930 * - scip : SCIP main data structure
931 * - conshdlr : the constraint handler itself
932 * - cons : constraint for which the symmetry detection graph is requested
933 *
934 * output:
935 * - graph : symmetry detection graph
936 * - success : pointer to store whether the constraint successfully returned the symmetry detection graph
937 */
938#define SCIP_DECL_CONSGETPERMSYMGRAPH(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
939 SYM_GRAPH* graph, SCIP_Bool* success)
940
941/** constraint handler method providing the signed permutation symmetry detection graph of a constraint (if possible)
942 *
943 * The constraint handler can (this callback is optional) provide this callback to return a graph that encodes the
944 * signed permutation symmetries of a constraint. If this is not possible, the success pointer has to be set to FALSE
945 * or the callback should not be implemented.
946 *
947 * input:
948 * - scip : SCIP main data structure
949 * - conshdlr : the constraint handler itself
950 * - cons : constraint for which the symmetry detection graph is requested
951 *
952 * output:
953 * - graph : symmetry detection graph
954 * - success : pointer to store whether the constraint successfully returned the symmetry detection graph
955 */
956#define SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* cons, \
957 SYM_GRAPH* graph, SCIP_Bool* success)
958
959#ifdef __cplusplus
960}
961#endif
962
963#endif
common defines and data types used in all packages of SCIP
struct SCIP_Cons SCIP_CONS
Definition type_cons.h:63
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition type_cons.h:64
struct SCIP_ConsSetChg SCIP_CONSSETCHG
Definition type_cons.h:66
struct SYM_Graph SYM_GRAPH
Definition type_cons.h:68
struct SCIP_LinConsStats SCIP_LINCONSSTATS
Definition type_cons.h:67
SCIP_LinConstype
Definition type_cons.h:72
@ SCIP_LINCONSTYPE_BINPACKING
Definition type_cons.h:85
@ SCIP_LINCONSTYPE_VARBOUND
Definition type_cons.h:78
@ SCIP_LINCONSTYPE_EMPTY
Definition type_cons.h:73
@ SCIP_LINCONSTYPE_INVKNAPSACK
Definition type_cons.h:83
@ SCIP_LINCONSTYPE_PRECEDENCE
Definition type_cons.h:77
@ SCIP_LINCONSTYPE_AGGREGATION
Definition type_cons.h:76
@ SCIP_LINCONSTYPE_MIXEDBINARY
Definition type_cons.h:88
@ SCIP_LINCONSTYPE_SINGLETON
Definition type_cons.h:75
@ SCIP_LINCONSTYPE_SETCOVERING
Definition type_cons.h:81
@ SCIP_LINCONSTYPE_EQKNAPSACK
Definition type_cons.h:84
@ SCIP_LINCONSTYPE_FREE
Definition type_cons.h:74
@ SCIP_LINCONSTYPE_KNAPSACK
Definition type_cons.h:86
@ SCIP_LINCONSTYPE_SETPARTITION
Definition type_cons.h:79
@ SCIP_LINCONSTYPE_INTKNAPSACK
Definition type_cons.h:87
@ SCIP_LINCONSTYPE_SETPACKING
Definition type_cons.h:80
@ SCIP_LINCONSTYPE_GENERAL
Definition type_cons.h:89
@ SCIP_LINCONSTYPE_CARDINALITY
Definition type_cons.h:82
struct SCIP_Conshdlr SCIP_CONSHDLR
Definition type_cons.h:62
struct SCIP_ConsData SCIP_CONSDATA
Definition type_cons.h:65
enum SCIP_LinConstype SCIP_LINCONSTYPE
Definition type_cons.h:91
type definitions for primal heuristics
type definitions for LP management
result codes for SCIP callback methods
type definitions for return codes for SCIP methods
type definitions for SCIP's main datastructure
type definitions for storing primal CIP solutions
timing definitions for SCIP
type definitions for problem variables