[Cbc] Correct solving of problem with SOS only

Stefan Vigerske stefan at math.hu-berlin.de
Thu Oct 25 14:01:21 EDT 2012


Hi,

On 10/24/2012 07:18 PM, Kish Shen wrote:
> Hi,
>
> Some additional information to my last post:
>
> I noticed an error in the objective I gave for the problem:
>
> On 22/10/2012 20:51, Kish Shen wrote:
>
>> Objective: -2*X1*X2*X3
>
> This is wrong -- it should be minimise -2*X1-X2-X3, i.e. a normal linear
> objective.
>
> So when the SOS1 for X1,X2,X3 is ignored, the variables are all set to 1
> (giving an objective value of -4). When the SOS1 is taken into account,
> only X1 is set to 1.
>
>
> The incorrect solution with SOS1 ignored is generated unless I post some
> 'normal' constraints to the problem. This happens when the addObjects()
> call happens before or after CbcMain0().

The "unless I post some 'normal' constraints to the problem." is 
probably the important difference.

When I run a model with SOS1, no integers, but linear constraints, Cbc 
solves it without problems (this is the gamsTest.cpp in Cbc/test).
It seems to run a normal MIP solve.

>  >It seems that the 'No Integer variables' warning message comes from
>  >the call to addObjects(), and not CbcMain0() as I thought.
>
> Thinking more about this -- isn't this warning incorrect? As the object
> being added is an SOS1, which I understand is a type of branching in the
> MIP search like integer variables are, so adding them should imply a MIP
> search, even if there are no integer variables (and normal constraints
> in this case), i.e. there is something to do (rather than Nothing to do,
> as the message states).

I also get this message, but it still works.

Maybe there is some place in Cbc where it checks whether there are rows 
in the problem and otherwise just stops, without having checked the 
CbcObject's.

Stefan

>
> Thanks and cheers,
>
> Kish
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc
>



More information about the Cbc mailing list