extfieldsofstudy:
Computer Science
Mathematics

text:
Constraint and Mathematical Programming Models for Integrated Port Container Terminal Operations

This paper considers the integrated problem of quay crane assignment, quay crane scheduling, yard location assignment, and vehicle dispatching operations at a container terminal. The main objective is to minimize vessel turnover times and maximize the terminal throughput, which are key economic drivers in terminal operations. Due to their computational complexities, these problems are not optimized jointly in existing work. This paper revisits this limitation and proposes Mixed Integer Programming (MIP) and Constraint Programming (CP) models for the integrated problem, under some realistic assumptions. Experimental results show that the MIP formulation can only solve small instances, while the CP model finds optimal solutions in reasonable times for realistic instances derived from actual container terminal operations.

Introduction
Maritime transportation has significant benefits in terms of cost and capability for carrying a higher number of cargos. Indeed, sea trade statistics indicate that 90% of global trade is performed by maritime transportation. This has led to new investments in container terminals and a variety of initiatives to improve the operational efficiency of existing terminals. Operations at a container terminal can be classified as quay side and yard side. They handle materials using quay cranes (QC), yard cranes (YC), and transportation vehicles such as yard trucks (YT). QCs load and unload containers at the quay side, while YCs load and discharge containers at the yard side. YTs provide transshipment of the containers between the quay and the yard sides.
In a typical container terminal, it is important to minimize the vessel berthing time, i.e., the period between the arrival and the departure of a vessel. When a vessel arrives at the terminal, the berth allocation problem selects when and where in the port the vessel should berth. Once a vessel is berthed, its stowage plan determines the containers to be loaded/discharged onto/from the vessel. This provides an input to the QC assignment and scheduling, which determines the sequence of the containers to be loaded or discharged from different parts of the vessel by the QCs. In addition, the containers discharged by the QCs are placed onto YTs and transported to the storage area, which corresponds to a vehicle dispatching problem. Each discharged container is assigned a storage location, giving rise to a yard location assignment problem. Finally, the containers are taken from YTs by YCs and placed onto stacks in storage blocks, specifying a YC assignment and scheduling problem.
A container terminal aims at completing the operations of each berthed vessel as quickly as possible to minimize vessel waiting times at the port and thus to maximize the turnover, i.e., the number of handled containers. Optimizing the integrated operations within a containing terminal is computationally challenging [17]. Therefore, the optimization problems identified earlier are generally considered separately in the literature, and the number of studies considering integrated operations is rather limited. However, although the optimization of individual problems brings some operational improvements, the main opportunity lies in optimizing terminal operations holistically. This is especially important since the optimization sub-problems have conflicting objectives that can adversely affect the overall performance of the system. This paper considers the integrated optimization of container terminal operations and proposes MIP and CP formulations under some realistic assumptions. To the best of our knowledge, the resulting optimization problem has not been considered in the literature so far. Experimental results show that the MIP formulation is not capable of solving instances of practical relevance, while the CP model finds optimal solutions in reasonable times for realistic instances derived from real container terminal operations.
The rest of the paper is organized as follows. Section 2 specifies the problem and the assumptions considered in this work. Section 3 provides a detailed literature review for the integrated optimization of container terminal operations. Section 4 presents the MIP model, while Section 5 presents the constraint programming model for the same problem. Section 6 presents the data generation procedure, the experimental results, and the comparison of the different models. Finally, Section 7 presents concluding remarks and future research directions.

Problem Definition
This section specifies the Integrated Port Container Terminal Problem (IPCTP) and its underlying assumptions. The IPCTP is motivated by the operations of actual container terminals in Turkey.
In container terminals, berth allocation assigns a berth and a time interval to each vessel. Literature surveys and interviews with port management officials reveal that significant factors in berth allocation include priorities between customers, berthing privileges of certain vessels in specific ports, vessel sizes, and depth of the water. Because of all these restrictions, the number of alternative berth assignments is quite low, especially in small Turkish ports. As a result, the berthing plan is often determined without the need of intelligent systems and the berthing decisions can be considered as input data to the scheduling of the material-handling equipment. The vessel stowage plan decides how to place the outbound containers on the vessel and is prepared by the shipping company. These two problems are thus separated from the IPCTP. In other words, the paper assumes that vessels are already berthed and ready to be served.
The IPCTP is formulated by considering container groups, called shipments. A single shipment represents a group of containers that travel together and belong to the same customer. Therefore, the containers in a single shipment must be stored in the same yard block and in the same vessel bay. In addition, each shipment is handled as a single batch by QCs and YCs.
The IPCTP determines the storage location in the yard for inbound containers. The yard is assumed to be divided into a number of areas containing the storage blocks. Each inbound shipment has a number of possible location points in each area. Each YC is assumed to be dedicated to a specific area of the yard. Note that outbound shipments are at specified yard locations at the beginning of the planning period and hence their YCs are known in advance. In contrast, for inbound shipments, the YC assignment is derived from the storage block decisions. The IPCTP assumes that each yard location can store at most one shipment but there is no difficulty in relaxing that assumption.
The inbound and outbound shipments and their vessel bays are specified in the vessel stowage plan. The IPCTP assigns each shipment to a QC and schedules each QC to process a sequence of shipments. The QC scheduling is constrained by movement restrictions and safety distances between QCs. Two adjacent QCs must be apart from each other by safety distance, so that they can perform their tasks simultaneously without interference as described in [13].
The IPCTP assumes the existence of a sufficient number of YTs so that cranes never wait. This assumption is motivated by observations in real terminals where many YTs are dedicated to each QC in order to ensure a smooth operation. This organization is justified by the fact that QCs are the most critical handling equipment in the terminal. As a result, QCs are very rarely blocked while discharging and almost never starve while loading. Therefore, the assumption of having a sufficient number of YTs is realistic and simplifies the IPCTP.
The IPCTP also assumes that the handling equipment (QC, YC, YT) is homogeneous, and their processing times are deterministic and known. Since the QCs cannot travel beyond the berthed vessel bays and must obey a safety distance [15], each shipment can only be assigned to an eligible set of QCs that respect safety distance and non-crossing constraints. These are illustrated in Figure 1 where berthed vessel bays and QCs are indexed in increasing order and the safety distance is assumed to be 1 bay. For instance, only QC-1 is eligible to service bays 1-2. Similarly, only QC-3 can operate on vessel bays 8-9. In contrast, bays 3-4 can be served by QC-1 and QC-2.
The main objective of a container terminal is to maximize total profit by increasing productivity. Terminal operators try to lower vessel turn times and decrease dwell times. To lower vessel turn times, the crane operations must be well-coordinated and the storage location of the inbound shipments must be chosen carefully, since they impact the distance traveled by the YTs. Therefore, the  IPCTP jointly considers the storage location assignment for the inbound shipments from multiple berthed vessels and the crane assignment and scheduling for both outbound and inbound containers. The objective of the problem is to minimize the sum of weighted completion times of the vessels.
The input parameters of the IPCTP are given in Table 1. Most are selfexplanatory but some necessitate additional explanation. The smallest distance δ v,w between quay cranes v and w is given by δ v,w = (δ + 1) |v − w| where δ is the safety distance. The minimum time between the starting times of shipments i and j when processed by cranes v and w is given by This captures the time needed for a quay crane to travel to a safe distance in case of potential interference. This is illustrated in Figure 2. If shipments i and j are processed by cranes v and w, then their starting times must be separated by s QC time units in order to respect the safety constraints (assuming that w = v + 1). For instance, if shipment i is processed first, crane v must move to bay 1 before shipment j can be processed. Finally, the set of interferences can be defined by The dummy (initial and last) shipments are only used in the MIP model.
YT handling time of outbound shipment i ∈ C l tt k YT transfer time of inbound shipment to yard location k ∈ Lu tyc k,l YC travel time between yard locations k and l eqci,j QC travel time from shipment i ∈ C to shipment j ∈ C eyci,j YC travel time from yard location i ∈ L to yard location j ∈ L sQC Travel time for unit distance of equipment QC δ Safety distance between two QCs δv,w Smallest allowed difference between bay positions of quay cranes v and w ∆ v,w i,j Minimum time between the starting times of shipments i and j when processed by cranes v and w Θ Set of all combinations of shipments and QCs with potential interferences 0 Dummy initial shipment N Dummy last shipment C 0 Set of all shipments including dummy initial shipment C ∪ {0} C N Set of all shipments including dummy last shipment C ∪ {N } M A sufficiently large constant integer

Literature Review
Port container terminal operations have received significant attention and many studies are dedicated to the sub-problems described earlier: See [1] for a classification of these subproblems. Recent work often consider the integration of two or three problems but very few papers propose formulations covering all the sub-problems jointly. Some papers give mathematical formulations of integrated problems but only use heuristic approaches given the computational complexity of solving the models. This section reviews recent publications addressing the integrated problems and highlights their contributions. Chen et al. [3] propose a hybrid flowshop scheduling problem (HFSP) to schedule QCs, YTs, and YCs jointly. Both outbound and inbound operations are considered, but outbound operations only start after all inbound operations are complete. In the proposed mathematical model, each stage of the flowshop has unrelated multiple parallel machines and a tabu-search algorithm is used to address the computational complexity. Zheng et al. [22] study the scheduling of QCs and YCs, together with the yard storage and vessel stowage plans. The authors consider an automated container handling system, in which twin 40 QCs and a railed container handling system is used. A rough yard allocation plan is maintained to indicate which blocks are available for storing the outbound containers from each bay. No mathematical model is provided, and the yard allocation, vessel stowage, and equipment scheduling is performed using a rulebased heuristic.
Xue et al. [21] propose a mixed integer programming (MIP) model for integrating the yard location assignment for inbound containers, quay crane scheduling, and yard truck scheduling. Non-crossing constraints and safety distances between QCs are ignored, and the assignment of QCs and YTs are predetermined. The yard location assignment considers block assignments instead of container slots. The resulting model cannot be solved for even medium-sized problems. Instead, a two-stage heuristic algorithm is employed, combining an ant colony optimization algorithm, a greedy algorithm, and local search.
Chen et al. [5] consider the integration of quay crane scheduling, yard crane scheduling, and yard truck transportation. The problem is formulated as a constraint-programming model that includes both equipment assignment and scheduling. However, non-crossing constraints and safety margins are ignored. The authors state that large-scale instances are computationally intractable for constraint programming and that even small-scale instances are too timeconsuming. A three-stage heuristic algorithm is solved iteratively to obtain solutions for large-scale problems with up to 500 containers.
Wu et al. [18] study the scheduling of different types of equipment together with the storage strategy in order to optimize yard operations. Only loading operations for outbound containers are considered, and the tasks assigned to each QC and their processing sequence are assumed to be known. The authors formulate models to schedule the YCs and automated guided vehicles (AGV), and use a genetic algorithm to solve large-scale problems.
Homayouni et al. [6] study the integrated scheduling of cranes, vehicles, and storage platforms at automated container terminals. They consider a splitplatform/retrieval system (SP-AS/RS), which includes AGVs and handling platforms for storing containers efficiently and providing quick access. A mathematical model of the same problem is proposed in [7]. In these studies, both outbound and inbound operations are considered. The origin and destination points of the containers are assumed to be predetermined and, in addition, empty for inbound containers. The earlier study proposes a simulated annealing (SA) algorithm to Lu and Le [12] propose an integrated optimization of container terminal scheduling, including YTs and YCs. The authors consider uncertainty factors such as YT travel speed, YC speed, and unit time of the YC operations. The assignment of YTs and YCs are not considered, and pre-assignments are assumed. The objective is to minimize the operation time of YCs in coordination with the YTs and QCs. The authors use a simulation of the real terminal operation environment to capture uncertainties. The authors also formulate a mathematical model and propose a particle swarm optimization (PSO) algorithm. As a future study, they indicate that the scheduling for simultaneous outbound and inbound operations should be considered for terminals adopting parallel operations.
Although most papers in container port operations focus on individual problems, recent developments have emphasized the need and potential for coordinating these interdependent operations. This paper pushes the state-of-the-art further by optimizing all operations holistically and demonstrating that constraint programming is a strong vehicle to address this integrated problem.

The MIP Model
The MIP decision variables are presented in Model 1, while the objective function and the constraints are given in Model 2. They use the formulation of QC interference constraints from [2].

Model 2 The MIP Model for the IPCTP: Objective and Constraints
Objective minimize s∈S Cmaxs (2-01)

Constraints
Cmaxs ≥ ws (sqci + Qi) ∀s ∈ S, ∀i ∈ C s l (2-02) syi,j = m∈Lu (tyc m,l i * xi,m) ∀i ∈ Cu, ∀j ∈ C l (2-16) syi,j = m∈Lu l∈Lu (tyc m,l * xi,m * x j,l ) ∀i, j ∈ Cu (2-17) syi,j = m∈Lu (tyc l i ,m * xi,m) ∀i ∈ C l , ∀j ∈ Cu (2-18) The first set of MIP variables are binary: They determine the yard location of every inbound shipment and the (immediate) successor relationships on the cranes. The remaining variables are essentially devoted to the start times and the travel times of the shipments.
The objective function (2-01) minimizes the maximum weighted completion time of each vessel. Constraints (2-02-2-03) compute the weighted completion time of each vessel. Inbound shipments start their operations at a QC and finish at a YC, whereas outbound shipments follow the reverse order. Constraint (2-04) expresses that each available storage block stores at most one inbound shipment. Constraint (2-05) ensures that each inbound shipment is assigned an available storage block. All the containers of a shipment are assigned to the same block. Constraints (2-06-2-07) assigns the first (dummy) shipments to each QC and YC and Constraints (2-08-2-09) do the same for the last (dummy) shipments. Constraint (2-10) states that every shipment is handled by exactly one eligible QC. Constraints (2-11-2-12) ensures that each shipment is handled by a single YC. In Constraint (2-12), yard blocks are known at the beginning of the planning horizon for outbound shipments: They are thus directly assigned to the dedicated YCs. Constraints (2-13-2-14) guarantee that the shipments are handled in welldefined sequences by each handling equipment (QC and YC). Constraint (2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)(15) defines the YT transportation times for the inbounds shipments. Constraints (2-16-2-18) specify the empty travel times of the YCs according to yard block assignments of the shipments. Constraints (2-19-2-22) specify the relationship between the start times of two consecutive shipments processed by the same handling equipment. Constraints (2-23-2-24) are the precedence constraints for each shipment, which again differ for inbound and outbound shipments. Constraint (2-25) ensures that, if shipment i precedes shipment j on a QC, shipment j cannot start its operation on that QC until shipment i finishes. Constraint (2-26) guarantees that shipments that potentially interfere are not allowed to be processed at the same time on any QC. Constraint (2-27) imposes a minimum temporal distance between the processing of such shipments, which corresponds to the time taken by the QC to move to a safe location.

The Constraint Programming Model
The CP model is presented in Model 3 using the OPL API of CP Optimizer. It uses interval variables for representing the QC handling of all shipments and the YC handling of inbound shipments. In addition, a range of optional interval variables are used to represent the handling of shipment i on QC j, and the handling of shipment i at yard location k. The model also declares a number of sequence variables associated with each QC and YC: Each sequence constraint Constraints alternative (qci, all (j in QC (i)) aqci,j) ∀i ∈ C (3-02) collects all the optional interval variables associated with a specific crane. Finally, the model declares a number of sequences for optional interval variables that may interfere. 1 The CP model minimizes the weighted completion time of each vessel by computing the maximum end date of the yard cranes (inbound shipments) and for the quay crane (outbound shipments). Alternative constraints (3-02) ensure that the QC processing of a shipment is performed by exactly one QC. Alternative constraints (3-03) enforce that each inbound shipment is allocated to exactly one yard location, and hence one yard crane. Constraints (3)(4) state that at most one shipment can be allocated to each yard location. Constraints (3-05) fix the yard location (and hence the yard crane) of outbound shipments. Cranes are disjunctive resources and can execute only one task at a time, which is expressed by the noOverlap constraints (3-06-3-07) over the sequence variables associated with the cranes. These constraints also enforce the transition times between successive operations, capturing the empty travel times between yard locations (constraints 3-06) and bay locations (constraints 3-07). Constraints (3-08) impose the precedence constraints between the QC and YC tasks of inbound shipments, while adding the travel time to move the shipment from its bay to its chosen yard location. Constraints (3)(4)(5)(6)(7)(8)(9) impose the precedence constraints between the YC and QC operations of outbound shipments, adding the travel time from the fixed yard location to the fixed bay of the shipment. Interference constraints for the QCs are imposed by constraints (3)(4)(5)(6)(7)(8)(9)(10). These constraints state that, if there is a conflict between two shipments and their QCs, then the two shipments cannot overlap in time, and their executions must be separated by a minimum time. This is expressed by noOverlap constraints over sequences consisting of the pairs of optional variables associated with these tasks.

Experimental Results
The MIP and CP models were written in OPL and run on the IBM ILOG CPLEX 12.7.1 software suite. The results were obtained on an Intel Core i7-5500U CPU 2.40 GHz computer.

Data Generation
The test cases were generated in accordance with earlier work, while capturing the operations of an actual container terminal. These are the first instances of this type, since the IPCTP has not been considered before in the literature. Travel and processing times in the test cases model those in the actual terminal. Different instances have slightly different times, as will become clear. Figure 3 depicts the layout of the yard side considered in the experiments, which also models the actual terminal. The yard side is divided into 3 separate fields denoted by A, B, and C. Each field has two location areas and a single YC is responsible for each location area, giving a total of 6 yard cranes. In each location area, there are 2 yard block groups, shown as the dotted region, and traveling between them takes one unit of time. Field C is the nearest to the quay side, and there is a hill from field C to field A. The transportation times for YTs are generated according to these distances. YTs can enter and exit each field from the entrance shown in the figure, so the transfer times between the vessels and the yard blocks close to the entrance take less time. YT transfer times are generated between [5,10] considering the position of the yard blocks. At the quay side, the travel of a QC between consecutive vessel bay locations takes 3 units of time.
The processing times of the cranes for a single container are generated uniformly in [2,5] for YCs and [2,4] for QCs. The safety margin for the QCs is set to 1 vessel bay. The IPCTP is expressed in terms of shipments and the number of containers in each shipment is uniformly distributed between [4,40].
The experiments evaluate the impact of the number of shipments, the number of vessel bays, the inbound-outbound shipment ratio, and the number of available yard locations for inbound shipments. The number of shipments varies between 5 and 25, by increments of 5. The instances can thus contain up to 1,000 containers. The number of vessel bays are taken in {4, 6, 8}. The number of QCs depends on the vessel bays due to the QC restrictions: There are half as many QCs as there are vessel bays. The inbound-outbound shipment ratios are 20% and 50%, representing the fraction of inbound shipments over the outbound shipments. Finally, the number of available yard locations (U-L ratio) is computed from the number of inbound shipments: There are 2 to 3 times more yard locations than inbound shipments. For each configuration of the parameters, 5 random instances were generated.

Computational Results and Analysis
The Results The results are given in Tables 2 and 3 for each configuration, for a total of 300 instances. Table 2 reports the results for 20% inbound-outbound ratio, and Table 3 for 50%. In the tables, each configuration is specified in terms of the U-L ratio, the number of bays and the number of shipments (Shp.). The average number of containers (Cnt.) in each shipment is also presented. For each such configuration, the tables report the average objective value and the average CPU time for its five instances. The CPU time is limited to an hour (3,600 seconds). The MIP solver did not always find feasible solutions within an hour for some or all five instances of a configuration. Note that this may result in an average objective value that is lower for the MIP model than the CP model, even when CP solves all instances optimally, since the MIP model may not find a feasible solution to an instance with a high optimal value. These cases are flagged by superscripts of the form x/y, where x is the number of infeasible and y is the number of suboptimal solutions in that average. The superscripts for CP indicate the number of suboptimal solutions. An entry 'NA' in the table means that the MIP cannot find a feasible solution to any of the five instances. For the MIP, the tables also report the optimality gap on termination, i.e., the gap in percentage between the best lower and upper bounds.
For CP, the experiments were also run with a CPU limit of 600 seconds. The relative percentage deviations (RPD%) from the 1-hour runs are listed to assess CP's ability to find high-quality solutions quickly. The RPD is computed  prove optimality for 103 instances. On all but the smallest instances, the MIP solver cannot prove optimality for all five instances of the same confguration.
In almost all configurations with 20 or more shipments, the MIP solver fails to find feasible solutions on at least one of the instances. In contrast, the CP model always find feasible solutions and proves optimality for 260 instances out of 300 instances. CP proves optimality on all but 12 instances in Table 3, and all but 28 in Table 2. On instances where both models find optimal solutions, the CP model is almost always 1-3 orders of magnitude faster (except for the smallest instances). Finally, the CP model always dominates the MIP model, in the sense that it proves optimality every time the MIP does.
Short Runs On almost all instances but the largest ones, the CP model finds optimal, or near optimal, solutions within 10 minutes. On the largest instances, longer CPU times are necessary to find optimal or near-optimal solutions.

Sensitivity Analysis
The sensitivity analysis is restricted to the CP model for obvious reasons. The sensitivity of each factor is analyzed by comparing their respective run times and objective values. In general, the effect of the number of bays on the solution values and on CPU times tend to be small. In contrast, increasing the U-L ratio from 2 to 3 gives inbound shipments more alternatives for yard locations, which typically increases CPU times. Increasing the ratio of inbound-outbound containers also increases problem difficulty. This is not a surprise, since inbound shipments are more challenging, as they require a yard location assignment, while outbound shipments have both their yard locations and vessel bays fixed. Nevertheless, the CP model scales reasonably well when this ratio is increased. These analyses indicate that the number of shipments/containers is by far the most important element in determining the computing times in the IPCTP: The other factors have a significantly smaller impact, which is an interesting result in its own right.

Conclusion
This paper introduced the Integrated Port Container Terminal Problem (IPCTP) which, to the best of our knowledge, integrates for the first time, a wealth of port operations, including the yard location assignment, the assignment of quay and yard cranes, and the scheduling of these cranes under realistic constraints. In particular, the IPCTP considers empty travel time of the equipment and interference constraints between the quay cranes. The paper proposed both an MIP and a CP model for the IPCTP of a configuration based on an actual container terminal, which were evaluated on a variety of configurations regarding the number of vessel bays, the number of yard locations, the ratio of inbound-outbound shipments, and the number of shipments/containers. Experimental results indicate that the MIP model can only be solved optimally for small instances and often cannot find feasible solutions. The CP model finds optimal solutions for 87% of the instances and, on instances where both models can be solved optimally, the CP model is typically 1-3 orders of magnitude faster and proves optimality each time the MIP does. The CP model scales reasonably well with the number of vessel bays and yard locations, and the ratio of inbound-outbound shipments. It also solves large realistic instances with hundreds of containers. These results contrast with the existing literature which typically resort to heuristic or meta-heuristic algorithms, with no guarantee of optimality. Future work will be devoted to capturing a number of additional features, including operator-based processing times, the stacking of inbound containers using re-shuffling operations, and the scheduling of the yard trucks.