Enhanced Ant Colony Algorithm for Discrete Dynamic Berth Allocation in a Case Container Terminal

<jats:p>Berth allocation is a critical concern in container terminal port logistics, involving the precise determination of where and when arriving vessels should dock along a quay. With berth space limitations and a continuous surge in container handling demands, ensuring an effective berth allocation is paramount for the smooth and efficient operation of container ports. However, due to the randomness of vessel arrival times and uncertainties surrounding container ship loading capacities, berth allocation problems (BAP) often present discrete and dynamic challenges. This paper addresses these challenges by considering real-world terminal operational factors, formulating relevant assumptions, and establishing a model for dynamic berth allocation and efficient ship berthing scheduling. The primary motivation stems from the parallels observed between the BAP problem and ant foraging path selection, leading to the proposal of a novel Parallel Search Structure Enhanced Ant Colony Algorithm (PACO). A proper set of parameters of the algorithm are selected based upon sensitivity analyses on the convergence and parallelism efficiency of the algorithm. To validate our method, a real-world case-container terminal operation in Shanghai Port was studied. The experimental comparison results show that the PACO algorithm outperforms other commonly used algorithms, making it more effective and efficient for the Discrete Dynamic Berth Allocation Problem (DDBAP).</jats:p>

section_content: The economic globalization accelerates the development of the marine transportation industry, which necessitates higher efficiency and productivity in container terminals. A container terminal in a harbor logistics operation consists of many physical resources such as containers, vessels, handling equipment, berths, container yards, and communication establishment [1]. The loading/unloading work is carried out by quay cranes (QCs), yard cranes (YCs), and container trucks (CTs) at a container terminal [2]. Referring to Figure 1, containers are delivered at a terminal by trucks and are stored in the terminal yard [3]. A vessel, loaded with containers, is allocated to a berth once it reaches the port. After that, its containers are unloaded and are temporally stored at the yard until being moved to trucks, trains, or vessels to be further delivered. QCs standing on the rail tracks along the quayside carry on the transshipment of containers from the waterside to the quayside [4]. 

One key issue in a particular container terminal (CT) is the scheduling of the quay space and serving time to ships that must be handled at a terminal [4, 5], which is generally categorized as the berth allocation problem (BAP). Each of the vessels will go through the following processes in a particular CT: in-bound to the port, waiting until the scheduled berthing time, mooring at the assigned berth, containers' loading/unloading, and then leaving the port. Apparently, the main problem is how to allocate the corresponding number of the berth to arriving vessels at the port, providing the berth time and location within a planning horizon period. The decision horizon is generally one week, while this may be updated based on the arrival and departure situation of vessels [6]. 

` One key issue in a particular container terminal (CT) is the scheduling of the quay space and serving time to ships that must be handled at a terminal 45, which is generally categorized as the berth allocation problem (BAP). Each of the vessels will go through the following processes in a particular CT: in-bound to the port, waiting until the scheduled berthing time, mooring at the assigned berth, containers' loading/unloading, and then leaving the port. Apparently, the main problem is how to allocate the corresponding number of the berth to arriving vessels at the port, providing the berth time and location within a planning horizon period. The decision horizon is generally one week, while this may be updated based on the arrival and departure situation of vessels 6. 

BAP problems can be divided into static (SBAP) or dynamic (DBAP) 7. The static BAP model assumes that all vessels reach the terminal earlier than the starting planning time, while a dynamic model defines the ships arriving at an arbitrary time of the planning period given future arrival data 8. The BAP problem can be further divided into discrete and continuous variants 9. In discrete cases, strictly one vessel can be accepted for each berthing location, that is, "berth"-one of the partitioned quay sections, at one time, regardless of its size. For the continuous cases, the quay is not segmented, i. e., ships can berth at arbitrary places within the boundaries of the quay, and consequently, the corresponding berth planning is more complex than that in a discrete case with a superiority of better quay space's utilization 10. 

Figure 2 shows the berth operation timeline for each vessel. The service time of a vessel at the port includes the waiting time between the arrival of the vessel and the vessel berthing time as well as the handling time for containers loading or unloading. For BAP, as an NP-hard scheduling problem [11], with the aim of a high efficiency in CT operations, researchers keep seeking for its better solution. Nevertheless, there is a distinct lack of comprehensive solutions that cater to the dynamic nature of container terminals. These solutions need to consider the evolving vessel type dynamics, arrival time, and distinctive handling time seamlessly. This gap underscores the need for a novel algorithmic approach that can adeptly address these multifarious factors. BAP problems can be divided into static (SBAP) or dynamic (DBAP) [7]. The static BAP model assumes that all vessels reach the terminal earlier than the starting planning time, while a dynamic model defines the ships arriving at an arbitrary time of the planning period given future arrival data [8]. The BAP problem can be further divided into discrete and continuous variants [9]. In discrete cases, strictly one vessel can be accepted for each berthing location, that is, "berth"-one of the partitioned quay sections, at one time, regardless of its size. For the continuous cases, the quay is not segmented, i. e., ships can berth at arbitrary places within the boundaries of the quay, and consequently, the corresponding berth planning is more complex than that in a discrete case with a superiority of better quay space's utilization [10]. 

Figure 2 shows the berth operation timeline for each vessel. The service time of a vessel at the port includes the waiting time between the arrival of the vessel and the vessel berthing time as well as the handling time for containers loading or unloading. For BAP, as an NP-hard scheduling problem [11], with the aim of a high efficiency in CT operations, researchers keep seeking for its better solution. Nevertheless, there is a distinct lack of comprehensive solutions that cater to the dynamic nature of container terminals. These solutions need to consider the evolving vessel type dynamics, arrival time, and distinctive handling time seamlessly. This gap underscores the need for a novel algorithmic approach that can adeptly address these multifarious factors. 

. Timeline of vessels staying at a port. 

Addressing this research gap begets pertinent questions: How can an algorithm that seamlessly integrates varying vessel types, safety regulations, and operational complexities while maintaining optimization efficiency be devised? How does the proposed algorithm perform across diverse operational conditions and constraints? Answering these questions is imperative to bridge the divide between theoretical Addressing this research gap begets pertinent questions: How can an algorithm that seamlessly integrates varying vessel types, safety regulations, and operational complexities while maintaining optimization efficiency be devised? How does the proposed algorithm perform across diverse operational conditions and constraints? Answering these questions is imperative to bridge the divide between theoretical optimization and the practical realities of container terminal operations. 

In the development of intelligent optimization algorithms, ant colony algorithms have been proven to be effective in solving various types of NP-hard problems [12]. On the basis of reviewing research work, this work's primary contribution lies in the formulation and validation of the Parallel Search Structure Enhanced Ant Colony Algorithm (PACO). Designed to surmount the limitations of conventional methods, PACO introduces an innovative approach inspired by ant foraging behaviors. Its parallel search structure enhances exploration, minimizing the risk of converging towards local optima. Furthermore, this study introduces a holistic model that effectively marries theoretical optimization with the intricate dynamics of real-world container terminal operations. 

The rest of the paper is organized as follows. Section 2 expatiates on the related literature review; the detailed description of the problem and the mathematics models of DDBAP are addressed in Section 3; Section 4 introduces the ant colony algorithm and argues for the parallel ant colony algorithm for solving the DDBAP models; the case experiments and the analysis results are illustrated in Section 5; and the summary of the work is drawn in the last section.
section_name: Introduction

section_content: The berth allocation problem (BAP) entails assigning incoming vessels to berth positions. Moreover, the BAP problems are often discrete and dynamic owing to the randomness of the arriving time of those container vessels and their loading capacities. At present, many scholars have proposed new solutions and methods for the berth allocation problem. Issam, E. H. et al. [13] investigated the Dynamic Berth Allocation Problem (DBAP) and provided a multi-objective mathematical model; the validity of the model was verified by numerical experiments. Hsu, H. P. [14] proposed a hybrid particle swarm optimization (PSO) algorithm, which combined the improved PSO algorithm with the event-based heuristic algorithm to solve the DDBAP problem and dynamic QCAP (DQCAP) seaside operation planning problems. Hu, Z. H. [15] proposed a multi-objective genetic algorithm (moGA) based on two-part representation to solve the two-objective model. Lin, S. W. et al. [16] studied a DDBAP problem, whose objective is to minimize the total service time, and introduced an iterative greedy (IG) algorithm to solve it. Türko gulları. et al. [17] focused on the integrated seaside operations, namely, the coordination of the berth assignment, quay crane allocation, and quay crane scheduling problems For DBAP, Simrin et al. [18] introduced a new mathematic model, where a non-linear mixed integer program was established to formulate the problem, converting it to be an equivalent mixed integer program (MIP). Kovač N et al. [19] proposed an enhanced evolution algorithm for the BAP to optimize the total waiting time of all ships. Kordić S et al. [20] provided an accurate combinatorial method for addressing the DBAP problem and the Hybrid BAP with given vessel loading/unloading times based on the Sedimentation Algorithm (SA). Budipriyanto A. et al. [21] studied the influence of uncertainty on the coordination between berths. It was verified that the cooperative strategy can improve the total waiting time, container processing time, and total vessel turnover time. Xiang, X. et al. [22] examined the berth allocation problem by analyzing uncertainties, and a dual-target robust BAP model focused on economic effectiveness and consumers' satisfaction was developed. 

It is not difficult to see from the above research that many scholars have designed many different algorithms to solve the BAP problem from different directions. Since continuously arriving vessels can be considered as jobs and discrete berths can be considered as parallel machines, the DDBAP problem can be converted as a parallel-machine scheduling problem [23], which is NP-hard in a strong sense [24]. The general object of berth planning is to obtain quick and credible services for vessels, which are referred to the various objective functions in the research articles. Among them, models are always formulated to optimize the sum of the waiting and processing time of ships (i. e., the time of staying in a port) [4]. Thus, in this paper, DDBAP is still the focus, and the mathematics model that dynamically allocates the berth and schedule vessels to the moor berth efficiently under the goal of optimizing the sum of the waiting as well as the total processing time of vessels in the port during a certain time is proposed with full consideration of related constraints. 

Many heuristic algorithms, such as the Genetic Algorithm (GA), Differential Evolution (DE), and Simulated Annealing (SA), have been applied to solve the BAP, as mentioned previously. Ant Colony Optimization (ACO) has successfully shown feasibility in many NP-hard combinatorial optimization problems, such as vehicle routing problems, quadratic assignment problems, other scheduling problems, etc. [24]. GA offers global optimization capabilities, yet it may be slower for dynamic scenarios. DE excels in non-linear optimization but could struggle with complexity. SA has a probabilistic advantage but requires parameter tuning. Ant Colony Optimization (ACO) is adept at combinatorial problems but can be slow in large-scale scenarios. To better solve these problems, the improved ACO is then proposed based on the original ACO algorithm. It increases the number of slave processors and makes multiple processors perform calculations at the same time. It can effectively improve the deficiencies of the ACO with the ease of sinking into the local optimum. 

After comparing and analyzing several typical logistics scheduling algorithms [25] [26] [27] [28] [29] [30] [31], Randall, M et al. examined several parallel decomposition strategies and applied them to a particular problem, that is, the travelling salesman problem, leading to a result of better efficiency and computing speeds [26]. Yu M et al. proposed a predictive two-stage path planning algorithm [27, 28]. It alleviates traffic congestion, avoids collisions, improves the efficiency of automated terminal loading and unloading, and considers road congestion factors. Li H T et al. proposed a dynamic ant colony genetic algorithm on the basis of the extensive research of the ant colony algorithm, genetic algorithm, and other related algorithms [29]. Based on the efficiency of enterprise workshop distribution operations, the allocation of the shop floor location is studied, and a coordinated optimization model of automatic guided vehicle berth assignment and material box allocation based on a genetic algorithm is proposed in the simulation environment [30]. Niu M et al. considered the time and space constraints between the ship entry and exit and ship berthing, focused on the realistic limitations caused by the berthing problem caused by the ship berthing priority, designed an immunogenetic algorithm to solve this, and gave a berth allocation scheme, a berthing scheme, and a ship entry and exit scheduling scheme [31]. The basic concepts and ideas of the genetic algorithm are introduced. At the same time, the function of some algorithms derived from the genetic algorithm is proposed. Zhang M et al. proposed an improved ACO algorithm, namely, 3D-PACA, which was implemented to identify and scan 3D terrains and achieved certain results [32]. 

To sum up, it can be seen from the above research that the parallel ACO algorithm, as an improvement of the ACO algorithm, has been applied in other fields and can be used to solve the practical problems. Therefore, it motivates us to apply it to the dynamic berth allocation problems.
section_name: Literature Review

section_content: Since each container has a different transit time from its original storage area to its assigned berth, each vessel has a different handling time at different berths. However, the vessel handling time is assumed to be deterministic in most published BAP models because the vessel handling time has been considered in different ways: (e) All the mentioned conditions (b-c) need to be handled at the same time. 

In this paper, the handing time relies on the number of cranes serving the vessel, the transshipment volume of containers, and the working performance of the assigned cranes. There are m vessels (i. e., vessels 1, 2,. . ., m) and m b berths (i. e., berths 1 b, 2 b,. . ., m b ). Assume that each vessel is served by only one berth at a time and each berth can handle one vessel at a time. If a vessel g starts serving at a berth, it will remain there continuously for the next time unit. 

The DDBAP considered here is considered to be a parallel machine scheduling problem, with vessels being jobs and berths being machines [33]. Job j has a processing time p j, a lease date a j, a weight w j, and a set of machines that are capable of processing the job j. The processing time p j, is determined by the quantity of working quay cranes and the efficiency of the cranes (the processing time depends on the quantity of cranes serving the vessels and the crane efficiency). To define our problem mathematically, the problem of sequencing vessels at a single berth is defined first. And then, the problem of allocating and sequencing vessels at multi-berths is modeled mathematically.
section_name: Problem Statement and Model Formulation

section_content: All notations of this paper are described in alphabetic order, including model-related notations and algorithm-related notations. O i : An ordered subset of vessels to be loaded/unloaded at berth i; t ij b : Moment of vessel j starting to berth at berth i; t j w : Arrival moment of vessel j to the waiting area, t j w ≥ 0;
section_name: Notation

section_content: T j b : Time duration of a vessel to berth and leave, assumed to be fixed and the same for different vessels, T j b > 0;

The finishing moment of loading/unloading vessel j at berth i, t ij fl = t ij l + T ij l ;

The beginning moment of loading and unloading vessel j at berth i; T ij l : Duration of loading and unloading vessel j at berth i; a function of n j l, n j cap, and n j c ;

PACO-Related Notations d ij' : Time distance between vessels j and j ; e(j,j ): Edge connecting i and j; t k (i):

The length of time during which the kth ant starts from berth i to the end through all sections of the path; Q:

Constant, the amount of information released by an ant after the complete path search is complete; L k :

The path length through which the kth ant passes; n ant : Quantity of ants in a colony; n con : Quantity of iterations of convergence; n max itr : Maximum allowable number of iterations;

n itr : Current number of iterations; n k (s): Notation of the number of nodes passed by the current ant k in the step s; p jj' k (o i ): Probability of ants k choosing vessel j' from vessel j as the next candidate within the ordered subset of berth i; α:

Adjustable parameters controlling the relative impact of pheromone trajectories τ jj (t);

β: Adjustable parameters controlling the relative impact of heuristic desirability; ρ:

Constant, a coefficient of evaporation; 0 < ρ < 1(1ρ) expresses pheromone decay during t and t + 1; τ jj (t):

The intensity of the trail on edge (j,j ) at time t;

η jj (t):

A heuristic measure of the desirability of adding edge (j,j ) to the solution being built; ∆τ jj :

A total incremental quantity of the pheromones laid by all ants on edge (j,j );

An incremental quantity of pheromones laid by the kth ant on edge (j,j ) during time t and time t + 1, which is a function of the length L k of tour T k (t):

Decision variable; number of quay cranes assigned to the vessel j; x ijo : Binary decision variable, with a value of one when vessel j at berth i is served at service time t and a value of 0 otherwise;
section_name: Notation

section_content: A single-berth allocation is just to sequence coming vessels in order to minimize the turn-around time (i = 1). The scheme of berth allocation can be realized by the following model:

The objective function ( 1 ) is to minimize the total time of the ship in a certain period that is the overall waiting time (the sum of time spent waiting to be berthed and operated by quay cranes), handling time T ij l, and berthing/departure time. Constraints (2) mean that each vessel has only one chance of berthing. Bind (3) ensures that one vessel or less is restricted to the moor at one berth at any moment. Bind (4) is the setup time it takes for vessel j to be processed with loading/unloading, which is no less than 0 to ensure that each vessel must be served after arrival. Bind (5) means the vessel j waiting time; this is no less than 0. Bind (6) announces a decision variable x 1jk, being a 0-1 variable [28].
section_name: Single-Berth Model

section_content: Mostly, there is more than one berth in every container terminal, so the multi-berths allocation problem is to solve not only how to sequence the loading/unloading of vessels but also to allocate berths to vessels to berth first. 

The berth allocation model follows the following assumptions:

1. 

The vessels arrival time is random; 2. 

The vessel loading and unloading times are derived from the number of containers, the quantity of QCs, the productivity of QCs, and other related factors;
section_name: Multi-Berth Model

section_content: The mooring space must conform to the real conditions of the vessel (depth and length of water) of the constraints; 4. 

The vessels moving from one berth to another will not be considered, where each vessel has only one berth opportunity; 5. 

The number of assigned QCs does not exceed the number of QCs allowed to work simultaneously; 6. 

When a large quantity of Quay Cranes (QCs) operates on a single vessel simultaneously, they can influence each other, potentially affecting the overall utilization rate of QC s. In cases where more than two terminal container cranes are operating simultaneously, one of them operates at a reduced capacity, typically around 90%. 

The berth assignment plays a significant role in the minimization of the turnaround time, which is one of the key indicators in evaluating the port operations. The purpose of berth allocation can be formulated as Equation (7). 

Here, p 1 is the service efficiency of the quay crane loading and unloading container vessel j; k 1 is the conversion coefficient of TEUs; k 2 is the co-operation rate of quay cranes; when n j c = 1, k 2 = 1; otherwise, k 2 = 90%; k 3 is the reordering rate of containers for container vessels. 

(

D j s is the draft depth of vessel j; D i b is the draft depth of berth i; L j s is the length of vessel j; L i b is the length of berth i;

The terms of the equation were given in Section 3. 1. The objective in ( 7 ) is to minimize the total time of the container vessels in a port during a certain period, that is, the total waiting time and processing time T ij l. Constraint (8) represents that each vessel has a chance to berth. Constraint (9) ensures that no more than one vessel is allowed to moor at one berth at any moment. Constraint (10) is the estimation of the vessel handling time; Constraint (12) is the loading and unloading time of vessel j, which is non-negative to ensure that each vessel must be serviced upon arrival [28]. Constraint (13) means the vessel j waiting time, which is non-negative. Constraints ( 14 ) and (15) emphasize that the distribution must conform to the physical conditions of the berth (depth and length). Constraint (16) declares that the decision variable x ijo is a 0-1 variable.
section_name: 3.

section_content: In this section, the basic principle of the ACO algorithm is discussed first, and then the modified ant colony algorithm for DDBAP is proposed. By comparing the parallel ant colony algorithm with the traditional ant colony algorithm, the parallel ant colony algorithm and its advantages in solving the berth allocation problem are analyzed.
section_name: Solution Algorithm

section_content: Berths are the main resources in the container terminal, berth allocation is the primary content of the formulation of the terminal loading and unloading operation plan, and the operation arrangements of the container terminal are all carried out around the arrangement of the berth allocation plan. The robustness of berth allocation stability in uncertain environments is important. 

Due to the limited number of berths at the terminal, the container terminal needs to make overall arrangements in advance for the berthing location and berthing time of the ships to be arriving during the planning period to improve the overall operational efficiency and service quality of the terminal. According to the shipping company's estimated arrival plan, the terminal can obtain the estimated arrival time, estimated departure time, and estimated loading and unloading time of each ship during the planning period and formulate the corresponding berth allocation plan accordingly. However, in the actual process, the actual arrival time of the ship is often affected by a variety of uncertainties, and there will be a certain deviation relative to the expected arrival time. However, the scheduling plan for the other facilities at the terminal is based on the original berth allocation plan, and this temporary adjustment will result in loading and unloading difficulties in terms of both time and cost. Moreover, due to the inevitable blindness and short-sightedness of temporary adjustments, frequent adjustments will seriously disrupt the normal operation order of the dock and reduce the overall operation efficiency of the wharf. Therefore, when formulating the berth allocation plan, it is one-sided to simply take the service efficiency of the ship as an evaluation index, and the thinking on the anti-interference ability of the plan in an uncertain environment should also be added, that is, the robustness of the plan. The ant colony algorithm has strong parallelism and robustness when solving the berth allocation problem. 

At present, the intelligent algorithms used to solve difficult problems with high complexity in time and space mainly include genetic algorithms, neural network algorithms, taboo search algorithms, simulated annealing algorithms, and ant colony algorithms. Genetic algorithms take the population as the solution unit, and the solution efficiency is high and widely used. Neural network algorithms have strong self-learning and adaptive abilities, but the algorithm is slow to converge. The probability of the contraindicated search algorithm seeking the optimal solution is large, and the algorithm convergence is good, but it has a strong laziness regarding the initial solution. The solution process of the simulated annealing algorithm is simple and easy to combine with other algorithms, but the solution time is long, and the performance of the algorithm is more sensitive to the selection of parameters. The ant colony algorithm has strong parallelism and good robustness. Therefore, when formulating the berth allocation plan, it is one-sided to simply take the service efficiency of the ship as an evaluation index, and the thinking on the antiinterference ability of the plan in an uncertain environment should also be added, that is, the robustness of the plan, so the text considers the use of the ant colony algorithm. 

In ant colony optimization (ACO), it is known that ants communicate through aromatic substances called pheromones, which are inspired by the collective behavior of ant colonies searching for food [34, 35]. Ants that find food return to their nests and mark their tracks with pheromones. By laying and tracking these pheromone tracks, ants can find a good proximity of the shortest path between the food source and nest [36]. 

The berth allocation and scheduling problem exhibits strong similarities with the ant colony routing problem. In this context, each vessel can be seen as a dynamic node seeking the optimal route to its destination within the terminal. It is well-documented that the ant colony algorithm, when applied to routing problems, operates in a distributed manner, offering positive feedback and demonstrating global convergence [37]. The idea is that if ants must choose among different paths at a given point, the ants that are strictly chosen by the preceding ants (i. e., those with high path levels) will be selected with a higher probability.
section_name: The Basic Principle of the Ant Colony Algorithm

section_content: For large-scale optimization problems, solving with a parallel ant colony algorithm will shorten the computation time and build a good foundation for the practical application of the algorithm. In an artificial ant colony algorithm, each ant is independent of the construction of the solution, and it can communicate with others indirectly through pheromones. This natural parallelism of the ACO algorithm provides a good foundation for the parallel implementation of the algorithm [38]. Therefore, it is feasible to transform the serial ant colony algorithm into a parallel ant colony algorithm. 

The basic idea of the parallel ant colony algorithm is to divide one ant colony (m ants) in the original serial algorithm into P ant colonies. The number of ants in each ant colony is m/P, and there is a processor for each sub-ant colony. The number of ants in different ant colonies can be equal or unequal. If the processor performance is the same, the number of ants is generally equal. 

To solve the problem that the ant colony algorithm tends to fall into local optimal solutions, each ant colony in a parallel ant colony algorithm separately searches the solutions [39]. Each subprocessor follows the basic principles of the ACO algorithm and calculates the best solution. After each iteration, each sub-processor needs to communicate with the main processor and other sub-processors to obtain information from them. When the termination condition of the parallel ACO algorithm is met, one of the processors collects the optimal solution of each sub-ant colony and outputs the global optimal solution which is shown as Figure 3.
section_name: The Basic Principle of the Parallel Ant Colony Algorithm

section_content: Given n set of nodes {1,2,. . ., n} and the travel time between every two nodes, the goal is to find a route that takes the minimum time to travel around every node and return to the starting point. If each node is considered as one of the graph nodes, and the time t jj is sought for a weight connecting vertices v j and v j, then the objective is to discover the shortest cycle within the complete graph with n nodes. 

Artificial ant k (k = 1, 2. . . m) decides the direction in which to move according to the amount of information on each path in the process of movement. Unlike the real ant system, the ant colony system has a memory function, a certain vision in a discrete environment. With the time passed, the information before was gradually faded, so after n itr moments when the ant completes a cycle path, the amount of information should be adjusted. Each artificial ant behavior should be in accordance with the following rules. 

(1) According to the concentration of hormones on the path, the ant selects the next path with the corresponding probability. 

(2) The ant no longer chooses nodes for the next path, which have been passed in this cycle, by using a data structure (tabu matrix) to control. (3) After completing a cycle, the ant releases pheromones in corresponding concentrations according to the length of the path and updates the pheromone concentration of the traversed path. In the initial stage, m ants are randomly placed on nodes with an equal amount of information on each path. 

` the serial ant colony algorithm into a parallel ant colony algorithm. 

The basic idea of the parallel ant colony algorithm is to divide one ant colony (m ants) in the original serial algorithm into P ant colonies. The number of ants in each ant colony is m/P, and there is a processor for each sub-ant colony. The number of ants in different ant colonies can be equal or unequal. If the processor performance is the same, the number of ants is generally equal. 

To solve the problem that the ant colony algorithm tends to fall into local optimal solutions, each ant colony in a parallel ant colony algorithm separately searches the solutions [39]. Each subprocessor follows the basic principles of the ACO algorithm and calculates the best solution. After each iteration, each sub-processor needs to communicate with the main processor and other sub-processors to obtain information from them. When the termination condition of the parallel ACO algorithm is met, one of the processors collects the optimal solution of each sub-ant colony and outputs the global optimal solution which is shown as Figure 3. Suppose τ jj (0) = τ 0 (τ 0 is constant). Ants autonomously choose the next path node based on the amount of information on the path. At the moment t, ant k from node j to node j is the probability given as Equation (17). 

where allowed k = {1, 2,. . ., n}-tabu k means all nodes are permitted to go to the next step, and tabu k records all of the passed nodes of ant k. When all nodes are put into tabu k, ant k will finish one cycle, and the path traversed by ant k is a solution to the problem. η jj is a heuristic factor that represents the desired degree for the ant to move from node i to node j, where η jj = 1/C jj and C jj is the required time passing from node j to node j. Parameters α and β control the relative significance of the trajectories and [40]. Thus, the transition probability is a balance between the visibility and trajectory strength at time t. Let τ jj (t) be the intensity of the trail on edge (j,j ) at time t. Each ant chooses the next node at time t, where it will be at time t + 1. At this point, the tension trajectory is updated as Equation (18). 

Here, the coefficient ρ is such that (1ρ) represents the evaporation of the trail between time t and t + n. 

where ∆τ k ij is the number per unit of the length of the trail substance (the pheromone in real ants) laid on the edge (j,j ) by the k-th ant between time t and t + n; it is given by Equation (20). 

if the kth ant goes from ito j between time t and t + 1 0 otherwise (20) where L k is the tour length of the k-th ant, which is equal to the sum of time taken on each route for the k-th ant. The greater the total path time is, the lower the unit pheromone concentration released. Obviously, the ants do not release pheromones in any path they had not experienced. 

In the ant-density model, trajectories of quantity Q are left on the edge (j,j ) when an ant goes from i to j. In the ant-quantity model, an ant leaves a quantity Q/di of the trail on the edge (j,j ) when it goes from i to j. 

Therefore, in the ant-density model, the quantity per unit of length of the trail substance is as shown in Equation ( 21 ):

Q if the kth ant goes from j to j between time t and t + 1 0 otherwise (21) And in the ant-quantity model, the amount of trail material per unit length is as shown in Equation ( 22 ):

if the kth ant goes from j to j between time t and t + 1 0 otherwise

From these definitions, it is clear that the increase in edge trajectories (j,j ) as ants go from j to j is independent of dij in the ant density model, whereas in the model, it is inversely proportional to djj in the ant-quantity model (i. e., shorter edges are made more desirable by ants in the ant-quantity model). 

In addition, some parameters including α and β in the ant colony algorithm have a great influence on the performance of the algorithm. Through the analysis of parameters in the ant system by Oliver30, M. Dorigo has found that when α = {0. 5, 1}, β = {1, 2, 3, 4, 5}, the ant system can always converge to the optimal solution, and when m (the number of ants) is close to n (the number of nodes), the algorithm has a better performance.
section_name: PACO for BAP

section_content: A fixed-length solution is used in PACO to represent (Figure 4 ). It encodes the order of vessels scheduling at each berth, not the berthing time. The order in which a vessel is serviced does not imply that the vessel can only berth after the service of its predecessor has been completed. It is used to specify the order in which a vessel begins to berth, i. e., the vessel's berthing time must be greater than or equal to the berthing time of its predecessor. Given the dispatch order of vessels, their berthing time can be easily calculated by considering Constraints (4)-( 6 ) described in Section 4. 3 of the problem formulation.
section_name: Solution Encoding

section_content: Berth assignment is known as a parallel machine scheduling problem, which is not only about assigning berths to vessels but also about sequencing the service for the vessel [28]. Considering the interaction between berths and storage yards, the collaborative optimization of the berth allocation and storage yard is studied from the perspective of ships in a certain planning period [40]. Each vessel is considered as a node (equivalent to a city in the TSP problem). 

The travelling salesman problem (also called the travelling salesperson problem or TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?" It is an NP-hard problem in combinatorial optimization and is important in theoretical computer science and operations research. The steps of PACO for the berth allocation problem are followed in Figure 5 [41]. 

During the initialization phase, suppose the time t = 0 and the cycle number n irr = 0, and set the maximum number of cycles n itr max. m ants are placed on n nodes (arriving container vessels to berth), the initial quantity of information on each edge is (j,j ), and τ ij (0) = const, where the initial quantity per unit ∆τ ij (0) = 0. 

Fitness function evaluation steps:

(1) Individual ants select elements (container vessel) j to go according to the probability calculated through the state transition probability formula (3), where j ∈ tabu k, c jj is a time equal to vessel j's time of completion minus vessel j's arrival time, and l k is the path of all nodes the ant has walked, namely, the total time of all vessels staying in the port.
section_name: PACO for the Berth Allocation Problem

section_content: Berth assignment is known as a parallel machine scheduling problem, which only about assigning berths to vessels but also about sequencing the service for the [28]. Considering the interaction between berths and storage yards, the collab During the initialization phase, suppose the time t = 0 and the cycle number n irr = 0, and set the maximum number of cycles n itr max. m ants are placed on n nodes (arriving container vessels to berth), the initial quantity of information on each edge is (j,j′), and τij′(0) = const, where the initial quantity per unit ∆τij′(0) = 0. 

Fitness function evaluation steps:

(1) Individual ants select elements (container vessel) j to go according to the probability calculated through the state transition probability formula (3), where j ∈ tabu k, cjj′ is a time equal to vessel j's time of completion minus vessel j's arrival time, and lk is the path of all nodes the ant has walked, namely, the total time of all vessels staying in the port. (2) Modify the tabu search list pointer that is for ant j to move to the new element (container vessel) after choosing, and put the element (container vessel) into the individual ant's tabu search list. (3) If the elements (container vessels) in Set C have not been traversed, which means k < m, then k = k + 1; otherwise, continue.
section_name: PACO for the Berth Allocation Problem

section_content: In this section, the proposed PACO algorithm is verified based on a series of
section_name: Numerical Experiments

section_content: In this section, the proposed PACO algorithm is verified based on a series of experiments. This part of the research data is obtained by the investigation of Shanghai Port. By analyzing the berth allocation data of container terminals for 24 consecutive hours, the experimental results are reliable and authentic.
section_name: Numerical Experiments

section_content: In order to conduct numerical analysis, it is necessary to first determine the values of a few parameters. 

Based on a survey at a four-berth container terminal of the Shanghai Port (time, reference number, and/or other information about the survey), when a group of 20 vessels came into a port at the same time, a certain period was chosen at random. Table 1 shows the time intervals in between the vessels' arrival (to simplify, the first vessel's arrival time is used as a reference, and the time is set as 0) and the processing time for loading/unloading. Note: The time interval between vessels arriving at the port refers to the time interval between two ships in a row, such as the time interval between vessels one and two, which is 13. 5 h, and the time interval between ships two and three, which is 8 h.
section_name: Determination of Parameter Values

section_name: Results of Single-Berth Allocation

section_content: Using the arrival time and loading/unloading time of the 20 known vessels, the ant colony algorithm can calculate the total time of arrival of all vessels in the port. In this experiment, Q = 100; α = 1, β = 5, ρ = 0. 5; the maximum number of iterations is 200 times and the ant population C a equals 5. 

By MATLAB programming, the ant colony algorithm can solve the problem of berth allocation. The total time of the 20 vessels in the port is 1095. 02 h, and the berthing order is as follows:

1-2-3-6-10-8-11-14-15-19-16-20-17-13-7-9-18-12-4-5

The abscissa shown in Figure 6 represents the number of iterations, while the ordinate reflects the total time spent in the port by all vessels. As the number of iterations grows, the total port time of the boats steadily lowers and ultimately stabilizes, as seen in Figure 6.
section_name: Based on ACO

section_content: Referring to the basic concepts of the parallel ACO algorithm and the process of solving the single-berth problem, the parallel ACO algorithm is programmed in MATLAB. In this experiment, six computers are used as the sub-processors. The calculated total ship processing time in the port is at least 1054. 93 h. The order of the berthing of the ship corresponding to this result is:

1-2-3-8-6-9-11-10-7-14-16-19-12-13-17-18-15-20-4-5

The abscissa represents the number of iterations, while the ordinate reflects the total time spent in the port by all vessels. As the number of iterations grows, the total port time of boats steadily lowers and ultimately stabilizes, as seen in Figure 7.
section_name: Based on PACO

section_content: Referring to the basic concepts of the parallel ACO algorithm and the process of solving the single-berth problem, the parallel ACO algorithm is programmed in MATLAB. In this experiment, six computers are used as the sub-processors. The calculated total ship processing time in the port is at least 1054. 93 h. The order of the berthing of the ship corresponding to this result is:

1-2-3-8-6-9-11-10-7-14-16-19-12-13-17-18-15-20-4-5

The abscissa represents the number of iterations, while the ordinate reflects the total time spent in the port by all vessels. As the number of iterations grows, the total port time of boats steadily lowers and ultimately stabilizes, as seen in Figure 7. ` 5. 2. 2. Based on PACO Referring to the basic concepts of the parallel ACO algorithm and the process of solving the single-berth problem, the parallel ACO algorithm is programmed in MATLAB. In this experiment, six computers are used as the sub-processors. The calculated total ship processing time in the port is at least 1054. 93 h. The order of the berthing of the ship corresponding to this result is:

1-2-3-8-6-9-11-10-7-14-16-19-12-13-17-18-15-20-4-5

The abscissa represents the number of iterations, while the ordinate reflects the total time spent in the port by all vessels. As the number of iterations grows, the total port time of boats steadily lowers and ultimately stabilizes, as seen in Figure 7. Compared with the result of the ant colony algorithm, it is shown that the PACO algorithm outperforms the normal ACO algorithm. The minimum total ship processing time has been improved from 1095. 02 h to 1054. 93 h, which makes the berthing time reduce by more than 2 h per vessel. And the computing efficiency is highly improved, with a fivetimes-faster convergence capability. Then, the PACO algorithm is proved to be feasible in solving the problem of berth allocation in the port. When it is applied to actual production, the operating efficiency of the container terminal can be improved.
section_name: Based on PACO

section_name: Results of Single-berth allocation

section_name: Results of Multi-Berth Allocation

section_content: The total actual stay time of the above 20 vessels in the port is 304. In 4 h, the PSO model of the linear decreasing inertia of inertial weights is adopted, the maximum number of iterations is set to 100 times, the best result obtained by continuously optimizing 10 times is 257. 2 h, and the worst result is 262 h. 

According to the first-come-first-service rule, the actual total time of 20 vessels staying in the harbor is 257. 2 h. The specific allocation results are as follows:

Berth1: 1-4-8-13-17 Berth2: 2-5-12-18 Berth3: 3-7-10-11-15-20 Berth4: 6-9-14-16-19

The ant colony optimization is employed to optimize the berth scheduling problem. Since Dorigo has found that when α = {0. 5, 1}, β = {1, 2, 3, 4, 5}, the ant system can always converge to the optimal solution, and when m (the number of ants) is close to n (the number of nodes), the algorithm has a better performance, so the parameters are assumed as follows:

Set the maximum number of iterations to 200 times with the ant population C a equaling 5. 

According to the first-come-first-service rule, the actual total time of 20 vessels staying in the harbor is 257. 2 h. The specific allocation results are as follows:

Berth1: 1-5-12-16-20 Berth2: 2-6-9-13-17 Berth3: 3-7-8-11-15-19 Berth4: 4-10-14-18

The ordinate shown in Figure 8 represents the average time of a vessel in the port in four berths. Compared with the single-berth order of vessels, it can be seen that the sum of the total port time of four berths is less than the total time of single-berth berths. It is found that the addition of berths can improve the waiting time of the vessels, so as to increase the loading and unloading efficiency of the vessels.
section_name: Based on ACO

section_content: In a parallel ant colony algorithm, the value of the parameter is the same as that of the ant colony algorithm, which can ensure the consistency of the experiments, and it is helpful for comparative analysis. The results show the best results for 251. 83 h. The scheduling Gantt chart is shown in Figure 9, and the corresponding berth assignment of the vessel berthing plan is as follows:

Berth1: 1-4-10-13-17 Berth2: 2-6-9-15-18 Berth3: 3-7-8-14-19 Berth4: 5-11-12-16-20
section_name: Based on PACO

section_content: In a parallel ant colony algorithm, the value of the parameter is the same as that of the ant colony algorithm, which can ensure the consistency of the experiments, and it is helpful for comparative analysis. The results show the best results for 251. 83 h. The scheduling Gantt chart is shown in Figure 9, and the corresponding berth assignment of the vessel berthing plan is as follows:

Berth1: 1-4-10-13-17 Berth2: 2-6-9-15-18 Berth3: 3-7-8-14-19 Berth4: 5-11-12-16-20

The ordinate shown in Figure 10 represents the average time of the vessel in the port in four berths. Compared with the single-berth parallel ant colony algorithm, with the same principle of the PACO algorithm, six computers are used to calculate the vessels' time in the port. Based on the results of different sub-processors, it is found that the final result of the PACO algorithm is superior to that of the ACO algorithm in terms of both the objective value and computing efficiency.
section_name: Based on PACO

section_content: In order to verify the validity of the number of ant colonies, under the same conditions as those of other experiments, only one parameter was changed, and several other experiments were carried out. When the ant population C a was changed, the experimental results are shown in Table 2 and Figure 11. The ordinate shown in Figure 10 represents the average time of the vessel in the port in four berths. Compared with the single-berth parallel ant colony algorithm, with the same principle of the PACO algorithm, six computers are used to calculate the vessels' time in the port. Based on the results of different sub-processors, it is found that the final result of the PACO algorithm is superior to that of the ACO algorithm in terms of both the objective value and computing efficiency.
section_name: Sensitivity Analysis

section_content: In order to verify the validity of the number of ant colonies, under the same conditions as those of other experiments, only one parameter was changed, and several other experiments were carried out. When the ant population C a was changed, the experimental results are shown in Table 2 and Figure 11. The data in Table 2 also show that the smaller the quantity of ants, the earlier the initial convergent algebra without changing other parameters. Since berth scheduling is a parallel machine problem, each ant can only walk N b /C s nodes (in this case, the number of nodes is five). Experiments show that when the number of ants is less than the number of nodes, the optimization is easily convergent. As the number of ants increases, the calculated time decreases and the convergence speed increases. At the same time, increasing the number of ants will make the calculation time for each generation longer; thus, it increases the burden on the processor. From the benchmarking results in Table 2, we found that when the number of ants was chosen to be 5 or 10, the calculation result was better and the calculation time was shorter. In other words, in the parallel ant colony algorithm calculation, the number of ants should be approximately equal to the number of nodes. The data in Table 2 also show that the smaller the quantity of ants, the earlier th initial convergent algebra without changing other parameters. Since berth scheduling is parallel machine problem, each ant can only walk N b /C s nodes (in this case, the number o nodes is five). Experiments show that when the number of ants is less than the number o nodes, the optimization is easily convergent. As the number of ants increases, th calculated time decreases and the convergence speed increases. At the same time increasing the number of ants will make the calculation time for each generation longer thus, it increases the burden on the processor. From the benchmarking results in Table 2 we found that when the number of ants was chosen to be 5 or 10, the calculation resul was better and the calculation time was shorter. In other words, in the parallel ant colon algorithm calculation, the number of ants should be approximately equal to the numbe of nodes. 

After determining the number of ants, the next step is to determine the values of and β in the parallel ant colony algorithm to ensure optimal calculation results. Therefore C a was defined as five in this experiment, and the influence of the values of α and β on th results was studied. When α = 0. 5 or 1, β = {1, 2, 3, 4, 5, 6}, the total residence time of al vessels in the port and the started convergence algebra were calculated, respectively. Th result is as shown in Table 3 : After determining the number of ants, the next step is to determine the values of α and β in the parallel ant colony algorithm to ensure optimal calculation results. Therefore, C a was defined as five in this experiment, and the influence of the values of α and β on the results was studied. When α = 0. 5 or 1, β = {1, 2, 3, 4, 5, 6}, the total residence time of all vessels in the port and the started convergence algebra were calculated, respectively. The result is as shown in Table 3 : As can be in Figure 12, regardless of whether α is equal to 0. 5 or 1, as long as β = 5, the minimum total residence time of all vessels in the port is obtained, and the minimum optimal value is 251. 83 h. J. Mar. Sci. Eng. 2023, 11, x FOR PEER REVIEW As can be seen in Figure 12, regardless of whether α is equal to 0. 5 or 1, as lo = 5, the minimum total residence time of all vessels in the port is obtained, minimum optimal value is 251. 83 h. In comparison to the previous experiment, the value of C a in this experim changed to 10 and we obtained all the corresponding berth scheduling operation by varying α and β as presented in Table 4. As we can see in Figure 13, the values β have little effect on the experimental results. In other words, a = 0. 5 or 1, β = {2 and the total residence time of all vessels in the port can be minimized. In comparison to the previous experiment, the value of C a in this experiment was changed to 10 and we obtained all the corresponding berth scheduling operations results by varying α and β as presented in Table 4. As we can see in Figure 13, the values of α and β have little effect on the experimental results. In other words, a = 0. 5 or 1, β = {2, 3, 4, 5}, and the total residence time of all vessels in the port can be minimized. Through the above two sets of experiments, an obvious rule can be found: if both C a and α remain unchanged, as the value of β increases, the started convergence algebra gradually decreases. Moreover, if β is too small, it is poorly convergent. In addition, if other conditions are consistent, α = 0. 5 makes the optimization result easier to obtain than α = 1. Overall, the optimal values obtained from the second set of experiments (C a = 10) are more stable. To consider the overall calculation results and the optimized speed, the values of C a, α, and β should be 10, 0. 5, and 5. Through the above two sets of experiments, an obvious rule can be found: if both C a and α remain unchanged, as the value of β increases, the started convergence algebra gradually decreases. Moreover, if β is too small, it is poorly convergent. In addition, if other conditions are consistent, α = 0. 5 makes the optimization result easier to obtain than α = 1. Overall, the optimal values obtained from the second set of experiments (C a = 10) are more stable. To consider the overall calculation results and the optimized speed, the values of C a, α, and β should be 10, 0. 5, and 5.
section_name: Sensitivity Analysis

section_name: `

section_content: To further validate the superiority of our proposed algorithm, we conducted experiments on the same case using both the Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). 

In solving the berth allocation problem for the given case, we applied a Genetic Algorithm (GA). GA is an iterative search technique designed to find optimal solutions through successive generations. To adapt GA effectively to our specific case, we meticulously selected and fine-tuned its control parameters, including the population size, crossover probability, mutation probability, and maximum number of generations. Through experimentation, we determined that a population size of 30, a crossover probability of 0. 8, and a mutation probability of 0. 1, with 20 generations, yielded highly promising results. This parameter configuration struck a balance between maintaining population diversity and converging towards optimal solutions. As a result, our GA optimization achieved a total port time of 254. 17 h for the 20 vessels in the case. 

In a parallel effort, we employed Particle Swarm Optimization (PSO) to address the berth allocation problem in the same case scenario. PSO is a population-based optimization algorithm inspired by the social behaviors of birds and fish. In PSO, a population of potential solutions, represented as particles, navigates the search space to discover the optimal solution. Each particle adjusts its position based on its individual experiences and the experiences of neighboring particles. The primary goal of PSO is to find the best solution by iteratively updating particle positions and velocities. Upon running the PSO algorithm and optimizing the berth allocation, we calculated the total vessel time for the port. The outcome of our experiments revealed that, under the PSO algorithm's optimization, the total vessel time for the port was reduced to 257. 25 h. 

Comparative results can be found in Table 5, highlighting the performance differences among the actual condition, GA, PSO, ACO, and our proposed PACO.
section_name: Benchmarking Analysis with Other Algorithms

section_content: To further validate the superiority of our proposed algorithm, we conducted experiments on the same case using both the Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). 

In solving the berth allocation problem for the given case, we applied a Genetic Algorithm (GA). GA is an iterative search technique designed to find optimal solutions through successive generations. To adapt GA effectively to our specific case, we meticulously selected and fine-tuned its control parameters, including the population size, crossover probability, mutation probability, and maximum number of generations. Through experimentation, we determined that a population size of 30, a crossover probability of 0. 8, and a mutation probability of 0. 1, with 20 generations, yielded highly promising results. This parameter configuration struck a balance between maintaining population diversity and converging towards optimal solutions. As a result, our GA optimization achieved a total port time of 254. 17 h for the 20 vessels in the case. 

In a parallel effort, we employed Particle Swarm Optimization (PSO) to address the berth allocation problem in the same case scenario. PSO is a population-based optimization algorithm inspired by the social behaviors of birds and fish. In PSO, a population of potential solutions, represented as particles, navigates the search space to discover the optimal solution. Each particle adjusts its position based on its individual experiences and the experiences of neighboring particles. The primary goal of PSO is to find the best solution by iteratively updating particle positions and velocities. Upon running the PSO algorithm and optimizing the berth allocation, we calculated the total vessel time for the port. The outcome of our experiments revealed that, under the PSO algorithm's optimization, the total vessel time for the port was reduced to 257. 25 h. 

Comparative results can be found in Table 5, highlighting the performance differences among the actual condition, GA, PSO, ACO, and our proposed PACO. These comparisons underscore the effectiveness of our proposed Enhanced Ant Colony Algorithm (PACO) in addressing the challenges posed by the Discrete Dynamic Berth Allocation Problem (DDBAP) in the specified case.
section_name: Benchmarking Analysis with Other Algorithms

section_content: problem of berth allocation for incoming vessels is discrete and random, which brought difficulties in obtaining the optimum solution and largely affected the port operation efficiency. To address this issue, this paper built up a dynamic BAP model referring to the truly practical environment of berth allocation in container terminals. A parallel ant colony algorithm catering to berth allocation is designed to allocate berths for vessels arriving at the right time. With the principle of the ant routing process, a parallel ant colony algorithm is delivered to handle the BAP problem. Regarding the prematurity and convergence of the optimization algorithm, the experimental analysis and tuning of the parameters in the ant colony algorithm are carried out. To validate the feasibility of the approach, a case study is provided. 

The existing ship scheduling scheme and berth allocation scheme are relatively single, and there is no strong flexibility or universality; for this reason, this paper proposes a dynamic berth allocation scheme, which can be achieved under certain conditions and can reduce the ship's stay time in a port to a certain extent. In the numerical examples, it can be found that the PACO algorithm effectively avoids the deficiencies of the premature convergence of the ACO algorithm when solving the berth allocation problem. The superiority of the PACO algorithm is proved. In addition, the different parameters of the PACO algorithm are studied and compared to find the optimal value when solving the problem of berth allocation. This not only ensures the accuracy of the calculation results but also improves the calculation speed. Without increasing the number of large berths, the service level of the terminal can be effectively improved based on better allocation planning via the proposed method, and the shortage of berths at terminals can be alleviated. Moreover, we conducted comprehensive comparisons with other common optimization algorithms to showcase the superiority of the PACO algorithm. While our study considered limited practical factors and operated under specific assumptions, we acknowledge the need for future research to involve more practical constraints. In particular, we plan to conduct experiments on a broader range of instances to ensure the robustness and generalizability of our approach. This will further enhance the applicability of our algorithm to real-world scenarios and contribute to the ongoing development of berth allocation solutions.
section_name: Conclusions

section_name: Conflicts of Interest:

section_content: Data Availability Statement: Data is contained within the article.

section_content: The authors declare no conflict of interest.
section_name: Conflicts of Interest: