| 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.
This callback is called whenever a new potential incumbent is found during branch-and-cut searches. It allows you to analyze the proposed incumbent and optionally reject it. In this case, CPLEX will continue the branch-and-cut search. This callback is thus typically combined with a branch callback that instructs CPLEX how to branch on a node after it has found a potential incumbent and thus considered the node solution to be integer feasible.
When you use this callback to reject an incumbent, you must also
set the parameter to
control type of primal and dual reductions, IloCplex::Reduce
either to 1 (one) in order to restrict presolve to
primal reductions only, or to 0 (zero) in order to disable all
presolve reductions. This setting of the reduction parameter is not
necessary if the incumbent callback is used for other purposes.
The incumbent callback may be invoked during MIP start processing.
In that case getSolutionSource will return
MIPStartSolution. In this situation the following
special consideration applies:
See Also:
IloCplex, IloCplex::Callback, IloCplex::CallbackI, IloCplex::MIPCallbackI, IloCplex::OptimizationCallbackI, ILOINCUMBENTCALLBACK0
| Method Summary | |
|---|---|
public NodeData * | getNodeData() const |
public NodeId | getNodeId() const |
public IloNum | getObjValue() const |
public IloNum | getSlack(const IloRange rng) const |
public void | getSlacks(IloNumArray val, const IloRangeArray con) const |
public IncumbentCallbackI::SolutionSource | getSolutionSource() const |
protected Callback::Type | getType() const |
public IloNum | getValue(const IloIntVar var) const |
public IloNum | getValue(const IloNumVar var) const |
public IloNum | getValue(const IloExprArg expr) const |
public void | getValues(IloNumArray val, const IloIntVarArray vars) const |
public void | getValues(IloNumArray val, const IloNumVarArray vars) const |
public void | reject() |
public NodeData * | setNodeData(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 |
| Inner Enumeration |
|---|
| IncumbentCallbackI::SolutionSource |
| Method Detail |
|---|
This method retrieves the NodeData object that may have
previously been assigned to the current node by the user with the method
IloCplex::BranchCallbackI::makeBranch. If no data object has
been assigned to the current node, 0 (zero) will be returned.
This method returns the NodeId of the current
node.
See MIPCallbackI::NodeId.
This method returns the query objective value of the potential incumbent.
If you need the object representing the objective itself,
consider the method
IloCplex::getObjective instead.
This method returns the slack value for the range specified by
rng for the potential incumbent.
This method puts the slack value for each range in the array of
ranges con into the corresponding element of the array
val for the potential incumbent. For this CPLEX resizes
array val to match the size of array con.
This method returns the source of the solution for which the callback was invoked.
This method returns the query value of the variable
var in the potential incumbent solution.
For special considerations about integrality, truncation, and rounding applicable to this method, see the concept Integer values, integrality tolerance, and round-off in CPLEX Optimizers.
This method returns the value of the variable
var in the potential incumbent solution.
This method returns the value of the expr for
the potential incumbent solution.
This method returns the query values of the variables in the array
vars in the potential incumbent solution and copies them to
val. CPLEX automatically resizes the array
val to match the size of the array vars.
For special considerations about integrality, truncation, and rounding applicable to this method, see the concept Integer values, integrality tolerance, and round-off in CPLEX Optimizers.
This method returns the query values of the variables in the array
vars in the potential incumbent solution and copies them to
val. CPLEX automatically resizes the array
val to match the length of the array vars.
This method rejects the proposed incumbent.
This method sets the NodeData object assigned to the
the current node. If a NodeData object has already been
set for the current node, then the method replaces this object and
and returns the old object. Otherwise, the method returns 0 (zero).
This method returns the callback type of the invoking callback object.
| Inner Enumeration Detail |
|---|
This enumeration lists the values that tell for which type of solution the incumbent callback or lazy constraint callback was invoked.
NodeSolution
The integral solution was found as the solution to an LP-relaxation
of a node in the search tree.
HeuristicSolution
The integral solution was found by a CPLEX internal heuristic.
UserSolution
The integral solution was found by the user's heuristic callback function.
This value is returned only in incumbent callbacks, not in lazy constraint
callbacks.
MIPStartSolution
The integral solution was found during MIP start processing.
Note that callbacks invoked in this situation do not have the full API
available. For example, you cannot set/get user data to a node, nor can
you do anything else that requires a search tree node context.
| Fields |
|---|
NodeSolution = CPX_CALLBACK_MIP_INCUMBENT_NODESOLN | |
HeuristicSolution = CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN | |
UserSolution = CPX_CALLBACK_MIP_INCUMBENT_USERSOLN | |
MIPStartSolution = CPX_CALLBACK_MIP_INCUMBENT_MIPSTART |