[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Tricky constraint formulation
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Tricky constraint formulation |
Date: |
Wed, 09 Mar 2011 18:47:47 +0300 |
On Wed, 2011-03-09 at 18:43 +0300, Andrew Makhorin wrote:
> On Wed, 2011-03-09 at 06:30 -0800, teitifeiti wrote:
> > Hello everyone.
> >
> > I have a problem in formulating a constraint. The constraint is:
> > C[r,i] - C[r,k] + P*D[i,k] >= T[r,i] where (1 <= r <= M ; 1 <= i < k
> > <= N);
> >
> > So what I tried first was:
> >
> > s.t. constraint{r in 1..R,i 1..I,k in 1..I}
> >
> > But that constraint holds for all k < i, which I don't want it to do.
> >
> > Does anyone have a cool solution to my problem??
> >
> > Respectfully, TeitiFeiti
>
> s.t. constraint{r in 1..R,i 1..I,k in 1..I: i < k} ...
>
The following is more efficient:
s.t. constraint{r in 1..R,i 1..I,k in i+1..I} ...