Scippy

SCIP

Solving Constraint Integer Programs

cons_abspower.h File Reference

Detailed Description

Constraint handler for absolute power constraints $\textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}$.

Author
Stefan Vigerske

This constraint handler handles constraints of the form

\[ \textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs} \]

for $n > 1.0$ a rational number, $a$ and $c$ arbitrary, and $x$ and $z$ variables. Note that $x$ can have $-a$ in the interior of its domain.

Constraints are enforced by separation, domain propagation, and spatial branching.

Cuts that separate on the convex hull of the graph of $\textrm{sign}(x+a) |x+a|^n$ are generated as long as they separate the relaxation solution. Otherwise, spatial branching on $x$ is applied.

Further, domain propagation is implemented to propagate bound changes on $x$ onto $z$, and vice versa, and repropagation is implemented to allow for conflict analysis. During presolve, a pairwise comparison of absolute power constraints may allow to fix or aggregate some variables. See also

Stefan Vigerske
Decomposition of Multistage Stochastic Programs and a Constraint Integer Programming Approach to Mixed-Integer Nonlinear Programming
PhD Thesis, Humboldt-University Berlin, 2012, submitted.

Definition in file cons_abspower.h.

#include "scip/scip.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeConshdlrAbspower (SCIP *scip)
 
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_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)
 
SCIP_RETCODE SCIPgetNlRowAbspower (SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
 
SCIP_VARSCIPgetNonlinearVarAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_VARSCIPgetLinearVarAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetExponentAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetOffsetAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetCoefLinearAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetLhsAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetRhsAbspower (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetViolationAbspower (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
 

Function Documentation

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 
)

creates and captures a absolute power constraint

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
xnonlinear variable x in constraint
zlinear variable z in constraint
exponentexponent n of |x+offset|^n term in constraint
xoffsetoffset in |x+offset|^n term in constraint
zcoefcoefficient of z in constraint
lhsleft hand side of constraint
rhsright hand side of constraint
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
separateshould the constraint be separated during LP processing? Usually set to TRUE.
enforceshould the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints.
checkshould the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints.
propagateshould the constraint be propagated during node processing? Usually set to TRUE.
localis constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints.
modifiableis constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint.
dynamicis constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are seperated as constraints.
removableshould the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Definition at line 6941 of file cons_abspower.c.

References BMSclearMemory, CONSHDLR_NAME, NULL, pow(), REALABS, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPallocMemory, SCIPcreateCons(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPisEQ(), SCIPisInfinity(), SCIPisZero(), SCIPmarkDoNotMultaggrVar(), SCIPvarIsActive(), and square().

Referenced by presolveFindDuplicates(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), SCIP_DECL_QUADCONSUPGD(), and SCIPcreateConsBasicAbspower().

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 
)

creates and captures an absolute power constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsAbspower(); all flags can be set via SCIPconsSetFLAGNAME-methods in scip.h

See Also
SCIPcreateConsAbspower() for information about the basic constraint flag configuration
Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()

creates and captures an absolute power constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsAbspower(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h

See Also
SCIPcreateConsAbspower() for information about the basic constraint flag configuration
Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
xnonlinear variable x in constraint
zlinear variable z in constraint
exponentexponent n of |x+offset|^n term in constraint
xoffsetoffset in |x+offset|^n term in constraint
zcoefcoefficient of z in constraint
lhsleft hand side of constraint
rhsright hand side of constraint

Definition at line 7042 of file cons_abspower.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsAbspower(), and TRUE.

SCIP_RETCODE SCIPgetNlRowAbspower ( SCIP scip,
SCIP_CONS cons,
SCIP_NLROW **  nlrow 
)

gets the absolute power constraint as a nonlinear row representation

Parameters
scipSCIP data structure
consconstraint
nlrowa buffer where to store pointer to nonlinear row

Definition at line 7064 of file cons_abspower.c.

References CONSHDLR_NAME, createNlRow(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

SCIP_VAR* SCIPgetNonlinearVarAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets nonlinear variable x in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7090 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_VAR* SCIPgetLinearVarAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets linear variable z in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7107 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetExponentAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets exponent in power term in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7124 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetOffsetAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets offset in power term in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7141 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetCoefLinearAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets coefficient of linear variable in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7158 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetLhsAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets left hand side in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7175 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetRhsAbspower ( SCIP scip,
SCIP_CONS cons 
)

gets right hand side in absolute power constraint

Parameters
scipSCIP data structure
consabsolute power constraint

Definition at line 7192 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetName().

Referenced by SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetViolationAbspower ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol 
)

gets the absolute violation of a absolute power constraint by a solution

Parameters
scipSCIP data structure
consabsolute power constraint
solLP solution

Definition at line 7209 of file cons_abspower.c.

References CONSHDLR_NAME, NULL, pow(), REALABS, SCIP_Real, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebugMessage, SCIPgetSolVal(), and SIGN.