CPXXcallbackmakebranch and CPXcallbackmakebranch

The routine CPXXcallbackmakebranch/CPXcallbackmakebranch defines the branching constraints that define a branch from the current node in the MIP search tree, from the context CPX_CALLBACKCONTEXT_BRANCHING. The branch can include both variable bound changes and additional linear constraints.

int  CPXXcallbackmakebranch( CPXCALLBACKCONTEXptr context, CPXDIM varcnt, CPXDIM const * varind, char const * varlu, double const * varbd, CPXDIM rcnt, CPXNNZ nzcnt, double const * rhs, char const * sense, CPXNNZ const * rmatbeg, CPXDIM const * rmatind, double const * rmatval, double nodeest, CPXCNT * seqnum_p )

int  CPXcallbackmakebranch( CPXCALLBACKCONTEXptr context, int varcnt, int const * varind, char const * varlu, double const * varbd, int rcnt, int nzcnt, double const * rhs, char const * sense, int const * rmatbeg, int const * rmatind, double const * rmatval, double nodeest, int * seqnum_p )

Description

The routine CPXXcallbackmakebranch/CPXcallbackmakebranch defines the branching constraints that define a branch from the current node in the MIP search tree, from the context CPX_CALLBACKCONTEXT_BRANCHING. The branch can include both variable bound changes and additional linear constraints. Branch constraints are always specified in the original space.

Warning: Your call of this function is valid only if the callback was invoked in the context CPX_CALLBACKCONTEXT_BRANCHING. In all other contexts, it returns an error.
Table 1. Values of varlu[i]
L change the lower bound
U change the upper bound
B change both upper and lower bounds
Table 2. Values of sense[i]
L less than or equal to constraint
E equal to constraint
G greater than or equal to constraint

Arguments

context

The callback context as passed into the callback function.

varcnt
An integer that specifies the number of bound changes that are specified in the arrays varind, varlu, and varbd.
varind
Together with varlu and varbd, this array defines the bound changes for the branch. The entry varind[i] is the index for the variable.
varlu
Together with varind and varbd, this array defines the bound changes for the branch. The entry varlu[i] is one of three possible values specifying which bound to change. Those values appear in Table 1.
varbd
Together with varind and varlu, this array defines the bound changes for the branch. The entry varbd[i] specifies the new value of the bound.
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. Possible values appear in Table 2.
rmatbeg
An array that with rmatbeg and rmatind defines the constraints for the branch.
rmatind
An array that with rmatbeg and rmatind 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 pararameter to control MIP node selection strategy (CPXPARAM_MIP_Strategy_NodeSelect).
seqnum_p
A pointer to an integer that, on return, will contain the unique identifier number that CPLEX has assigned to the node created from this branch.

Return

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