[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] [Fwd: Re: fraction with vars]

From: Michael Hennebry
Subject: Re: [Help-glpk] [Fwd: Re: fraction with vars]
Date: Wed, 7 Aug 2013 23:51:59 -0500 (CDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

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)

if SUM qk[j]==1, w>=k*y   for k in range(x)
  j in range(x)

Michael   address@hidden
"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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]