[Cbc] How efficient is a SOS1 contraint?

John Forrest john.forrest at fastercoin.com
Mon Jan 1 14:02:37 EST 2018


Bjorn,

For using SOS type 1 when you could just use binary variables, the best 
thing is to have the constraint in (with a binary slack making it ==1) 
as well as the SOS.

The clue is in the word "Ordered".  So if you are modeling a facility 
with 4 possible sizes 2, 5, 12, 30 then you would have the binary slack 
first and then 4 variables.  Originally you would have referred to a 
reference row which would be the capacity row but now you just give the 
5 weights of 0,2,5,12,30.  Then if say the slack was 0.7 and the 30 
variable was .3 the capacity is 9 and the code would do two branches - 
one setting 0,2,5 to 0 the other setting 12,30 variables to 0.

So you get good control of branching.  Obviously the benefit gets 
greater the more variables are in the set.

SOS type 2 are more interesting .....

John Forrest
On 01/01/18 16:19, Bjørn Sigurd Johansen (Spider Solutions AS) wrote:
>
> Dear All,
>
> Question: Is a SOS1 constraint handled more efficiently (i.e. faster 
> and/or better) than writing the constraint in full the “normal” way, 
> i.e. as follows:
>
> MyBinaryVariable1 + MyBinaryVariable2 + … + MyBinaryVariableN <= *1*
>
> Best regards,
>
> Bjørn Sigurd
>
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/cbc


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180101/5deacb71/attachment.html>


More information about the Cbc mailing list