On Sun, 21 Oct 2012, Meketon, Marc wrote:

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Reginald Beardsley
Sent: Sunday, October 21, 2012 10:46 AM
To: glpk
Subject: [Help-glpk] "multiplication of linear forms not allowed"

I'm trying to apply the following constraint following a suggestion by xypron:

var M{J} ,binary;

var B{J,K} ,>= 0;

s.t. a{j}: -M[j]*sum{k in  K}B[j,k] <= A[j] <= M[j]*sum{k in K}B[j,k];

The goal being to force A[j] = 0 if the sum over k of B[j,k] = 0;

If B is continuous, I suspect that it cannot be done.
If B is integer:

var s{J} ,binary;
var B{J,K} ,>=0;
param M{J} ;  upper bound on sum{k in K}B[j,k]
param L{j} ;  lower bound on A[j]
param U{j} ;  upper bound on A[j]

s.t. a{j in J}: s[j] <= sum{k in K}B[j,k] <= M[j]*s[j];
s.t. b{j in J}: L[j]*s[j] <= A[j] <= U[j]*s[j]

--
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

Reply via email to