CPXgetcallbacknodeinfo


Usage

Mixed Integer Users Only

Description

The routine CPXgetcallbacknodeinfo() is called from within user-written callbacks during a MIP optimization and accesses information about nodes. When the wherefrom argument is CPX_CALLBACK_MIP_NODE, a node with any nodeindex value can be queried. When the wherefrom argument is any one of CPX_CALLBACK_MIP_CUT, CPX_CALLBACK_MIP_INCUMBENT, CPX_CALLBACK_MIP_HEURISTIC, or CPX_CALLBACK_MIP_BRANCH, only the current node can be queried. This is done by specifying a nodeindex value of 0. Other values of the wherefrom argument are invalid for this routine; an invalid nodeindex value or wherefrom argument value will result in an error return value.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs.

The return value CPXERR_NODE_ON_DISK indicates an attempt to access a node currently located in a node file on disk.

Synopsis

  int CPXgetcallbacknodeinfo (CPXCENVptr env,
                              void *cbdata,
                              int wherefrom,
                              int nodeindex,
                              int whichinfo,
                              void *result_p);

Arguments

CPXCENVptr env

The pointer to the ILOG CPLEX environment, as returned by one of the CPXopenCPLEX routines.

void *cbdata

The pointer passed to the user-written callback. This parameter must be the value of cbdata passed to the user-written callback.

int wherefrom

An integer value indicating where the user-written callback was called from. This parameter must be the value of wherefrom passed to the user-written callback.

int nodeindex

The index of the node for which information is requested. Nodes are indexed from 0 (zero) to (nodecount - 1) where nodecount is obtained from the callback information function CPXgetcallbackinfo(), with a whichinfo value of CPX_CALLBACK_INFO_NODES_LEFT.

int whichinfo

An integer indicating which information is requested. Table 1 summarizes possible values.

Table 1 Information Requested for a User-Written Node Callback

Symbolic Constant 
C Type 
Meaning 
CPX_CALLBACK_INFO_NODE_SIINF 
double 
sum of integer infeasibilities 
CPX_CALLBACK_INFO_NODE_NIINF 
int 
number of integer infeasibilities 
CPX_CALLBACK_INFO_NODE_ESTIMATE 
double 
estimated integer objective 
CPX_CALLBACK_INFO_NODE_DEPTH 
int 
depth of node in branch & cut tree 
CPX_CALLBACK_INFO_NODE_OBJVAL 
double 
objective value of LP subproblem 
CPX_CALLBACK_INFO_NODE_TYPE 
int 
CPX_CALLBACK_INFO_NODE_VAR 
int 
for nodes of type CPX_TYPE_VAR, the branching variable for this node; for SOS-type branches, the rightmost variable in left subset 
CPX_CALLBACK_INFO_NODE_SOS 
int 
the number of the SOS used in branching; -1 if none used 
CPX_CALLBACK_INFO_NODE_SEQNUM 
int 
sequence number of the node 
CPX_CALLBACK_INFO_NODE_NODENUM 
int 
node index of the node 

Table 2 summarizes possible values returned when the type of information requested is branch type (that is, whichinfo = CPX_CALLBACK_INFO_NODE_TYPE).

Table 2 Branch Types Returned when whichinfo = CPX_CALLBACK_INFO_NODE_TYPE

Symbolic Constant 
Value 
Branch Type 
CPX_TYPE_VAR 
'0' 
variable branch 
CPX_TYPE_SOS1 
'1' 
SOS1 branch 
CPX_TYPE_SOS2 
'2' 
SOS2 branch 
CPX_TYPE_USER 
'X' 
user-defined 

void *result_p

A generic pointer to a variable of type double or int, representing the value returned by whichinfo. (The column "C Type" in Table 1 indicates the type of various values returned by whichinfo.)

Example

  status = CPXgetnodecallbackinfo(env, 
                                  curlp, 
                                  wherefrom, 
                                  0, 
                                  CPX_CALLBACK_INFO_NODE_NIINF, 
                                  &numiinf);

See Also

CPXgetcallbackinfo() (ILOG CPLEX Reference Manual), CPXgetcallbackseqinfo(), Advanced MIP Control Interface

Previous Page: CPXgetcallbacklp Return to Top Next Page: CPXgetcallbacknodeintfeas