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