## hub network modelling

Problems with modeling
cio86
User
Posts: 4
Joined: 7 months ago

### hub network modelling

Hi
I want to set a model for an incomplete hubcovering problem. However, this program give me a complete graph. How can i fix this problem. Model and gams codes attached. an mst algorithm is working in the model. But every time it connects all hub points together.

options limrow=1000,limcol=1000,iterlim=100000000,reslim=36000,optcr=0 ;
set i cities /1*25/;
alias (i,k);
alias (i,j);
scalar Beta /2712.8/;
scalar Alfa /0.8/;
Table d(i,j) distances
.......
Table t(i,j) times
.......
......
parameter FH(i) /...../;
binary variables x(i,j),
z (i,j),
y (i,j,k);
positive variables r(i);
free variables amac;
Equations
objective
constraint1
constraint2
constraint3
constraint4
constraint5
constraint6
constraint7
constraint8
constraint9
constraint10
constraint11
constraint12
constraint13
constraint16
constraint17
constraint18;
objective..amac=e=sum((k),FH(k)*x(k,k))+sum((i,j)\$(ord(i) lt ord(j)),FL(i,j)*z(i,j));
constraint1(i)..sum((j),x(i,j))=e=1;
constraint2(i,j)..x(i,j)=l=x(j,j);
constraint3(i,j)\$(ord(i) lt ord(j))..z(i,j)=l=x(i,i);
constraint4(i,j)\$(ord(i) lt ord(j))..z(i,j)=l=x(j,j);
constraint5(j,k)\$(ord(j) ne ord(k))..sum(i\$(ord(i) ne ord(j)),y(i,j,k))=g=x(k,k)+x(j,j)-1;
constraint6(j,k)\$(ord(j) ne ord(k))..sum(i\$(ord(i) ne ord(j)),y(i,j,k))=l=x(k,k);
constraint7(i,j,k)\$(ord(j) ne ord(k) and ord(i) ne ord(j))..y(i,j,k)+y(j,i,k)=l=z(i,j);
constraint8(i,j,k)\$(ord(j) ne ord(k) and ord(i) ne ord(j))..d(k,j)=g=d(k,i)+t(i,j)*y(i,j,k)-Beta/Alfa*(1-y(i,j,k));
constraint9(i,j)\$(ord(i) ne ord(j))..d(i,j)=e=d(j,i);
constraint10(k)..d(k,k)=e=0;
constraint11(i,j)..r(j)=g=t(i,j)*x(i,j);
constraint12(j,k)..r(k)+Alfa*d(k,j)+r(j)=l=Beta;
constraint13(i,j)\$(ord(i) ne ord(j))..d(i,j)=g=t(i,j);
constraint16..sum((i,j)\$(ord(i) lt ord(j)),z(i,j))=g=sum(k,x(k,k))-1;
constraint17(i,j)\$(ord(i) lt ord(j))..d(i,j)=l=t(i,j)*z(i,j)+Beta/Alfa*(1-z(i,j));
constraint18(i,j)..d(i,j)=g=0;
model hubcover /all/ ;
option mip=cplex
solve hubcover using MIP minimizing amac;
hubcover.optfile=1;
display amac.l,y.l, x.l, z.l, r.l;
Attachments