30.01.2015 Views

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IloCplex<br />

This method adds con as a cut to the invoking IloCplex object. The cut is not<br />

extracted as the regular constraints in a model, but is only copied when invoking the<br />

method addCut. Thus, con may be deleted or modified after addCut has been called<br />

and the change will not be notified to the invoking IloCplex object.<br />

When columns are deleted from the extracted model, all cuts are deleted as well and<br />

need to be reextracted if they should be considered. Cuts are not part of the root<br />

problem, but are considered on an as-needed basis. A solution computed by IloCplex<br />

is guaranteed to satisfy all cuts added with this method.<br />

public const IloConstraintArray addCuts(const IloConstraintArray con)<br />

This method adds the constraints in con as cuts to the invoking IloCplex object.<br />

Everything said for addCut applies equally to each of the cuts given in array con.<br />

public IloConstraint addLazyConstraint(IloConstraint con)<br />

Note:This is an advanced method. Advanced methods typically demand a profound<br />

understanding of the algorithms used by <strong>ILOG</strong> <strong>CPLEX</strong>. Thus they incur a higher<br />

risk of incorrect behavior in your application, behavior that can be difficult to<br />

debug. Therefore, <strong>ILOG</strong> encourages you to consider carefully whether you can<br />

accomplish the same task by means of other methods instead.<br />

This method adds con as a lazy constraint to the invoking IloCplex object. The<br />

constraint con is copied into the lazy constraint pool; the con itself is not part of the<br />

pool, so changes to con after it has been copied into the lazy constraint pool will not<br />

affect the lazy constraint pool.<br />

Lazy constraints added with addLazyConstraint are typically constraints of the<br />

model that are not expected to be violated when left out. The idea behind this is that the<br />

LPs that are solved when solving the MIP can be kept smaller when these constraints are<br />

not included. IloCplex will, however, include a lazy constraint in the LP as soon as it<br />

becomes violated. In other words, the solution computed by IloCplex makes sure that<br />

all the lazy constraints that have been added are satisfied.<br />

By contrast, if the constraint does not change the feasible region of the extracted model<br />

but only strengthens the formulation, it is referred to as a user cut. While user cuts can<br />

be added to IloCplex with addLazyConstraint, it is generally preferable to do<br />

so with addUserCuts. It is an error, however, to add lazy constraints by means of the<br />

method addUserCuts.<br />

When columns are deleted from the extracted model, all lazy constraints are deleted as<br />

well and need to be recopied into the lazy constraint pool. Use of this method in place of<br />

addCuts allows for further presolve reductions<br />

This method is equivalent to addCut.<br />

<strong>ILOG</strong> <strong>CPLEX</strong> <strong>C++</strong> <strong>API</strong> <strong>9.0</strong> REFERENCE M ANUAL 53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!