Code: Select all

```
sets
i non hub node i /1*81/
*/p city /1*81/
Alias(i,j,k,m) ;
Parameters
a discount /0.7/
c(i,j,k,m) /c(i,k)+c(m,j)+(a*c(k,m))/
table t(i,k) average amount of commodities from i to j
$include C:\Users\Asus\Desktop\appendixs\Appendix3.inc
;
table d(i,j) distance between i and j
$include C:\Users\Asus\Desktop\appendixs\Appendix1.inc
;
table c(i,k) cost between i and j
/5*d(i,j) /
table h(i,j) connection between i and j
$include C:\Users\Asus\Desktop\appendixs\Appendix2.inc
;
Variable
z objective
p hub
y(i,k,m) i düğümünden çıkarak k ve m düğümünden geçen akış miktarı
binary variable
x(i,k) i düğümü k hub ına atanırsa
x(k,k) k düğümü hub olursa
positive variable
x(i,j,k,m) the total flow for each origin–destination pair
;
Equation
obj objective function
cons1
cons2
cons3
cons4
;
obj.. z=e=sum(i,sum(j,sum(k,sum(m,(h(i,j)*x(i,j,k,m)*c(i,j,k,m))))));
cons1.. sum(k,(x(k,k)))=e=p ;
cons2(i,j).. sum(k,sum(m,(x(i,j,k,m))))=e=1 ;
cons3(i,j,k,m).. x(i,j,k,m)=l=x(k,k);
cons4(i,j,k,m).. x(i,j,k,m)=l=x(m,m);
model project /all/;
solve project using mip minimizing z;
display z.l,x.l, y.l;
```