[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Sign of an integer
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Sign of an integer |
Date: |
Mon, 7 Apr 2008 13:10:47 +0400 |
> var sx{a in A, b in B}, binary;
> /* sx[a,b] is sign(sum{c in C} x[a,b,c]) */
> /* in other word, sx[a,b] is logical_or{c in C} x[a,b,c] */
>
> s.t. foo{a in A, b in B}: sum{c in C} x[a,b,c] <= card(C) * sx[a,b];
>
> s.t. rooms{a in A}: sum{b in B} sx[a,b] <= r;
Incorrect. The first constraint must be the following:
s.t. foo{a in A, b in B}:
0 <= card(C) * sx[a,b] - sum{c in C} x[a,b,c] <= card(C) - 1;