Use the approach in the question you linked. The expression
Max(c4 * x4, c5 * x5)
can be replaced by a variable x6
, provided that you add the following additional constraints:
x6 >= c4 * x4
x6 >= c5 * x5
So you total set becomes:
Minimize (c1 * x1) + (c2 * x2) + (c3 * x3) + x6 + (c6 * x4) + (c7 * x5)
subject to:
some equality and inequality constraints
and the new requirements:
x6 >= c4 * x4
x6 >= c5 * x5
This works since Max(c4 * x4, c5 * x5)
will either take the value c4 * x4
or c5 * x5
. The introduced variable x6
will always be larger or equal to both of these expressions, and so will always be larger or equal to the total max-expression. When properly minimized, x6 will bottom out at the value of the max-expression. So when minimized, the two forms are equivalent.