Originally posted by: SystemAdmin
Hi everybody, I'm having some problems understanding how min() and max() operators work with empty set. Let's consider max(), since min() behaves symmetrically. As it is reported in the documentation, max() over an empty set should return -infinity. Consider this simple example:
using CPLEX; range R = 1..3;
int a[i in R] = i; dvar
int x[R] in R; dvar
int y in R; maximize sum(i in R)(x[i]) + y; subject to
{ y == maxl(1, max(i in 0..-1) a[i]);
}
It's easy to see that, since y is bound to 1 (because the max in that empty set is -infinity), the optimal objective function has value 3 + 3 + 3 + 1 = 10. This example works as intended.
Let's now consider this other example which is very similar:
using CPLEX; range R = 1..3;
int a[i in R] = i; dvar
int x[R] in R; dvar
int y in R; maximize sum(i in R)(x[i]) + y; subject to
{ y == maxl(1, max(i in 0..-1) x[i]);
}
The only thing that changed is that the max() operator is maximizing the variable x instead that the constant a. When CPLEX has finished solving this, the Problem Browser says that x and y have "No value" (I'm pretty sure that this means that the problem is unfeasible), while it seems clear to me that it should behave the same way as the previous one, with the objective function once again having value of 3 + 3 + 3 + 1 = 10.
What am I missing? How do max() and min() work with empty set while maximizing or minimizing variables?
Regards,
Stefano
#DecisionOptimization#OPLusingCPLEXOptimizer