Overview | Group | Tree | Graph | Index | Concepts |
The routine CPXgetcallbacknodeinfo
is called from within
user-written callbacks during a MIP optimization and accesses information
about nodes.
The primary purpose of this routine is to examine nodes in order to
select one from which to proceed. In this case the wherefrom
argument is
CPX_CALLBACK_MIP_NODE
, and a node with any
nodeindex
value can be queried. A secondary purpose of this routine is to
obtain information about the current node. When
the wherefrom
argument is any one of
the following values, only the current node can be queried.
CPX_CALLBACK_MIP_CUT
CPX_CALLBACK_MIP_INCUMBENT
CPX_CALLBACK_MIP_HEURISTIC
CPX_CALLBACK_MIP_SOLVE
CPX_CALLBACK_MIP_BRANCH
To query the current node, specify 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.
The values returned for CPX_CALLBACK_INFO_NODE_SIINF
and CPX_CALLBACK_INFO_NODE_NIINF
for the current node are the
values that applied to the node when it was stored and thus before the
branch was solved. As a result, these values should not be used to assess
the feasibility of the node.
This routine cannot retrieve information about nodes that have been moved
to node files. For more information about node files, see the ILOG CPLEX
User's Manual.
If the argument nodeindex
refers to a node in a
node file, CPXgetnodecallbackinfo
returns the value
CPXERR_NODE_ON_DISK
. Nodes still in memory have the lowest
index numbers so a user can loop through the nodes until
CPXgetcallbacknodeinfo
returns an error, and then exit the
loop.
Example
status = CPXgetnodecallbackinfo(env, curlp, wherefrom, 0, CPX_CALLBACK_INFO_NODE_NIINF, &numiinf);
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 | type of branch at this node; see Table 2 |
CPX_CALLBACK_INFO_NODE_VAR | int | for nodes of type CPX_TYPE_VAR , the branching variable
for this node; for other types, -1 is returned |
CPX_CALLBACK_INFO_NODE_SOS | int | for nodes of type CPX_TYPE_SOS1 or
CPX_TYPE_SOS2 the number of the SOS used in
branching; -1 otherwise |
CPX_CALLBACK_INFO_NODE_SEQNUM | int | sequence number of the node |
CPX_CALLBACK_INFO_NODE_NODENUM | int | node index of the node (only available for
CPXgetcallbackseqinfo ) |
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 |
CPX_TYPE_ANY | 'A' | multiple bound changes and/or constraints were used for branching |
See also Advanced MIP Control Interface in the ILOG CPLEX User's Manual.
See Also:
CPXgetcallbackinfo, CPXgetcallbackseqinfo
env | A pointer to the CPLEX environment, as returned by |
cbdata | The pointer passed to the user-written callback. This parameter must be the value of |
wherefrom | An integer value indicating where the user-written callback was called from. This parameter must be the value of |
nodenum | The index of the node for which information is requested. Nodes are indexed from |
whichinfo | An integer indicating which information is requested. Table 1 summarizes the possible values. Table 2 summarizes possible values returned when the type of information requested is branch type (that is, |
result_p | A generic pointer to a variable of type double or int, representing the value returned by |
CPXERR_NODE_ON_DISK
indicates an attempt to access a node currently
located in a node file on disk.