On Thu, 29 Nov 2007, Leandro Barcelos wrote:
> On Nov 29, 2007 3:15 PM, ican.ozgur <[EMAIL PROTECTED]> wrote:
> > Hi GLPK'ers.
> > I have a binary variable say, "x_dh", having day and hour indices .If x_dh 
> > is
> > 1   i want it to be also 1 for the consecutive 2 hours. Do you have any idea
> > on how to implement such a situation  in MathProg?

(reordered)
> I think this could be something like that...
>
> s.t:{d in Days, h in Hours : h <= 22}:  x[d,h] <=  (x[d,h+2] + x[d,h+1] )* 0.5

Mathematically correct, but one should go for a tighter linear relaxation.
x[d,h]<=x[d,h+1]
x[d,h]<=x[d,h+2]
With this formulation, the latter constraint is redundant.
x[d,h]<=x[d,h+1] where d indexes a day and h and h+1 index hours.

-- 
Mike   [EMAIL PROTECTED]
"Horse guts never lie."  -- Cherek Bear-Shoulders



_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to