Re: [AMPL 6528] any hint to linearize max and min

594 views
Skip to first unread message

Piotr Kałamucki

unread,
Jan 29, 2013, 6:39:30 AM1/29/13
to am...@googlegroups.com
Hi,
y = min(a,b) is basically :
if (a>b) then y=b else y=a
you can make it linear with a little help of this link:


Regards


2013/1/29 hesam eivazy <hesam...@gmail.com>
Hi All
I am trying to linearize x*[min(a, S+d)-max(b,S)] where a, b, an d are parameters, S is continuous variable, x is binary variable.

Thanks   

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Fourer

unread,
Jan 30, 2013, 6:53:54 PM1/30/13
to am...@googlegroups.com

I would suggest thinking of the subexpression

 

   min(a,S+d) - max(b,S)

 

as a single (concave) piecewise-linear function of S, which you can represent using AMPL's piecewise-linear expression notation (chapter 17 in the AMPL book, www.ampl.com/BOOK/download.html).  Then your entire expression is Z where

 

   x = 0 ==> Z = 0 else Z = Y

   Y = <piecewise-linear expression>

 

You can use the ==> ("implies") operator with CPLEX, but in general you can replace it with a couple of linear mixed-integer constraints.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of hesam eivazy
Sent: Monday, January 28, 2013 6:33 PM
To: am...@googlegroups.com
Subject: [AMPL 6528] any hint to linearize max and min

Reply all
Reply to author
Forward
0 new messages