ILOG CPLEX .NET Reference Manual

Cplex.AddLazyConstraints Method (IConstraint[])

This is an advanced method.

public virtual IConstraint[] AddLazyConstraints(
   IConstraint[] cut
);

Parameters

cut
The array of constraints to be added as lazy constraints. All constraints must be linear.

Return Value

The array of constraints added as lazy constraints.

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 the constraints given in cut to the list of lazy constraints. The constraints are copied into the lazy constraint pool; the constraints themselves do not become part of the pool, so changes to them after they have been copied into the lazy constraint pool will not affect the lazy constraint pool.

Lazy constraints added with addLazyConstraints 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 | Cplex.AddLazyConstraints Overload List