[Cbc] Using LP solvers other than CLP

Lou Hafer lou at cs.sfu.ca
Tue Jan 25 17:21:12 EST 2011


Iain,

	  I agree; it's a shame that cbc ended up so tightly tied to clp.
That's not to say it needs to be that way.  One of my longer-term goals is to
break this tie, but it's not trivial and there's a lot of side work to be done
along the way.  Cbc is not the only piece of COIN with this problem.  Up until
about four years ago, I was able to maintain an ability to use libCbc with a
generic OSI solver (cbc-generic, files with prefix CbcGen), but eventually could
no longer keep up with the repairs.  A bunch of observations, in no particular
order:

  * To appreciate the scope of the problem, try the following on Cbc/src:
  
      find . -name .svn -prune -o -exec grep -l ClpSimplex {} \;
      
    Every file name that prints contains code that's specific to clp.  There are
    about 30 such files in the cbc source.  For some of these, the fix is
    relatively simple; indeed, some of them date to the period when cbc-generic
    still worked and generic code is already in place as an alternative.  For
    others, the fix will be difficult.
    
    For at least a few, I suspect that equivalent functionality is simply not
    possible within the existing OSI API. A fix will require extensions to OSI
    or a rethink of the cbc code. This is the core reason why cbc is tied to
    clp --- there was no feasible alternative at the time.

  * There's another batch of code, not quite so easy to identify, which depends
    on the OsiSimplex API or equivalent for access to the simplex tableau
    (several of the cutting plane generators, for example).  This is a largely
    unimplemented subset of OSI; currently only clp and, relatively recently,
    dylp, provide this capability.  Most of the other OsiXXX could be upgraded,
    but someone has to take the time to do it.

  * LibCbc is a separate thing from libCbcSolver; libCbcSolver is built on top
    of libCbc. LibCbc is less tightly tied to clp than libCbcSolver, but
    libCbcSolver contains much of the heuristic intelligence that's applied at
    startup.

  * Your best chance, if you want to try this, is to edit Cbc/src/Makefile.am
    (or do something equivalent) so that you build only libCbc.  Undefine
    COIN_HAS_CLP and see what breaks.

I'm certainly interested in the results, and can provide advice and guidance,
but I'm not really in a position to give hands-on coding help.  (I'm
overcommitted as it is, and currently deep in one of the bits of side work I
mentioned at the start.)

							Lou



More information about the Cbc mailing list