Scippy

SCIP

Solving Constraint Integer Programs

cons_varbound.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_varbound.h
17  * @ingroup CONSHDLRS
18  * @brief Constraint handler for variable bound constraints \f$lhs \leq x + c y \leq rhs\f$.
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Michael Winkler
22  * @author Gerald Gamrath
23  * @author Stefan Heinz
24  *
25  */
26 
27 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
28 
29 #ifndef __SCIP_CONS_VARBOUND_H__
30 #define __SCIP_CONS_VARBOUND_H__
31 
32 
33 #include "scip/scip.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /** creates the handler for variable bound constraints and includes it in SCIP
40  *
41  * @ingroup ConshdlrIncludes
42  * */
43 extern
45  SCIP* scip /**< SCIP data structure */
46  );
47 
48 /**@addtogroup CONSHDLRS
49  *
50  * @{
51  *
52  * @name Variable Bound Constraints
53  *
54  * @{
55  *
56  * This constraint handler handles a special type of linear constraints, namely variable bound constraints.
57  * A variable bound constraint has the form
58  * \f[
59  * lhs \leq x + c y \leq rhs
60  * \f]
61  * with coefficient \f$c \in Q\f$, \f$lhs\in Q \cup \{-\infty\}\f$, \f$rhs\in Q \cup \{\infty\}\f$,
62  * and decision variables \f$x\f$ (non-binary) and \f$y\f$ (binary or integer).
63  */
64 
65 /** creates and captures a variable bound constraint: lhs <= x + c*y <= rhs
66  *
67  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
68  */
69 extern
71  SCIP* scip, /**< SCIP data structure */
72  SCIP_CONS** cons, /**< pointer to hold the created constraint */
73  const char* name, /**< name of constraint */
74  SCIP_VAR* var, /**< variable x that has variable bound */
75  SCIP_VAR* vbdvar, /**< binary, integer or implicit integer bounding variable y */
76  SCIP_Real vbdcoef, /**< coefficient c of bounding variable y */
77  SCIP_Real lhs, /**< left hand side of variable bound inequality */
78  SCIP_Real rhs, /**< right hand side of variable bound inequality */
79  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
80  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
81  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
82  * Usually set to TRUE. */
83  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
84  * TRUE for model constraints, FALSE for additional, redundant constraints. */
85  SCIP_Bool check, /**< should the constraint be checked for feasibility?
86  * TRUE for model constraints, FALSE for additional, redundant constraints. */
87  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
88  * Usually set to TRUE. */
89  SCIP_Bool local, /**< is constraint only valid locally?
90  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
91  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
92  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
93  * adds coefficients to this constraint. */
94  SCIP_Bool dynamic, /**< is constraint subject to aging?
95  * Usually set to FALSE. Set to TRUE for own cuts which
96  * are separated as constraints. */
97  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
98  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
99  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
100  * if it may be moved to a more global node?
101  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
102  );
103 
104 /** creates and captures a varbound constraint
105  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
106  * method SCIPcreateConsVarbound(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
107  *
108  * @see SCIPcreateConsVarbound() for information about the basic constraint flag configuration
109  *
110  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
111  */
112 extern
114  SCIP* scip, /**< SCIP data structure */
115  SCIP_CONS** cons, /**< pointer to hold the created constraint */
116  const char* name, /**< name of constraint */
117  SCIP_VAR* var, /**< variable x that has variable bound */
118  SCIP_VAR* vbdvar, /**< binary, integer or implicit integer bounding variable y */
119  SCIP_Real vbdcoef, /**< coefficient c of bounding variable y */
120  SCIP_Real lhs, /**< left hand side of variable bound inequality */
121  SCIP_Real rhs /**< right hand side of variable bound inequality */
122  );
123 
124 /** gets left hand side of variable bound constraint lhs <= x + c*y <= rhs */
125 extern
127  SCIP* scip, /**< SCIP data structure */
128  SCIP_CONS* cons /**< constraint data */
129  );
130 
131 /** gets right hand side of variable bound constraint lhs <= x + c*y <= rhs */
132 extern
134  SCIP* scip, /**< SCIP data structure */
135  SCIP_CONS* cons /**< constraint data */
136  );
137 
138 /** gets bounded variable x of variable bound constraint lhs <= x + c*y <= rhs */
139 extern
141  SCIP* scip, /**< SCIP data structure */
142  SCIP_CONS* cons /**< constraint data */
143  );
144 
145 /** gets bounding variable y of variable bound constraint lhs <= x + c*y <= rhs */
146 extern
148  SCIP* scip, /**< SCIP data structure */
149  SCIP_CONS* cons /**< constraint data */
150  );
151 
152 /** gets bound coefficient c of variable bound constraint lhs <= x + c*y <= rhs */
153 extern
155  SCIP* scip, /**< SCIP data structure */
156  SCIP_CONS* cons /**< constraint data */
157  );
158 
159 /** gets the dual solution of the variable bound constraint in the current LP */
160 extern
162  SCIP* scip, /**< SCIP data structure */
163  SCIP_CONS* cons /**< constraint data */
164  );
165 
166 /** gets the dual Farkas value of the variable bound constraint in the current infeasible LP */
167 extern
169  SCIP* scip, /**< SCIP data structure */
170  SCIP_CONS* cons /**< constraint data */
171  );
172 
173 /** returns the linear relaxation of the given variable bound constraint; may return NULL if no LP row was yet created;
174  * the user must not modify the row!
175  */
176 extern
178  SCIP* scip, /**< SCIP data structure */
179  SCIP_CONS* cons /**< constraint data */
180  );
181 
182 /* @} */
183 
184 /* @} */
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolVarbound(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_ROW * SCIPgetRowVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs)
SCIP_RETCODE SCIPcreateConsVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs, 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_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Bool
Definition: def.h:61
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Real
Definition: def.h:135
SCIP callable library.
SCIP_RETCODE SCIPincludeConshdlrVarbound(SCIP *scip)