addGenConstrMax() with expressions

22 views
Skip to first unread message

Pablo Santibanez

unread,
Sep 20, 2017, 12:32:21 AM9/20/17
to Gurobi Optimization
Is it possible to use addGenConstrMax() with expressions (containing variables) instead of just variables?

In particular, I'm looking to model W = Max(1-Xi), which of course can be modelled using (1 - W) in the formulation but I'm trying to avoid rewriting the code.

I'm using Gurobi 7.0.2.

Thanks!

Tobias Achterberg

unread,
Sep 20, 2017, 5:31:07 AM9/20/17
to gur...@googlegroups.com
No, you need to introduce an auxiliary variable:

W = Max(Yi)
Yi = 1 - Xi

This is just a modeling overhead and will not affect solve times (in a systematic way).
Gurobi's presolve will eliminate Yi again.

Regards,

Tobias

Pablo Santibanez

unread,
Sep 20, 2017, 3:12:05 PM9/20/17
to Gurobi Optimization
Thanks Tobias!
Reply all
Reply to author
Forward
0 new messages