help-glpk
[Top][All Lists]

## Re: [Help-glpk] syntax problem ?

 From: Matthieu Bollot Subject: Re: [Help-glpk] syntax problem ? Date: Sun, 27 Jan 2008 20:15:54 +0100

```I answered a little bit too fast.
here is something to understand a little bit more :

x[i,j,k,a] for i=1, j=1 can be :
k
2 0 1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
a 1 2 3 4 5 6 7 8 9

with this example, i=1, j=2 can be :
k
2 0 0 0 0 0 0 0 0 0
1 0 0 0 0 1 1 0 0 0
a 1 2 3 4 5 6 7 8 9

but it can't be :
k
2 0 0 0 0 0 0 0 0 0
1 0 0 1 1 0 0 0 0 0
a 1 2 3 4 5 6 7 8 9

this example will be correct with :
param p:=
[*,*,1]: 1 2:=
1  2 1
2  1 3
[*,*,2]: 1 2:=
1  3 2
2  2 3;

and zt will be :
zt[1,1]=2
zt[1,2]=2

Le Dimanche 27 janvier 2008 à 19:58 +0100, Matthieu Bollot a écrit :
> Le Dimanche 27 janvier 2008 à 21:15 +0300, Andrew Makhorin a écrit :
> > > there, is another way :
> > > subject to cont4{i in 1..n, j in 1..OFi[i]-1,k in 1..m, a in
> > > 1..BS-1-trmax} :
> > > p[i,j]*x[i,j+1,k,a] <= sum{kk in 1..m, aa in
> > > 1..a-1-tr[k,kk]}x[i,j,kk,aa];
> >
> > > but in my case, p[i,j] can't be a parameter because it depend on k so I
> > > would like something like :
> >
> > > subject to cont4{i in 1..n, j in 1..OFi[i]-1,k in 1..m, a in
> > > 1..BS-1-trmax} :
> > > zt[i,j]*x[i,j+1,k,a] <=
> > > sum{kk in 1..m, aa in 1..a-1-tr[k,kk]}x[i,j,kk,aa];
> >
> > > subject to cont41{i in 1..n, j in 1..OFi[i]} :
> > zt[i,j]>>=sum{k in 1..m}z[i,j,k]*p[i,j,k];
> >
> > > but multiplication of linear forms is not allowed... is it possible with
> > > an other way ?
> >
> > This is because in mip all constraints must be linear.
> >
> > Could you formulate your question more precisely?
>
> var x{i in 1..n,j in 1..OFi[i],k in 1..m, l in 1..BS} binary;
>
> param p:=
> [*,*,1]: 1 2:=
> 1  1 0
> 2  8 1...
> [*,*,2]: 1 2:=
> 1  3 2
> 2  3 1;
>
> my model will choose the best value for p
> var zt{i in 1..n, j in 1..OFi[i]};
> for example, zt[1,1] can be 1.
> zt[2,1] could be 8 or 3.
>
> What I want is :
> subject to cont4{i in 1..n,j in 1..(OFi[i]-1), k in 1..m,
> a in 1..BS-1-trmax} :
> x[i,j+1,k,a]*zt[i,j]<=sum{kk in 1..m, aa in 1..a+tr[k,kk]}x[i,j,kk,aa];
> ^^^^^^^^^^^^^^^^^^^^the problem is here.
>
> which means that I can't have x[i,j+1,k,a]=1 before sum of x[i,j,k,a] is
> equal to zt[i,j]
> I could say that the task j+1 can't start before j is completely done.
>
> But may be my model is completely wrong ?
>
>
>
> _______________________________________________
> Help-glpk mailing list