目录
3仓库,4客户运输问题
! 3 Warehouse, 4 Customer Transportation Problem;
sets:
Warehouse /1..3/: a;
Customer /1..4/: b;
Routes( Warehouse, Customer) : c, x;
endsets
! Here are the parameters;
data:
a = 30, 25, 21;
b = 15, 17, 22, 12;
c = 6, 2, 6, 7,
4, 9, 5, 3,
8, 8, 1, 5;
enddata
! The objective;
[OBJ] min = @sum( Routes: c * x);
! The supply constraints;
@for( Warehouse(i): [SUP]
@sum( Customer(j): x(i,j)) <= a(i));
! The demand constraints;
@for( Customer(j): [DEM]
@sum( Warehouse(i): x(i,j)) = b(j));