On Monday, May 2, 2011 3:28:34 PM UTC-4, Noor wrote:
S[i,j]=Max {P[i,j,x,y]*T[x,y]} for all x,y
Here i,j,x,y are parameters
Also P is parameter, and only T is variable
S must also be a variable (since it's a function of variables).
set I;
set J;
set X;
set Y;
param P {I, J, X, Y};
param M > 0; # needs to be at least as large as max P*T - min P*T
var S {I, J};
var T {X, Y};
var z {I, J, X, Y} binary; # chooses where max occurs
# ...
s.t. SLimit {i in I, j in J, x in X, y in Y}: S[i,j] >= P[i,j,x,y]*T[x,y]; # max is >= every element in set
s.t. SWhere {i in I, j in J, x in X, y in Y}: S[i, j] <= Pi[i,j,x,y]*T[x,y] + M*(1-z[i,j,x,y]);
s.t. SOS {i in I, j in J}: sum {x in X, y in Y} z[i,j,x,y] = 1; # one max per (i,j) pair
If the objective penalizes S and it does not appear in other constraints (so that it is clear that, regardless of whatever else is going on in the model, smaller S values are preferable), then you do not need z and the SWhere and SOS constraints; you just need the SLimit constraints.
Paul