[Cbc] Question on resolving models
Chase Slater
coslater at gmail.com
Fri May 25 17:12:26 EDT 2018
Hi,
I could use a little help better understanding how Cbc works. I trying to
solve many small integer problems. Between solves, I change some of the
row bounds and objective coefficients but the number of rows and columns
remain the same. I've tried the pattern in modify.cpp but I am incurring
too much overhead re-initializing the CbcModel object (and it's crashing
when I set a strategy). Is there a faster pattern?
Thank you!
Chase
Psuedo code:
// ---- do this stuff once! ---
CoinModel build;
// .setColumnBounds, .setObjective, .setInteger, .addRow, etc.
OsiClpSolverInterface solver;
solver.loadFromCoinModel(build)
CbcModel model = CbcModel(solver);
CbcStrategyDefault strategy();
strategy.setupPreProcessing(1, 10);
model.setStrategy(strategy); // default strategy
model.branchAndBound();
// --- do this stuff many times ---
model.solver()->setRowUpper(i, value);
model.solver()->setObjCoeff(i, value);
model.branchAndBound(); // this part does not work because the model has
already been solved? Can I avoid reallocating the entire CbcModel object?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180525/5ad21720/attachment-0001.html>
More information about the Cbc
mailing list