CPXXgetcallbackindicatorinfo and CPXgetcallbackindicatorinfo
The routine CPXXgetcallbackindicatorinfo/CPXgetcallbackindicatorinfo accesses
information about the indicator constraints of the presolved problem
during MIP callbacks.
int CPXXgetcallbackindicatorinfo( CPXCENVptr env, void * cbdata, int wherefrom, CPXDIM iindex, int whichinfo, void * result_p )
int CPXgetcallbackindicatorinfo( CPXCENVptr env, void * cbdata, int wherefrom, int iindex, int whichinfo, void * result_p )
Description
This is an advanced routine. Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead.
The routine CPXXgetcallbackindicatorinfo/CPXgetcallbackindicatorinfo accesses
information about the indicator constraints of the presolved problem
during MIP callbacks. When indicator constraints are present, CPLEX
creates a presolved problem with indicator constraints in canonical form,
regardless of the presolve settings.
Canonical Form
(implying variable = { 0 | 1 }) IMPLIES (implied variable) R rhs
In that canonical form, rhs stands for righthand side and R stands for one of these relations:
- less than or equal to
- greater than or equal to
- equal to
In the original problem, you may have indicator constraints in which the implied constraint has two or more variables. In contrast, in the canonical form, the implied constraint can have only one variable; moreover, its coefficient in the constraint must be 1 (one). For example, CPLEX transforms the indicator constraint
x = 0 -> 3y + z <= 0
into canonical form by introducing an implied variable
w, like this:
w = 3y + z
x = 0 -> w <= 0
The argument whichinfo can assume one of the
following values in a call to CPXXgetcallbackindicatorinfo/CPXgetcallbackindicatorinfo:
CPX_CALLBACK_INFO_IC_NUMreturns the number of indicator constraints.CPX_CALLBACK_INFO_IC_IMPLYING_VARreturns the index of the implying variable of theiindex-th indicator constraint. If the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is off (that is, set toCPX_OFF), the index is in terms of the original problem, and if the index = -1, then the variable has been created by presolve. Otherwise, the index is in terms of the presolved problem.CPX_CALLBACK_INFO_IC_IMPLIED_VARreturns the index of the implied variable of theiindex-th indicator constraint. If the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is set toCPX_OFF, the index is in terms of the original problem, and if the index = -1, then the variable has been created by presolve. Otherwise, the index is in terms of the presolved problem.CPX_CALLBACK_INFO_IC_SENSEreturns the sense of theiindex-th indicator constraint.CPX_CALLBACK_INFO_IC_COMPLreturns 0 (zero) if theiindex-th indicator constraint is not complemented, and 1 (one) otherwise.CPX_CALLBACK_INFO_IC_RHSreturns the righthand side of theiindex-th indicator constraint.CPX_CALLBACK_INFO_IC_IS_FEASIBLEreturns 1 (one) if the implying variable is not 0 (zero) or 1 (one), or if theiindex-th indicator constraint is satisfied at the current node; otherwise, it returns 0 (zero).
Any routine that queries the current LP solution can yield invalid
data when wherefrom==CPX_CALLBACK_MIP because in that case,
the MIP callback is called before the LP relaxation of the current node
is solved.
Arguments
- env
-
A pointer to the CPLEX environment, as returned by
CPXXopenCPLEX/CPXopenCPLEX. - cbdata
-
The pointer passed to the user-written callback. This argument must be the value of
cbdatapassed to the user-written callback. - wherefrom
-
An integer value that reports where the user-written callback was called from. This argument must be the value of
wherefrompassed to the user-written callback.Do not call this routine with
wherefrom==CPX_CALLBACK_MIP_DELETENODE. Do not call this routine withwherefrom==CPX_CALLBACK_MIP_NODE. - iindex
- An integer, the index of the indicator constraint.
- whichinfo
- An integer specifying one of the symbolic values that tell what kind of information to access.
- result_p
-
A generic pointer to a variable of type
doubleorint, representing the value returned bywhichinfo.