! The dock or gate assignment problem. (GateAssign)
A number of vehicles (trucks, airplanes...)
arrive over time at an exchange facility.
The facility has a number of docks or gates.
Each gate can handle at most one vehicle at a time.
We would like to assign vehicles to gates so that
the value of the assignments is maximized, and
at most one vehicle is assigned to specific gate
at a specific instance.
 Additional realistic features not included:
allowing some vehicles to be slightly delayed,
disallowing certain, e.g., large, vehicles to
be at adjacent gates;
! Keywords: Assignment, Gate assignment, Dock assignment;
SETS:
  VEH: ARVT, LEVT;
  GATE;
  VXG( VEH, GATE) : VAL, Y;
ENDSETS
DATA: ! Vehicles, their arrival times, and their leave or departure times; VEH ARVT LEVT = V01 615 650 V02 617 651 V03 630 700 V04 644 720 V05 651 731 V06 702 740 V07 703 739 V08 716 750 V09 717 748 V10 720 752; ! The available gates; GATE = G01 G02 G03 G04; ! The value of assigning vehicle v to gate g; VAL = 3 4 4 3 4 6 7 3 5 5 5 5 4 6 5 3 2 6 7 3 6 4 2 3 3 6 7 3 4 6 6 3 1 9 7 2 4 6 7 3; ENDDATA ! Maximize the value of the assignments; MAX = @SUM( VXG(v,g): VAL( v, g)* Y( v, g)); ! Each vehicle can be assigned to at most one gate; @FOR( VEH( v): @SUM( VXG( v, g): Y( v, g)) <= 1; ); ! When vehicle v is assigned to a gate, for each gate g, at most one vehicle can be assigned to gate g; ! With a little bit of care, one can reduce the number of the following constraints that need be generated; @FOR( VXG( v, g): ! Sum over all vehicles v2 arrived already and are still around; @SUM( VXG( v2, g) | ARVT( v2) #LE# ARVT(v) #AND# LEVT( v2) #GT# ARVT(v): Y( v2, g)) <= 1; ); ! The Y( v, g) are 0/1 variables; @FOR( VXG( v, g): @BIN( Y( v, g)); );