[Coin-discuss] Cbc question: Adding SOS data to a preprocessed problem

John J Forrest jjforre at us.ibm.com
Tue Sep 12 04:24:25 EDT 2006


Kish,

Have patience - I have been looking at this off and on for some weeks for
SOS2 and I have nearly finished.  And then I need to make easier for other
people.  It is a mess as it is all mixed up with AMPL stuff.

However if you want to try for SOS1 then after preprocessing use code such
as at 2128 of CoinSolve.cpp (trunk).  Before preprocessing you may want to
mark SOS as at line 1722.  It is a bit of a mess.  The main problem is the
organization of Coin in that preprocessing (CglPreProcess) knows nothing
about Cbc objects e.g. SOS.

If you have any ideas on how to organize e.g. CbcPreProcess and how it
should look I am open to suggestions from everyone.

John


                                                                           
             Kish Shen                                                     
             <kish.shen at crossc                                             
             oreop.com>                                                 To 
             Sent by:                  coin-discuss at list.coin-or.org       
             coin-discuss-boun                                          cc 
             ces at list.coin-or.                                             
             org                                                   Subject 
                                       [Coin-discuss] Cbc question: Adding 
                                       SOS data to a preprocessed          
             09/11/06 05:20 PM         problem                             
                                                                           
                                                                           
             Please respond to                                             
             Discussions about                                             
                open source                                                
               software for                                                
                Operations                                                 
                 Research                                                  
             <coin-discuss at lis                                             
              t.coin-or.org>                                               
                                                                           
                                                                           




Hi,

I am trying to add SOS data to a problem to my code. Currently, my code use

OsiClpSolverInterface to setup a problem. To solve a MIP problem, I create
a
preprocessed copy of the problem:

             mipsolver = process.preProcess(*lpd->lp->Solver, false, 5);

where lpd->lp->Solver is the `original' problem, and is
OsiClpSolverInterface*,
mipsolver is a OsiSolverInterface*.

The CbcModel for the problem is then created by:

mipmodel = new CbcModel(static_cast<OsiSolverInterface &>(*mipsolver));

Looking at the example Cbc code sample4, SOS data can be added to a
CbcModel
using

mipmodel->addObjects(nsos,objects);

where objects is an array of CbcObjects constructed using CbcSOS.

However, the construction of the CbcObjects are done using the column
indexes from
the original problem, not the preprocessed problem that was assigned to
mipmodel. So
I assume I cannot simply call addObjects as above. Is there anyway I can
add these SOS
to the problem?

Thanks in advance for any information/help!

Cheers,

Kish

_______________________________________________
Coin-discuss mailing list
Coin-discuss at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-discuss





More information about the Coin-discuss mailing list