help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] [Fwd: Either...or logic]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: Either...or logic]
Date: Wed, 19 Jun 2013 15:27:08 +0400

-------- Forwarded Message --------
From: Alan Zinober <address@hidden>
To: address@hidden
Subject: Either...or logic
Date: Wed, 19 Jun 2013 09:54:28 +0100


Suppose

set S;   #  eg S = {1,3,4,6,8}

N = card(S);
  
var x{i in S} binary;   # x = 1 if the item i is active   ;     x = 0 if
no items are included



I have a logical constraint having the form:

either
sum{i in S} x[i] = N

or

    sum{i in S} x[i] = 0 


In words either all the items x[i] are included or none are.

This will be repeated many times in my model. What is the optimal manner of 
implementing this in the model?

   Alan
-- 
Sent from my MacBook Pro 





reply via email to

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