hub network modelling

Problems with modeling
Post Reply
cio86
User
User
Posts: 4
Joined: 10 months ago

hub network modelling

Post by cio86 » 9 months ago

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
.......
Table FL(i,j) linkcost
......
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 threads=1;
option mip=cplex
solve hubcover using MIP minimizing amac;
hubcover.optfile=1;
display amac.l,y.l, x.l, z.l, r.l;
Attachments
incompletehubcovering.png

cladelpino
User
User
Posts: 108
Joined: 1 year ago

Re: hub network modelling

Post by cladelpino » 8 months ago

Fix the variables at the values of a solution that should be feasible and with a better value of the objective function, then try to run the problem.
The infeasible constraints are blocking this solution.

Post Reply