Thursday, July 24, 2008

Modeling question

>Among the constraints in the formulation my team have worked on,
>some of them have special properties like:
>x1>=a1
>x1+x2>=a1+a2
>x1+x2+x3>=a1+a2+a3
>...
>...
>x1+x2+x3+...+x39>=a1+a2+a3+...+a39
>
>Here a[i] are nonnegative parameters, so RHSs are non-decreasing.
>Besides these constraints, we deal with tons of constraints, so we are not looking
>for any algorithm or method, but looking for smart conversion of these constraints.
>My question is "Are they any ways to formulate this more intellingently or effectively
>to reduce computational effort?


parameter b(i);
alias (i,j);
b(i) = sum(j$(ord(j)<=ord(i)), a(j));

variable y(i);

ydef(i).. y(i) =e= y(i-1) + x(i);
y.lo(i) = b(i);

This requires more variables but many fewer nonzeroes, so likely more efficient (sparser).