|
Constraint handler for "and" constraints, .
- Author
- Tobias Achterberg
-
Stefan Heinz
-
Michael Winkler
This constraint handler deals with "and" constraint. These are constraint of the form:
where is a binary variable for all . Hence, is also of binary type. The variable is called resultant and the 's operators.
Definition in file cons_and.h.
Go to the source code of this file.
|
SCIP_RETCODE | SCIPincludeConshdlrAnd (SCIP *scip) |
|
SCIP_RETCODE | SCIPcreateConsAnd (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars, 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 | SCIPcreateConsBasicAnd (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars) |
|
int | SCIPgetNVarsAnd (SCIP *scip, SCIP_CONS *cons) |
|
SCIP_VAR ** | SCIPgetVarsAnd (SCIP *scip, SCIP_CONS *cons) |
|
SCIP_VAR * | SCIPgetResultantAnd (SCIP *scip, SCIP_CONS *cons) |
|
SCIP_Bool | SCIPisAndConsSorted (SCIP *scip, SCIP_CONS *cons) |
|
SCIP_RETCODE | SCIPsortAndCons (SCIP *scip, SCIP_CONS *cons) |
|
SCIP_RETCODE | SCIPchgAndConsCheckFlagWhenUpgr (SCIP *scip, SCIP_CONS *cons, SCIP_Bool flag) |
|
SCIP_RETCODE | SCIPchgAndConsRemovableFlagWhenUpgr (SCIP *scip, SCIP_CONS *cons, SCIP_Bool flag) |
|
creates the handler for and constraints and includes it in SCIP
- Parameters
-
SCIP_RETCODE SCIPcreateConsAnd |
( |
SCIP * |
scip, |
|
|
SCIP_CONS ** |
cons, |
|
|
const char * |
name, |
|
|
SCIP_VAR * |
resvar, |
|
|
int |
nvars, |
|
|
SCIP_VAR ** |
vars, |
|
|
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 an and constraint
- Note
- the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
- Parameters
-
scip | SCIP data structure |
cons | pointer to hold the created constraint |
name | name of constraint |
resvar | resultant variable of the operation |
nvars | number of operator variables in the constraint |
vars | array with operator variables of constraint |
initial | should the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'. |
separate | should the constraint be separated during LP processing? Usually set to TRUE. |
enforce | should the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints. |
check | should the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints. |
propagate | should the constraint be propagated during node processing? Usually set to TRUE. |
local | is constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. |
modifiable | is constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint. |
dynamic | is constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints. |
removable | should 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'. |
stickingatnode | should 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. |
creates and captures an and constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsAnd(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
- See also
- SCIPcreateConsAnd() 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
-
scip | SCIP data structure |
cons | pointer to hold the created constraint |
name | name of constraint |
resvar | resultant variable of the operation |
nvars | number of operator variables in the constraint |
vars | array with operator variables of constraint |
gets number of variables in and constraint
- Parameters
-
scip | SCIP data structure |
cons | constraint data |
gets array of variables in and constraint
- Parameters
-
scip | SCIP data structure |
cons | constraint data |
gets the resultant variable in and constraint
- Parameters
-
scip | SCIP data structure |
cons | constraint data |
return if the variables of the and-constraint are sorted due to their indices
- Parameters
-
scip | SCIP data structure |
cons | and-constraint |
sort the variables of the and-constraint due to their indices
- Parameters
-
scip | SCIP data structure |
cons | and-constraint |
when 'upgrading' the given and-constraint, should the check flag for the upgraded constraint be set to TRUE, even if the check flag of this and-constraint is set to FALSE?
- Parameters
-
scip | SCIP data structure |
cons | constraint data |
flag | should an arising constraint from the given and-constraint be checked, even if the check flag of the and-constraint is set to FALSE |
when 'upgrading' the given and-constraint, should the removable flag for the upgraded constraint be set to FALSE, even if the removable flag of this and-constraint is set to TRUE?
- Parameters
-
scip | SCIP data structure |
cons | constraint data |
flag | should an arising constraint from the given and-constraint be not removable, even if the removable flag of the and-constraint is set to TRUE |
|