| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

This is an advanced class. Advanced classes typically demand a profound 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 classes instead.
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-and-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 MIPCallbackI::NodeId.
See Also:
IloCplex, IloCplex::Callback, IloCplex::CallbackI, IloCplex::MIPCallbackI, IloCplex::OptimizationCallbackI, ILONODECALLBACK0
| Method Summary | |
|---|---|
public IloNumVar | getBranchVar(NodeId nodeid) const |
public IloNumVar | getBranchVar(IloInt64 node) const |
public virtual IloInt | getCurrentNodeDepth() const |
public IloInt | getDepth(NodeId nodeid) const |
public IloInt | getDepth(IloInt64 node) const |
public IloNum | getEstimatedObjValue(NodeId nodeid) const |
public IloNum | getEstimatedObjValue(IloInt64 node) const |
public IloNum | getInfeasibilitySum(NodeId nodeid) const |
public IloNum | getInfeasibilitySum(IloInt64 node) const |
public IloInt | getNinfeasibilities(NodeId nodeid) const |
public IloInt | getNinfeasibilities(IloInt64 node) const |
public NodeData * | getNodeData(NodeId nodeid) const |
public NodeData * | getNodeData(IloInt64 node) const |
public NodeId | getNodeId(IloInt64 node) const |
public IloInt | getNodeNumber(NodeId nodeid) const |
public IloInt64 | getNodeNumber64(NodeId nodeid) const |
public IloNum | getObjValue(NodeId nodeid) const |
public IloNum | getObjValue(IloInt64 node) const |
protected Callback::Type | getType() const |
protected | NodeCallbackI(IloEnv env) |
public void | selectNode(NodeId nodeid) |
public void | selectNode(IloInt64 node) |
public NodeData * | setNodeData(IloInt64 node, NodeData * data) |
Inherited Methods from MIPCallbackI |
|---|
getCurrentNodeDepth, getObjCoef, getObjCoef, getObjCoefs, getObjCoefs, getType, getUserThreads, MIPCallbackI |
Inherited Methods from OptimizationCallbackI |
|---|
getModel, getNcols, getNQCs, getNrows |
Inherited Methods from CallbackI |
|---|
abort, duplicateCallback, getCplexTime, getDetTime, getEndDetTime, getEndTime, getEnv, getStartDetTime, getStartTime, getType, main |
| Method Detail |
|---|
This constructor creates a callback for use in an application with user-defined node selection inquiry during branch-and-cut searches.
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,
this method returns a null handle.
See MIPCallbackI::NodeId.
Returns the variable that was branched on last when creating the
node specified by the index number node. If that node has
been created by branching on a constraint or on multiple variables,
this method returns a null handle.
Returns the depth of the current node in the search tree.
This method always throws an IloCplex::Exception exception
since the callback is not invoked in the context of any node.
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.
See MIPCallbackI::NodeId.
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.
See MIPCallbackI::NodeId.
This method returns the estimated objective value of the node
specified by the index number node.
This method returns the sum of infeasibility measures at the
node with the identifier nodeid.
See MIPCallbackI::NodeId.
This method returns the sum of infeasibility measures at the
node specified by the index number node.
This method returns the number of infeasibilities at the node
with the identifier nodeid.
See MIPCallbackI::NodeId.
This method returns the number of infeasibilities at the node
specified 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
identifier nodeid with one of the methods
IloCplex::BranchCallbackI::makeBranch.
If no data object has been assigned to the that node,
the method returns 0 (zero).
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, the
method returns 0 (zero).
This method returns the node identifier of the node specified by
the index number node. During branch and 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.
See also
MIPCallbackI::NodeId.
Returns the current index number of the node specified by
the node identifier nodeid.
See MIPCallbackI::NodeId.
Returns the current index number of the node specified by
the node identifier nodeid.
See MIPCallbackI::NodeId.
This method returns the objective value of the node with the
identifier node.
See MIPCallbackI::NodeId.
If you need the object representing the objective itself,
consider the method
IloCplex::getObjective instead.
This method returns the objective value of the node specified by
the index number node.
If you need the object representing the objective itself,
consider the method
IloCplex::getObjective instead.
This method selects the node with the identifier nodeid
and sets it as the next node to process in the branch-and-cut search.
The invoking instance of IloCplex
uses the specified node as the next node to process.
See MIPCallbackI::NodeId.
This method selects the node specified by its index number
node and sets it as the next node to process in the branch
& cut search. The argument 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.
This method sets the NodeData object assigned to the
the node identified by node. If a NodeData
object has already been set for the current node, then the method
replaces this object and returns
the old object. Otherwise, the method returns
0 (zero).
This method returns the callback type of the invoking callback object.