help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] How to make consecutive variables take a certain value?


From: Michael Hennebry
Subject: Re: [Help-glpk] How to make consecutive variables take a certain value?
Date: Thu, 29 Nov 2007 16:18:07 -0600 (CST)

On Thu, 29 Nov 2007, Leandro Barcelos wrote:
> On Nov 29, 2007 3:15 PM, ican.ozgur <address@hidden> 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   address@hidden
"Horse guts never lie."  -- Cherek Bear-Shoulders





reply via email to

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