> Advanced Programming Techniques > User Cut and Lazy Constraint Pools > Adding User Cuts and Lazy Constraints |
Adding User Cuts and Lazy Constraints |
INDEX PREVIOUS NEXT |
You may add user cuts or lazy constraints through add
routines in the Component Libraries or via LP and SAV files.
The following routines will add to the user cut pool.
CPXaddusercuts
.
IloCplex::addUserCuts
.
The following routines will add to the lazy constraint pool.
CPXaddlazyconstraints
.
IloCplex::addLazyConstraints
.
User cuts and lazy constraints may also be specified in LP-format and SAV-format files, and so may be read:
CPXreadcopyprob
and IloCplex::importModel
.
The general syntax rules for LP format given in the reference manual ILOG CPLEX File Formats apply to user cuts and lazy constraints.
USER CUTS
.
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
.
Here is an example of a file containing ordinary constraints and lazy constraints.
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.
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:
ux
where x
is an index number starting at 1.
lx
where x
is again an index number starting at 1.
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.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |