| 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::LazyConstraintCallbackI
represents a user-written callback in an application that uses an instance
of IloCplex to solve a MIP while applying lazy constraints.
IloCplex calls the user-written callback when either a
candidate feasible solution is found, and the candidate needs to be tested whether
it violates any lazy constraints; or the LP relaxation is found to be
unbounded, and a lazy constraint may cut off the unbounded direction.
When querying information about the current solution to be tested, such information may be different from information directly derived from the node relaxation. Such differences arise when the solution candidate to be tested is generated from a heuristic rather than the branch-and-bound tree itself.
The lazy constraint callback may be invoked during MIP start processing.
In that case getSolutionSource returns
MIPStartSolution. When this value is returned
some special considerations apply:
See Also:
IloCplex, IloCplex::Callback, IloCplex::CallbackI, IloCplex::MIPCallbackI, IloCplex::ControlCallbackI, IloCplex::OptimizationCallbackI, ILOLAZYCONSTRAINTCALLBACK0
| Method Summary | |
|---|---|
public IloConstraint | add(IloConstraint con, IloCplex::CutManagement purgeable=UseCutForce) |
public IloConstraint | addLocal(IloConstraint con) |
public IncumbentCallbackI::SolutionSource | getSolutionSource() const |
protected Callback::Type | getType() const |
public IloBool | isUnboundedNode() const |
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 method adds a lazy constraint to the
current node LP subproblem
for the constraint specified by
con. This lazy constraint must be globally valid.
The added lazy constraint must be linear.
It will not be removed by backtracking.
The lazy constraint that this method adds is a
deep copy of the argument con.
Depending on the value of the argument purgeable,
CPLEX removes the lazy constraint during branch and cut
under certain circumstances.
purgeable is the symbolic value
UseCutForce, then CPLEX adds the
lazy constraint and never removes it.
UseCutPurge, then CPLEX adds
the lazy constraint, but CPLEX may purge (that is, eliminate) the
lazy constraint later.
UseCutFilter is not a valid value
for the argument purgeable in this method.
Special considerations:
When you use this method with the nondefault value
UseCutPurge for the argument purgeable,
you are authorizing CPLEX to purge (that is, to eliminate) the
lazy constraint under certain circumstances (for example, if the
constraint becomes slack). Consequently, in view of such purging,
you must not assume that any previously added
constraints are still in the current relaxation. In other words,
the purged constraint can be violated in subsequent relaxations.
As a user, you must take responsibility to check whether any new
incumbent solution requires that the purged constraint be added
back to the problem.
| con | The constraint to be added as lazy. This method (in contrast to |
| purgeable | A value specifying when and whether CPLEX can remove this lazy constraint. |
The routine always returns con.
This method adds a local lazy constraint
to the current node LP subproblem
for the constraint specified by
con. IloCplex will manage
the local lazy constraint in
such a way that it will be active only when
CPLEX is processing nodes of this
subtree. That is, the added lazy constraint is local.
The added lazy constraint must be linear.
The lazy constraint that this method adds
is a deep copy of the argument con.
| con | The constraint to be added locally as lazy. This method (in contrast to |
The routine always returns con.
This method returns the source of the solution for which the callback was invoked.
Note that lazy constraint callbacks are not invoked for solutions
provided by the heuristic callback. So a value of
UserSolution will never be returned.
This method returns IloTrue if the callback was
invoked when the LP relaxation is found to be unbounded and the user
needs to test whether a lazy constraint cuts off the unbounded direction;
and it returns IloFalse if the callback was invoked to
test whether a feasible solution candidate found at this search tree
node satisfies all lazy constraints.
This method returns the callback type of the invoking callback object.