Welcome to the Cbc home page
Note that these project webpages are based on Wiki, which allows webusers to modify the content to correct typos, add information, or share their experience and tips with other users. You are welcome to contribute to these project webpages. To edit these pages or submit a ticket you must first register and login.
Introduction
Cbc (Coin-or branch and cut) is an open-source mixed integer programming solver written in C++. It can be used as a callable library or using a stand-alone executable. It can be called through AMPL (natively), GAMS (using the links provided by the Optimization Services and GAMSlinks projects), MPL (through the CoinMP project), AIMMS (through the AIMMSlinks project), PuLP, CMPL, OpenSolver for Excel, JuMP, or MiniZinc.
Cbc links to a number of other COIN projects for additional functionality, including:
- Clp (the default solver for LP relaxations)
- Cgl (for cut generation)
- CoinUtils (for reading input files and various utilities)
For more information on supported platforms, links to dependent projects, current version, and more, click here
Cbc is developed by John Forrest, now retired from IBM Research. The project is currently managed by John Forrest, Ted Ralphs, and the rest of the Cbc team.
Latest Releases
- The latest stable version of Cbc is
.
- The latest release version of Cbc is
.
- Click here to see the current change log.
Supported Platforms
- GNU/Linux (gcc, 32- and 64-bit)
- Microsoft Windows
- CYGWIN (w/ gcc and cl compilers, 32- and 64-bit)
- MinGW (w/ gcc and cl compilers, 32- and 64-bit)
- Visual C++
- Mac OSX (gcc and clang)
Testing Status
Travis-CI (OS X and Linux)
Appveyor (Windows)
Download and Install
Binaries available from Bintray:
- Linux: On Debian/Ubuntu, Cbc is available in the package coinor-cbc and can be installed with apt. On Fedora, Cbc is available in the package coin-or-Cbc. Pre-compiled binaries are also available as part of the COIN-OR Optimization Suite.
- Windows: The easiest way to get Cbc on Windows is to download the Windows installer for the COIN Optimization Suite, which provides Visual Studio compatible libraries and binaries. Binary archives are also available from Bintray.
- OS X: The easiest way to get Cbc on OSX is through Homebrew
- brew tap coin-or-tools/coinor
- brew install cbc
- AMPL also provides stand-alone provides Cbc executables that can be used with (or without) AMPL.
- The GAMS distribution includes 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
- Downloading a snapshot of the source code for the latest release version of Cbc from the Cbc source code download page, or
- Checking out the latest stable source using a subversion client.
- Checking out the code from Github
The recommended method is to use subversion because it makes it easier to obtain updates. Below are some quick start guides for building on common platforms. More detailed build instructions are here?.
Quick Start Guide for Unix-like Environments
In a Unix-like environment (such as Linux or CYGWIN), the following commands may be used to obtain and build Cbc from source using either SVN or git in most cases. For SVN, do
svn checkout https://projects.coin-or.org/svn/Cbc/releases/2.9.8 Cbc-2.9.8 cd Cbc-2.9.8
For git do
git clone --branch=stable/2.9 https://github.com/coin-or/Cbc Cbc-2.9 cd Cbc-2.9 git clone --branch=stable/0.8 https://github.com/coin-or-tools/BuildTools/ BuildTools/get.dependencies fetch
Finally, do
./configure make make install
Optionally, once could also execute make test to run Cbc's unit test.
Quick Start Guide for Microsoft Visual C++ Users
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 subversion client (see the COIN-OR FAQ) 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.
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:
- A VS solution with all necessary projects (libCbc, libClp, libCbcSolver, libCgl, libCoinUtils, libOsi, libOsiCbc, libOsiClp). The project files can be found inside the "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.note and pthreadVS2.note 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
Documentation
- See the current README and INSTALL files to get started quickly.
- User's Guide (single page format)
- Cbc command-line guide
- Cbc html documentation
- FAQ (Frequently Asked Questions)
- Lessons from the trenches
- Source code examples
- Success Stories
- Cbc Papers
- Cbc undocumented features.
- Setting up a Visual Studio project to use CBC
Doxygen Documentation
If you have Doxygen available, you can build the html documentation by typing
make doxydoc
in the source directory after building with the autotools in any *nix environment. After making the documentation, open the file doxydoc/html/index.html with a browser. Note that this creates the documentation for the entire Cbc package (including dependencies). If you prefer to generate the documentation only for a subset of these projects, you can edit the file doxydoc/doxygen.conf to exclude directories (using the EXCLUDE variable, for example).
If Doxygen is not available, you can use the link to the Cbc html documentation listed above.
News
February 26, 2016
- Cbc 2.9.8 has been released.
October 9, 2015
- Cbc 2.9.7 has been released.
September 22, 2015
June 2, 2015
March 30, 2015
- Cbc 2.9.4 has been released.
March 7, 2015
- Cbc 2.9.3 has been released.
February 9, 2015
- Cbc 2.9.2 has been released.
February 7, 2015
- Cbc 2.9.1 has been released.
January 18, 2015
- Cbc 2.9.0 has been released.
January 18, 2015
- Cbc 2.8.13 has been released.
August 27, 2014
- Cbc 2.8.12 has been released.
August 24, 2014
- Cbc 2.8.11 has been released.
July 4, 2014
- Cbc 2.8.10 has been released.
April 14, 2014
- Cbc 2.8.9 has been released.
- Attempt to make Cbc thread safe.
- Add parallel examples.
- Add CbcSolverUsefulInfo?.
- Bug fixes.
- Click here to see changes from release 2.8.8
December 26, 2013
- Cbc 2.8.8 has been released.
November 23, 2013
- Cbc 2.8.7 has been released.
November 14, 2013
- Cbc 2.8.6 has been released.
October 15, 2013
- Cbc 2.8.5 has been released.
September 13, 2013
- Cbc 2.8.4 has been released.
July 16, 2013
June 14, 2013
- Cbc 2.8.2 has been released.
April 26, 2013
April 10, 2013
- Cbc 2.8.0 has been released.
- 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 <number> 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).
- Click here to see changes from release 2.7.8
Project Links