Optimal Unloading Path Search Algorithm Based on Enumeration: Optimization and Application Considering Transportation Constraints ()
1. Introduction
In the context of economic globalization, trade exchanges have become increasingly frequent, and the volume of international trade continues to grow. According to statistics from the United Nations Conference on Trade and Development (UNCTAD), global maritime trade volume reached 12 billion tons in 2023, maintaining its absolute dominance among global trade transportation modes [1]-[3]. Maritime logistics not only accounts for more than 80% of global trade transportation demand but also plays a crucial role in ensuring the stable operation of international supply chains [4] [5]. Against this backdrop, how to scientifically and economically schedule transportation, particularly the rational planning of unloading paths, has become a key factor for shipping enterprises to enhance operational efficiency and reduce logistics costs.
Traditionally, vessel unloading paths have been largely determined by manual experience and manual arrangements. While this approach can satisfy daily operational needs to some extent, it suffers from low efficiency and is prone to issues such as unreasonable path selection and delayed cargo delivery. These shortcomings increase transportation costs and reduce port turnaround efficiency [6]-[8]. With the rapid development of big data technologies, artificial intelligence, and intelligent optimization methods, an increasing number of transportation and logistics enterprises are undergoing digital transformation, leveraging intelligent algorithms to enhance the accuracy and efficiency of unloading path planning [9]-[11]. Therefore, it is of both theoretical significance and practical value to develop an efficient and economical optimization method for vessel unloading path planning.
In the field of path optimization research, traditional graph theory-based shortest path algorithms, such as Dijkstra’s algorithm and the A* algorithm, have been widely applied in transportation systems and robot navigation [12]-[14]. However, these methods typically optimize only a single objective (e.g., path length minimization) and are less effective in handling the multiple complex constraints involved in vessel unloading [15]. For example, in multi-port unloading scenarios, optimization must account not only for path length but also for destination cargo volume limits, port handling capacities, vessel compartment layouts, and the operational sequence [16] [17]. The inclusion of these multidimensional constraints makes vessel unloading path optimization substantially more complex than the traditional Vehicle Routing Problem (VRP) [18]-[20].
To address such complex transportation scheduling problems, researchers have proposed a range of advanced methods. On one hand, exact optimization approaches, such as integer programming, branch-and-bound, and column generation, can achieve optimal solutions in small-scale cases [21] [22], but often become impractical in large-scale maritime logistics scenarios due to their computational complexity [23]. On the other hand, heuristic and metaheuristic methods, including genetic algorithms, ant colony optimization, and variable neighborhood search, have been widely applied in VRP and its variants (e.g., VRPTW, CVRP, GVRP) [24]-[27]. These methods improve solution efficiency and scalability to some extent but are often challenged by slow convergence, instability of solutions, and sensitivity to parameter tuning [28] [29].
In recent years, some studies have focused on path optimization in the context of “green shipping” and smart ports, attempting to incorporate energy consumption and carbon emission constraints into unloading path design, with the aim of achieving low-carbon and energy-efficient operations [5] [30] [31]. Research has shown that green transportation models not only reduce fuel consumption but also alleviate port congestion and enhance environmental benefits [32] [33]. Nonetheless, these methods still face a trade-off between computational efficiency and solution accuracy in practical applications [34]. Particularly for vessel unloading path optimization, which involves unique structures and constraints, existing studies remain relatively limited [35].
In light of these challenges, this paper proposes an intelligent search method that integrates an enumeration algorithm with the cargo volume constraint principle. By exhaustively exploring all possible unloading path schemes and embedding the shortest path principle together with cargo volume restrictions into the search process, this method achieves a balance between economic efficiency and practical feasibility, while maintaining computational tractability. Experimental results demonstrate that the proposed approach can effectively reduce transportation costs, enhance port operational efficiency, and provide new insights for shipping enterprises seeking intelligent logistics management in the era of digital transformation.
The remainder of this paper is organized as follows. Section II introduces the preliminary knowledge, including the basic concepts of the Ship Unloading Path Problem, the enumeration algorithm, and the principle of cargo capacity constraints. Section III presents the optimal unloading path search algorithm based on the enumeration method, with detailed steps of design and implementation. Section IV reports the numerical experiments conducted on real-world scheduling data from January to May 2023, followed by an analysis of the experimental results. Finally, Section V discusses the advantages, innovations, and limitations of the proposed algorithm, as well as possible directions for future improvements in Section V.
2. Preliminary Knowledge
2.1. Basic Concepts of the Ship Unloading Path Problem
The Ship Unloading Path Problem (SUPP) refers to the task of determining the optimal unloading path for a vessel that must call at multiple destination ports, under the constraints of cargo demand and operational requirements. The goal is to minimize transportation costs while maximizing operational efficiency [5].
Suppose a vessel needs to unload cargo at n ports, denoted as the set:
(1)
The vessel’s total cargo volume is Q, and the amount unloaded at port
is
, subject to the constraint:
(2)
The objective of the unloading path problem is to identify a route
that visits all ports such that the sailing distance function:
(3)
is minimized, where
denotes the sailing distance or cost between port i and port j.
Therefore, the SUPP is essentially a path optimization problem with cargo volume constraints, whose computational complexity is similar to that of the Traveling Salesman Problem (TSP), but with more complex constraints [32].
2.2. Basic Principle of the Enumeration Algorithm
The fundamental idea of the Enumeration Algorithm is to list all possible path schemes, examine their feasibility and cost one by one, and finally select the path with the minimum cost.
In the Ship Unloading Path Problem, if a vessel needs to visit n ports, the total number of possible paths is:
(4)
For example, when n = 5, the total number of paths is 5! = 120; when n = 10, the total number of paths is approximately 3.6 × 106. As n increases, the number of paths grows exponentially, a phenomenon known as combinatorial explosion [33].
Therefore, a pure enumeration algorithm is inefficient for large-scale unloading path problems. However, when combined with constraint-based pruning, it can effectively guarantee the global optimal solution for small- and medium-scale problems.
2.3. Constrained Optimization and the Principle of Cargo Capacity Limitation
A constrained optimization problem can be formalized as:
(5)
where
represents the objective function, and
,
denote the inequality and equality constraints, respectively.
In the context of the Ship Unloading Path Problem, a typical cargo capacity constraint can be expressed as follows:
1) Unloading constraint condition
(6)
where
denotes the quantity of cargo unloaded at port
during the k-th step of the path, and Q represents the total cargo carried by the vessel.
2) Remaining Cargo Constraint
(7)
which requires that after any unloading step mm, the remaining cargo on the vessel must be non-negative.
3) Feasible Path Constraint
If a given port does not meet its demand, the corresponding path is immediately deemed infeasible and pruned.
By introducing such constraints, the search space in the enumeration process can be significantly reduced, thereby improving computational efficiency [34].
4) Intelligent Search and Pruning Strategies
To address the inefficiency of enumeration algorithms, researchers commonly adopt pruning strategies. The core idea is that during the enumeration process, if a partial path is found unlikely to yield a better solution, the search along that branch is terminated early.
Common pruning methods include:
Bound-based pruning
If the sum of the current partial path cost Cpartial and the theoretical minimum remaining cost LB already exceeds the known optimal solution C*, the branch can be discarded.
Constraint-based pruning
If the current partial path violates cargo capacity or operational sequence constraints, the branch is not expanded further.
Heuristic-based pruning
Paths lacking priority can be filtered early using heuristic functions (e.g., shortest-distance estimates) [35].
3. Optimal Unloading Path Search Algorithm Based on
Enumeration Method
During a single voyage, after completing loading operations, the target vessel must proceed according to the schedule to several unloading ports in sequence. The core task of the shipping scheduling system is to determine an economical and feasible unloading path—that is, to decide the sequence of unloading ports while ensuring that each port’s demand is met and draft/cargo load limitations (cargo capacity constraints) are satisfied, as well as to provide corresponding arrival, completion, and departure times. The proposed algorithm is based on the principle of enumerating all candidate unloading sequences combined with cargo capacity validation. It prioritizes solutions that minimize sailing distance while meeting port cargo constraints, and, when necessary, provides a manual adjustment interface to enhance practical applicability in real-world operations.
3.1. Algorithm Design
In international shipping scheduling, obtaining the optimal unloading path under port loading and unloading constraints is a key factor for improving transportation efficiency and reducing operating costs. Given that the number of unloading ports is limited and the constraints are clearly defined, this study introduces the Enumeration Method. By exhaustively generating all possible unloading schemes and progressively filtering them based on business rules, the algorithm ultimately identifies the optimal unloading path that satisfies all constraints.
The overall design of the algorithm follows the principle of “generate feasible solutions first, then gradually filter, and finally output the optimal solution”. It consists of five core steps:
1) Information collection and data acquisition;
2) Unloading scheme generation;
3) Voyage path construction and distance calculation;
4) Cargo capacity constraint validation;
5) Optimal path search and manual adjustment.
The overall framework is illustrated in Figure 1.
Figure 1. Flowchart of the algorithm.
3.1.1. Information Collection and Data Acquisition
Through a human-computer interaction interface, the scheduling plan and the target vessel’s Maritime Mobile Service Identity (MMSI) are collected. Port-related data (loading port, unloading ports, and the unloading volume for each port) is retrieved from the database. The raw data then undergo a cleaning and preprocessing stage, which includes removing missing values, discarding invalid ports, filtering out identical loading and unloading ports, and verifying whether ports belong to the same navigation region. To accelerate subsequent computations, Redis in-memory caching is adopted for data storage and quick access.
3.1.2. Unloading Scheme Generation
All unloading ports of the target vessel are first subject to a regional consistency check. If inconsistencies are detected, the input data must be reselected; if consistent, duplicate ports are removed, and permutations of the remaining ports are enumerated to produce all feasible unloading schemes.
For example, when the vessel with MMSI = 636,022,324 has two unloading ports, NLVSG and DEBRA (as shown in Table 1), two feasible schemes can be generated:
Scheme A: NLVSG → DEBRA
Scheme B: DEBRA → NLVSG
Table 1. Example of vessel information awaiting scheduling.
mmsi |
start_time |
end_time |
start_port_code |
Cargo_volume |
End_port_code |
Plan_id |
Arrival_time |
Unload_port |
636022324 |
2023-03-12 00:00:00 |
2023-03-18 12:42:00 |
BRPOR |
6000 |
UYPTP |
1 |
2023-03-17 07:54:00 |
NLVSG |
636022324 |
2023-03-18 12:42:00 |
2023-03-19 17:30:00 |
UYPTP |
6000 |
UYPTP |
1 |
2023-03-17 07:54:00 |
NLVSG |
636022324 |
2023-03-19 17:30:00 |
2023-03-20 13:39:36 |
UYPTP |
4200 |
UYPTP |
1 |
2023-03-17 07:54:00 |
DEBRA |
636022324 |
2023-03-20 13:39:36 |
2023-03-21 08:51:36 |
UYPTP |
4000 |
UYPTP |
1 |
2023-03-17 07:54:00 |
DEBRA |
1) Voyage Path Construction and Distance Calculation
Based on the last loading port and the unloading ports specified in each unloading scheme, the voyage path is constructed step by step. The inter-port distance table is queried to obtain the distance between any two ports, from which the total voyage distance is calculated. For example, if UYPTP is the last loading port, then:
Scheme A: UYPTP → NLVSG → DEBRA, with a total distance of 6663 nautical miles.
Scheme B: UYPTP → DEBRA → NLVSG, with a total distance of 6909 nautical miles.
According to the “shortest path priority” principle, the scheme with the shorter total distance is selected as the current unloading plan.
2) Cargo Capacity Constraint Validation
For the current unloading scheme, the vessel’s cargo load before and after each unloading port is calculated and compared against the maximum permissible load at that port to verify compliance with draft restrictions. If a port’s constraint is violated, the scheme with the next-shortest voyage distance is selected as the new candidate plan, and the validation process is repeated until all constraints are satisfied.
3) Optimal Path Search and Manual Adjustment
Once cargo capacity constraints are satisfied, the vessel’s estimated arrival, unloading completion, and departure times are further computed, and the results are written into the scheduling plan to generate the optimal unloading path (see Table 2). If scheduling personnel deem the result unreasonable due to factors such as policy changes or weather, they may manually input a preferred port sequence. The algorithm then recalculates the arrival and unloading completion times based on the user-defined order, revalidates the new scheme under the defined constraints, and updates the results, thereby producing the final optimal unloading path.
Compared with traditional experience-based manual scheduling methods, this algorithm leverages real business data and systematic computational rules to achieve efficient and accurate unloading path optimization, demonstrating strong practical application value.
Table 2. The scheduling results output by the algorithm proposed in this paper.
mmsi |
start_unload_time |
end_unload_time |
start_port_code |
cargo_volume |
End_port_code |
Plan_id |
Arrival_time |
636022324 |
2023-04-15 23:55:48 |
2023-04-18 21:12:36 |
NLVSG |
−8200 |
DEBRA |
1 |
2023-04-17 05:51:00 |
636022324 |
2023-03-21 08:51:36 |
2023-04-15 23:55:48 |
UYPTP |
−12,000 |
NLVSG |
1 |
2023-04-13 14:19:48 |
4. Numerical Experiments
To verify the effectiveness and practicality of the proposed optimal unloading path search algorithm based on enumeration, this study selected real scheduling plans from a shipping company covering the period from January to May 2023 as experimental data. These schedules were prepared by approximately ten schedulers, thereby reflecting the company’s actual operational conditions. The core objective of the experiment is to test the applicability and accuracy of the algorithm under real-world business data.
To ensure a fair evaluation, the accuracy of the algorithm was defined based on professional schedulers’ validation. Specifically, an algorithm-generated unloading path was classified as “correct” under two conditions: (i) the sequence of ports exactly matched the original schedule prepared by schedulers, or (ii) although the sequence differed, the schedulers confirmed that the path satisfied all practical constraints (e.g., draft limitations, port regulations, unloading priorities) and was considered operationally reasonable. This definition allows the accuracy metric to capture both exact replications and logically acceptable alternatives.
4.1. Data Sources and Experimental Design
The experimental data cover vessel schedules from January to May 2023, including information on target vessels, loading and unloading ports, cargo volumes, and relevant scheduling constraints. Under the principles of maintaining reasonable unloading sequences and satisfying cargo volume restrictions, the algorithm automatically generates and optimizes unloading paths. The resulting numbers of unloading voyages are shown in Figure 2.
Figure 2. Number of vessel unloading voyages from January to May 2023.
4.2. Experimental Results and Analysis
The experimental results demonstrate that the proposed algorithm achieved an overall accuracy exceeding 75% when applied to real scheduling plans from January to May 2023. Accuracy was evaluated by comparing the optimal unloading paths generated by the algorithm with those manually designed by professional schedulers. A solution was considered correct if it was judged by schedulers to be logically consistent with practical unloading operations.
The findings reveal several key observations:
1) Stability across different scenarios. The algorithm consistently maintained high stability across different months and task scales. Even in months with a large number of voyages—such as January and April, with 67 voyages each—it was still able to efficiently generate feasible solutions.
2) Practicality ensured by capacity constraints. By integrating the cargo capacity constraint principle, the algorithm effectively prevented infeasible solutions caused by ship overloading, thereby ensuring that the output was operationally viable.
3) Efficiency compared with manual scheduling. In contrast to traditional experience-based planning, the algorithm substantially reduced repetitive tasks and significantly shortened the time required for schedulers to design paths. This efficiency gain provides strong support for shipping enterprises undergoing digital transformation.
Overall, the numerical experiments validate the effectiveness and applicability of the proposed algorithm in real-world business contexts, demonstrating both robustness and practical utility.
5. Discussion and Outlook
5.1. Advantages and Innovation
The enumeration-based optimal unloading path search algorithm proposed in this study offers several innovations by integrating path planning with real-world operational constraints. First, by generating all permutations of unloading ports, the algorithm ensures comprehensive path exploration and guarantees the identification of globally optimal solutions. In both the experimental dataset and common practice, the number of unloading ports per voyage does not exceed five, making this exhaustive approach computationally efficient and tractable. Unlike commonly used heuristic methods, this exhaustive approach is not only feasible in shipping scenarios with a limited number of ports but also provides strong interpretability, which is essential for practical decision-making.
Second, the incorporation of cargo capacity constraints into path selection represents a key advancement. The algorithm rigorously verifies whether ship loading and unloading activities at each port satisfy draft restrictions, thereby producing results that are more consistent with actual operational requirements.
Third, the design of a manual adjustment mechanism enhances practical usability. Scheduling personnel can refine system-generated solutions, which then trigger recalculation and validation. This design achieves a synergistic integration of intelligent computation and human expertise.
Finally, the use of databases and caching technologies significantly improves data processing and query efficiency, aligning with the optimization trends of modern logistics information systems.
Collectively, these innovations ensure that the algorithm not only guarantees the theoretical global optimality but also provides flexibility for handling business constraints and manual interventions. The proposed algorithm can be integrated into Terminal Operating Systems (TOS) or vessel management platforms to automatically generate optimal unloading sequences and estimated operation times, while allowing manual adjustments for practical contingencies. This integration can improve berth utilization, reduce vessel idle time, and enhance overall operational efficiency, offering a practical perspective for intelligent maritime logistics management.
5.2. Limitations and Future Improvements
Despite its advantages, the algorithm still has notable limitations. First, the computational complexity of enumeration increases factorially with the number of ports, which undermines efficiency in large-scale scenarios. Existing studies often address this challenge by adopting heuristic or branch-and-bound methods to improve scalability. Second, this study focuses solely on cargo capacity constraints, without accounting for additional critical dimensions such as time windows, fuel consumption, carbon emissions, and meteorological conditions. These factors are becoming increasingly important in the context of green and sustainable shipping. Third, the current algorithm relies on static data and lacks the ability to dynamically re-optimize solutions in response to disruptions such as adverse weather conditions or port congestion, thereby limiting its adaptability to real-time uncertainties. Finally, while manual adjustments provide flexibility, they remain heavily dependent on human experience and lack intelligent recommendation support, introducing potential risks of subjective bias.
Future work may proceed in the following directions: 1) integrating enumerat ion with heuristic methods to balance exactness in small- and medium-scale problems with efficiency in large-scale cases; 2) expanding the range of constraints to construct multi-objective models that simultaneously address economic and environmental goals; 3) leveraging real-time data and predictive analytics to enhance adaptability and robustness; and 4) incorporating intelligent recommendation mechanisms into the manual adjustment process to reduce dependence on subjective experience.
In conclusion, while the algorithm demonstrates strong interpretability and alignment with business requirements, further research is needed to improve its scalability, adaptability, and ability to handle multi-dimensional constraints in complex shipping environments.