> Advanced Programming Techniques > User Cut and Lazy Constraint Pools > Adding User Cuts and Lazy Constraints

You may add user cuts or lazy constraints through add routines in the Component Libraries or via LP and SAV files.

Component Libraries

The following routines will add to the user cut pool.

The following routines will add to the lazy constraint pool.

Reading LP and SAV Files

User cuts and lazy constraints may also be specified in LP-format and SAV-format files, and so may be read:

General Syntax

The general syntax rules for LP format given in the reference manual ILOG CPLEX File Formats apply to user cuts and lazy constraints.

These sections, and the ordinary constraints section preceded by the keywords SUBJECT TO, can appear in any order and can be present multiple times, as long as they are placed after the objective function section and before any of the keywords BOUNDS, GENERALS, BINARIES, SEMI-CONTINUOUS or END.

Example

Here is an example of a file containing ordinary constraints and lazy constraints.

Maximize
 obj: 12 x1 + 5 x2 + 15 x3 + 10 x4
Subject To
 c1: 5 x1 + x2 + 9 x3 + 12 x4 <= 15
Lazy Constraints
 l1: 2 x1 + 3 x2 + 4 x3 + x4 <= 10
 l2: 3 x1 + 2 x2 + 4 x3 + 10 x4 <= 8
Bounds
 0 <= x1 <= 5
 0 <= x2 <= 5
 0 <= x3 <= 5
 0 <= x4 <= 5
Generals
 x1  x2  x3  x4
End  

ILOG CPLEX stores user cuts and lazy constraints in memory separately from ordinary constraints, and any optional constraint names provided for them in the input (that is, preceded by a colon :) are not retained. In other words, the optional constraint names in LP format for user cuts and lazy constraints are discarded.

Writing LP and SAV Files

When writing LP or SAV format files, user cuts and lazy constraints added through their respective add routines or read from LP or SAV format files will be included in the output files. In LP-format files:

Using the Interactive Optimizer

User cuts and lazy constraints will appear when the command display problem all is issued in the Interactive Optimizer. User cuts and lazy constraints can also be added to an existing problem with the add command of the Interactive Optimizer.