wiki:FAQ

CBC FAQs

What is the CBC code?

It is a branch and cut code designed to work with any OSI capable solver and in particular Clp. It used to be called Sbb (Simple Branch and Bound) but due to people confusing it with GAMS Sbb solver it has been renamed to Cbc.

Is Cbc reliable?

Cbc is at version 1.01.00 so it is no longer a pre-release version - and yes it is reliable.

Is it fast?

It is not very fast out of the box, but is very flexible so it can be very effective with correct use of cut generators and heuristics. For instance, cut generators can be switched off, on every so often or only at root node (which is probably best default). The stand-alone code has been much improved to try and make it faster for less experienced users.

Does it use Clp?

It is written using the Osi interface so it can use any code which is supported. Obviously it can use Clp and that is what I am using so I can stress Clp. Going through Osi does make it a bit slower and I am seeing what I can do to reduce the overhead when using Clp.

What are its advantages?

A: It is designed to be less heavyweight than BCP or Symphony. It is very easy to add new cut generators and heuristics and branching methods such as lot-sizing variables. I need to publish some more heuristic methods as I have several I use for my own work which at present are too problem specific.

How should I start to use it?

There is a stand-alone code "cbc" which I need to improve, both for ease of use and for default behavior. There are also drivers in the examples directory. The sample driver in Cbc/examples/sample1.cpp will solve many of the miplib test set as it is. To add a new generator involves adding less than ten lines of code. It is also possible to add heuristics in the same way and to influence the search - sample2.cpp and sample3.cpp expose more of the strategy as user code.

What happened to the SBB code?

SBB stands for Simple Branch and Bound. When COIN-OR LP was being written, the Osi interface demanded an integer solver. An exception could have been thrown but anyone can write a branch and bound code in a day. With Strong Branching it was 460 lines of code, without 300 lines. Somehow the code kept growing and eventually it was moved it to its own project. Now the "Simple" is not as accurate and there was confusion with Gams Sbb code so was frozen as of Halloween 2004. All future development has been on Cbc (COIN-OR Branch and Cut) which is just a renamed version of Sbb.

How does one get a list of the undocumented cbc executable options?

Run the cbc executable, set the verbose option to 15, and then enter a ? to get a list of all commands.

./bin/cbc
verbose 15
?

How do you build the COIN-OR Cbc AMPL solver executable on Unix-like platforms (including Cygwin and MinGW) from the SUBVERSION Cbc code base?

  • (Cygwin requires that you have the following four packages installed beyond the base installation before it can build CBC: from the devel category: 1) gcc-g++: C++ compiler; 2) Make: the GNU version of the Make utility; and 3) subversion: a version control system. From the web category, 4) wget: utility to retrieve files from the WWW )
  • First get Cbc:
    svn co https://projects.coin-or.org/svn/Cbc/trunk cbc
    
  • Get the AMPL ASL library. There is a script with the distribution that makes setting up the ASL very convenient:
    cd cbc/ThirdParty/ASL
    ./get.ASL
    
  • Run configure from the root directory of the source distribution (src in this case) and build cbc.
    cd ../..
    ./configure
    make
    make install
    
  • NOTE: If you are working in Cygwin or MinGW and use the native MS compiler ("cl"), you need to do the following steps in the set of instructions in the previous bullet, immediately after "./configure":
    cd ThirdParty/ASL
    ./compile_MS_ASL
    cd ../..
    
  • The resulting cbc executable will work both as a regular command line shell to cbc and as an AMPL driver. Make sure it is on your path. Then simply choose cbc as the solver in AMPL:
    ampl: option solver cbc;
    

How do you build the COIN-OR Cbc AMPL solver executable on Windows using cygwin from the (old) CVS Cbc code base?

You will need to have cygwin installed on the machine. Cygwin can be downloaded and installed from http://www.cygwin.com.

Follow these steps:

  • Download COIN source by following the steps in http://www.coin-or.org/faqs.html#q5
    export CVSROOT=:pserver:anonymous@www.coin-or.org:2401/home/coin/coincvs 
    cvs login  (use password anonymous)
    cvs checkout COIN
    
    This will create a directory named COIN.
  • Download solvers.tar which contains the AMPL glue code from http://netlib.bell-labs.com/netlib/ampl/index.html to the COIN directory.
  • Untar the AMPL glue code.
    cd COIN
    tar -xf solvers.tar
    
  • Edit COIN/solvers/makefile.u and make appropriate changes for cygwin (search for keyword "cygwin").
  • Build amplsolve.a
    cd COIN/solvers
    make -f makefile.u
    
  • Edit COIN/Makefiles/Makefile.location and uncomment the CoinLibsDefined += COIN_ampl by removing the exclamation point.
  • Search for COIN_ampl in COIN/Makefiles/Makefile.location and set the correct path to point to the AMPL glue code directory (ie: COIN/solvers).
  • Build the Coin Cbc AMPL interface driver. On successful completion, the driver will be created at COIN/Cbc/Test/CYGWIN-G/solve.exe.
    cd COIN/Cbc
    make solve
    
  • Rename solve.exe to coin_cbc.exe.
    cd COIN/Cbc/Test/CYGWIN-G
    mv solve.exe coin_cbc.exe
    

To use coin_cbc.exe as the ampl interface, specify "option solver coin_cbc.exe" from the ampl prompt or specify it in the .run file.

Last modified 10 years ago Last modified on Jan 16, 2009 7:30:27 PM