[Cbc] multiple solutions with CbcMain
Matthew Galati
matthew.galati at gmail.com
Fri Feb 13 08:53:02 EST 2015
I switched to CbcMain from CbcModel.branchAndBound() based on comments
about performance.
I want to get multiple solutions from Cbc.
I am doing this:
const char * argv[20];
int argc = 0;
string cbcExe = "cbc";
string cbcSolve = "-solve";
string cbcQuit = "-quit";
string cbcLog = "-log";
string cbcLogSet= UtilIntToStr(debugLevel);
string cbcMaxSave= "-maxSaved";
string cbcMaxSaveSet= "100";
argv[argc++] = cbcExe.c_str();
argv[argc++] = cbcLog.c_str();
argv[argc++] = cbcLogSet.c_str();
argv[argc++] = cbcMaxSave.c_str();
argv[argc++] = cbcMaxSaveSet.c_str();
argv[argc++] = cbcSolve.c_str();
argv[argc++] = cbcQuit.c_str();
CbcModel cbc(*osiClp);
CbcMain(argc, argv, cbc);
And from the log, I can tell there are multiple solutions.
Then, I tried to get them with:
int nSolutions = cbc.numberSavedSolutions();
But, it says there is only 1.
When I was using cbc.branchAndBound(), this access method worked fine.
How do I get the multiple solutions back when using CbcMain?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20150213/5ddfad72/attachment.html>
More information about the Cbc
mailing list