The COIN-OR Cut Generation Library (Cgl
) is a collection of cut generators that can be used with other COIN-OR packages that make use of cuts, such as, among others, the linear solver Clp or the mixed integer linear programming solvers Cbc or BCP.
Cgl
uses the abstract class OsiSolverInterface
(see Osi) to use or communicate with a solver.
It does not directly call a solver.
Cgl
is written in C++ and is released as open source code under the Eclipse Public License (EPL).
It is available from the COIN-OR initiative.
Each cut generator is in a separate directory with its own maintainer.
All generators are combined in one library when Cgl
is compiled.
The Cgl website is https://github.com/coin-or/Cgl.
The project managers of Cgl are Robin Lougee (@rlougee) and Francois Margot.
Available cut generators are:
-
Combinatorial cuts:
- CglAllDifferent
- CglClique
- CglKnapsackCover
- CglOddHole
- CglZeroHalf
-
Flow cover cuts:
-
Gomory cuts and variants:
- CglGomory
- CglGMI
- CglRedSplit
- CglRedSplit2
-
Lift-and-project cuts:
-
Mixed integer rounding cuts and variants:
-
Strengthening:
To build Cgl from source, obtain the coinbrew
script from
https://coin-or.github.io/coinbrew/
and run
/path/to/coinbrew fetch --main-proj=Cgl
/path/to/coinbrew build --main-proj=Cgl --test
/path/to/coinbrew install --main-proj=Cgl
The coinbrew
script will fetch these additional projects.
- Install these Dependencies
- Obtain the source code, e.g., from https://github.com/coin-or/Cgl
- Run
./configure -C
to generate makefiles - Run
make
to build the CoinUtils library - Run
make test
to build and run the CoinUtils unit test program - Run
make install
to install library and header files.
- Cgl Wiki with more information on available cut generators
- Doxygen-generated html documentation
- Cgl general mailing list, Cgl subproject managers mailing list
- Report a bug
A cut generator in Cgl
must conform to the following:
- Its main class
CglCutGeneratorDeriv
is derived from the classCglCutGenerator
. - It has three related classes used for data, parameters and information with respect to the enumeration tree:
- A class
CglDataDeriv
derived fromCglData
; it should contain pointers on all data used by the generator that might be obtained from anOsiSolverInterface
object when callinggenerateCuts()
with anOsiSolverInterface
object as parameter. The classCglDataDeriv
might beCglData
if the latter is sufficient. An exception is made for generators needing information deemed too expensive to collect from the solver (for example the optimal Simplex tableau); in this caseCglDataDeriv
might still contain a pointer on theOsiSolverInterface
object, but its use should be limited to obtaining the "expensive" information from the solver. - A class
CglParamDeriv
derived fromCglParam
. It should contain parameters of the generator that can be set by the user. The parameters in the classCglParamDeriv
must be taken into account during the cut generation. The classCglParamDeriv
might beCglParam
if the latter is sufficient. - A class
CglTreeInfoDeriv
derived fromCglTreeInfo
. The classCglTreeInfoDeriv
might beCglTreeInfo
if the latter is sufficient.
- A class
- The class
CglCutGeneratorDeriv
must have- A member of type
CglParamDeriv
used to store the current parameters. - A method
getParam()
that returns the object storing the current parameters. - A method
generateCuts(const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfoDeriv info)
- A method
generateCuts(const CglDataDeriv &data, OsiCuts & cs, const CglTreeInfoDeriv info)
- A member of type
- The data class
CglDataDeriv
must have methodsgetMember()
andsetMember()
for eachmember
of the class. Data members inCglData
irrelevant for a generator are completely ignored. If a data member that is used by a generator is not available whengenerateCuts(const CglDataDeriv &data, OsiCuts & cs, const CglTreeInfoDeriv info)
is called, the call is aborted, as if no cuts were found. A warning message might be printed. - The class
CglParamDeriv
must have methodsgetMember()
andsetMember()
for eachmember
of the class. All parameters must have default values. Each cut generator with a derived class is free to change the default values for all the members ofCglParamDeriv
, including those fromCglParam
. - Once an object of the cut generator class is created, it should be possible to call generateCuts() several times in a row without having to destroy and re-create the object.
- By default, a successful call to
generateCuts()
should not generate any output. If an error occurs, a message might be printed.