Scippy

SCIP

Solving Constraint Integer Programs

cons_superindicator.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-2017 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 cons_superindicator.h
17  * @ingroup CONSHDLRS
18  * @brief constraint handler for indicator constraints over arbitrary constraint types
19  * @author Ambros Gleixner
20  * @author Frederic Pythoud
21  *
22  */
23 
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
25 
26 #ifndef __SCIP_CONS_SUPERINDICATOR_H__
27 #define __SCIP_CONS_SUPERINDICATOR_H__
28 
29 
30 #include "scip/scip.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 
37 
38 /*
39  * constraint-specific interface methods
40  */
41 
42 /** creates the handler for superindicator constraints and includes it in SCIP
43  *
44  * @ingroup ConshdlrIncludes
45  * */
46 extern
48  SCIP* scip /**< SCIP data structure */
49  );
50 
51 /**@addtogroup CONSHDLRS
52  *
53  * @{
54  *
55  * @name Superindicator Constraints
56  *
57  * @{
58  *
59  * Superindicator constraints are constraints of the form
60  * \f[
61  * x_i = 1 \Rightarrow C(x)
62  * \f]
63  * where \f$ x_i \f$ is a binary variable and \f$ C(\dot) \f$ a constraint. The superindicator constraint is satisfied
64  * if and only if x_i is zero or C is satisfied.
65  */
66 
67 /** creates and captures a superindicator constraint
68  *
69  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
70  */
71 extern
73  SCIP* scip, /**< SCIP data structure */
74  SCIP_CONS** cons, /**< pointer to hold the created constraint */
75  const char* name, /**< name of constraint */
76  SCIP_VAR* binvar, /**< pointer to the indicator constraint */
77  SCIP_CONS* slackcons, /**< constraint corresponding to the handled constraint */
78  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
79  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
80  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
81  * Usually set to TRUE. */
82  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
83  * TRUE for model constraints, FALSE for additional, redundant constraints. */
84  SCIP_Bool check, /**< should the constraint be checked for feasibility?
85  * TRUE for model constraints, FALSE for additional, redundant constraints. */
86  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
87  * Usually set to TRUE. */
88  SCIP_Bool local, /**< is constraint only valid locally?
89  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
90  SCIP_Bool dynamic, /**< is constraint subject to aging?
91  * Usually set to FALSE. Set to TRUE for own cuts which
92  * are separated as constraints. */
93  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
94  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
95  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
96  * if it may be moved to a more global node?
97  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
98  );
99 
100 /** creates and captures a superindicator constraint
101  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
102  * method SCIPcreateConsSuperindicator(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
103  *
104  * @see SCIPcreateConsSuperindicator() for information about the basic constraint flag configuration
105  *
106  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
107  */
108 extern
110  SCIP* scip, /**< SCIP data structure */
111  SCIP_CONS** cons, /**< pointer to hold the created constraint */
112  const char* name, /**< name of constraint */
113  SCIP_VAR* binvar, /**< pointer to the indicator constraint */
114  SCIP_CONS* slackcons /**< constraint corresponding to the handled constraint */
115  );
116 
117 /** gets binary variable corresponding to the superindicator constraint */
118 extern
120  SCIP_CONS* cons /**< superindicator constraint */
121  );
122 
123 /** gets the slack constraint corresponding to the superindicator constraint */
124 extern
126  SCIP_CONS* cons /**< superindicator constraint */
127  );
128 
129 
130 
131 /*
132  * constraint-dependent SCIP methods
133  */
134 
135 /** transforms the current problem into a MinUC problem (minimizing the number of unsatisfied constraints),
136  * a CIP generalization of the MinULR (min. unsatisfied linear relations) problem
137  */
138 extern
140  SCIP* scip, /**< SCIP data structure */
141  SCIP_Bool* success /**< pointer to store whether all constraints could be transformed */
142  );
143 
144 
145 
146 /*
147  * constraint-dependent dialog entries
148  */
149 
150 /** dialog execution method for the SCIPtransformMinUC() command */
151 extern
152 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeMinUC);
153 
154 /* @} */
155 
156 /* @} */
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPtransformMinUC(SCIP *scip, SCIP_Bool *success)
SCIP_RETCODE SCIPcreateConsSuperindicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, SCIP_CONS *slackcons, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeMinUC)
SCIP_RETCODE SCIPcreateConsBasicSuperindicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, SCIP_CONS *slackcons)
#define SCIP_Bool
Definition: def.h:61
SCIP_CONS * SCIPgetSlackConsSuperindicator(SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeConshdlrSuperindicator(SCIP *scip)
SCIP callable library.
SCIP_VAR * SCIPgetBinaryVarSuperindicator(SCIP_CONS *cons)