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