[Cbc] sos2 and preprocess

John Forrest john.forrest at fastercoin.com
Thu Feb 22 07:14:49 EST 2018


James,

It was a "minor" bug in CbcSOS where the integer tolerance was used when 
it should be an absolute zero/non-zero.

Hopefully fixed in trunk.  You can just copy over CbcSOS.cpp if using 
stable.

As to "preslope" etc - I am not sure it is worth effort of implementing 
in that way.

The example of -

pwl1: y = x 0.5 (0, 0) (1, 1) (2, 4) 2.0

can be implemented (I hope I haven't made a stupid mistake) as

-y 0.5 xpre + x1 + 4 x2 +2 xpost = 0
-x + xpre + x0 + x1 + x2 + xpost = 0
BOUNDS
x free
xpre free
SOS
set: S2:: xpre:-10 x0:0 x1:1 x2:2 xpost:10

John Forrest

On 22/02/18 01:13, James Howey wrote:
>
> I am modeling a simple piecewise linear problem with an sos2:
>
> MINIMIZE
>
> sol
>
> SUBJECT TO
>
> -sol + 32000 L1 +0 L2 + 0 L3 = 0
>
> -x +0 L1 +32000 L2 + 1E8 L3 = 0
>
> L1 + L2 + L3 = 1
>
> BOUNDS
>
> x = 50000
>
> SOS
>
> set1: S2:: L1:2 L2:3 L3:4
>
> END
>
> With the upper bound for x set at 1e8 and preprocess on, this comes up 
> proven infeasible.
>
> With the upper bound for x set at 1e 8 and preprocess off, this comes 
> up with an optimum.
>
> With the upper bound for x set at 1e 10 and preprocess off, this comes 
> up with an optimum.
>
> With the upper bound for x set at 1e 11 and preprocess off, this comes 
> up proven infeasible.
>
> With the upper bound for x set at 1e7 and preprocess on or off, this 
> comes up with an optimum.
>
> 1e7 seems a little small, particularly if coefficients are O(1e5). I 
> can work with 1e10, but I believe I would miss having preprocess. I 
> would happily apply any fix that allowed me to slacken these constraints.
>
> My larger difficulty is that I don’t know how to model the “preslope” 
> and “postslope” attributes as does cplex in their PWL section (lp 
> format here):
>
> pwl1: y = x 0.5 (0, 0) (1, 1) (2, 4) 2.0
>
> My present problem occurs when I try to model postslope with an 
> arbitrarily large bound. If there was a clever way to do this without 
> the big bound, then all my problems would disappear and all my dreams 
> would come true.
>
> Thanks for listening
>
> jkh
>
>
>
> _______________________________________________
> 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/20180222/7d8f9ba1/attachment.html>


More information about the Cbc mailing list