cons_indicator.h File Reference Detailed Descriptionconstraint handler for indicator constraints An indicator constraint is given by a binary variable and an inequality . It states that if then holds. This constraint is handled by adding a slack variable with . The constraint is enforced by fixing to 0 if .
This constraint is equivalent to a linear constraint and an SOS1 constraint on and (at most one should be nonzero). In the indicator context we can, however, separate more inequalities. The name indicator apparently comes from CPLEX. Definition in file cons_indicator.h. #include "scip/scip.h" Go to the source code of this file. Function Documentation
creates the handler for indicator constraints and includes it in SCIP
Definition at line 6702 of file cons_indicator.c. References CONFLICTHDLR_DESC, CONFLICTHDLR_NAME, CONFLICTHDLR_PRIORITY, CONSHDLR_CHECKPRIORITY, CONSHDLR_DELAYPROP, CONSHDLR_DELAYSEPA, CONSHDLR_DESC, CONSHDLR_EAGERFREQ, CONSHDLR_ENFOPRIORITY, CONSHDLR_MAXPREROUNDS, CONSHDLR_NAME, CONSHDLR_NEEDSCONS, CONSHDLR_PRESOLTIMING, CONSHDLR_PROP_TIMING, CONSHDLR_PROPFREQ, CONSHDLR_SEPAFREQ, CONSHDLR_SEPAPRIORITY, DEFAULT_ADDCOUPLING, DEFAULT_ADDCOUPLINGCONS, DEFAULT_ADDOPPOSITE, DEFAULT_BRANCHINDICATORS, DEFAULT_CONFLICTSUPGRADE, DEFAULT_DUALREDUCTIONS, DEFAULT_ENFORCECUTS, DEFAULT_FORCERESTART, DEFAULT_GENERATEBILINEAR, DEFAULT_GENLOGICOR, DEFAULT_MAXCONDITIONALTLP, DEFAULT_MAXCOUPLINGVALUE, DEFAULT_MAXSEPACUTS, DEFAULT_MAXSEPACUTSROOT, DEFAULT_NOLINCONSCONT, DEFAULT_REMOVEINDICATORS, DEFAULT_RESTARTFRAC, DEFAULT_SCALESLACKVAR, DEFAULT_SEPAALTERNATIVELP, DEFAULT_SEPACOUPLINGCUTS, DEFAULT_SEPACOUPLINGLOCAL, DEFAULT_SEPACOUPLINGVALUE, DEFAULT_TRYSOLFROMCOVER, DEFAULT_TRYSOLUTIONS, DEFAULT_UPDATEBOUNDS, DEFAULT_UPGRADELINEAR, DEFAULT_USEOBJECTIVECUT, DEFAULT_USEOTHERCONSS, EVENTHDLR_BOUND_DESC, EVENTHDLR_BOUND_NAME, EVENTHDLR_RESTART_DESC, EVENTHDLR_RESTART_NAME, FALSE, initConshdlrData(), LINCONSUPGD_PRIORITY, NULL, SCIP_CALL, SCIP_OKAY, SCIP_REAL_MAX, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPaddRealParam(), SCIPallocMemory, SCIPcreateConsIndicator(), SCIPfindConshdlr(), SCIPincludeConflicthdlrBasic(), SCIPincludeConshdlrBasic(), SCIPincludeEventhdlrBasic(), SCIPincludeLinconsUpgrade(), SCIPsetConflicthdlrFree(), SCIPsetConshdlrCopy(), SCIPsetConshdlrDelete(), SCIPsetConshdlrDisable(), SCIPsetConshdlrEnable(), SCIPsetConshdlrExit(), SCIPsetConshdlrExitsol(), SCIPsetConshdlrFree(), SCIPsetConshdlrGetDiveBdChgs(), SCIPsetConshdlrGetNVars(), SCIPsetConshdlrGetVars(), SCIPsetConshdlrInit(), SCIPsetConshdlrInitlp(), SCIPsetConshdlrInitpre(), SCIPsetConshdlrInitsol(), SCIPsetConshdlrParse(), SCIPsetConshdlrPresol(), SCIPsetConshdlrPrint(), SCIPsetConshdlrProp(), SCIPsetConshdlrResprop(), SCIPsetConshdlrSepa(), SCIPsetConshdlrTrans(), and TRUE. Referenced by SCIP_DECL_CONSGETDIVEBDCHGS(), SCIP_DECL_CONSHDLRCOPY(), and SCIPincludeDefaultPlugins().
creates and captures an indicator constraint
Definition at line 6948 of file cons_indicator.c. References consdataCreate(), CONSHDLR_NAME, FALSE, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPceil(), SCIPconsAddUpgradeLocks(), SCIPconsGetNUpgradeLocks(), SCIPconshdlrGetData(), SCIPcreateCons(), SCIPcreateConsBasicIndicator(), SCIPcreateConsLinear(), SCIPcreateConsQuadratic(), SCIPcreateVar(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPinfinity(), SCIPisIntegral(), SCIPisZero(), SCIPmarkDoNotMultaggrVar(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvarGetType(), SCIPvarIsIntegral(), and TRUE. Referenced by createIndicatorConstraint(), readIndicators(), SCIP_DECL_CONSINITPRE(), SCIP_DECL_LINCONSUPGD(), SCIPcreateConsBasicIndicator(), SCIPincludeConshdlrIndicator(), and upgradeIndicatorSuperindicator().
creates and captures an indicator constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsIndicator(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
Definition at line 7142 of file cons_indicator.c. References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsIndicator(), SCIPcreateConsIndicatorLinCons(), and TRUE. Referenced by SCIPcreateConsIndicator().
creates and captures an indicator constraint with given linear constraint and slack variable
Definition at line 7171 of file cons_indicator.c. References consdataCreate(), CONSHDLR_NAME, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPconsAddUpgradeLocks(), SCIPconsGetHdlr(), SCIPconsGetNUpgradeLocks(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPcreateCons(), SCIPcreateConsBasicIndicatorLinCons(), SCIPcreateConsQuadratic(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPgetNVarsLinear(), SCIPgetVarsLinear(), SCIPmarkDoNotMultaggrVar(), SCIPvarGetType(), and TRUE. Referenced by createSubSCIP(), readIndicators(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), SCIPcreateConsBasicIndicator(), and SCIPcreateConsBasicIndicatorLinCons().
creates and captures an indicator constraint with given linear constraint and slack variable in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsIndicator(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
Definition at line 7309 of file cons_indicator.c. References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddVarIndicator(), SCIPcreateConsIndicatorLinCons(), and TRUE. Referenced by SCIPcreateConsIndicatorLinCons().
adds variable to the inequality of the indicator constraint
Definition at line 7328 of file cons_indicator.c. References CONSHDLR_NAME, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPchgVarType(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetLinearConsIndicator(), SCIPisIntegral(), SCIPvarGetType(), and SCIPvarIsIntegral(). Referenced by SCIPcreateConsBasicIndicatorLinCons(). gets the linear constraint corresponding to the indicator constraint (may be NULL)
Definition at line 7359 of file cons_indicator.c. References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPsetLinearConsIndicator(). Referenced by computeRanks(), createSubSCIP(), SCIP_DECL_LINCONSUPGD(), SCIP_DECL_READERWRITE(), SCIPaddVarIndicator(), SCIPwriteLp(), and writeOpbConstraints().
sets the linear constraint corresponding to the indicator constraint (may be NULL)
Definition at line 7376 of file cons_indicator.c. References CONSHDLR_NAME, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_STAGE_PROBLEM, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPcaptureCons(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdelCons(), SCIPerrorMessage, SCIPgetBinaryVarIndicator(), SCIPgetNVarsLinear(), SCIPgetStage(), SCIPgetVarsLinear(), SCIPreleaseCons(), SCIPvarGetType(), and TRUE. Referenced by SCIPgetLinearConsIndicator().
sets binary indicator variable for indicator constraint
Definition at line 7464 of file cons_indicator.c. References CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_ERROR, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_GBDCHANGED, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_VARTYPE_BINARY, SCIPcatchVarEvent(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsTransformed(), SCIPerrorMessage, SCIPgetSlackVarIndicator(), SCIPgetTransformedVar(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetType(). Referenced by SCIPgetBinaryVarIndicator(). gets binary variable corresponding to indicator constraint
Definition at line 7447 of file cons_indicator.c. References CONSHDLR_NAME, NULL, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPsetBinaryVarIndicator(). Referenced by computeRanks(), createCoveringProblem(), createSubSCIP(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONSGETDIVEBDCHGS(), SCIP_DECL_HEUREXEC(), SCIP_DECL_READERWRITE(), SCIPsetLinearConsIndicator(), SCIPwriteGms(), SCIPwriteLp(), tryOneOpt(), trySolCandidate(), and writeOpbConstraints(). gets slack variable corresponding to indicator constraint
Definition at line 7538 of file cons_indicator.c. References CONSHDLR_NAME, NULL, SCIP_Bool, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPisViolatedIndicator(). Referenced by createSubSCIP(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_READERWRITE(), SCIPsetBinaryVarIndicator(), SCIPwriteGms(), SCIPwriteLp(), and writeOpbConstraints(). checks whether indicator constraint is violated w.r.t. sol
Definition at line 7555 of file cons_indicator.c. References FALSE, NULL, SCIPconsGetData(), SCIPconsIsDeleted(), SCIPgetSolVal(), SCIPisFeasPositive(), SCIPmakeIndicatorFeasible(), and TRUE. Referenced by SCIP_DECL_CONSGETDIVEBDCHGS(), and SCIPgetSlackVarIndicator().
Based on values of other variables, computes slack and binary variable to turn constraint feasible Based on values of other variables, computes slack and binary variable to turn constraint feasible It will also clean up the solution, i.e., shift slack variable, as follows: If the inequality is , the value of the slack variable to achieve equality is
where is the given solution. In case of , we arrive at
The typical values of in the first case is -1 and +1 in the second case. Now, let be the sign of in the first case and in the second case. Thus, if and , the inequality cannot be satisfied by a nonnegative value for the slack variable; in this case, we have to leave the values as they are. If and , the solution violates the indicator constraint (we can set the slack variable to value ). If and or and , the constraint is satisfied, and we can set the slack variable to 0.
Definition at line 7610 of file cons_indicator.c. References CONSHDLR_NAME, FALSE, NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_INITPRESOLVE, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_NEGATED, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPconsIsActive(), SCIPgetLhsLinear(), SCIPgetNVarsLinear(), SCIPgetRhsLinear(), SCIPgetSolVal(), SCIPgetStage(), SCIPgetValsLinear(), SCIPgetVarsLinear(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisFeasZero(), SCIPisInfinity(), SCIPisZero(), SCIPmakeIndicatorsFeasible(), SCIPsetSolVal(), SCIPvarGetLbLocal(), SCIPvarGetNegationVar(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetStatus(), TRUE, and varGetObjDelta(). Referenced by SCIP_DECL_CONSCHECK(), SCIPisViolatedIndicator(), and SCIPmakeIndicatorsFeasible().
Based on values of other variables, computes slack and binary variable to turn all constraints feasible
Definition at line 7784 of file cons_indicator.c. References CONSHDLR_NAME, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_INITPRESOLVE, SCIPaddLinearConsIndicator(), SCIPconsGetData(), SCIPconshdlrGetConss(), SCIPconshdlrGetName(), SCIPconshdlrGetNConss(), SCIPgetStage(), and SCIPmakeIndicatorFeasible(). Referenced by SCIPmakeIndicatorFeasible(), and SCIPperformGenericDivingAlgorithm().
adds additional linear constraint that is not connected by an indicator constraint, but can be used for separation adds additional linear constraint that is not connected with an indicator constraint, but can be used for separation
Definition at line 7831 of file cons_indicator.c. References consdataEnsureAddLinConsSize(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddRowIndicator(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPconsIsLocal(). Referenced by SCIPmakeIndicatorsFeasible().
adds additional globally valid row that is not connected by an indicator constraint, but can be used for separation adds additional row that is not connected by an indicator constraint, but can be used for separation
Definition at line 7863 of file cons_indicator.c. References addAltLPRow(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMessage, SCIProwGetName(), and SCIProwIsLocal(). Referenced by SCIP_DECL_CONSINITLP(), SCIPaddLinearConsIndicator(), and separatePoint(). |