ILOG CPLEX .NET Reference Manual

Cplex.AddLazyConstraint Method 

This is an advanced method.

public virtual IConstraint AddLazyConstraint(
   IConstraint cut
);

Parameters

cut
The constraint to be added as a lazy constraint. The constraint must be linear.

Return Value

The constraint added as a lazy constraint.

Remarks

Important:

Advanced methods typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other methods instead.

This method adds cut as a lazy constraint to the invoking Cplex object. The constraint cut is copied into the lazy constraint pool; the cut itself is not part of the pool, so changes to cut after it has been copied into the lazy constraint pool will not affect the lazy constraint pool.

Lazy constraints added with addLazyConstraint are typically constraints of the model that are not expected to be violated when left out. The idea is that the LPs that are solved when the MIP is being solved can be kept smaller when these constraints are not included. Cplex will, however, include a lazy constraint in the LP as soon as the constraint is violated. In other words, the solution computed by Cplex makes sure that all the lazy constraints that have been added are satisfied.

By contrast, if the constraint does not change the feasible region of the active model but only strengthens the formulation, it is referred to as a user cut. User cuts can be added to Cplex by addLazyConstraint, but it is generally preferable to do so with addUserCuts. It is an error, however, to add lazy constraints by means of addUserCuts.

When columns are deleted from the active model, all lazy constraints are deleted as well and need to be recopied into the lazy constraint pool. Otherwise, use clearLazyConstraints to clear the list of lazy constraints.

See Also

Cplex Class | ILOG.CPLEX Namespace