Model [_1]!4supply,4 demand [_2]Transshipment problem; [_3]set: [_4]m/1,2,3,4/:supply; [_5]n/1,2,3,4/:demand; [_6]k/1,2,3,4/:R; [_7]linkⅠ(supply, demand):c,x; [_8]linkⅡ(k,demand):R,y; [_9]A !A(i,j)=1 if we use lind i,j; [_10]U, !the limited of vessel [_11]Endsets [_12] data: [_13]supply=300,200,450,320; [_14]demand=300,150,500,320; [_15]C=70,0,50,0 50,0,30,0 0,100,120,80 0,240,200,80; [_16]R=210,180,190,230; [_17]A=1,0,1,0 1,0,1,1 0,1,1,1 0,1,1,1; [_18]U=300,0,300,0 350,0,350,360 0,200,300,360 0,200,200,280; [_19]enddata [_19]!the objective [_20][obj]min=@sum(linkⅠ:c(i,j)*x(i,j))+@sum(linkⅡ:R(j)*y(j)); [_21]@for(demand(j):[sup] [_22] @sum(supply(i x(i,j)*A(i,j)+y(j)=demand(j); [_23]@for(supply(i):[MID] [_24] @sum(demand(j):x(i,j)* A(i,j)<=supply(i); [_25]@for(linkⅠ:[DEM] [_26] @sum(linkⅠ:x(p,q)*t(p,q,i,j),=U(i,j); [_27]end |