[Cbc] sos2 and preprocess

James Howey james.howey at gmail.com
Thu Feb 22 19:40:36 EST 2018


I applied the fix and am currently experiencing superior headroom. Thanks.

 

Note that Preprocess must be disabled to take advantage of higher values.

 

As to pre/post slope, I was sadly unable to get the example working. I took
some liberties filling in extra bits. There was a missing sign in the y
computation which I arbitrarily provided:

 

MINIMIZE

y

SUBJECT TO

-y + 0.5 xpre + x1 + 4 x2 +2 xpost = 0

-x + xpre + x0 + x1 + x2 + xpost = 0

xpre + x0 + x1 + x2 + xpost = 1

BOUNDS

x = 1.5

xpre free

SOS

set: S2:: xpre:-10 x0:0 x1:1 x2:2 xpost:10

END

 

What I actually seek would be represented in the cplex pre/post slope
nomenclature as:

 

pwl1: y = x 0.0 (32000, 12000) (44000, 0) 0.0

x free

 

You may recognize this from your taxable social security computation :).
Looks like it should be obvious, but my brain is weak.

 

Thanks again,

 

jkh

 

From: Cbc [mailto:cbc-bounces at coin-or.org] On Behalf Of John Forrest
Sent: Thursday, February 22, 2018 4:15 AM
To: cbc at list.coin-or.org
Subject: Re: [Cbc] sos2 and preprocess

 

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 <mailto:Cbc at list.coin-or.org> 
https://list.coin-or.org/mailman/listinfo/cbc
<https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mai
lman_listinfo_cbc&d=DwMD-g&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=T
NTf22dccgjfhN9Y2JzsFSJ7NwRGIuNRtJlW92g0GOA&m=3I7-N68tWAAhGT_YIhxv2DSudaOkPnn
ZjGU_RD3KqF4&s=W1xoc44PZsYdsEv2YylNEltrddkBsaKm4f8f6X9FzM8&e=> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180222/02b58849/attachment.html>


More information about the Cbc mailing list