sets
i index for firms /A,B/
j index for stores /S,T/
k index for customers /1*3/


parameters
D(k) demand of customers /1 60,2 40,3 70/
CAp(i) production capacity of firms /A 100,B 90/ ;

table c(i,j) cost of transportation between firms and stores
         S       T
A        2       5
B        7       4 ;


table cp(j,k)
         1       2       3
S        3       4       7
T        2       5       3;

variables
Z
integer variable X(i,j)
integer variable y(j,k)
;

equations
ObjectiveFunction
co1(i)
co2(k)
co3(j);

objectiveFunction .. Z =e= sum((i,j), x(i,j)*c(i,j)) + sum((j,k),y(j,k)*cp(j,k)) ;
co1(i)            .. sum(j,x(i,j)) =l= cap(i);
co2(k)            .. sum(j,y(j,k)) =g= d(k) ;
co3(j)            .. sum(i,x(i,j)) =g= sum(k,y(j,k));

model firstsupplychain /all/;
solve firstsupplychain using mip minimizing Z;
display Z.l,X.l,Y.l ;