Scippy

SCIP

Solving Constraint Integer Programs

cons_varbound.h File Reference

Detailed Description

Constraint handler for variable bound constraints $lhs \leq x + c y \leq rhs$.

Author
Tobias Achterberg
Timo Berthold
Michael Winkler
Gerald Gamrath
Stefan Heinz

This constraint handler handles a special type of linear constraints, namely variable bound constraints. A variable bound constraint has the form

\[ lhs \leq x + c y \leq rhs \]

with coefficient $c \in Q$, $lhs\in Q \cup \{-\infty\}$, $rhs\in Q \cup \{\infty\}$, and decision variables $x$ (non-binary) and $y$ (binary or integer).

Definition in file cons_varbound.h.

#include "scip/scip.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeConshdlrVarbound (SCIP *scip)
 
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_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_Real SCIPgetLhsVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetRhsVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_VARSCIPgetVarVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_VARSCIPgetVbdvarVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetVbdcoefVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetDualsolVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetDualfarkasVarbound (SCIP *scip, SCIP_CONS *cons)
 
SCIP_ROWSCIPgetRowVarbound (SCIP *scip, SCIP_CONS *cons)
 

Function Documentation

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 
)

creates and captures a variable bound constraint: lhs <= x + c*y <= rhs

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
varvariable x that has variable bound
vbdvarbinary, integer or implicit integer bounding variable y
vbdcoefcoefficient c of bounding variable y
lhsleft hand side of variable bound inequality
rhsright hand side of variable bound inequality
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 separated 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 4545 of file cons_varbound.c.

References catchEvents(), consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPconshdlrGetData(), SCIPcreateCons(), SCIPcreateConsBasicVarbound(), SCIPerrorMessage, SCIPfindConshdlr(), and SCIPisTransformed().

Referenced by addVarbound(), createPrecedenceCons(), createVarUbs(), presolveTryAddLinearReform(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_LINCONSUPGD(), SCIPcreateConsBasicVarbound(), and SCIPincludeConshdlrVarbound().

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 
)

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

See also
SCIPcreateConsVarbound() 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 a variable bound constraint: lhs <= x + c*y <= rhs with all constraint flags set to their default values

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
varvariable x that has variable bound
vbdvarbinary, integer or implicit integer bounding variable y
vbdcoefcoefficient c of bounding variable y
lhsleft hand side of variable bound inequality
rhsright hand side of variable bound inequality

Definition at line 4615 of file cons_varbound.c.

References FALSE, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcreateConsVarbound(), SCIPgetLhsVarbound(), and TRUE.

Referenced by SCIPcreateConsVarbound().

SCIP_Real SCIPgetLhsVarbound ( SCIP scip,
SCIP_CONS cons 
)
SCIP_Real SCIPgetRhsVarbound ( SCIP scip,
SCIP_CONS cons 
)
SCIP_VAR* SCIPgetVarVarbound ( SCIP scip,
SCIP_CONS cons 
)
SCIP_VAR* SCIPgetVbdvarVarbound ( SCIP scip,
SCIP_CONS cons 
)
SCIP_Real SCIPgetVbdcoefVarbound ( SCIP scip,
SCIP_CONS cons 
)
SCIP_Real SCIPgetDualsolVarbound ( SCIP scip,
SCIP_CONS cons 
)

gets the dual solution of the variable bound constraint in the current LP

Parameters
scipSCIP data structure
consconstraint data

Definition at line 4738 of file cons_varbound.c.

References CONSHDLR_NAME, NULL, SCIP_INVALID, SCIP_Real, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, SCIPgetDualfarkasVarbound(), and SCIProwGetDualsol().

Referenced by SCIPgetVbdcoefVarbound().

SCIP_Real SCIPgetDualfarkasVarbound ( SCIP scip,
SCIP_CONS cons 
)

gets the dual Farkas value of the variable bound constraint in the current infeasible LP

Parameters
scipSCIP data structure
consconstraint data

Definition at line 4762 of file cons_varbound.c.

References CONSHDLR_NAME, NULL, SCIP_INVALID, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, SCIPgetRowVarbound(), and SCIProwGetDualfarkas().

Referenced by SCIPgetDualsolVarbound().

SCIP_ROW* SCIPgetRowVarbound ( SCIP scip,
SCIP_CONS cons 
)

returns the linear relaxation of the given variable bound constraint; may return NULL if no LP row was yet created; the user must not modify the row!

Parameters
scipSCIP data structure
consconstraint data

Definition at line 4788 of file cons_varbound.c.

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

Referenced by SCIPgetDualfarkasVarbound().