[Cbc] Making CBC deterministic

Haroldo Gambini Santos haroldo.santos at gmail.com
Mon Jan 5 10:29:30 EST 2015


Hi Dan,

Do you use a time limit ? If yes the method could behave differently 
depending on the system load.

Cheers,

Haroldo


On 05-01-2015 13:06, Dan Burkolter wrote:
> Hi
>
> I'm using CBC to create line diagrams modeled as a MILP. I have the 
> problem that I need to ensure that two runs of the same instance 
> always lead to the same solution. I tried to do this by setting the 
> CBC and CLP random seeds in the following way:
>
> OsiClpSolverInterface solver;
> solver.loadFromCoinModel( build ); // build is a CoinModel
> CbcModel model( solver );
>
> // set optimality gap, heuristics, cut generators, and strategy
>
> model.setRandomSeed( 42 );
> solver.getModelPtr()->setRandomSeed( 42 );
>
> model.initialSolve();
> model.branchAndBound( 1 );
>
> However, I still get random behaviour, ie two runs of the same 
> instance may end in a different solution.
>
> What am I missing?
>
>
> Thanks for your help!
> Dan
>
>

-- 
==================================================
Haroldo Gambini Santos
D.Sc, Computer Science
Universidade Federal de Ouro Preto
http://www.decom.ufop.br/haroldo/



More information about the Cbc mailing list