Overview | Group | Tree | Graph | Index | Concepts |
An instance of the class IloCplex::NodeCallbackI
represents
a user-written callback in an application that uses an instance of
IloCplex
to solve a mixed integer
programming problem (a MIP). The methods of this class
enable you (from a user-derived callback class) to query the instance of
IloCplex
about the next node that it plans
to select in the branch & cut search, and optionally to override this
selection by specifying a different node.
When an instance of this callback executes, the invoking instance of
IloCplex
still has n =
getNremainingNodes
(inherited from IloCplex::MIPCallbackI
) nodes left to process. These
remaining nodes are numbered from 0 (zero) to (n - 1)
.
For that
reason, the same node may have a different number each time an instance of
NodeCallbackI
is called. To identify a node uniquely, an
instance of IloCplex
also assigns a unique
NodeId
to each node. That unique identifier remains unchanged
throughout the search. The method getNodeId(int i)
allows you to access the NodeId
for
each of the remaining nodes
(0 to n-1). Such a query allows you to associate data with individual
nodes.
The methods of this class are protected for use in deriving a
user-written callback class and in implementing the main
method there.
If an attempt is made to access information not available to an instance of this class, an exception is thrown.
See Also:
IloCplex, IloCplex::Callback, IloCplex::CallbackI, IloCplex::MIPCallbackI, ILONODECALLBACK0
Constructor Summary | |
---|---|
protected | NodeCallbackI() |
Method Summary | |
---|---|
protected IloNumVar | getBranchVar(NodeId) |
protected IloNumVar | getBranchVar(int) |
protected IloInt | getDepth(NodeId) |
protected IloInt | getDepth(int) |
protected IloNum | getEstimatedObjValue(NodeId) |
protected IloNum | getEstimatedObjValue(int) |
protected IloNum | getInfeasibilitySum(NodeId) |
protected IloNum | getInfeasibilitySum(int) |
protected IloInt | getNinfeasibilities(NodeId) |
protected IloInt | getNinfeasibilities(int) |
protected NodeData * | getNodeData(NodeId) |
protected NodeData * | getNodeData(int) |
protected NodeId | getNodeId(int) |
protected IloInt | getNodeNumber(NodeId) |
protected IloNum | getObjValue(NodeId) |
protected IloNum | getObjValue(int) |
protected void | selectNode(NodeId) |
protected void | selectNode(int) |
Inherited Methods from CallbackI |
---|
abort, duplicateCallback, getEnv, getModel, getNcols, getNQCs, getNrows, main |
Constructor Detail |
---|
This constructor creates a callback for use in an application with user-defined node selection inquiry during branch & cut searches.
Method Detail |
---|
This method returns the variable that was branched on last
when CPLEX created the
node with the identifier nodeid
. If that node has
been created by branching on a constraint or on multiple variables,
0 (zero) will be returned.
Returns the variable that was branched on last when creating the
node indicated by the index number node
. If that node has
been created by branching on a constraint or on multiple variables,
0 (zero) will be returned.
This method returns the depth of the node in the search tree for the
node with the identifier nodeid
.
The root node has depth 0 (zero). The depth of other nodes is defined
recursively as the depth of their parent node plus one. In other
words, the depth of a node is its distance in terms of the number of
branches from the root.
This method returns the depth of the node in the search tree. The root node has depth 0 (zero). The depth of other nodes is defined recursively as the depth of their parent node plus one. In other words, the depth of a node is its distance in terms of the number of branches from the root.
This method returns the estimated objective value of
the node with the identifier node
.
This method returns the estimated objective value of the node
indicated by the index number node
.
This method returns the sum of infeasibility measures at the
node with the identifier nodeid
.
This method returns the sum of infeasibility measures at the
node indicated by the index number node
.
This method returns the number of infeasibilities at the node
with the identifier nodeid
.
This method returns the number of infeasibilities at the node
indicated by the index number node
.
This method retrieves the NodeData
object that may
have previously been assigned by the user to the node with the
identfier nodeid
with one of the methods
IloCplex::BranchCallbackI::makeBranch
.
If no data object has been assigned to the that node,
0 (zero) will be returned.
This method retrieves the NodeData
object that may have
previously been assigned to the node with index node
by the
user with the method IloCplex::BranchCallbackI::makeBranch
.
If no data object has been assigned to the specified node, 0 (zero)
will be returned.
This method returns the node identifier of the node indicated by
the index number node
. During branch & cut, an
instance of IloCplex
assigns node
identifiers
sequentially from 0 (zero) to (getNodes - 1)
as it creates
nodes. Within a search, these node identifiers are unique throughout the
duration of that search. However, at any point, the remaining nodes,
(that is, the nodes that have not yet been processed)
are stored in an array
in an arbitrary order. This method returns the identifier of the node
stored at position node
in that array.
Returns the current index number of the node indicated by
the node identifier nodeid
.
This method returns the objective value of the node with the
identifier node
.
This method returns the objective value of the node indicated by
the index number node
.
This method selects the node with the identifier nodeid
and sets it as the next node to process in the branch & cut search.
The invoking instance of IloCplex
uses the specified node as the next node to process.
This method selects the node indicated by its index number
node
and sets it as the next node to process in the branch
& cut search. The parameter node
must be an integer
between 0 (zero) and (getNremainingNodes - 1)
.
The invoking instance of IloCplex
uses
the specified node as the next node to process.