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

Warning:

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_NUM returns the number of indicator constraints.
  • CPX_CALLBACK_INFO_IC_IMPLYING_VAR returns the index of the implying variable of the iindex-th indicator constraint. If the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is off (that is, set to CPX_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_VAR returns the index of the implied variable of the iindex-th indicator constraint. If the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is set to CPX_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_SENSE returns the sense of the iindex-th indicator constraint.
  • CPX_CALLBACK_INFO_IC_COMPL returns 0 (zero) if the iindex-th indicator constraint is not complemented, and 1 (one) otherwise.
  • CPX_CALLBACK_INFO_IC_RHS returns the righthand side of the iindex-th indicator constraint.
  • CPX_CALLBACK_INFO_IC_IS_FEASIBLE returns 1 (one) if the implying variable is not 0 (zero) or 1 (one), or if the iindex-th indicator constraint is satisfied at the current node; otherwise, it returns 0 (zero).
Important:

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 cbdata passed 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 wherefrom passed to the user-written callback.

Do not call this routine with wherefrom==CPX_CALLBACK_MIP_DELETENODE. Do not call this routine with wherefrom==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 double or int, representing the value returned by whichinfo.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.