Projects such as this one are maintained by a small group of volunteers under the auspices of the non-profit COIN-OR Foundation and we need your help! Please consider sponsoring our activities or volunteering to help!
This file is auto-generated from config.yml using the generate_readme script. To make changes, please edit config.yml or the generation scripts here and here.
Cbc (Coin-or branch and cut) is an open-source mixed integer linear programming solver written in C++. It can be used as a callable library or using a stand-alone executable. It can be used in a wide variety of ways through various modeling systems, packages, etc.
Cbc is developed by John Forrest, now retired from IBM Research, and others. The project is currently managed by John Forrest, Ted Ralphs, Stefan Vigerske, Haroldo Gambini Santos, and the rest of the Cbc team.
Cbc is written in C++ and is released as open source under the Eclipse Public License 2.0.
It is distributed under the auspices of the COIN-OR Foundation.
The Cbc development site is https://github.com/coin-or/Cbc.
What follows is a quick start guide for obtaining or building Cbc on common platforms. More detailed information is available here.
There is a Docker image that provides Cbc, as well as other projects in the COIN-OR Optimization Suite here
For newer releases, binaries will be made available as assets attached to releases in Github here. Older binaries are archived as part of Cbc here.
Linux (see https://repology.org/project/coin-or-cbc/versions for a complete listing):
$ sudo pacman -S coin-or-cbc
$ sudo apt-get install coinor-cbc coinor-libcbc-dev
$ sudo yum install coin-or-Cbc coin-or-Cbc-devel
$ sudo pkg install math/cbc
Windows: The easiest way to get Cbc on Windows is to download an archive as described above.
Mac OS X: The easiest way to get Cbc on Mac OS X is through Homebrew.
$ brew tap coin-or-tools/coinor
$ brew install coin-or-tools/coinor/cbc
conda (cross-platform, no Windows for now):
$ conda install coin-or-cbc
Due to license incompatibilities, pre-compiled binaries lack some functionality. If binaries are not available for your platform for the latest version and you would like to request them to be built and posted, feel free to let us know on the mailing list.
Source code can be obtained either by
Cbc has a number of dependencies, which are detailed in config.yml. Dependencies on other COIN-OR projects are automatically downloaded when obtaining the source with coinbrew
. For some of the remaining third-party dependencies, automatic download scripts and build wrappers are provided (and will also be automatically run for required and recommended dependencies), while other libraries that are aeasy to obtain must be installed using an appropriate package manager (or may come with your OS by default).
These quick start instructions assume you are in a bash shell.
To download and build Cbc from source, execute the following on the command line.
wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
chmod u+x coinbrew
./coinbrew fetch Cbc@master
./coinbrew build Cbc
For more detailed instructions on coinbrew, see https://coin-or.github.io/coinbrew. The coinbrew
script will fetch the additional projects specified in the Dependencies section of config.yml.
coinbrew
(Expert users)
./configure -C
make
make test
make install
With Microsoft Visual Studio
For Microsoft Visual C++ users, there are project files for version 10 available in the MSVisualStudio
directory. First, obtain the source code using either a Windows git client or download a snapshot. In MSVC++ Version 10, open the solution file (this should be converted to whatever version of MSVC+ you are using) and build the Cbc project. The code should build out of the box with default settings.
It is also possible to build Cbc with the Visual Studio compiler from the command line using the procedure for Unix-like environments, using the Msys2 shell or CYGWIN. This is the recommended and best-supported way of building Cbc in Windows from source. To do so, make sure the cl
compiler is in your path and add --enable-msvc to build command of
coinbrew`.
If you want to build a parallel version of CBC using Visual Studio you can following instructions: (thanks to Tobias Stengel and Alexis Guigue).
Assumptions:
MSVisualStudio
folders.Steps (based on VS 2013):
for each of the lib* projects do: add CBC_THREAD
under Properties -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions (a subset of the lib* projects may be sufficient, but it doesn't hurt to do it for all)
Link against a pthreads library. PThreadsWin32 works (even in 64 bits systems) and is distributed under the LGPL. If you decide to use the precompiled binaries: both pthreadVC2 and pthreadVS2 seem to work. Otherwise: third party VS project files for pthreads4win can be found on github.
Note: If you use C++/Cli, make sure that no callback (eventHandlers, custom cut generators, custom heuristics, ...) contains managed code. Otherwise your code will crash at runtime with AssembyNotFoundExceptions inside the native threads created by Cbc. Even if not, problems with the GC are likely.
If you link statically against pthreads4win, you have to define PTW32_STATIC_LIB when building your program/Cbc (e.g. via Properties -> C/C++/Preprocessor -> Preprocessor Definitions) AND - only if you build pthreads yourself - when building pthreads. Linking pthreads dynamically works without additional preprocessor definitions.
pass -threads yourNumber
to CbcMain1
If you have Doxygen
available, you can build a HTML documentation by typing
make doxydoc
in the build directory. If Cbc was built via coinbrew
, then the build directory will be ./build/Cbc/master
by default. The doxygen documentation main file is found at <build-dir>/doxydoc/html/index.html
.
If you don't have doxygen
installed locally, you can use also find the documentation here.
Release 3.0 (in preparation)
visibility(default)
-attribute, thus building Cbc with -fvisibility=hidden
still produces a usable library.dllimport
-attribute, so that a Cbc C++ DLL can be used.*_addlibs
files have been removed, pkg-config should be used instead.compile
is now used to wrap around calls of cl/icl/ifort and translate GCC-style compiler flags to MSVC style.$prefix/include/coin-or
instead of $prefix/include/coin
.--prefix
is no longer the build directory, but the autotools-default, probably /usr/local
.--enable-debug
does not imply --disable-shared
anymore.--enable-debug-cbc
, use --enable-debug
instead.--disable-silent-rules
or call make with V=1
to disable.--without-pic
to disable.--with-*-incdir
and --with-*-lib
configure flags have been replaced by corresponding --with-*-cflags
and --with-*-lflags
flags. Note that the include directories need to be specified via -I<dir>
in --with-*-cflags
.--enable-cbc-parallel
is now enabled by default if a pthread library is found. Use --disable-cbc-parallel
to disable.CglCliqueStrengthening
: preprocessing routine applied on set packing constraints.CglBKClique
: clique cut separator based on an improved version of Bron-Kerbosch algorithm.CglOddWheel
: odd-cycle separator with a lifting routine.cgraph
: sets the use of conflict graph-based routines (CglBKClique, CglOddWheel and CliqueStrengthening) - "off"=turns these routines off, "on"=turns these routines on, "clq"=turns these routines off and enables the cut separator of CglClique - default="on"clqstr
: sets the use of the preprocessing routine based on clique strengthening (CglCliqueStrengthening) - "off"=turn off this routine, "before"=perform clique strengthening before initial solve, "after"=perform clique strengthening after initial solve - default="after".clique
: sets the use of CglBKClique (on, root, ifmove, forceOn, onglobal) - default="ifmove".bkpivot
: pivoting strategy used by Bron-Kerbosch algorithm in CglBKClique - 0=off, 1=random, 2=degree, 3=weight, 4=modified degree, 5=modified weight, 6=modified degree + modified weight - default=3.bkmaxcalls
: maximum number of recursive calls that can be made by Bron-Kerbosch algorithm in CglBKClique - default=1000.bkclqext
: strategy used to extend violated cliques found by CglBKClique - 0=off, 1=random, 2=degree, 3=modified degree, 4=reduced cost(inversely proportional), 5=reduced cost(inversely proportional) + modified degree - default = 4.oddwheel
: sets the use of CglOddWheel (on, root, ifmove, forceOn, onglobal) - default = ifmove.oddwext
: strategy used to search for wheel centers for the cuts found by CglOddWheel - 0=off, 1=one variable, 2=clique - default=2.Release 2.10.10
Release 2.10.9
Release 2.10.8
Release 2.10.7
Release 2.10.6
Release 2.10.5
Release 2.10.4
Release 2.10.3
Release 2.10.2
Release 2.10.1
Release 2.10.0
PrepNames
to indicate whether column names should be kept in the pre-processed modelsosPrioritize
to determine how to prioritize SOSgeneratedCuts
guess
checks properties of the model to decide the best parameters for solving the LP relaxation.Release 2.9.10
Release 2.9.9
Release 2.9.8
Release 2.9.7
Release 2.9.6
Release 2.9.5
Release 2.9.4
Release 2.9.3
Release 2.9.2
DESTDIR
Release 2.9.1
Release 2.9.0
-constraint conflict
)Release 2.8.13
Release 2.8.12
Release 2.8.11
Release 2.8.10
Release 2.8.9
Release 2.8.8
Release 2.8.7
Release 2.8.6
Release 2.8.5
Release 2.8.4
Release 2.8.3:
Release 2.8.2:
Release 2.8.1:
Release 2.8.0:
Introduced new secondaryStatus 8 to indicate that solving stopped due to an iteration limit.
Solution pool is now accessible via the command line and the CbcMain* interface.
New mipstart option to read an initial feasible solution from a file. Only values for discrete variables need to be provided.
Added Proximity Search heuristic by Fischetti and Monaci (off by default): The simplest way to switch it on using stand-alone version is -proximity on
.
Proximity Search is the new "No-Neighborhood Search" 0-1 MIP refinement heuristic recently proposed by Fischetti and Monaci (2012). The idea is to define a sub-MIP without additional constraints but with a modified objective function intended to attract the search in the proximity of the incumbent. The approach works well for 0-1 MIPs whose solution landscape is not too irregular (meaning the there is reasonable probability of finding an improved solution by flipping a small number of binary variables), in particular when it is applied to the first heuristic solutions found at the root node.
An implementation of Zero-Half-Cuts by Alberto Caprara is now available. By default, these cuts are off. To use add to your command line -zerohalfCuts root (or other options) or just -zero. So far, they may help only on a small subset of problems and may need some tuning.
The implementation of these cuts is described in G. Andreello, A. Caprara, and M. Fischetti "Embedding Cuts in a Branch and Cut Framework: a Computational Study with {0,1/2}-Cuts" INFORMS Journal on Computing 19(2), 229-238, 2007 http://dx.doi.org/10.1287/ijoc.1050.0162
An alternative implementation of a reduce and split cut generator by Giacomo Nannicini is now available. By default, these cuts are off. To use add to your command line -reduce2AndSplitCuts root (or other options).
The implementation of these cuts is described in G. Cornuejols and G. Nannicini "Practical strategies for generating rank-1 split cuts in mixed-integer linear programming" Mathematical Programming Computation 3(4), 281-318, 2011 http://dx.doi.org/10.1007/s12532-011-0028-6
An alternative robust implementation of a Gomory cut generator by Giacomo Nannicini is now available. By default, these cuts are off. To use add to your command line -GMI root (or other options).
The implementation of these cuts is described in G. Cornuejols, F. Margot, and G. Nannicini "On the safety of Gomory cut generators" http://faculty.sutd.edu.sg/~nannicini/index.php?page=publications
To encourage the use of some of the more exotic/expensive cut generators a parameter -slowcutpasses has been added. The idea is that the code does these cuts just a few times - less than the more usual cuts. The default is 10. The cut generators identified by "may be slow" at present are just Lift and project and ReduceAndSplit (both versions).
Allow initialization of random seed by user. Pseudo-random numbers are used in Cbc and Clp. In Clp they are used to break ties in degenerate problems, while in Cbc heuristics such as the Feasibility Pump use them to decide whether to round up or down. So if a different pseudo-random seed is given to Clp then you may get a different continuous optimum and so different cuts and heuristic solutions. This can be switched on by setting randomSeed for Clp and/or randomCbcSeed for Cbc. The special value of 0 tells code to use time of day for initial seed.
Building on this idea, Andrea Lodi, Matteo Fischetti, Michele Monaci, Domenico Salvagnin, Yuji Shinano, and Andrea Tramontani suggest that this idea be improved by running at the root node with multiple copies of solver, each with its own different seed and then passing in the solutions and cuts so that the main solver has a richer set of solutions and possibly stronger cuts. This is switched on by setting -multipleRootPasses. These can also be done in parallel.
Few changes to presolve for special variables and badly scaled problems (in CoinUtils).
New option -extraVariables which switches on a trivial re-formulation that introduces extra integer variables to group together variables with same cost.
For some problems, cut generators and general branching work better if the problem would be infeasible if the cost is too high. If the new option -constraintFromCutoff is set, the objective function is added as a constraint which rhs is set to the current cutoff value (objective value of best known solution).
Release 2.7.8:
Release 2.7.7:
Fix to report interruption on user event if SIGINT is received by CbcSolver. model->status() should now be 5 if this event happened. Added method CbcModel::sayEventHappened() to make cbc stop due to an 'user event'.
Other minor fixes.
Release 2.7.6:
Fixes to build system.
Other minor fixes.
Release 2.7.5:
Fixes to get AMPL interface working again.
More fixes to MSVC++ files.
Release 2.7.4:
Release 2.7.3:
Minor bugfixes.
Fixes to MSVC++ files.
Release 2.7.2:
Allow row/column names for GMPL models.
Added CbcModel::haveMultiThreadSupport() to indicate whether Cbc library has been compiled with multithread support.
Added CbcModel::waitingForMiniBranchAndBound() to indicate whether sub-MIP heuristic is currently running.
Cbc shell should work with readline if configured with --enable-gnu-packages
.
Support for compressed input files (.gz, .bz2) is now enabled by default.
Fix problems with relative gap tolerance > 100% and further bugs.
Fixes for MSVC++ Version 9 files.
Minor fixes in buildsystem; update to BuildTools 0.7.1.
Release 2.7.1:
Release 2.7.0:
License has been changed to the EPL.
Support for MSVC++ version 10 added.
Support for BuildTools version 0.7 to incorporate recent enhancements, including proper library versioning in Linux, prohibiting installation of private headers, etc.
Updated externals to new stable versions of dependent projects.
Improvements to heuristics.
New options for cut generation.
Improved reporting of results.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4