CPXXgetcallbacknodeintfeas and CPXgetcallbacknodeintfeas

The routine CPXXgetcallbacknodeintfeas/CPXgetcallbacknodeintfeas retrieves information for each variable about whether or not the variable is integer feasible in the subproblem at the current node.

int  CPXXgetcallbacknodeintfeas( CPXCENVptr env, void * cbdata, int wherefrom, int * feas, CPXDIM begin, CPXDIM end )

int  CPXgetcallbacknodeintfeas( CPXCENVptr env, void * cbdata, int wherefrom, int * feas, int begin, int end )

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 CPXXgetcallbacknodeintfeas/CPXgetcallbacknodeintfeas retrieves information for each variable about whether or not the variable is integer feasible in the subproblem at the current node. It can be used in a user-written callback during MIP optimization. The information is from the original problem if the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is set to CPX_OFF. Otherwise, the information is from the presolved problem.

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 reporting from where the user-written callback was called. The argument must be the value of wherefrom passed to the user-written callback. Do not call this routine with wherefrom==CPX_CALLBACK_MIP_DELETENODE.
feas
An array to receive integer feasibility information for the node subproblem. This array must be of length at least (end-begin+1). If successful, feas[0] through feas[end-begin] will contain the integer feasibility information. Possible return values appear in the table.
begin
An integer specifying the beginning of the range of integer feasibility information to be returned.
end
An integer specifying the end of the range of integer feasibility information to be returned.

Return

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

Example


 status = CPXgetcallbacknodeintfeas(env, cbdata, wherefrom,
                                    feas, 0, cols-1);

See admipex1.c and admipex2.c in the standard distribution.

Before you call CPXXgetcallbacknodeintfeas/CPXgetcallbacknodeintfeas from a solve callback function, a solution must exist; that is, you must first create the solution by calling a CPLEX optimization routine, such as CPXXdualopt/CPXdualopt, and then verify that this routine generated a solution by checking its return value before you call CPXXgetcallbacknodeintfeas/CPXgetcallbacknodeintfeas.

This routine can be called with any value of wherefrom except CPX_CALLBACK_MIP_DELETENODE.

Table 1. Integer-feasibility status for a node of the subproblem
CPX_INTEGER_FEASIBLE 0 variable j+begin is integer-valued
CPX_INTEGER_INFEASIBLE 1 variable j+begin is not integer-valued
CPX_IMPLIED_INTEGER_FEASIBLE 2 variable j+begin may have a fractional value in the current solution, but it will take on an integer value when all integer variables still in the problem have integer values. It should not be branched upon.