[Cbc] getting sos to work through cbcinterface dll

James Howey james.howey at gmail.com
Tue Feb 13 20:53:51 EST 2018


After applying recent SOS fixes, the below model is solved correctly with an
objective value of zero.

 

However, I am trying to use the cbc interface dll. As it has no readLp, I
added one.

 

COINLIBAPI int COINLINKAGE

Cbc_readLp(Cbc_Model * model, const char *filename)

{

       const char prefix[] = "Cbc_C_Interface::Cbc_readLp(): ";

       //  const int  VERBOSE = 2;

       if (VERBOSE > 0) printf("%s begin\n", prefix);

       if (VERBOSE > 1) printf("%s filename = '%s'\n", prefix, filename);

 

       auto clpSolver = dynamic_cast< OsiClpSolverInterface*>
(model->model_->solver());

       int result = 1;

       //result = model->model_->solver()->readLp(filename);

       result = clpSolver->readLp(filename);

       assert(result == 0);

 

       if (VERBOSE > 0) printf("%s return %i\n", prefix, result);

       return result;

}

 

When I route the model thru the interface, It appears to lose the SOS sets
and gives me an unbounded result.

 

I would value any insights or better, a workaround/fix to enable my
scenario. Is it CbcModel vs. Cbc_Model?

 

Thanks for any assistance,

 

jkh

 

 

MAXIMIZE

+HS_pos 

SUBJECT TO

HS_free: -HS_ at free +HS_free  = 0

HS_P0_diff: +HS_free +HS_P0_diff -HS_pos  = 0

HS_P0_sum: +HS_P0_y +HS_P0_z  = 1

HS_pos: -HS_ at pos +HS_pos  = 0

BOUNDS

HS_ at free free

HS_ at pos free

HS_free = -50000

BINARY

HS_P0_y HS_P0_z 

SOS

S0: S1:: HS_pos:1 HS_P0_y:2 

S1: S1:: HS_P0_diff:1 HS_P0_z:2 

END

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180213/7ff1f1fc/attachment.html>


More information about the Cbc mailing list