On Wed, 7 Aug 2013, Michael Hennebry wrote:
Don't know exactly what you are trying to accomplish.
In general, to model w = x * y, where range(x) is finite and all are bounded:
x = SUM k*qx[k]
k in range(x)
1 = SUM qx[k]
k in range(x)
qk[range(x)] binary
if qx[k]==1, w=k*y for k in range(x)
use the small-M method.
Possibly better, assuming w, x, y required to be non-negative:
if SUM qk[j]==1, w<=k*y for k in range(x)
j in range(x)
j<=k
if SUM qk[j]==1, w>=k*y for k in range(x)
j in range(x)
j>=k
--
Michael [email protected]
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk