CPXXbranchcallbackbranchconstraints and CPXbranchcallbackbranchconstraints

The routine CPXXbranchcallbackbranchconstraints/CPXbranchcallbackbranchconstraints specifies the branches to be taken from the current node when the branch is specified by adding one or more constraints to the node problem.

int CPXXbranchcallbackbranchconstraints( CPXCENVptr env, void * cbdata, int wherefrom, CPXDIM rcnt, CPXNNZ nzcnt, double const * rhs, char const * sense, CPXNNZ const * rmatbeg, CPXDIM const * rmatind, double const * rmatval, double nodeest, void * userhandle, CPXCNT * seqnum_p )

int CPXbranchcallbackbranchconstraints( CPXCENVptr env, void * cbdata, int wherefrom, int rcnt, int nzcnt, double const * rhs, char const * sense, int const * rmatbeg, int const * rmatind, double const * rmatval, double nodeest, void * userhandle, int * seqnum_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 CPXXbranchcallbackbranchconstraints/CPXbranchcallbackbranchconstraints specifies the branches to be taken from the current node when the branch is specified by adding one or more constraints to the node problem. It can be called only from within a user-written branch callback function.

Constraints are in terms of the original problem if the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is set to CPX_OFF before the call to CPXXmipopt/CPXmipopt that calls the callback. Otherwise, constraints are in terms of the presolved problem.

Table 1. Values of sense[i]
L less than or equal to constraint
E equal to constraint
G greater than or equal to constraint

Arguments

env
A pointer to the CPLEX environment, as returned by CPXXopenCPLEX/CPXopenCPLEX.
cbdata
A 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.
rcnt
An integer that specifies the number of constraints for the branch.
nzcnt
An integer that specifies the number of nonzero constraint coefficients for the branch. This specifies the length of the arrays rmatind and rmatval.
rhs
An array of length rcnt containing the righthand side term for each constraint for the branch.
sense
An array of length rcnt containing the sense of each constraint to be added for the branch. Values of the sense appear in Table 1.
rmatbeg
An array that with rmatind and rmatval defines the constraints for the branch.
rmatind
An array that with rmatbeg and rmatval defines the constraints for the branch.
rmatval
An array that with rmatbeg and rmatind defines the constraints for the branch. The format is similar to the format used to describe the constraint matrix in the routine CPXXaddrows/CPXaddrows. Every row must be stored in sequential locations in this array from positionrmatbeg[i] to rmatbeg[i+1]-1 (or from rmatbeg[i] to nzcnt-1 if i=rcnt-1). Each entry, rmatind[i], specifies the column index of the corresponding coefficient, rmatval[i]. All rows must be contiguous, and rmatbeg[0] must be 0.
nodeest
A double that specifies the value of the node estimate for the node to be created with this branch. The node estimate is used to select nodes from the branch-and-cut tree with certain values of the parameter to control MIP node selection strategy (CPXPARAM_MIP_Strategy_NodeSelect).
userhandle
A pointer to user private data that should be associated with the node created by this branch. Can be NULL.
seqnum_p
A pointer to an integer that, on return, will contain the sequence number that CPLEX has assigned to the node created from this branch. The sequence number may be used to select this node in later calls to the node callback.

Return

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