Scippy

SCIP

Solving Constraint Integer Programs

cons_abspower.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_abspower.h
17  * @ingroup CONSHDLRS
18  * @brief Constraint handler for absolute power constraints \f$\textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}\f$
19  * @author Stefan Vigerske
20  *
21  * This constraint handler handles constraints of the form
22  * \f[
23  * \textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}
24  * \f]
25  * for \f$n > 1.0\f$ a rational number, \f$a\f$ and \f$c\f$ arbitrary, and \f$x\f$ and \f$z\f$ variables.
26  * Note that \f$x\f$ can have \f$-a\f$ in the interior of its domain.
27  *
28  * Constraints are enforced by separation, domain propagation, and spatial branching.
29  *
30  * Cuts that separate on the convex hull of the graph of \f$\textrm{sign}(x+a) |x+a|^n\f$ are generated as long as they separate the relaxation solution.
31  * Otherwise, spatial branching on \f$x\f$ is applied.
32  *
33  * Further, domain propagation is implemented to propagate bound changes on \f$x\f$ onto \f$z\f$, and vice versa, and
34  * repropagation is implemented to allow for conflict analysis.
35  * During presolve, a pairwise comparison of absolute power constraints may allow to fix or aggregate some variables.
36  * See also
37  *
38  * @par
39  * Stefan Vigerske@n
40  * Decomposition of Multistage Stochastic Programs and a Constraint Integer Programming Approach to Mixed-Integer Nonlinear Programming@n
41  * PhD Thesis, Humboldt-University Berlin, 2012, submitted.
42  */
43 
44 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
45 
46 #ifndef __SCIP_CONS_ABSPOWER_H__
47 #define __SCIP_CONS_ABSPOWER_H__
48 
49 #include "scip/scip.h"
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /** creates the handler for absolute power constraints and includes it in SCIP */
56 extern
58  SCIP* scip /**< SCIP data structure */
59  );
60 
61 /** creates and captures a absolute power constraint
62  *
63  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
64  */
65 extern
67  SCIP* scip, /**< SCIP data structure */
68  SCIP_CONS** cons, /**< pointer to hold the created constraint */
69  const char* name, /**< name of constraint */
70  SCIP_VAR* x, /**< nonlinear variable x in constraint */
71  SCIP_VAR* z, /**< linear variable z in constraint */
72  SCIP_Real exponent, /**< exponent n of |x+offset|^n term in constraint */
73  SCIP_Real xoffset, /**< offset in |x+offset|^n term in constraint */
74  SCIP_Real zcoef, /**< coefficient of z in constraint */
75  SCIP_Real lhs, /**< left hand side of constraint */
76  SCIP_Real rhs, /**< right hand side of constraint */
77  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
78  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
79  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
80  * Usually set to TRUE. */
81  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
82  * TRUE for model constraints, FALSE for additional, redundant constraints. */
83  SCIP_Bool check, /**< should the constraint be checked for feasibility?
84  * TRUE for model constraints, FALSE for additional, redundant constraints. */
85  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
86  * Usually set to TRUE. */
87  SCIP_Bool local, /**< is constraint only valid locally?
88  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
89  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
90  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
91  * adds coefficients to this constraint. */
92  SCIP_Bool dynamic, /**< is constraint subject to aging?
93  * Usually set to FALSE. Set to TRUE for own cuts which
94  * are seperated as constraints. */
95  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
96  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
97  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
98  * if it may be moved to a more global node?
99  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
100  );
101 
102 /** creates and captures an absolute power constraint
103  * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
104  * method SCIPcreateConsAbspower(); all flags can be set via SCIPconsSetFLAGNAME-methods in scip.h
105  *
106  * @see SCIPcreateConsAbspower() for information about the basic constraint flag configuration
107  *
108  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
109  */
110 extern
112  SCIP* scip, /**< SCIP data structure */
113  SCIP_CONS** cons, /**< pointer to hold the created constraint */
114  const char* name, /**< name of constraint */
115  SCIP_VAR* x, /**< nonlinear variable x in constraint */
116  SCIP_VAR* z, /**< linear variable z in constraint */
117  SCIP_Real exponent, /**< exponent n of |x+offset|^n term in constraint */
118  SCIP_Real xoffset, /**< offset in |x+offset|^n term in constraint */
119  SCIP_Real zcoef, /**< coefficient of z in constraint */
120  SCIP_Real lhs, /**< left hand side of constraint */
121  SCIP_Real rhs /**< right hand side of constraint */
122  );
123 
124 /** gets the absolute power constraint as a nonlinear row representation */
125 extern
127  SCIP* scip, /**< SCIP data structure */
128  SCIP_CONS* cons, /**< constraint */
129  SCIP_NLROW** nlrow /**< a buffer where to store pointer to nonlinear row */
130  );
131 
132 /** gets nonlinear variable x in absolute power constraint */
133 extern
135  SCIP* scip, /**< SCIP data structure */
136  SCIP_CONS* cons /**< absolute power constraint */
137  );
138 
139 /** gets linear variable z in absolute power constraint */
140 extern
142  SCIP* scip, /**< SCIP data structure */
143  SCIP_CONS* cons /**< absolute power constraint */
144  );
145 
146 /** gets exponent in power term in absolute power constraint */
147 extern
149  SCIP* scip, /**< SCIP data structure */
150  SCIP_CONS* cons /**< absolute power constraint */
151  );
152 
153 /** gets offset in power term in absolute power constraint */
154 extern
156  SCIP* scip, /**< SCIP data structure */
157  SCIP_CONS* cons /**< absolute power constraint */
158  );
159 
160 /** gets coefficient of linear variable in absolute power constraint */
161 extern
163  SCIP* scip, /**< SCIP data structure */
164  SCIP_CONS* cons /**< absolute power constraint */
165  );
166 
167 /** gets left hand side in absolute power constraint */
168 extern
170  SCIP* scip, /**< SCIP data structure */
171  SCIP_CONS* cons /**< absolute power constraint */
172  );
173 
174 /** gets right hand side in absolute power constraint */
175 extern
177  SCIP* scip, /**< SCIP data structure */
178  SCIP_CONS* cons /**< absolute power constraint */
179  );
180 
181 /** gets the absolute violation of a absolute power constraint by a solution */
182 extern
184  SCIP* scip, /**< SCIP data structure */
185  SCIP_CONS* cons, /**< absolute power constraint */
186  SCIP_SOL* sol /**< LP solution */
187  );
188 
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #endif
SCIP_Real SCIPgetExponentAbspower(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPcreateConsAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, 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_VAR * SCIPgetLinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetViolationAbspower(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateConsBasicAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
#define SCIP_Bool
Definition: def.h:53
SCIP_RETCODE SCIPincludeConshdlrAbspower(SCIP *scip)
SCIP_Real SCIPgetLhsAbspower(SCIP *scip, SCIP_CONS *cons)
#define SCIP_Real
Definition: def.h:127
SCIP_Real SCIPgetOffsetAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetNonlinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetCoefLinearAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetNlRowAbspower(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
SCIP callable library.