NO FRAMES

Class IloCplex::NodeCallbackI

Definition file: ilocplexi.h
Include files: ilcplex/ilocplex.h

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:

Constructor Summary
protected NodeCallbackI()
Method Summary
protected IloNumVargetBranchVar(NodeId)
protected IloNumVargetBranchVar(int)
protected IloIntgetDepth(NodeId)
protected IloIntgetDepth(int)
protected IloNumgetEstimatedObjValue(NodeId)
protected IloNumgetEstimatedObjValue(int)
protected IloNumgetInfeasibilitySum(NodeId)
protected IloNumgetInfeasibilitySum(int)
protected IloIntgetNinfeasibilities(NodeId)
protected IloIntgetNinfeasibilities(int)
protected NodeData *getNodeData(NodeId)
protected NodeData *getNodeData(int)
protected NodeIdgetNodeId(int)
protected IloIntgetNodeNumber(NodeId)
protected IloNumgetObjValue(NodeId)
protected IloNumgetObjValue(int)
protected voidselectNode(NodeId)
protected voidselectNode(int)
Inherited Methods from MIPCallbackI
getBestObjValue, getCutoff, getDirection, getDirection, getIncumbentObjValue, getIncumbentValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getMyThreadNum, getNcliques, getNcovers, getNdisjunctiveCuts, getNflowCovers, getNflowPaths, getNfractionalCuts, getNGUBcovers, getNimpliedBounds, getNiterations, getNMIRs, getNnodes, getNremainingNodes, getObjCoef, getObjCoef, getObjCoefs, getObjCoefs, getPriority, getPriority, getUserThreads, hasIncumbent
Inherited Methods from CallbackI
abort, duplicateCallback, getEnv, getModel, getNcols, getNQCs, getNrows, main
Constructor Detail

NodeCallbackI

protected NodeCallbackI()

This constructor creates a callback for use in an application with user-defined node selection inquiry during branch & cut searches.


Method Detail

getBranchVar

protected IloNumVar getBranchVar(NodeId nodeid)

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.


getBranchVar

protected IloNumVar getBranchVar(int node)

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.


getDepth

protected IloInt getDepth(NodeId nodeid)

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.


getDepth

protected IloInt getDepth(int node)

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.


getEstimatedObjValue

protected IloNum getEstimatedObjValue(NodeId nodeid)

This method returns the estimated objective value of the node with the identifier node.


getEstimatedObjValue

protected IloNum getEstimatedObjValue(int node)

This method returns the estimated objective value of the node indicated by the index number node.


getInfeasibilitySum

protected IloNum getInfeasibilitySum(NodeId nodeid)

This method returns the sum of infeasibility measures at the node with the identifier nodeid.


getInfeasibilitySum

protected IloNum getInfeasibilitySum(int node)

This method returns the sum of infeasibility measures at the node indicated by the index number node.


getNinfeasibilities

protected IloInt getNinfeasibilities(NodeId nodeid)

This method returns the number of infeasibilities at the node with the identifier nodeid.


getNinfeasibilities

protected IloInt getNinfeasibilities(int node)

This method returns the number of infeasibilities at the node indicated by the index number node.


getNodeData

protected NodeData * getNodeData(NodeId nodeid)

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.


getNodeData

protected NodeData * getNodeData(int node)

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.


getNodeId

protected NodeId getNodeId(int node)

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.


getNodeNumber

protected IloInt getNodeNumber(NodeId nodeid)

Returns the current index number of the node indicated by the node identifier nodeid.


getObjValue

protected IloNum getObjValue(NodeId nodeid)

This method returns the objective value of the node with the identifier node.


getObjValue

protected IloNum getObjValue(int node)

This method returns the objective value of the node indicated by the index number node.


selectNode

protected void selectNode(NodeId nodeid)

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.


selectNode

protected void selectNode(int node)

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.