1. Introduction
In the context of globalization, international trade has become one of the key drivers of economic growth for countries around the world [
1]. Among various modes of transportation, international maritime shipping stands out as the backbone of global economic activity due to its large cargo capacity and low cost [
2]. Statistics show that over 80% of global trade by volume is carried out through maritime transport, with nearly every industry relying on shipping for the transportation of goods—ranging from raw materials to finished products, from food to electronics [
3]. Ports, as critical nodes in the maritime transport chain, perform essential functions such as cargo loading and unloading, storage, inspection, and quarantine. The efficiency of port operations directly affects transportation costs and delivery times. To improve port operation efficiency, it is crucial to allocate berth and crane resources in a rational manner. As a result, the berth allocation and crane assignment problem (BACAP) has been proposed [
4].
In BACAP, the term berth refers to the position within the port where a vessel can dock, while quay crane (QC) refers to the container cranes located at the port’s quay, typically installed along the dock to load and unload containers. BACAP aims to allocate berth and crane resources rationally in order to minimize the vessels’ stay and waiting times at the port.
Figure 1 provides a schematic of BACAP, where a. represents the minimum safety distance between vessels; b. represents the minimum safety distance between QCs. Each time a vessel finishes unloading, it will depart. c. represents the vessel allocation process; d. represents the QC allocation process; e. represents the vessels waiting to dock have been assigned both a berth and a QC. Once a QC completes its current task, it can immediately be reassigned to another vessel that requires its service.
Early studies on BACAP mostly assumed a static condition, where vessel arrival times and cargo volumes were known and fixed [
5]. Researchers applied algorithms based on Linear Programming (LP) [
6] and Integer Programming (IP) [
7] to solve such problems. However, LP and IP are only suitable for small to medium-sized port problems. With economic growth and the increasing demand at ports [
8], these algorithms can no longer meet the requirements. As a result, heuristic methods have been used to solve the problem, as these algorithms are better suited for large-scale, complex port environments. For example, Imai et al. [
9] used Genetic Algorithms (GAs) to obtain fitness values for chromosomes by scheduling QC transfers between berths. Li et al. [
10] combined the simulated annealing (SA) algorithm to design an enhanced Quantum Annealing algorithm (EQA) with strong global search capability. Krimi et al. [
11] integrated the Tabu Search (TS) algorithm. All these studies achieved good results under static assumptions.
However, due to various uncertain factors such as weather, shipping conditions, and customs processes, vessel arrival times and cargo volumes are often difficult to predict accurately [
12], making the solution methods developed under static conditions unable to meet the demand. For example, delays in vessel arrival times may disrupt the original work schedule, leading to frequent adjustments in QC assignments and affecting the overall operational efficiency of the port. Therefore, researchers have shifted focus to solving the BACAP under dynamic conditions, taking into account the impact of uncontrollable factors, such as climate, on vessel arrival times and cargo volumes [
13,
14]. However, most heuristic algorithms do not fully consider the influence of these factors on the overall allocation plan, and under conditions of frequent resource conflicts, they often get trapped in local optima. Although many methods exist to optimize these algorithms, the time cost required can significantly increase [
15,
16].
In recent years, with the work of Monaco et al. [
17] combining Differential Evolution (DE) and Robust Optimization (RO) to solve BACAP, the use of RO to address the dynamic berth allocation and crane assignment problem (DBACAP) has gradually become the focus of research. RO aims to generate more adaptable solutions by simulating the impact of uncertain factors under different scenarios [
18,
19]. Specifically, within a limited time window, RO can reduce the need for frequent resource adjustments by tolerating a certain range of changes, thus achieving efficient and stable allocation [
20]. Imai et al. [
21] proposed a berth allocation scheme based on GA to address berth demands with service priorities, but it did not consider QC allocation simultaneously. Zhu and Lim [
22] designed a simulated annealing algorithm with effective neighborhood search for solving large-scale dynamic scenarios, but they overlooked constraints such as port length and the safety distance between vessels. Zou et al. [
23] combined Particle Swarm Optimization (PSO) with an intra-layer and inter-layer competition mechanism to solve this problem, but they did not simulate multiple scenarios to handle uncertain situations. Wang R. et al. [
24] proposed an improved Ant Colony System (ACS) algorithm to solve it, but did not adequately address the global optimality of the solution.
In this paper, we make efforts to address the robustness issue of the large-scale DBACAP under the uncertainty of vessel arrival times.
1.1. Berth Allocation and Crane Assignment Problem
BACAP is a core issue in port management, aiming to maximize the loading and unloading efficiency of vessels and minimize their waiting time by finding reasonable berth and crane allocation solutions. Before BACAP was proposed, the earliest issue encountered in port management was the berth allocation problem (BAP) [
25,
26], which has been extensively studied for small, medium, and large-scale instances [
27,
28,
29]. Furthermore, early considerations of berth allocation were discrete, known as discrete berth allocation problem (DBAP), where fixed docking locations were preassigned [
30], until researchers introduced continuous berth conditions, known as continuous berth allocation problem (CBAP), where vessels could dock at any available position [
31]. However, in BAP, only factors such as vessel arrival times, berth locations, and berth capacity were considered, and QC allocation was not addressed in detail. With the increasing demand for terminal services, port managers began to focus on the scheduling of QCs, and the crane assignment problem (CAP) gradually came into the spotlight [
32,
33,
34]. Soon, some researchers combined BAP and CAP in the hope of improving port operational efficiency by considering both berth and crane assignments, leading to the emergence of BACAP, which quickly garnered significant attention [
35,
36,
37]. We summarize some methods for solving BACAP in
Table 1.
However, when we consider external factors, such as adverse weather conditions causing vessels to arrive later than scheduled, or customs inspections leading to changes in cargo volume, the performance of the above algorithms significantly deteriorates. Therefore, a solution is urgently needed for DBACAP.
1.2. Berth Allocation Model Based on Robust Optimization
As the uncertainty during a vessel’s voyage increases [
38], factors such as adverse weather, crew conditions, and customs processes directly affect the vessel’s arrival time, cargo volume, and operational requirements. Traditional BACAP have gradually revealed many shortcomings. The optimal solutions proposed under fixed conditions cannot adapt to such random fluctuations, leading to a deterioration in the robustness of the model. The uncertainty of vessel arrival times can cause port congestion and delays in unloading processes, which have a decisive impact on port resource scheduling. As a result, it is often a focal point of research [
39].
For example, Zhen and Chang [
40] proposed a bi-objective robust optimization model, Lu et al. [
41] incorporated the uncertainty of vessel arrival times and container handling times into the scheduling considerations, Iris et al. [
42] developed a recoverable robust optimization method, Bin et al. [
43] introduced buffer time as a robustness indicator, Yang et al. [
44] developed a feedforward-feedback dynamic berth allocation method, Wu and Miao [
45] used berth areas and relative sequences as new scheduling variables, and Du et al. [
46] proposed a feedback-based robust berth allocation model. We summarize some methods for solving DBACAP in
Table 2.
However, most existing algorithms can only achieve optimal results when the disturbance in vessel arrival times is slight (within 10%), and as the number of vessels increases, the performance of these algorithms gradually deteriorates.
1.3. Contribution of This Work
Existing robust optimization algorithms for vessel berth allocation typically consider only small disturbances in vessel arrival times, limiting their applicability in real-world, large-scale, high-disturbance scenarios. To address this, we propose a ternary historical memory-based robust optimization framework (THM-RCPSO) for solving the dynamic berth allocation and crane assignment problem (DBACAP) under such challenging conditions.
Our main contributions are summarized as follows:
- (1)
Improved PSO algorithm incorporating ternary historical memory: We enhance the traditional Particle Swarm Optimization (PSO) by integrating gradient descent and Lévy flight strategies with certain probabilities. This yields three local optima, each stored in historical memory and compared to guide the swarm toward the global optimum. Gradient descent accelerates local convergence, while Lévy flight promotes global exploration. This balance significantly improves convergence speed, solution accuracy, and robustness against multimodal optimization challenges, outperforming conventional PSO methods [
7,
8,
9,
10].
- (2)
Cluster-based strategy for robust optimization in BACAP: We introduce a clustering mechanism that divides the particle swarm into multiple smaller clusters. Each cluster performs independent local searches to identify local optima, followed by inter-cluster competition and information exchange to update the global best solution continuously. This approach mitigates the premature convergence issues and high time complexity typical of gradient-based methods [
40,
42,
46], enabling more thorough exploration of the search space. The clustering mechanism also reduces computational complexity by limiting search scope within smaller groups.
- (3)
Robustness under large-scale and high-disturbance environments: Our framework explicitly models significant disturbances in vessel arrival times through multiple simulated scenarios, ensuring the generated berth and crane allocation plans maintain high performance and stability under uncertainty.
3. Proposed Algorithm
A large number of experiments have shown that existing robust optimization algorithms for DBACAP can achieve good results when the vessel arrival time disturbance is small, and the number of vessels is limited. However, when the disturbance in vessel arrival times increases or the number of vessels grows, these algorithms exhibit significant drawbacks. To improve the optimization performance of DBACAP under large-scale and high-disturbance conditions, we propose a THM-RCPSO algorithm to enhance the performance of swarm optimization algorithms under uncertainty. Additionally, we address the issue of local convergence by introducing a clustering mechanism to balance the search within the population. Finally, under the clustering framework, we also design a restart strategy to ensure that each exploration position is sufficiently distant from the previous optimal solution.
In the following chapters, we first provide a comprehensive overview of the overall framework, and then sequentially introduce the encoding method, the robust optimization framework, the clustering method, and the ternary historical memory-based particle swarm optimization strategy used in this paper.
3.1. Overall Framwork
Before presenting the model framework, let us ask the readers to consider the following scenario: Suppose the arrival time of a single vessel fluctuates. Specifically, assume that the vessel arrives 10 min later than planned. This change could lead to two different outcomes: Through local adjustments to the berth location and crane allocation, the vessel could still dock and unload normally without affecting the schedule of other vessels or their resource allocation; or, the vessel could not dock and unload as planned, disrupting the schedules of subsequent vessels. We refer to the first scenario as the vessel’s arrival time fluctuation being within the robust region, as shown in
Figure 2a, and the second scenario as the arrival time fluctuation being outside the robust region, as shown in
Figure 2b. The model proposed in this paper aims to identify such a robust region, where, regardless of how much the vessel arrival time fluctuates, the berth and crane allocation schemes will remain valid.
Algorithm 1 presents the overall framework of THM-RCPSO. Before presenting the details of the framework process, the algorithm’s encoding scheme is introduced.
Determining the particle encoding method is a prerequisite for the implementation of the algorithm. We encode each particle as a vector containing
elements. This encoding method combines two key decision variables: the vessel’s berth position and the number of cranes allocated. Specifically, assuming there are
vessels in the port that need to be allocated berths and cranes, the encoding of each particle can be represented as a
dimensional vector. The first
elements represent the berth position of each vessel, and the last
elements represent the number of cranes allocated to each vessel.
Figure 3 illustrates the particle encoding method.
The specific formula is as follows:
The details of THM-RCPSO are as follows. First, we initialize the particle swarm and perform clustering (line 1). Then, we evaluate the fitness of the particles and perform iterative optimization using the robust optimization framework (line 2–line 14). In each iteration, we cluster the particles in each cluster to find the local optimum (line 5–line 8). Next, we compute the robust fitness value (line 9) and position changes (line 11) for each cluster, and check for convergence (line 12). The solving process of THM-RCPSO is shown in
Figure 4.
Algorithm 1 THM-RCPSO |
- 1:
Initialize the particle swarm to 200 - 2:
while not convergence do - 3:
Initialize the convergence state to false - 4:
Record posprev of the particles - 5:
for clusteridx ← 1 to numclusters do - 6:
for clusteriter ← 1 to maxcluster do - 7:
Clustering (Algorithm 2) - 8:
end for - 9:
Robust fitness (Algorithm 3) - 10:
end for - 11:
Compute poschange - 12:
if poschange < convergence threshold then - 13:
Continue - 14:
end if - 15:
end while
|
Algorithm 2 Clustered PSO |
- 1:
for each restart in total restarts do - 2:
Set convergence counter to 0 - 3:
for each iteration in total iters do - 4:
for each particle i do - 5:
Update velocity V(i) - 6:
Update position X(i) - 7:
if X(i) is within the boundary then - 8:
Calculate the fitness of the particle - 9:
Add penalty term - 10:
end if - 11:
Update pbest and gbest - 12:
if convergence then - 13:
count++ - 14:
end if - 15:
update gbest - 16:
end for - 17:
Randomly reinitialize V(i) and X(i) - 18:
end for
|
Algorithm 3 RobustFitness |
- 1:
for each simulate in simulates do - 2:
for each disturbance k: - 3:
Generate disturbance data - 4:
Disturb the vessel arrival time - 5:
Compute fitnessk - 6:
Accumulate fitnessk into fitnesstotal - 7:
end for - 8:
robustfitness = fitnesstotal/simulations - 9:
return robustfitness - 10:
end for
|
3.2. Local Search
To improve the stability of DBACAP, enhance the sufficiency of the search, and reduce its complexity, we propose the THM-RCPSO algorithm. It consists of two main components: local search and particle swarm optimization, as shown in
Figure 5. First, the particle swarm is clustered, followed by a local search within each cluster. Then, the ternary historical memory mechanism is utilized to enhance exploration within the population, while robust optimization ensures the stability of the solutions. The detailed steps of the THM-RCPSO algorithm are described below.
During the iterative process, each particle swarm gradually approaches a local optimal solution. When the particle swarm is close to a local optimum, gradient descent and Lévy flight are applied for search optimization with a certain probability.
Using gradient descent allows particles to quickly approach the robust region, accelerating convergence and ensuring that local solutions within each cluster remain stable in the robust region. Randomly, 20% of the particles are selected for gradient descent optimization. The execution process of gradient descent is illustrated in
Figure 6.
The berth position is updated as follows:
The QC is updated as follows:
The Lévy flight strategy is employed to explore a larger solution space, preventing the particle swarm from getting trapped in local optima and enhancing global search capability. By utilizing Lévy flight, particles can escape local regions and explore more potential solutions, thereby improving the overall robustness of the solution.
Among the particles not selected for gradient descent, 20% are randomly chosen for Lévy flight optimization. The execution process of Lévy flight is illustrated in
Figure 7.
The berth position is updated as follows:
The QC is updated as follows:
The step size
and
are generated based on the Lévy distribution:
is the exponent parameter of the Lévy distribution, typically in the range of (0, 2]. is the scaling factor that controls the size of the steps.
3.3. THM-RCPSO Algiorithm
To improve search efficiency and avoid getting trapped in local optima, this paper proposes a Clustered Particle Swarm Optimization (Clustered PSO) strategy. We divide the initial particle swarm evenly into multiple clusters. Each cluster independently performs local search to find the optimal solution, and then, through information exchange and competition between clusters, updates the global optimal solution.
As shown in Algorithm 2, we employ the following method for clustering: The entire particle swarm is divided evenly into
clusters, with each cluster containing
particles.
Each particle within a cluster performs a search using the standard PSO algorithm, and this results in obtaining local best information (). The fitness function can be calculated based on (3).
The particle position update formula is:
The particle velocity update formula is:
To ensure the validity of berth positions and quay crane allocations, the dimensions of the particles must be constrained within given upper and lower bounds:
The distance
between particles
and
within a cluster can be defined as:
when
is smaller than a predefined threshold, the particles are considered to be in the same cluster.
When a cluster does not update near the local optimal solution for a long time, or when the convergence speed slows down, the algorithm will trigger a restart mechanism to reinitialize the particle swarm of that cluster. The restart trigger conditions are as follows:
In addition, as shown in Algorithm 3, during the local search for each cluster, considering the simulation of the uncertainty in the vessel’s arrival time, we generate multiple disturbance scenarios based on (1) and (2), and evaluate the adaptability of the solution for each scenario. This ensures the validity of the berth and quay crane allocation scheme under different disturbance conditions, in order to find the robust region.
The ternary historical memory mechanism is one of the key innovations of this algorithm. Its overall framework is shown in Algorithm 4.
Section 3.2 explains two local search optimization strategies, both of which are executed with a certain probability in the algorithm. Therefore, our algorithm will produce three local optimal solutions:
obtained by directly using the traditional PSO;
obtained by using the gradient descent strategy; and
obtained by using the Lévy flight strategy. The global optimal solution can be obtained by the following formula:
Our robust clustering mechanism divides the initial particle swarm into multiple clusters, each performing independent local searches. This approach enhances the algorithm’s ability to explore diverse regions of the solution space, avoiding premature convergence and improving robustness. Particles are grouped into clusters based on their Euclidean distance in the solution space. Specifically, if the distance between two particles is less than 10% of the maximum possible distance between particles, they are assigned to the same cluster. The number of clusters is fixed at five in our experiments. This value was chosen based on preliminary tests, which showed that five clusters provide a good balance between exploration and exploitation. The effectiveness of the robust clustering mechanism is demonstrated by the experimental results presented in
Section 4.
Algorithm 4 OptimizeBestSolution |
- 1:
while iter < maxIter do - 2:
Dynamically adjust α - 3:
Initialize gradpos, gradcrane - 4:
for each vessel i do - 5:
Calculate gradpos [i] - 6:
Calculate gradcrane [i] - 7:
Execute gradient descent with a 20% probability - 8:
Execute Lévy flight with a 20% probability - 9:
Calculate robustFitness - 10:
Update fitness - 11:
end while - 12:
Output best fitness
|
3.4. Theoretical Analysis of Robustness
To theoretically support the effectiveness of the proposed THM-RCPSO framework, we highlight how the ternary historical memory mechanism contributes to improved robustness. Traditional PSO often suffers from premature convergence or slow adaptation in dynamic environments due to reliance on limited memory (i.e., personal and global best). In contrast, our method introduces a threefold memory design that enhances both exploration and exploitation capacities across different temporal and spatial scales: 1. The personal historical memory retains the particle’s elite states over time, allowing reactivation of high-quality solutions that may become relevant again in dynamic settings. 2. The neighborhood memory facilitates local cooperation, enabling faster adaptation to changes in specific regions of the search space. 3. The global memory provides access to globally diverse elite positions, improving the swarm’s ability to avoid stagnation and escape from local optima.
This division of memory sources effectively decouples local search from global search and reduces the variance of convergence paths. By aggregating guidance from multiple perspectives, particles are less sensitive to noise, disruptions, or abrupt landscape shifts. The adaptive combination of these memories also serves as a stabilizing mechanism, maintaining performance even when the optimization landscape is subject to frequent changes.
The robustness of the THM-RCPSO framework is supported by both theoretical analysis and experimental validation. The ternary historical memory mechanism ensures that the algorithm retains information from multiple optimization strategies, enabling it to dynamically adjust the search direction and avoid local optima. This mechanism is particularly effective in multimodal problems, where traditional methods often fail to explore the entire solution space. Furthermore, the clustering mechanism divides the particle swarm into multiple clusters, each performing independent local searches. This approach not only improves search efficiency but also ensures that the algorithm can handle large-scale problems with high disturbance levels. Experimental results on 25 test instances in next section demonstrate that THM-RCPSO consistently outperforms other robust algorithms in terms of both solution quality and stability, further validating its robustness.
4. Numerical Experiments
In this section, we tested the performance of THM-RCPSO on a set of BACAP test cases to demonstrate its capabilities. First, we introduced the data for the test cases. Next, we described the experimental design, including THM-RCPSO and several comparison algorithms. Then, we presented and analyzed the results of all the experiments.
4.1. Case Generation
We selected a BACAP dataset containing 25 test cases, and
Table 3 presents the specifications of each case in the dataset. These cases cover a wide range of scales and configurations of port operations, designed to simulate various real-world scenarios. The dataset includes the following details:
Number of vessels: The dataset includes cases with 30, 50, 100, 150, and 200 vessels, with five cases for each vessel count.
Number of cranes: The number of available cranes for each group of five cases is set to 30, 50, 50, 70, and 70, respectively.
Vessel length and cargo volume: The length of vessels ranges from 50 to 400 m, and the cargo handling capacity ranges from 800 to 12,000 units, ensuring a realistic representation of port operations.
This diversified test scenario design aims to comprehensively evaluate the performance of the algorithm under different conditions, including small-scale, medium-scale, and large-scale problems. By incorporating varying vessel counts, crane configurations, and cargo volumes, the dataset effectively reflects the complexity and diversity of real-world port operations. The total length of the port’s quay is 3000 m.
4.2. Comparison Algorithms
To demonstrate the superiority of THM-RCPSO’s performance, we selected four classical DBACAP solutions as benchmark comparisons. These include: an Ant Colony Optimization-based discrete berth allocation model (ACO) [
43], a feedforward–feedback dynamic berth allocation model (HRBA) [
44], a robust scheduling method using simulation-generated feedforward plans (GAMCS) [
45], and a feedback-program-based robust berth allocation model (FPA-RBAP) [
46]. In order to make these algorithms applicable to the test cases we designed, we made appropriate adjustments to their encoding methods and constraints, which are described as follows:
- (1)
ACO: ACO algorithm gradually updates information to select the optimal berth allocation scheme, excelling in small-scale dynamic optimization problems. Since this algorithm only considers berth allocation and does not include crane resource allocation, we added crane numbers and related constraints to the original encoding.
- (2)
HRBA: HRBA model addresses uncertainty by constructing a linear allocation scheme. It not only considers continuous updates to the optimal solution but also adjusts the positions of historical solutions. This algorithm is well-suited to handle optimization problems with small-scale disturbances.
- (3)
GAMCS: GAMCS introduces the concept of berth regions and relative order, applying simulation-generated feedforward plans to improve convergence speed. To adapt this algorithm to our case’s specific needs, we adjusted the allocation rules for berths and cranes in its constraint conditions.
- (4)
FPA-RBAP: FPA-RBAP combines simulated annealing, feedback adjustments, and buffer adjustments based on inconsistent costs. This method performs well in robust optimization for large-scale datasets but often incurs higher time costs.
The running parameters for all algorithms are shown in
Table 4. For each test case, each algorithm is independently run 25 times to ensure the stability of the statistical data. We use the mean and standard deviation as performance indicators, measuring the average fitness of each algorithm and calculating its standard deviation. In the tests, the algorithm stops iterating when the change in fitness value is less than 1 × 10
−3 or when the maximum number of iterations (
, where
is the number of vessels) is reached.
4.3. Results Display
Table 5 presents the experimental results of all comparison algorithms, with the optimal solution for each test case highlighted in bold. From these results, the superior performance of the proposed THM-RCPSO algorithm is clearly evident. It consistently achieves lower average vessel dwell times and standard deviations compared to the other algorithms. This advantage becomes particularly pronounced in large-scale instances involving 150 vessels (C16–C25), underscoring THM-RCPSO’s strong capability in handling dynamic and large-scale DBACAP scenarios with high disturbance levels.
To enhance the clarity of the comparative analysis, we added an Average Rank row to
Table 5. The ranks were calculated by sorting each algorithm’s performance in every test case (excluding standard deviation) and assigning a score from 1 (best) to 5 (worst). The final average rank results clearly demonstrate the overall superiority of THM-RCPSO, which consistently ranks first across all 25 instances. It is followed by HRBA, ACO, and FPA-RBPA, while GAMCS performs the worst overall. This ranking provides an intuitive and comprehensive perspective on algorithm performance across diverse problem scales.
Moreover, the comparative performance of HRBA reveals its strength in terms of solution stability, as indicated by its relatively low standard deviations across several instances. This suggests that preserving historical solutions during iterative optimization contributes to robustness in dynamic environments. The direct comparison between THM-RCPSO and HRBA further validates the effectiveness of the ternary historical memory mechanism embedded in our framework.
In addition, the results demonstrate that THM-RCPSO significantly outperforms GAMCS, highlighting the limited effectiveness of feedforward planning in this context when compared to historical memory-guided search strategies. Similarly, when compared with ACO and FPA-RBPA, THM-RCPSO exhibits a more robust and consistent optimization performance across both small- and large-scale DBACAP instances, reaffirming the practical value of its robust clustered swarm structure.
4.4. Statistical Analysis
To validate the superiority of THM-RCPSO, we performed a Friedman Test to compare its performance with other algorithms (ACO, HRBA, GAMCS, and FPA-RBPA) across 25 test instances.
The Friedman Test is used to compare the performance of multiple algorithms across multiple test instances. It ranks the performance of each algorithm on each test instance and then evaluates whether the differences in rankings are statistically significant. The test is based on the following steps:
First, for each test instance, rank the algorithms based on their performance. The best-performing algorithm receives a rank of 1, the second-best receives a rank of 2, and so on. Then, calculate the average rank of each algorithm across all test instances. Finally compute the Friedman statistic using the following formula:
where
is the number of test instances.
is the number of algorithms.
is the average rank of the
-th algorithm.
Based on the data in
Table 5, we calculated the average rankings of each algorithm across the 25 test instances. The results are as follows: THM-RCPSO: 1.2, HRBA: 2.1, ACO: 3.0, GAMCS: 3.8, FPA-RBPA: 4.9.
With four degrees of freedom (since = 5), the critical value for a significance level of 0.05 is 9.49. Since the Friedman statistic (15.67) exceeds the critical value, we conclude that there are statistically significant differences in performance among the algorithms.
5. Discussion
In this section, we first discuss the differences between THM-RCPSO and some commonly used robust optimizers, and theoretically prove its superiority. Then, we use ablation experiments to demonstrate the effectiveness of the proposed three-term historical memory method in robust optimization. Finally, we analyze the combined effects of the gradient descent ratio and Lévy flight ratio on the performance of THM-RCPSO. All experiments in this section use the same cases and settings as those in
Section 4.
5.1. Comparative Analysis
Currently, the mainstream robust optimizers mostly combine heuristic algorithms to address the resulting robust berth scheduling problems [
47,
48]. For example, RBSHO [
49] uses a bi-objective optimization approach, applying simulation to assess the proposed berth scheduling strategy and comparing it with the three commonly used vessel service strategies under uncertain conditions. RBAP [
50] integrates simulated annealing and branch-and-bound algorithms to construct a robust berth scheduling model. Additionally, some researchers have developed deep extensions based on PSO, such as PSO-TBIR [
51], which introduces a time-buffer insertion algorithm, incorporating the adaptive search process of time buffers into PSO.
However, the direction explored by THM-RCPSO differs from theirs. Based on PSO, we divide the particles into multiple clusters through a clustering strategy. Each cluster performs independent local searches, and the inter-cluster competition mechanism prevents resource waste in clusters that have already converged. In complex, high-dimensional DBACAP problems, this allows for more effective coverage of the search space. Additionally, the algorithm retains historical memory, exploring future solutions while not abandoning the best historical solutions. Therefore, whether in terms of vertical or horizontal performance, THM-RCPSO demonstrates superior performance.
5.2. Ablation Study
In this section, we conduct an ablation study to evaluate the effectiveness of the core components of THM-RCPSO, including the clustering mechanism and the ternary historical memory strategy. We compare four algorithmic variants: the complete THM-RCPSO, No-Cluster (without particle clustering), No-Memory (with the historical memory mechanism disabled), and the canonical PSO algorithm as a baseline. The experiments are performed on the same 25 benchmark test cases and under identical disturbance settings as described earlier. Each algorithm is independently run 25 times per case, and the mean and standard deviation of the vessel dwell times are reported. The final column in
Table 6 shows the performance gain (or loss) of THM-RCPSO relative to the other variants, using GAP percentage to quantify improvements, calculated as the relative difference from the baseline solution.
From
Table 6, it is evident that THM-RCPSO performs well in both small-scale and large-scale DBACAP scenarios, thanks to the clustering mechanism. Specifically, THM-RCPSO achieved the best performance in test cases C1, C4, C5, C21, C22, C24, and C25. Among these, the improvement reached 3.97% in the C1 case and 3.29% in the C25 case. The reasons for this can be analyzed as follows: In small-scale scenarios, the intra-cluster and inter-cluster competition mechanisms help slow down the convergence speed of the particle swarm, allowing for more thorough exploration. In large-scale scenarios, clustering effectively addresses the multi-modal nature of the problem and prevents the exploration from being too localized. In medium-sized cases, these characteristics are not as apparent but still provide some benefit, likely because the swarm size is moderate, and the three-way historical memory algorithm alone can maintain a good exploration effect.
Secondly, for the ternary historical memory-based algorithm, the optimization performance is particularly significant in large-scale cases. Specifically, test cases C21–C25 exhibit superior results. The reason behind this is that in large-scale populations, the number of particles in each cluster increases, providing more samples and optimization space for the execution of the ternary historical memory-based algorithm. In each iteration, a certain percentage of particles are selected for Lévy flight and gradient descent strategies with a certain probability, allowing the algorithm to achieve a better balance between exploration and exploitation. THM-RCPSO can dynamically adjust its search direction. This strategy is particularly effective in multi-modal problems, as it helps the algorithm switch between different solution regions, increasing the probability of finding the global optimum.
5.3. Parameter Analysis
In THM-RCPSO, two key parameters are involved: the adjustment coefficient , which influences the impact of ship length on port arrival time perturbations, and the probability , which determines the likelihood of selecting Lévy flight or gradient descent during local exploration. In this section, we conduct tests on five representative scenarios, namely C5, C10, C15, C20, and C25, using different combinations of {,} to analyze their joint effects. Specifically, ∈ {0.05, 0.1, 0.15, 0.2, 0.25, 0.3} and ∈ {0.05, 0.1, 0.15, 0.2, 0.25, 0.3}.
Figure 8 presents a 3D surface plot illustrating the performance of THM-RCPSO under different {
,
} combinations, where darker colors indicate better results (lower evaluation values). The results clearly show that
and
significantly impact THM-RCPSO’s effectiveness. In particular, the optimal setting {
,
} = {0.2, 0.2} yields the best performance across tested scenarios, suggesting that appropriate tuning of these parameters is crucial for balancing exploration and exploitation and improving solution quality.
Other parameters related to the PSO framework and gradient descent, such as the inertia weight , learning coefficients and , and gradient descent learning rates and , were set following standard practices and preliminary validations. Specifically, decreases linearly from 0.9 to 0.4 over iterations to balance global and local search; and are both set to 2.05, consistent with canonical PSO settings, ensuring balanced influence from personal and global best positions. Parameters and were empirically set to 0.01, providing a good trade-off between convergence speed and stability, and gradient descent is applied with 20% probability to maintain global exploration capabilities. Given these parameters follow well-established guidelines and showed stable performance in preliminary tests, a more comprehensive sensitivity analysis was focused on and .
Parameter selection was conducted via grid search combined with cross-validation to identify the optimal settings.
6. Conclusions
In this paper, we designed the THM-RCPSO model to solve the DBACAP. First, we established a mathematical model for this problem, which considers uncertainties in vessel arrival times and crane assignments. Then, we designed a robust optimization framework based on three-memory history to evaluate the fitness and iteratively optimize the particle swarm. Furthermore, during each iteration, we perform clustering and local search for each cluster of particles to find local optimal solutions. In the experiments, we conducted comparative tests on 25 BACAP cases. The experimental results show that THM-RCPSO outperforms ACO, HRBA, GAMCS, and FPA-RBPA. Finally, we analyzed the theory and parameters of THM-RCPSO for solving dynamic BACAP and conducted ablation studies to demonstrate the effectiveness of three-memory history in large-scale cases.
While the THM-RCPSO method demonstrates strong performance in DBACAP, it does have some limitations. The performance of THM-RCPSO can be influenced by the initial distribution of particles in the solution space. If the initial particles are concentrated in a suboptimal region, the algorithm may require more iterations to converge to the global optimum. THM-RCPSO relies on several parameters, which need to be carefully tuned for optimal performance.
In future work, we will continue to study solutions for BACAP under various uncertainties. Additionally, we will explore applying THM-RCPSO to optimize and solve other large-scale problems, such as power grid optimization scheduling [
52], cloud resource allocation, load balancing [
53], etc.