[Coin-discuss] Cbc branchAndBound

Esben Mose Hansen esben at ange.dk
Fri Mar 16 13:15:19 EDT 2007


On Thursday 15 March 2007 14:53:32 Matthew Galati wrote:
> Hi -- lots of related discussion on other threads. Solutions all seem to
> involve a re-design or new version of OSI.
>
> Can someone just answer this simple question?
>   CbcModel cbc(*si);
>   CbcStrategyDefault cbcStrategyDefault;
>   cbc.setStrategy(cbcStrategyDefault);
>   cbc.branchAndBound();
>
> Is this approximately equivalent to what is in CoinSolve.cpp? From
> experimentation, just running cbc.branchAndBound() without setting the
> strategy is a bad idea.

As John wrote, not really. What I did was look in the source code for cbc 
(especially cbcsolve()) and lift anything that looked useful.

No idea what that analyse() function is supposed to do. I have yet to find a 
problem for which it returns anything useful, though, so you can probably 
just skip that. Then skip anything about option handling and cut out look at 
the bit concerning branch and bound, and you will get down to the 100 lines 
or so that will get you a solver that works "like cbc". Of course, that code 
doesn't use stuff like the strategy, but I have no experience using that.

Essentially, you want to do 3 things:
1. preprocess
2. add cutgenerators
3. add heuristics.

It is not too hard to see which one Cbc uses per default (which are most).

-- 
kind regards, Esben



More information about the Coin-discuss mailing list