[Cbc] Using SOS with CbcModel/CbcSolver

Stefan Vigerske stefan at math.hu-berlin.de
Wed Jun 24 08:44:15 EDT 2009


Hi,

I had experienced no problem with SOS when I added it to the CbcModel
using the addObjects method after the CbcMain0 call.

Stefan

Kish Shen wrote:
> Hi,
> 
> I am looking at the issue of adding SOS to a problem to be solved by 
> CBC. I last looked at this about 3 years ago, and wrote some code to add 
> a CbcSOS object via addObjects() to a CbcModel. However, this code is 
> commented out, with the comment that SOS cannot be added to a 
> preprocessed problem.
> 
> As I said, this was done 3 years ago, when I first wrote the code for 
> our interface to CBC. My code have changed significantly since then, in 
> particular it now uses CbcSolver rather than CbcModel directly. I assume 
> there may be changes in CBC since that time too, so I am wondering if I 
> can now add SOS to the problem.
> 
> Currently, the problem is stored in a OsiClpSolverInterface, which is 
> cast to a CbcModel:
> 
> CbcModel* model = new 
> CbcModel(static_cast<OsiSolverInterface&>(*clpmodel);
> 
> and the problem is then solved using CbcMain0 and CbcMain1:
> 
> CbcMain0(*model);
> ...
> CbcMain1(5, cbc_args,*model.callBack);
> 
> Can I add SOS during this process, and if there are still any conditions 
> to when I can add the SOS?
> 
> Thanks in advance for any information!
> 
> Cheers,
> 
> Kish
> 


-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan



More information about the Cbc mailing list