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-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file 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/def.h"
31 #include "scip/type_cons.h"
32 #include "scip/type_dialog.h"
33 #include "scip/type_retcode.h"
34 #include "scip/type_scip.h"
35 #include "scip/type_var.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 
42 
43 /*
44  * constraint-specific interface methods
45  */
46 
47 /** creates the handler for superindicator constraints and includes it in SCIP
48  *
49  * @ingroup ConshdlrIncludes
50  * */
53  SCIP* scip /**< SCIP data structure */
54  );
55 
56 /**@addtogroup CONSHDLRS
57  *
58  * @{
59  *
60  * @name Superindicator Constraints
61  *
62  * @{
63  *
64  * Superindicator constraints are constraints of the form
65  * \f[
66  * x_i = 1 \Rightarrow C(x)
67  * \f]
68  * where \f$ x_i \f$ is a binary variable and \f$ C(\dot) \f$ a constraint. The superindicator constraint is satisfied
69  * if and only if x_i is zero or C is satisfied.
70  */
71 
72 /** creates and captures a superindicator constraint
73  *
74  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
75  */
78  SCIP* scip, /**< SCIP data structure */
79  SCIP_CONS** cons, /**< pointer to hold the created constraint */
80  const char* name, /**< name of constraint */
81  SCIP_VAR* binvar, /**< pointer to the indicator constraint */
82  SCIP_CONS* slackcons, /**< constraint corresponding to the handled constraint */
83  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
84  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
85  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
86  * Usually set to TRUE. */
87  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
88  * TRUE for model constraints, FALSE for additional, redundant constraints. */
89  SCIP_Bool check, /**< should the constraint be checked for feasibility?
90  * TRUE for model constraints, FALSE for additional, redundant constraints. */
91  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
92  * Usually set to TRUE. */
93  SCIP_Bool local, /**< is constraint only valid locally?
94  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
95  SCIP_Bool dynamic, /**< is constraint subject to aging?
96  * Usually set to FALSE. Set to TRUE for own cuts which
97  * are separated as constraints. */
98  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
99  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
100  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
101  * if it may be moved to a more global node?
102  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
103  );
104 
105 /** creates and captures a superindicator constraint
106  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
107  * method SCIPcreateConsSuperindicator(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
108  *
109  * @see SCIPcreateConsSuperindicator() for information about the basic constraint flag configuration
110  *
111  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
112  */
115  SCIP* scip, /**< SCIP data structure */
116  SCIP_CONS** cons, /**< pointer to hold the created constraint */
117  const char* name, /**< name of constraint */
118  SCIP_VAR* binvar, /**< pointer to the indicator constraint */
119  SCIP_CONS* slackcons /**< constraint corresponding to the handled constraint */
120  );
121 
122 /** gets binary variable corresponding to the superindicator constraint */
125  SCIP_CONS* cons /**< superindicator constraint */
126  );
127 
128 /** gets the slack constraint corresponding to the superindicator constraint */
131  SCIP_CONS* cons /**< superindicator constraint */
132  );
133 
134 
135 
136 /*
137  * constraint-dependent SCIP methods
138  */
139 
140 /** transforms the current problem into a MinUC problem (minimizing the number of unsatisfied constraints),
141  * a CIP generalization of the MinULR (min. unsatisfied linear relations) problem
142  */
145  SCIP* scip, /**< SCIP data structure */
146  SCIP_Bool* success /**< pointer to store whether all constraints could be transformed */
147  );
148 
149 
150 
151 /*
152  * constraint-dependent dialog entries
153  */
154 
155 /** dialog execution method for the SCIPtransformMinUC() command */
157 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeMinUC);
158 
159 /* @} */
160 
161 /* @} */
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif
SCIP_EXPORT SCIP_RETCODE SCIPincludeConshdlrSuperindicator(SCIP *scip)
#define SCIP_EXPORT
Definition: def.h:98
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_EXPORT SCIP_VAR * SCIPgetBinaryVarSuperindicator(SCIP_CONS *cons)
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_CONS * SCIPgetSlackConsSuperindicator(SCIP_CONS *cons)
SCIP_EXPORT SCIP_RETCODE SCIPcreateConsBasicSuperindicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, SCIP_CONS *slackcons)
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT SCIP_RETCODE SCIPtransformMinUC(SCIP *scip, SCIP_Bool *success)
type definitions for user interface dialog
SCIP_EXPORT 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)
common defines and data types used in all packages of SCIP
SCIP_EXPORT SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeMinUC)
type definitions for constraints and constraint handlers