Formulation max(min(...))) in a constraint

31 views
Skip to first unread message

Frank Meissner

unread,
Aug 31, 2019, 1:14:54 PM8/31/19
to Pyomo Forum
Hello,

could someone please explain how to write min()  and max() formulations in Pyomo for a MIP in GLPK?

I have following constraint, whereby a and b are control variables:

− x * max (min (2− b, 2− a0)


Thank you in advance


Frank


David Woodruff

unread,
Sep 1, 2019, 5:22:47 PM9/1/19
to pyomo...@googlegroups.com
The standard way to do this is:
y <= 2a-b
y <= 2b-a
z >=0
z>= y
r = a + b - x * z

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/b6ac88d4-3b98-4c13-b1cf-046c5535c940%40googlegroups.com.

Frank Meissner

unread,
Sep 2, 2019, 1:30:42 AM9/2/19
to Pyomo Forum
Thank you!


On Sunday, September 1, 2019 at 11:22:47 PM UTC+2, DLWoodruff wrote:
The standard way to do this is:
y <= 2a-b
y <= 2b-a
z >=0
z>= y
r = a + b - x * z

On Sat, Aug 31, 2019 at 10:14 AM Frank Meissner <pyth...@gmail.com> wrote:
Hello,

could someone please explain how to write min()  and max() formulations in Pyomo for a MIP in GLPK?

I have following constraint, whereby a and b are control variables:

− x * max (min (2− b, 2− a0)


Thank you in advance


Frank


--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages