error1217

hi
dear gamsworld member

i have a problem with solving my model in gams because of error 1217:no solution exist, is there anyone to help me kindly?

the following model is mine:


sets

i all locations /18/
k vehicles /1
3/
l period /1*3/


alias(i,j,p,h)



scalar Q capacity of vehicles

/40/ ;

parameters


table d(i,l) demand of customer j on day l of combination r

1 2 3

1 0 0 0
2 5 5 5
3 10 10 10
4 7 7 7
5 15 15 15
6 9 9 9
7 12 12 12
8 8 8 8



table c(i,j) travel cost matrix
1 2 3 4 5 6 7 8
1 0.00 58.68 100.32 17.36 37.91 97.63 54.56 37.63
2 58.68 0.00 82.31 66.23 72.81 79.58 39.64 79.56
3 100.32 82.31 0.00 90.99 134.63 2.85 49.34 136.95
4 17.36 66.23 90.99 0.00 54.25 88.49 50.55 52.43
5 37.91 72.81 134.63 54.25 0.00 131.83 86.03 9.23
6 97.63 79.58 2.85 88.49 131.83 0.00 46.50 134.20
7 54.56 39.64 49.34 50.55 86.03 46.50 0.00 89.20
8 37.63 79.56 136.95 52.43 9.23 134.20 89.20 0.00






Binary variables

x(i,j,k,l) if edge i-j is traversed from i to j in the route performed by vehicle k on day l
b(i,l) if customer j is visited in period l


positive variable

v(i) ;
;
variables
z;


Equations
cost
cons2
cons3
cons33
cons333
cons4
cons6
cons8
cons88
cons888
cons9

;

cost…z=e=sum((i,j,k,l)$(ord(i)ord(j)),c(i,j)*x(i,j,k,l));

cons2(l,i,k)…sum(j,x(i,j,k,l))-sum(p,x(p,i,k,l))=e=0;

*cons3(i,j,k,l)$((ord(j)ord(j))and(ord(i)>1)and(ord(j)>1))…u(i,k,l)-u(j,k,l)+(card(j)x(i,j,k,l))=l=card(j)-1;


cons3(k,l,i,j)…v(i)-v(j)+(Q
x(i,j,k,l))=l=Q-d(j,l);

cons33(i,l)…d(i,l)=l=v(i);

cons333(i,k)…v(i)=l=Q;



cons4(k,l)…sum((i,j)$(ord(i)>1),d(i,l)*x(j,i,k,l))=l=Q ;

cons6(k,l)…sum((i,j)((ord(i)1)),x(i,j,k,l))=l=1; \ \ cons8(i)((ord(i)1))…sum(l,b(i,l))=e=1 ;
cons88(i)((ord(i)3))..sum(l,b(i,l))=e=2 ; cons888(i)(ord(i)>6)…sum(l,b(i,l))=e=3;

cons9(i,l)$(ord(i)>1)…sum((j,k),x(j,i,k,l))=e=b(i,l) ;



model model /all/;
solve model using mip minimizing z;
display x.l,b.l,v.l,z.l ;

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Hi

If your model gives you an error, tell us, where Gams found one (Gams shows you exactly where the error is by putting

If I run your model, I get error 2 (not 1217), so I don’t know where this error 1217 comes from.



107 model model /all/;

**** $2$2



You can’t use „model“ as model name. Use something different.

If I use “mymodel” the code is fine (I don’t know if the model itself is correct).

Cheers



Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of n nazari
Sent: Thursday, May 29, 2014 4:09 PM
To: gamsworld@googlegroups.com
Subject: error1217



hi



dear gamsworld member



the following is my writen model in gams but output shows me error 1217, is anyone help me kindly?!





sets



i all locations /1*8/

k vehicles /1*3/

l period /1*3/





alias(i,j,p,h)







scalar Q capacity of vehicles



/40/ ;



parameters





table d(i,l) demand of customer j on day l of combination r



1 2 3



1 0 0 0

2 5 5 5

3 10 10 10

4 7 7 7

5 15 15 15

6 9 9 9

7 12 12 12

8 8 8 8







table c(i,j) travel cost matrix

1 2 3 4 5 6 7 8

1 0.00 58.68 100.32 17.36 37.91 97.63 54.56 37.63

2 58.68 0.00 82.31 66.23 72.81 79.58 39.64 79.56

3 100.32 82.31 0.00 90.99 134.63 2.85 49.34 136.95

4 17.36 66.23 90.99 0.00 54.25 88.49 50.55 52.43

5 37.91 72.81 134.63 54.25 0.00 131.83 86.03 9.23

6 97.63 79.58 2.85 88.49 131.83 0.00 46.50 134.20

7 54.56 39.64 49.34 50.55 86.03 46.50 0.00 89.20

8 37.63 79.56 136.95 52.43 9.23 134.20 89.20 0.00













Binary variables



x(i,j,k,l) if edge i-j is traversed from i to j in the route performed by vehicle k on day l

b(i,l) if customer j is visited in period l





positive variable



v(i) ;

;

variables

z;





Equations

cost

cons2

cons3

cons33

cons333

cons4

cons6

cons8

cons88

cons888

cons9



;



cost…z=e=sum((i,j,k,l)(ord(i)ord(j)),c(i,j)*x(i,j,k,l)); \ \ \ cons2(l,i,k)..sum(j,x(i,j,k,l))-sum(p,x(p,i,k,l))=e=0; \ \ \ *cons3(i,j,k,l)((ord(j)ord(j))and(ord(i)>1)and(ord(j)>1))…u(i,k,l)-u(j,k,l)+(card(j)x(i,j,k,l))=l=card(j)-1;





cons3(k,l,i,j)…v(i)-v(j)+(Q
x(i,j,k,l))=l=Q-d(j,l);



cons33(i,l)…d(i,l)=l=v(i);



cons333(i,k)…v(i)=l=Q;







cons4(k,l)…sum((i,j)(ord(i)>1),d(i,l)*x(j,i,k,l))=l=Q ; \ \ \ cons6(k,l)..sum((i,j)((ord(i)1)),x(i,j,k,l))=l=1;





cons8(i)$((ord(i)1))…sum(l,b(i,l))=e=1 ;

cons88(i)$((ord(i)3))…sum(l,b(i,l))=e=2 ;

cons888(i)(ord(i)>6)..sum(l,b(i,l))=e=3; \ \ \ cons9(i,l)(ord(i)>1)…sum((j,k),x(j,i,k,l))=e=b(i,l) ;







model model /all/;

solve model using mip minimizing z;

display x.l,b.l,v.l,z.l ;






\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Thanks alot dear renger

yes,you say correct, i know that . its clear that i shouldnt use word model in last lines but its because of my mistake in typing model in this page not in gams , when i use another word replacing model i face the error1217 (no solution exist).

regards

On Thursday, 29 May 2014 18:39:08 UTC+4:30, n nazari wrote:

hi

dear gamsworld member

the following is my writen model in gams but output shows me error 1217, is anyone help me kindly?!


sets

i all locations /18/
k vehicles /1
3/
l period /1*3/


alias(i,j,p,h)



scalar Q capacity of vehicles

/40/ ;

parameters


table d(i,l) demand of customer j on day l of combination r

1 2 3

1 0 0 0
2 5 5 5
3 10 10 10
4 7 7 7
5 15 15 15
6 9 9 9
7 12 12 12
8 8 8 8



table c(i,j) travel cost matrix
1 2 3 4 5 6 7 8
1 0.00 58.68 100.32 17.36 37.91 97.63 54.56 37.63
2 58.68 0.00 82.31 66.23 72.81 79.58 39.64 79.56
3 100.32 82.31 0.00 90.99 134.63 2.85 49.34 136.95
4 17.36 66.23 90.99 0.00 54.25 88.49 50.55 52.43
5 37.91 72.81 134.63 54.25 0.00 131.83 86.03 9.23
6 97.63 79.58 2.85 88.49 131.83 0.00 46.50 134.20
7 54.56 39.64 49.34 50.55 86.03 46.50 0.00 89.20
8 37.63 79.56 136.95 52.43 9.23 134.20 89.20 0.00






Binary variables

x(i,j,k,l) if edge i-j is traversed from i to j in the route performed by vehicle k on day l
b(i,l) if customer j is visited in period l


positive variable

v(i) ;
;
variables
z;


Equations
cost
cons2
cons3
cons33
cons333
cons4
cons6
cons8
cons88
cons888
cons9

;

cost…z=e=sum((i,j,k,l)$(ord(i)ord(j)),c(i,j)*x(i,j,k,l));

cons2(l,i,k)…sum(j,x(i,j,k,l))-sum(p,x(p,i,k,l))=e=0;

*cons3(i,j,k,l)$((ord(j)ord(j))and(ord(i)>1)and(ord(j)>1))…u(i,k,l)-u(j,k,l)+(card(j)x(i,j,k,l))=l=card(j)-1;


cons3(k,l,i,j)…v(i)-v(j)+(Q
x(i,j,k,l))=l=Q-d(j,l);

cons33(i,l)…d(i,l)=l=v(i);

cons333(i,k)…v(i)=l=Q;



cons4(k,l)…sum((i,j)$(ord(i)>1),d(i,l)*x(j,i,k,l))=l=Q ;

cons6(k,l)…sum((i,j)((ord(i)1)),x(i,j,k,l))=l=1; \ \ cons8(i)((ord(i)1))…sum(l,b(i,l))=e=1 ;
cons88(i)((ord(i)3))..sum(l,b(i,l))=e=2 ; cons888(i)(ord(i)>6)…sum(l,b(i,l))=e=3;

cons9(i,l)$(ord(i)>1)…sum((j,k),x(j,i,k,l))=e=b(i,l) ;



model model /all/;
solve model using mip minimizing z;
display x.l,b.l,v.l,z.l ;


\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Hello,

You have to change the model name as following:

model n_nazari /all/;
solve n_nazari using mip minimizing z;
display x.l,b.l,v.l,z.l ;

Regards,

Morteza Shabanzadeh







On Thursday, May 29, 2014 8:12 PM, n nazari wrote:


hi
dear gamsworld member

i have a problem with solving my model in gams because of error 1217:no solution exist, is there anyone to help me kindly?

the following model is mine:


sets

i all locations /18/
k vehicles /1
3/
l period /1*3/


alias(i,j,p,h)



scalar Q capacity of vehicles

/40/ ;

parameters


table d(i,l) demand of customer j on day l of combination r

1 2 3

1 0 0 0
2 5 5 5
3 10 10 10
4 7 7 7
5 15 15 15
6 9 9 9
7 12 12 12
8 8 8 8



table c(i,j) travel cost matrix
1 2 3 4 5 6 7 8
1 0.00 58.68 100.32 17.36 37.91 97.63 54.56 37.63
2 58.68 0.00 82.31 66.23 72.81 79.58 39.64 79.56
3 100.32 82.31 0.00 90.99 134.63 2.85 49.34 136.95
4 17.36 66.23 90.99 0.00 54.25 88.49 50.55 52.43
5 37.91 72.81 134.63 54.25 0.00 131.83 86.03 9.23
6 97.63 79.58 2.85 88.49 131.83 0.00 46.50 134.20
7 54.56 39.64 49.34 50.55 86.03 46.50 0.00 89.20
8 37.63 79.56 136.95 52.43 9.23 134.20 89.20 0.00






Binary variables

x(i,j,k,l) if edge i-j is traversed from i to j in the route performed by vehicle k on day l
b(i,l) if customer j is visited in period l


positive variable

v(i) ;
;
variables
z;


Equations
cost
cons2
cons3
cons33
cons333
cons4
cons6
cons8
cons88
cons888
cons9

;

cost…z=e=sum((i,j,k,l)$(ord(i)ord(j)),c(i,j)*x(i,j,k,l));

cons2(l,i,k)…sum(j,x(i,j,k,l))-sum(p,x(p,i,k,l))=e=0;

*cons3(i,j,k,l)$((ord(j)ord(j))and(ord(i)>1)and(ord(j)>1))…u(i,k,l)-u(j,k,l)+(card(j)x(i,j,k,l))=l=card(j)-1;


cons3(k,l,i,j)…v(i)-v(j)+(Q
x(i,j,k,l))=l=Q-d(j,l);

cons33(i,l)…d(i,l)=l=v(i);

cons333(i,k)…v(i)=l=Q;



cons4(k,l)…sum((i,j)$(ord(i)>1),d(i,l)*x(j,i,k,l))=l=Q ;

cons6(k,l)…sum((i,j)((ord(i)1)),x(i,j,k,l))=l=1; \ \ cons8(i)((ord(i)1))…sum(l,b(i,l))=e=1 ;
cons88(i)((ord(i)3))..sum(l,b(i,l))=e=2 ; cons888(i)(ord(i)>6)…sum(l,b(i,l))=e=3;

cons9(i,l)$(ord(i)>1)…sum((j,k),x(j,i,k,l))=e=b(i,l) ;



model model /all/;
solve model using mip minimizing z;
display x.l,b.l,v.l,z.l ;

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

the following is my test model i try to solve with cplex in gams , As you see , result of running it is some error such as

  1. mip status 108:time limit exceeded, no integer solution
    2 . cplex error 1217:no solution exist

report picture is attached

i dont know what to do, can you help me kindly plz?

option optcr=0;
option optca=0;


sets

i all locations /110/
k vehicles /1
3/
l period /1*3/
alias(i,j)



scalar Q capacity of vehicles

/40/ ;

parameters

d(i) demand of customer
/
1 0
2 12
3 8
4 16
5 5
6 12
7 5
8 13
9 20
10 13

/

et(i)
/
1 0
2 354
3 234
4 411
5 474
6 155
7 361
8 451
9 425
10 72

/

lt(i)
/
1 800
2 509
3 401
4 573
5 622
6 295
7 509
8 629
9 588
10 199

/


st(i)
/
1 0
2 2
3 7
4 21
5 24
6 1
7 17
8 6
9 5
10 7

/


table c(i,j) travel cost matrix

1 2 3 4 5 6 7 8 9 10
1 0.0 48.2 24.9 63.8 49.1 74.7 60.9 15.8 79.1 22.5
2 48.2 0.0 58.7 100.3 17.3 37.9 97.6 54.6 37.6 70.5
3 24.9 58.7 0.0 82.3 65.9 72.8 79.6 39.6 79.6 27.4
4 63.8 100.3 82.3 0.0 90.8 134.6 2.9 49.3 137.0 56.3
5 49.1 17.3 65.9 90.8 0.0 54.2 88.3 50.2 52.5 71.1
6 74.7 37.9 72.8 134.6 54.2 0.0 131.8 86.0 9.2 94.3
7 60.9 97.6 79.6 2.9 88.3 131.8 0.0 46.5 134.2 53.7
8 15.8 54.6 39.6 49.3 50.2 86.0 46.5 0.0 89.2 25.6
9 79.1 37.6 79.6 137.0 52.5 9.2 134.2 89.2 0.0 99.5
10 22.5 70.5 27.4 56.3 71.1 94.3 53.7 25.6 99.5 0.0


table t(i,j) travel cost matrix

1 2 3 4 5 6 7 8 9 10
1 0.0 4.8 2.5 6.4 4.9 7.5 6.1 1.6 7.9 2.2
2 4.8 0.0 5.9 10.0 1.7 3.8 9.8 5.5 3.8 7.0
3 2.5 5.9 0.0 8.2 6.6 7.3 8.0 4.0 8.0 2.7
4 6.4 10.0 8.2 0.0 9.1 13.5 0.3 4.9 13.7 5.6
5 4.9 1.7 6.6 9.1 0.0 5.4 8.8 5.0 5.2 7.1
6 7.5 3.8 7.3 13.5 5.4 0.0 13.2 8.6 0.9 9.4
7 6.1 9.8 8.0 0.3 8.8 13.2 0.0 4.6 13.4 5.4
8 1.6 5.5 4.0 4.9 5.0 8.6 4.6 0.0 8.9 2.6
9 7.9 3.8 8.0 13.7 5.2 0.9 13.4 8.9 0.0 10.0
10 2.2 7.0 2.7 5.6 7.1 9.4 5.4 2.6 10.0 0.0

;
Binary variables

x(i,j,k,l)
b(i,l)


positive variable
u(i,l)
at(i,k,l) ;
variables
z;


Equations
cost
cons1
cons2
cons3
cons4
cons5
cons6
cons7
cons8
cons9
cons10
cons11
cons14
cons15
cons16
cons17
cons18
;


cost…z=e=sum((i,j,k,l)(ord(i)ord(j)),c(i,j)*x(i,j,k,l)); \ \ \ cons1(i)((ord(i)>1)and(ord(i)4))…sum(l,b(i,l))=e=2 ;
cons3(i)$(ord(i)>7)…sum(l,b(i,l))=e=3;

cons4(i,l)(ord(i)>1)..sum((k,j)(ord(i)ord(j)),x(i,j,k,l))=e=b(i,l);
cons5(j,l)(ord(j)>1)..sum((k,i)(ord(i)ord(j)),x(i,j,k,l))=e=b(j,l);

cons6(i,k,l)…sum(j$(ord(j)ord(i)),x(i,j,k,l))=e=sum(j$(ord(j)ord(i)),x(j,i,k,l));

cons7(k,l)…sum(j$(ord(j)>1),x(‘1’,j,k,l))=l=1;

Cons8(k,l)…sum((i,j)(ord(i)ord(j)),d(i)*x(i,j,k,l))=l=q; \ \ cons9(i,j,l)((ord(i)>1)and(ord(j)>1)and(ord(i)ord(j)))… u(i,l) - u(j,l) + (card(i)*sum(k,x(i,j,k,l))) =l= card(i) - 1;

cons10(i,l)$(ord(i)>1)…1=l=u(i,l);

cons11(i,l)$(ord(i)>1)…card(i)=g=u(i,l);

Cons14(i,j,l,k)$(ord(i)ord(j))…at(i,k,l)+st(i)+t(i,j)-at(j,k,l)=l=10000000*(1-x(i,j,k,l));

cons15(i,k,l)(ord(i)>1)..sum(j(ord(i)ord(j)),x(i,j,k,l))*et(i)=l=at(i,k,l);
cons16(i,k,l)(ord(i)>1)..sum(j(ord(i)ord(j)),x(i,j,k,l))*lt(i)=g=at(i,k,l);

cons17(k,l)…lt(‘1’)=g=at(‘1’,k,l);
cons18(k,l)…et(‘1’)=l=at(‘1’,k,l);





model rp /all/;
solve rp using mip minimizing z;
display x.l,b.l,u.l,z.l,at.l ;



On Thursday, 29 May 2014 20:58:30 UTC+4:30, Renger van Nieuwkoop wrote:

Hi

If your model gives you an error, tell us, where Gams found one (Gams shows you exactly where the error is by putting

If I run your model, I get error 2 (not 1217), so I don’t know where this error 1217 comes from.



107 model model /all/;

**** $2$2



You can’t use „model“ as model name. Use something different.

If I use “mymodel” the code is fine (I don’t know if the model itself is correct).

Cheers



Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of n nazari
Sent: Thursday, May 29, 2014 4:09 PM
To: gams...@googlegroups.com
Subject: error1217



hi



dear gamsworld member



the following is my writen model in gams but output shows me error 1217, is anyone help me kindly?!





sets



i all locations /1*8/

k vehicles /1*3/

l period /1*3/





alias(i,j,p,h)







scalar Q capacity of vehicles



/40/ ;



parameters





table d(i,l) demand of customer j on day l of combination r



1 2 3



1 0 0 0

2 5 5 5

3 10 10 10

4 7 7 7

5 15 15 15

6 9 9 9

7 12 12 12

8 8 8 8







table c(i,j) travel cost matrix

1 2 3 4 5 6 7 8

1 0.00 58.68 100.32 17.36 37.91 97.63 54.56 37.63

2 58.68 0.00 82.31 66.23 72.81 79.58 39.64 79.56

3 100.32 82.31 0.00 90.99 134.63 2.85 49.34 136.95

4 17.36 66.23 90.99 0.00 54.25 88.49 50.55 52.43

5 37.91 72.81 134.63 54.25 0.00 131.83 86.03 9.23

6 97.63 79.58 2.85 88.49 131.83 0.00 46.50 134.20

7 54.56 39.64 49.34 50.55 86.03 46.50 0.00 89.20

8 37.63 79.56 136.95 52.43 9.23 134.20 89.20 0.00













Binary variables



x(i,j,k,l) if edge i-j is traversed from i to j in the route performed by vehicle k on day l

b(i,l) if customer j is visited in period l





positive variable



v(i) ;

;

variables

z;





Equations

cost

cons2

cons3

cons33

cons333

cons4

cons6

cons8

cons88

cons888

cons9



;



cost…z=e=sum((i,j,k,l)(ord(i)ord(j)),c(i,j)*x(i,j,k,l)); \ \ \ cons2(l,i,k)..sum(j,x(i,j,k,l))-sum(p,x(p,i,k,l))=e=0; \ \ \ *cons3(i,j,k,l)((ord(j)ord(j))and(ord(i)>1)and(ord(j)>1))…u(i,k,l)-u(j,k,l)+(card(j)x(i,j,k,l))=l=card(j)-1;





cons3(k,l,i,j)…v(i)-v(j)+(Q
x(i,j,k,l))=l=Q-d(j,l);



cons33(i,l)…d(i,l)=l=v(i);



cons333(i,k)…v(i)=l=Q;







cons4(k,l)…sum((i,j)(ord(i)>1),d(i,l)*x(j,i,k,l))=l=Q ; \ \ \ cons6(k,l)..sum((i,j)((ord(i)1)),x(i,j,k,l))=l=1;





cons8(i)$((ord(i)1))…sum(l,b(i,l))=e=1 ;

cons88(i)$((ord(i)3))…sum(l,b(i,l))=e=2 ;

cons888(i)(ord(i)>6)..sum(l,b(i,l))=e=3; \ \ \ cons9(i,l)(ord(i)>1)…sum((j,k),x(j,i,k,l))=e=b(i,l) ;







model model /all/;

solve model using mip minimizing z;

display x.l,b.l,v.l,z.l ;






\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.