If I have the following problem: y <= max(x1, x2) (make it linear) Can I solve it as follows: y <= x1 + M * z and y <= x2 + M * (z1) or do I need the 2 inequalities described below too? x1 >= x2  M * z and x2 >= x1  M * (z1) asked 13 Jan '15, 13:51 Luckiiiz 
It depends...
P.S.: ...assuming that you meant to write \((1z)\)  not \((z1)\). answered 13 Jan '15, 14:46 fbahr ♦ Yes indeed (1z)! So the last two inequalities are always irrelevant? Because in the link there is only the possibility between my first two inequalities and using a slack variable that keeps track of the largest value.
(13 Jan '15, 15:29)
Luckiiiz
You will need the (other) 2 inequalities iff [sic!], quoting @Paul Rubin", "you cannot be sure that the 'pressure' of the objective function will prevent inflated values of z from occurring, and you really do need the value of z to be correct."
(13 Jan '15, 15:40)
fbahr ♦
Thank you very much!!
(13 Jan '15, 15:49)
Luckiiiz

The link from @fbahr shows four constraints to enforce y = max(x1, x2). In this case, you want the inequality y <= max(x1, x2). Your first two constraints (with (1z) instead of (z1)) do just that. Your last two constraints are unnecessary. answered 20 Jan '15, 12:33 optimizer 