[Cbc] Making CBC deterministic

Dan Burkolter dan.burkolter at trafit.ch
Mon Jan 5 10:06:10 EST 2015


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


-- 
Dr. Dan Burkolter

trafIT solutions gmbh
Heinrichstrasse 48
8005 Zürich

+41 44 271 16 06
burkolter at trafit.ch
www.trafit.ch


More information about the Cbc mailing list