[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] var between 2 parameters
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] var between 2 parameters |
Date: |
Wed, 08 Aug 2012 21:10:54 +0400 |
> I'm working on scheduling model which consider the day-off in the allocation.
> I need your help because I need to model a constraint as the following:
>
> var x, y;
> param a,b;
>
> if (x > param a) and (x < param b) then
> y = 1;
> else
> y = 0;
> end if;
>
> do you think is feasible?
> Thanks in advance for your help.
>
x >= a - M1 * (y - 1)
x <= b + M2 * (y - 1)
where y is a binary variable, M1 and M2 are "big M's" that should be
chosen as small as possible.