Scippy

SCIP

Solving Constraint Integer Programs

cons_logicor.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_logicor.h
17  * @ingroup CONSHDLRS
18  * @brief Constraint handler for logicor constraints \f$1^T x \ge 1\f$ (equivalent to set covering, but algorithms are suited for depth first search).
19  * @author Tobias Achterberg
20  * @author Michael Winkler
21  *
22  */
23 
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
25 
26 #ifndef __SCIP_CONS_LOGICOR_H__
27 #define __SCIP_CONS_LOGICOR_H__
28 
29 
30 #include "scip/scip.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** creates the handler for logic or constraints and includes it in SCIP
37  *
38  * @ingroup ConshdlrIncludes
39  * */
40 extern
42  SCIP* scip /**< SCIP data structure */
43  );
44 
45 /**@addtogroup CONSHDLRS
46  *
47  * @{
48  *
49  * @name Logicor Constraints
50  *
51  * @{
52  *
53  * This constraint handler handles a special type of linear constraints, namely
54  * logic or constraints. These are equivalent to set covering constraints, but
55  * are handled by special algorithms which are better suited for depth first search.
56  * For a set of binary variables \f$x_i, i=1,\dots,n\f$, a logic or constraint has the form
57  * \f[
58  * \sum_{i=1}^n x_i \ge 1.
59  * \f]
60  */
61 
62 /** creates and captures a logic or constraint
63  *
64  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
65  */
66 extern
68  SCIP* scip, /**< SCIP data structure */
69  SCIP_CONS** cons, /**< pointer to hold the created constraint */
70  const char* name, /**< name of constraint */
71  int nvars, /**< number of variables in the constraint */
72  SCIP_VAR** vars, /**< array with variables of constraint entries */
73  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
74  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
75  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
76  * Usually set to TRUE. */
77  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
78  * TRUE for model constraints, FALSE for additional, redundant constraints. */
79  SCIP_Bool check, /**< should the constraint be checked for feasibility?
80  * TRUE for model constraints, FALSE for additional, redundant constraints. */
81  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
82  * Usually set to TRUE. */
83  SCIP_Bool local, /**< is constraint only valid locally?
84  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
85  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
86  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
87  * adds coefficients to this constraint. */
88  SCIP_Bool dynamic, /**< is constraint subject to aging?
89  * Usually set to FALSE. Set to TRUE for own cuts which
90  * are separated as constraints. */
91  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
92  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
93  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
94  * if it may be moved to a more global node?
95  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
96  );
97 
98 /** creates and captures a logicor constraint
99  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
100  * method SCIPcreateConsLogicor(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
101  *
102  * @see SCIPcreateConsLogicor() for information about the basic constraint flag configuration
103  *
104  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
105  */
106 extern
108  SCIP* scip, /**< SCIP data structure */
109  SCIP_CONS** cons, /**< pointer to hold the created constraint */
110  const char* name, /**< name of constraint */
111  int nvars, /**< number of variables in the constraint */
112  SCIP_VAR** vars /**< array with variables of constraint entries */
113  );
114 
115 /** adds coefficient in logic or constraint */
116 extern
118  SCIP* scip, /**< SCIP data structure */
119  SCIP_CONS* cons, /**< logicor constraint */
120  SCIP_VAR* var /**< variable to add to the constraint */
121  );
122 
123 /** gets number of variables in logic or constraint */
124 extern
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_CONS* cons /**< constraint data */
128  );
129 
130 /** gets array of variables in logic or constraint */
131 extern
133  SCIP* scip, /**< SCIP data structure */
134  SCIP_CONS* cons /**< constraint data */
135  );
136 
137 /** gets the dual solution of the logic or constraint in the current LP */
138 extern
140  SCIP* scip, /**< SCIP data structure */
141  SCIP_CONS* cons /**< constraint data */
142  );
143 
144 /** gets the dual Farkas value of the logic or constraint in the current infeasible LP */
145 extern
147  SCIP* scip, /**< SCIP data structure */
148  SCIP_CONS* cons /**< constraint data */
149  );
150 
151 /** returns the linear relaxation of the given logic or constraint; may return NULL if no LP row was yet created;
152  * the user must not modify the row!
153  */
154 extern
156  SCIP* scip, /**< SCIP data structure */
157  SCIP_CONS* cons /**< constraint data */
158  );
159 
160 /* @} */
161 
162 /* @} */
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 #endif
SCIP_RETCODE SCIPaddCoefLogicor(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Real SCIPgetDualsolLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
SCIP_ROW * SCIPgetRowLogicor(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Bool
Definition: def.h:61
SCIP_Real SCIPgetDualfarkasLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPincludeConshdlrLogicor(SCIP *scip)
#define SCIP_Real
Definition: def.h:135
SCIP callable library.