!************************************;
! WARNING: Runtimes for this model ;
! increase dramatically as the number;
! of cities increase. Formulations ;
! with more than a dozen cities ;
! WILL NOT SOLVE in a reasonable ;
! amount of time! ;
!************************************;
SETS:
! Q(I) is the amount required at city I,城市i的需求量,
U(I) is the accumulated delivers at city I ,城市i的累积交付量;
CITY/1..8/: Q, U;
! DIST(I,J) is the distance from city I to city J
X(I,J) is 0-1 variable: It is 1 if some vehicle
travels from city I to J, 0 if none;
CXC( CITY, CITY): DIST, X;
ENDSETS
DATA:
! city 1 represent the common depo;
Q = 0 6 3 7 7 18 4 5;
! distance from city I to city J is same from city
J to city I distance from city I to the depot is
0, since the vehicle has to return to the depot;