Hi,
If a boolean tells you either you must have
sum{i in S} x[i] = N or sum{i in S} x[i] = 0
like in :
X =1 --> sum{i in S} x[i] = N
then you can use the transformation of an "implication" into GLPK (by the
so-called Big-M method OR Convex Hull).
Many GLPK (Andrew too) users don't like Big-M method.
regards
Alex
Le 19 juin 2013 à 13:27, Andrew Makhorin a écrit :
> -------- Forwarded Message --------
> From: Alan Zinober <[email protected]>
> To: [email protected]
> 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
>
>
>
> _______________________________________________
> Help-glpk mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/help-glpk
-------------------------------
Alexandre Saidi
Maitre de Conférences
Ecole Centrale de Lyon-Dép. MI
LIRIS-CNRS UMR 5205
Tél : 0472186530, Fax : 0472186443
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk