1. Introduction
Maritime shipping in complex marine environments poses a major challenge, as it is necessary to ensure the safety of navigation, minimise travel time, and optimise logistics management at the same time. These challenges are particularly pronounced in areas with numerous geometric obstacles such as coastlines, islands and infrastructure, as well as in areas with OWFs, where fast and safe access for maintenance, inspection and operational support is crucial.
Previous studies have largely relied on theoretical modelling and simulations, which limit their applicability in real-world conditions, while empirical data and dynamic approaches rarely consider all relevant logistical and environmental factors.
This study focuses on analysing the maritime route networks in the area of the Croatian ports of Pula and Rijeka, including the main access routes to OWFs and zones with multiple navigational challenges. The focus is on the harmonisation of safety criteria, logistical efficiency, and access times to enable fast and reliable supply, maintenance and operational monitoring in the offshore area.
The aim of this research is to develop an empirically based and practically applicable framework for the optimisation of sea routes that combines analytical precision with operational efficiency. By applying Dijkstra and A* algorithms in parallel, the study enables a comparison of the performance of deterministic and heuristic approaches, including their ability to reduce navigational risk, optimise voyage costs, and ensure fast logistical access to OWFs. Such a comparative approach provides insights into the advantages and limitations of each algorithm and contributes to the selection of optimal methods under real-world and dynamic conditions.
To achieve these goals, empirical methods were applied, including the analysis of real and simulated maritime route networks, the evaluation of statistical route parameters (distance, travel time, obstacle risk), and the visualisation of results to assess logistical and operational efficiency.
The paper begins with an introduction and overview of the research to date, which is divided into five subsections: algorithms for optimal route planning, the influence of wind and obstacles, safety assessment in the vicinity of OWFs, the application of Machine Learning (ML) and advanced heuristics, and comparative studies of A* and Dijkstra algorithms. The second chapter contains a detailed presentation of the data used, the methodology applied and the implementation of the algorithms, including comparative analyses, with all analyses performed using the R package version 4.5.1. The third chapter presents the results together with all metrics, graphical interpretations and validation procedures, while the fourth chapter analyses the results through a comprehensive discussion. The paper concludes with a summary of the main results, followed by a list of abbreviations and references.
1.1. Algorithms for Optimal Route Planning Between Ports and OWFs
The implementation of Dijkstra’s algorithm in the R environment has demonstrated high reliability in finding the shortest path within known graphs, making it a valuable tool for modelling and analysing complex maritime transport networks [
1].
Beyond its conventional use, scientists have integrated the capability plot method with Dijkstra’s algorithm to optimise vessel routes between anchorages. This approach takes into account not only the shortest distance, but also important navigational factors such as safety requirements, geometric constraints and journey times, thus strengthening decision-making when planning sea routes [
2].
The fusion of Automatic Identification System (AIS) data with Dijkstra’s algorithm has further improved navigation by enabling routes that are both safer and more efficient.
This integration emphasises the added value of combining algorithmic models with real-time navigation information, particularly in reducing risks in congested or difficult waters [
3].
For logistics purposes, researchers have developed methods that combine the Dijkstra algorithm with the C-W Savings algorithm and have demonstrated a measurable reduction in total distance and delivery times. Such integration proves to be particularly beneficial for maritime logistics operations where time and efficiency are critical factors [
4].
A practical application of route optimisation was carried out on the Shanghai-Vladivostok corridor, where quantitative and simulation-based analyses were used to determine the most efficient and safest sea routes. This case shows that the use of a multi-method framework provides more robustness in real-life shipping scenarios [
5].
In parallel, voyage optimisation algorithms have been developed with the dual aim of increasing shipping safety and improving energy efficiency. These algorithms make a significant contribution to reducing fuel consumption and pollutant emissions. They therefore directly support sustainable vessel operation and influence vessel design strategies [
6,
7].
Another dimension of route optimisation is the reduction in structural risks for vessels. Studies show that advanced routing models can prevent scenarios such as crack propagation that pose a serious threat to the integrity of vessels, highlighting the broader role of optimisation in maritime safety management [
8].
Comparative evaluations between the Dijkstra and A* algorithms have demonstrated the superior adaptability of the A* algorithm under complex maritime conditions, where the flexibility of trajectory adaptation is crucial for maintaining operational safety [
9].
The introduction of artificial intelligence and ML has marked another step forward in route optimisation. Deep learning approaches, in particular deep Q-nets, have been successfully used for adaptive trajectory optimisation in near-shore waters and have improved the ability of vessels to autonomously adapt to dynamic maritime environments [
10].
At the same time, research in the field of unmanned and autonomous surface vessels has emphasised both the safety and efficiency of route planning, highlighting the importance of integrating advanced algorithms into next-generation navigation and control systems [
11,
12].
More recently, the combination of Dijkstra’s algorithm with the artificial potential field method has enabled real-time navigation in dynamic marine environments. This hybrid approach addresses both global path optimisation and local obstacle avoidance and provides a practical solution for real-time navigation of unmanned surface vessels [
13].
1.2. Heuristic and Advanced Algorithm Changes
The comparative study of path planning algorithms has shown that both the A* algorithm and Dijkstra’s algorithm provide valuable capabilities for autonomous navigation, but their performance differs under different maritime conditions. While Dijkstra guarantees optimal solutions, A* provides more efficient pathfinding in large or complex search spaces, making it particularly useful for autonomous navigation of surface vessels [
14].
Building on these foundations, a smoothed A* algorithm for non-holonomic mobile vessels has been proposed that takes into account kinematic constraints often overlooked by standard algorithms. This improvement allows for more realistic and efficient route planning, especially in scenarios where vessels have to comply with turning radius and dynamic manoeuvrability constraints [
15]. Further refinements to heuristic methods include multiscale collision risk functions, hexagonal grid-based search spaces and parallel computational structures. These innovations, introduced in recent research, significantly improve route safety and computational efficiency when navigating in crowded or obstacle-rich maritime environments [
16,
17,
18].
A systematic review of route planning algorithms emphasises the need to comply with international collision avoidance regulations from a safety and regulatory perspective. This perspective emphasises the dual requirement to ensure operational efficiency while complying with maritime safety standards, which remain critical for the deployment of autonomous surface vessels [
19].
Advanced hybrid methods have also been developed, in particular by integrating the hybrid A* algorithm with the Dynamic Window Approach (DWA). These methods have been shown to improve trajectory planning by combining the global path finding capabilities of A* with the local obstacle avoidance capabilities of DWA, resulting in safer and more efficient navigation [
20,
21]. In addition to deterministic algorithms, reinforcement learning methods, in particular Double-Depth Reinforcement Learning (DDRL), have enabled adaptive route optimisation. Such approaches allow vessels to learn dynamically and adapt routes in real time, improving robustness under uncertain and rapidly changing maritime conditions [
22,
23,
24].
Parallel research has also focused on adaptive heuristics and parallel computing techniques, which together help to improve the scalability and effectiveness of route planning. By distributing computational loads and adapting heuristics to environmental variability, these methods enable faster and more reliable performance in complex operational scenarios [
25,
26].
Recently, large-scale language models have been integrated into real-time systems for multi-vehicle navigation. These systems combine heuristic principles with ML and enable dynamic adaptation to changing conditions at sea. Analyses show that such systems can effectively reduce travel time and conflicts compared to classical algorithms such as A* and Dijkstra. This points to a new era of intelligent, AI-controlled navigation systems in the maritime sector [
27].
1.3. Effects of Environment and Obstacles on Route Optimisation
Recent studies underline that environmental factors such as islands, wind and water depth have a decisive influence on route optimisation. These elements have a direct impact on voyage costs, both in terms of the energy required to overcome navigational obstacles and the associated safety risks. For example, research into improved A* algorithms has explicitly considered currents, water depth and traffic separation rules to create safer and more realistic vessel trajectories in confined waters [
28]. Similarly, global trajectory planning approaches based on the streamline method have shown improved adaptability for unmanned surface vehicles operating in complex sea areas with numerous environmental disturbances [
29].
A broader perspective on global planning methods emphasises the importance of incorporating non-holonomic vessel dynamics and the effects of complex ocean currents. Such approaches enable more accurate modelling of real-world navigation conditions, which improves both the efficiency and safety of maritime operations [
15,
30].
Complementary to wayfinding, research has focussed on real-time vessel state estimation. The application of Kalman-Philtres has been shown to be effective in predicting and correcting vessel heading deviations, reducing the risk of collisions in OWF [
31]. In parallel, probabilistic models have been developed to quantify navigational risks by defining tolerable collision probabilities between vessel routes and OWF [
32,
33]. These probabilistic frameworks provide a quantitative basis for the determination of safe operating distances and the design of reliable navigation corridors.
Finally, fuzzy inference systems have proven to be valuable tools for assessing navigation risks in the vicinity of OWFs. By capturing uncertainties and non-linearities inherent to maritime environments, fuzzy-based models enable a more accurate assessment of vessel-obstacle interactions, thus improving safety management and route optimisation decision making [
34].
1.4. Maritime Safety and Navigational Risk Assessment
The area of maritime safety and risk assessment for shipping has attracted considerable attention due to the increasing complexity of offshore activities. Studies have focussed on determining the minimum safety distance between vessels and offshore structures, which is a crucial factor in preventing accidents and ensuring safe shipping. Analyses show that OWFs pose unique hazards to shipping that require a refined methodology for determining safety distances [
35,
36,
37].
AIS-based approaches provide valuable insights into encounter frequency and collision probability. By integrating the modelling of traffic behaviour with the prediction of encounters, these methods improve the accuracy of risk assessments, especially in busy sea areas near OWFs [
38,
39]. Such applications demonstrate the role of AIS as a fundamental tool for quantifying navigational risks and supporting evidence-based decisions.
Safety criteria such as tolerable collision probability are also used to model minimum safety distances. These probabilistic frameworks enable risk quantification under different traffic and environmental conditions and contribute to robust safety planning [
32,
40].
In addition to probabilistic modelling, comparative studies across different jurisdictions have improved the understanding of how navigational risks are assessed worldwide. International comparisons contribute to the harmonisation and standardisation of safety protocols and provide a common framework for assessing risks around OWFs [
36,
41]. Beyond traditional modelling, innovative approaches such as artificial multi-target potential field models in combination with hybrid A* algorithms further minimise collision risk by improving the manoeuvrability of vessels in dynamic maritime contexts [
21].
Another important dimension of maritime safety is regulatory oversight through Port State Control (PSC) inspections. The application of advanced ML models and multi-criteria decision making methods has significantly improved the efficiency of PSC inspections, thereby raising maritime safety standards [
42,
43]. These methods allow authorities to prioritise inspections based on objective, data-driven assessments.
The integration of ML into the risk assessment of shipping goes beyond inspections. Adaptive navigation under uncertain and dynamic environmental conditions can be supported by machine learning models, allowing ships to react flexibly to unforeseen obstacles [
23,
24,
44]. In addition, distribution-based reinforcement learning improves the robustness of route planning by incorporating dynamic obstacles and variable wind conditions, thus ensuring safer and more reliable navigation [
44].
1.5. Comparative Studies and Conclusions
Comparative analyses show that the A* algorithm generally provides faster and more energy-efficient routes in complex scenarios, while the Dijkstra algorithm retains an advantage in static and known graphs [
14,
25].
The application of combined methods and optimised heuristics helps to reduce the collision risk and improve navigation safety [
2,
17].
In contrast to previous studies, this research makes an important contribution to the optimisation of sea routes through the empirical application of Dijkstra and A* algorithms in the ports of Pula and Rijeka, which consist of two ports, three obstacles (mainland and islands) and three OWFs. This approach goes beyond the generic networks, theoretical models and simulations prevalent in the existing literature, which often lack empirical validation in real maritime environments and only consider dynamic wind conditions and geometric obstacles to a limited extent [
28,
29,
31]. This gap represents an important research gap that the present study addresses.
The integration of adaptive heuristic modifications of the A* algorithm with real wind data enables dynamic route planning that optimises travel costs while reducing the risk of collision. The parallel application of Dijkstra’s algorithm provides reliable reference results in known graphs and enables a detailed comparative analysis of the performance of both algorithms under real-world conditions [
2,
16,
18]. This provides insights into the advantages and limitations of each algorithm and overcomes the limitations of previous simulation-based studies.
In addition, the study further develops navigational risk assessment methods by integrating wind measurements and obstacle modelling, contributing to increased safety in complex port areas and near OWFs [
21,
32,
34]. This creates a novel framework for sea route optimisation that combines empirical data with theoretical algorithms and increases the practical applicability for planning safe and energy-efficient trajectories.
The main contributions of this research can be summarised as follows:
Empirical validation of the algorithms in real ports, overcoming the limitations of previous simulation and theory-based studies.
Integration of dynamic wind and obstacle data into the route optimisation process, enabling a realistic cost and risk assessment.
Comparative evaluation of the Dijkstra and A* algorithms under real maritime conditions, providing both quantitative and qualitative insights into the performance of the algorithms.
Improved practical applicability of the algorithmic methods for safe and energy-efficient navigation in complex maritime environments.
This approach enables not only the evaluation of the efficiency of algorithms under controlled conditions, but also their practical application in real maritime scenarios. This closes a gap in the literature and contributes to safety, cost optimisation, and trajectory planning in complex maritime environments.
Although the paper emphasises “empirical validation” and “dynamic wind integration”, the specific innovation compared to previous studies is the following: In contrast to previous studies relying on theoretical models, simulations or generic networks, this study applies Dijkstra and A*’s algorithms directly in real maritime conditions between the ports of Pula and Rijeka, involving two ports, three onshore obstacles (mainland and islands) and three OWF. With this approach, the performance of the algorithms is empirically evaluated in a real environment, including actual wind conditions and geometric obstacles that were largely ignored in previous studies.
A further innovation lies in the application of adaptive heuristic modifications to the A* algorithm, which enable dynamic route planning based on real wind data, while the parallel application of Dijkstra’s algorithm provides a reliable reference for comparison. This clearly shows how both algorithms work under real conditions by optimising travel costs and reducing collision risk. Compared to previous research, they therefore make an important contribution to route planning in complex sea areas.
2. Materials and Methods
2.1. Data
Spatial and meteorological data relevant for the optimisation of sea routes were collected for this study. The data set includes:
Geographical locations of ports—precise coordinates of the most important ports in Croatia, which serve as important reference points for navigation and route planning.
Geographical locations of OWFs—coordinates of offshore or nearshore (coastal) installations that allow these obstacles to be included in risk assessment and route optimisation models.
Obstacle coordinates—polygons that define the outlines of islands and land masses and are essential for obstacle modelling and collision avoidance in algorithmic route planning.
Meteorological data—information on wind direction, frequency and average speed, which is crucial for a realistic assessment of route costs, navigation safety and optimal routing of vessels.
These data enable the integration of spatial and meteorological dimensions into maritime route planning and form the basis for the empirical application of Dijkstra and A* algorithms under real conditions.
Table 1 contains the exact geographical coordinates of two large ports in Croatia: Pula and Rijeka. The coordinates are given in latitude (x) and longitude (y). These coordinates are essential for maritime navigation as they enable the exact positioning of vessels in relation to ports and the planning of routes. Important to notice, in this research, the two observed ports (the port of Pula and the port of Rijeka) are defined by the coordinates that are very near but not exactly within the territory of the port itself. The reason for this lies within the fact that it was rather easier to do the mapping process and for the simulations to run faster as the authors wanted to minimize the number of points in the polygons that represent the obstructions. This selection does not result with the loss of generality of the methodology used in this research.
These coordinates serve as reference points for navigation, route optimisation, and spatial analysis in maritime operations.
Table 2 shows the locations of three OWFs. Similarly to ports, each OWF is identified by its latitude (x) and longitude (y) coordinates.
The table enables the integration of renewable energy installations in navigation charts and maritime simulations.
Table 3 contains geographical coordinates that define the outlines of islands and coastal land masses. Each unit is represented as a polygon, a closed set of points modelling obstacles relevant for navigation. These polygons are crucial for route planning and collision avoidance as they delineate areas that must be avoided.
The first polygon (Island1) corresponds to the island of Cres, one of the largest in the Kvarner region. Its coordinates cover both the northern and southern parts of the island and thus reflect the actual spatial extent of the island.
The second polygon (Island2) marks the small rocky island with the Galijola lighthouse, which lies to the south-west of Cres. The compact shape of the polygon reflects the limited area of this navigational landmark.
The third polygon (island3) refers to the coastal area near Pula and outlines the west coast of Istria. This land mass forms a natural barrier that must be taken into account when calculating the sea routes.
By connecting the coordinate points, each polygon represents the physical course of the corresponding island or landmass, thus ensuring the accuracy of the navigation systems and the reliability of the simulated sea routes.
Table 4 contains meteorological data showing the frequency and average wind speed from different directions around Pula in 2023 [
45].
Wind direction: Indicates the direction from which the wind is coming.
Frequency (%): Percentage of time the wind blows from this direction.
Speed (m/s): Average wind speed associated with the particular direction.
Full direction name: Converts the standard abbreviations (N, NE, ENE, etc.) into full, descriptive names to improve clarity.
For example, the table shows that winds from the east-northeast (ENE) occurred 14.2% of the time with an average speed of 4.8 m/s, while 22.8% of the time there was no wind. This information is crucial for vessel operations, sail planning, and navigational risk assessment in the vicinity of the port [
45].
Table 5 is similar to the previous one but shows the wind conditions in the port area of Rijeka for the same year. It contains the wind direction, frequency and speed, but without the complete directional data. For example, the wind from NNE (north-northeast) had a frequency of 20.9% with an average speed of 2.3 m/s, while calm winds were rare at 0.7%.
Table 1,
Table 2,
Table 3,
Table 4 and
Table 5 together form a comprehensive data set with spatial information (ports, OWFs, obstacles (islands, land masses)) and meteorological information (wind direction and speed), which are essential for the forward planning of sea routes and for operational decisions.
2.2. Methodology
This study is based on the empirical application of algorithms to optimise sea routes in complex and dynamic sea conditions, with a focus on navigational safety and energy efficiency. The Dijkstra algorithm, implemented via the function “
shortest_paths()” in the R package “
igraph” [
1], and the A* (A-star) algorithm with adaptive heuristic modifications, including parallel computation methods and optimised heuristics for dynamic routing, are investigated.
The wind measurements for each port are derived from local wind roses, which contain information on direction, frequency and speed. Each grid point is assigned to the nearest port, with wind conditions depending on the frequency of certain wind directions and speeds. This approach allows a precise simulation of the influence of wind on route costs and safety risk, taking into account local meteorological conditions. The integration of actual wind conditions into the model enables dynamic route planning that optimises voyage costs and minimises the risk of collision. So, in this study, wind direction and speed were assigned to each grid point by spatial interpolation. Specific wind parameters were assigned to each grid node based on its spatial proximity to the nearest port to ensure that local meteorological conditions are accurately represented in the model. This approach enables consistent integration of port-based wind data into the grid system used for route optimisation.
Obstacles and OWFs were selected based on their spatial distribution and navigational importance. Land and islands are modelled as static geometric obstacles, while OWFs are treated as dynamic risk elements in route optimisation. Each route between the ports must fulfil the obstacle avoidance criteria, with the algorithms optimising the paths in terms of distance, time, and the energy required to overcome wind resistance.
Optimal routes are calculated using the Dijkstra algorithm, which provides reliable reference results in static and known graphs, and the A* algorithm, whose heuristic function and adaptive changes enable faster and more energy-efficient route planning under complex conditions. The performance of the algorithms is evaluated using quantitative metrics, including total route cost, resistance, execution time, security risk, computation time to compute the optimal route, and energy efficiency. This comparative analysis accurately demonstrates the benefits and limitations of each algorithm under real-world conditions, going beyond simulations and theoretical studies.
The visual component includes graphical representations of routes, obstacles, OWFs, and wind directions as interactive maps that allow an immediate assessment of the spatial distribution of risk, the interaction of the vessel with obstacles, and the impact of the wind on the optimised trajectories. These visualisations support both the quantitative and qualitative evaluation of the algorithm’s performance, facilitate the interpretation of the results in a practical context, and allow the direct comparison of different approaches.
The comparative analysis is performed by evaluating the results of Dijkstra and A* according to several criteria: minimum distance, total cost of the route including wind influence, execution time of the algorithm, and safety risk due to interactions with obstacles and OWFs. This approach quantifies the benefits of the heuristic modifications of the A* algorithm under complex conditions while validating the reference results of the Dijkstra algorithm.
The study area includes important route nodes, with land and islands as geometric obstacles and OWFs as dynamic risk elements. The sea area is divided into grid points, which are assigned to the nearest nodes and wind conditions (direction in radians, speed by frequency, and directional labelling for visualisation). Dijkstra is applied for shortest paths and A* with adaptive heuristics and parallel processing considering distance, wind, and safety risk. Route costs, execution time, and energy requirements are calculated, and safety risk is assessed in conjunction with land, islands, and OWFs. Interactive maps and graphical outputs make it possible to analyse the impact of wind and obstacles on the routes and support the quantitative and qualitative evaluation of the algorithm’s performance.
The empirical results are validated by simulations and theoretical modelling. In this way, a route optimisation framework will be developed that contributes to safer and more energy-efficient navigation.
The overview of the research methodology for empirical maritime route planning is summarised in
Figure 3. It illustrates the key steps from the definition of the research area, network formation and wind distribution, application of the algorithm, performance evaluation, and visualisation to the final analysis and conclusions.
2.3. Dijkstra Algorithm
Dijkstra’s algorithm is a fundamental tool for finding shortest paths in graphs with positive edge weights. Although it was developed in 1956, its importance and applicability are undisputed. Current research is continuing to improve it for more complex and dynamic systems [
46].
The algorithm provides a method to find the shortest paths in a graph where each edge between the nodes has a certain weight or cost, such as distance or time. The algorithm starts with an initial node and gradually determines the minimum distances to all other nodes in the graph. The key principle is the “closest-first” strategy, i.e., at each step the algorithm selects the node that is closest to the source, i.e., the node with the smallest distance among all unprocessed nodes. In this way, the algorithm ensures that the first time it calculates the distance to a node, this value represents the “shortest possible path” from the source to this node.
After selecting the closest node, the algorithm checks all its neighboring nodes and updates their distances if a shorter path via the processed node exists. Consequently, the minimum distances gradually “propagate” through the graph until all nodes have been processed or until the distance to the destination node has been found.
In the context of optimal route planning, the cost of moving between two nodes (e.g., two ports or waypoints at sea) is not only the physical distance but may also include additional factors such as wind resistance or other unfavorable conditions. The total cost of crossing an edge (route segment) is defined in Equation (1):
Here, stands for the base distance between two nodes, in direct analogy to the edge weight in Dijkstra’s algorithm. If only were used, the algorithm would simply search for the shortest path by length. However, the formula introduces an additional factor that takes unfavorable conditions into account.
The resistance is defined as Equation (2):
where
denotes the difference between the vessel’s heading and the wind direction. This implies the following:
When the vessel moves in the same direction as the wind ( = 0°), cos(0°) = 1, hence .
When the vessel moves against the wind (, cos(180°) = −1, hence . The costs increase in proportion to the wind speed.
For all other angles, the resistance is between 0 and 1, proportional to how unreliable the wind is.
The factor Equation (2) therefore scales the effect of unfavourable wind conditions on the costs. Higher wind speeds or more unfavourable angles increase the total cost of the segment.
Accordingly, the total cost formula effectively combines the physical distance with the air resistance in the environment so that Dijkstra’s algorithm can search not only for the shortest path by length, but also for the most favourable path considering wind and air resistance. In this context, the “edge weighting” becomes dynamic and environment-dependent instead of being a fixed distance, which is crucial for realistic route optimisation.
The time complexity of the algorithm describes the number of operations required to find all shortest paths, depending on how the nodes are organised and searched. When advanced data structures such as Fibonacci clusters are used, finding the node with the smallest distance and updating its neighbours is very efficient, resulting in an overall complexity of ). Here, denotes the number of nodes, the number of edges, and results from logarithmic-time operations required for managing the priority structure. This complexity implies that the runtime grows linearly with the number of edges and logarithmically with the number of nodes.
This complexity means that the runtime increases linearly with the number of edges and logarithmically with the number of nodes.
With simpler data structures, such as arrays, each unprocessed node must be checked to find the smallest distance, which leads to a complexity of , as the linear search is repeated for each node. Understanding these formulas makes it clear how the size of the graph and the data structures directly affect the execution speed and why advanced structures significantly speed up processing in large graphs.
Recent optimisations include improvements in node selection and data storage that reduce memory requirements and increase efficiency, especially in large networks such as logistics and transportation. Research has shown that Dijkstra’s algorithm is “
universally optimal” when implemented with appropriate data structures such as advanced heaps, i.e., the fastest possible for a variety of graphs [
47].
Recently, a research team at Tsinghua University has developed an algorithm that eliminates the need for sorting nodes, overcoming a long-standing bottleneck in Dijkstra’s implementation. This approach enables faster execution for all graphs [
48].
2.4. A* Algorithm
The A* algorithm is a heuristic method to find the shortest or most efficient route from a start node to a destination node in a graph [
49]. In the context of maritime navigation, the graph can represent a network of points at sea, including ports, islands, and OWFs. Each node represents a position, and an edge represents a path between two positions with corresponding costs (e.g., distance and wind resistance).
The main formula of the A* algorithm is represented by Equation (3).
where
—represents the actual cost from the start point to the current node
. In the maritime context of this study, it is defined as Equation (4):
In Equation (5), represents the distance between consecutive nodes on the route is the wind speed at node , and is the difference between the vessel’s heading and the wind direction calculated as: . If , it is calculated as .
The term
accounts for wind resistance.
In Equation (6)——represents the heuristic estimate of the remaining cost from the current node to the destination, and in this study, it is expressed as the Euclidean distance between and the destination, adjusted to account for the average wind effect along the path to the destination.
represents the average wind speed between the current node and the destination, while is the difference between the vessel’s heading and the average wind direction.
—is the total estimated cost of the path through node . A* selects the node with the smallest value for further exploration.
In maritime navigation, the classic A* algorithm, which uses only the Euclidean distance as a heuristic, often provides the theoretically shortest but not the practically optimal route due to the influence of wind and other hydro-meteorological factors. By introducing the wind resistance factor into both the actual and heuristic cost formulae, the model more accurately reflects real-world navigation conditions. As a result, the algorithm adapts to the specific characteristics of the maritime environment and enables the selection of routes that are not only shorter, but also more energy efficient and safer.
In this way, the A* algorithm evolves from a purely geometric-based method to an energy-oriented routing model in which meteorological parameters directly influence the decision on the optimal route. This approach provides more realistic estimates of journey times and costs, which is particularly important when planning routes through complex waters with pronounced wind effects.
2.5. A Comparative Perspective
This study uses the simultaneous application of Dijkstra’s and A* algorithms to reconcile theoretical accuracy with operational efficiency in the optimisation of sea routes. Dijkstra’s algorithm determines the shortest path from the initial node to all other nodes in a graph, taking into account distances and additional factors such as wind resistance, which are included in the cost calculation for each route segment. Since the algorithm does not use heuristics, it must process all nodes in the graph to ensure minimum cost, which can be time-consuming for large graphs.
The A* algorithm extends Dijkstra’s principle by introducing a heuristic function that estimates the remaining cost from the current node to the target. This goal-oriented search enables faster identification of a practically optimal route. In the context of maritime navigation, the A* algorithm takes into account meteorological conditions, distances, wind resistance, and navigational safety, resulting in a more energy and time-efficient route, especially on complex waterways.
The simultaneous application of both algorithms makes it possible to combine the reliability and precision of Dijkstra with the efficiency and adaptability of A*, thus achieving a balance between theoretically minimised costs and operational practicability under real navigation conditions. The integration of the two approaches leads to a synergy: Dijkstra’s algorithm provides a rigorous basis for validation, analytical insights and the generation of statistical indicators (e.g., drag distribution, speed variability), while A* contributes operational flexibility, speed and scalability, which are crucial in real-time navigation or simulation scenarios. In this way, the methodological framework combines theoretical reliability with algorithmic efficiency and provides a robust and practical platform for optimising sea routes under complex and dynamic conditions.
Table 6 provides a detailed comparison of the Dijkstra and A* algorithms in key areas. These include the algorithm type, search strategy, exact formulae for cost and heuristics, influence of wind, complexity, efficiency and application in maritime navigation. The variables are clearly explained to facilitate understanding of the implementation and theoretical basis of the algorithms.
The distance between two consecutive nodes of a sea route cannot be accurately determined solely on the basis of differences in geographical coordinates, as latitude and longitude () are not linear measures. A difference of 0.1 degrees in latitude is not the same distance as a difference of 0.1 degrees in longitude, especially since the distance represented by longitude decreases as you approach the poles. Furthermore, the earth is not a flat surface but a sphere, so an accurate calculation of the distance between two points requires geodetic methods that take into account the curvature of the earth. For these reasons, the haversine formula (Equation (9)) is used, which allows the actual distance between two points on a sphere to be accurately determined by using the differences between the latitude and longitude of each segment.
Using this formula Equation (9) ensures that all distances are based on the actual geometry of the earth and not on an approximation of a flat surface, which is particularly important for navigation at sea and route optimisation. In this way, each segment of the route can be accurately quantified and the overall route realistically assessed, taking into account wind conditions, existing obstacles and specific navigation requirements.
and
The radius (R) of the Earth is 6371 km.
3. Results
3.1. Results of Dijkstra and A* Algorithm
The results of Dijkstra’s algorithm are shown in
Table 7 and demonstrate the efficiency of the algorithm in the context of planning a sea route between the Start_Harbour and WF_End (Wf3). The algorithm determined a route with 12 nodes that reflects a branched network of possible directions. The route length of 0.25314 in combination with the total cost of 0.26235 shows that the chosen route is relatively optimal in terms of minimum resistance and energy required for navigation.
The average resistance of 1.26504 indicates that the wind and sea conditions are moderate, while the maximum resistance of 4.61731 indicates the presence of localised adverse conditions that the algorithm was able to avoid. An average angle difference of 85.91° indicates that the route contains significant directional changes that may affect the vessel’s manoeuvring and fuel consumption.
The average wind speed of 2.22 and the maximum wind speed of 4.8 indicate that the algorithm takes wind into account as a factor in determining the optimal route, which is particularly important in maritime navigation. The algorithm’s execution time of 0.25899 s confirms its speed and suitability for real-time use in navigation planning systems.
Analysing the average wind speeds shows that in most cases these values alone do not necessitate a change in course for modern motor vessels. However, in combination with certain wind directions and traffic density, route optimisation can be of practical importance in order to increase the safety and efficiency of shipping. This justifies the inclusion of wind as a factor in the route simulations, even if the average values do not require a direct course adjustment in most situations.
Overall, these results show that the Dijkstra algorithm can efficiently select a safe and energy-efficient route, taking into account parameters such as resistance, wind, and directional changes.
Figure 4 shows the optimal route using Dijkstra’s algorithm. The ports are marked in blue, the OWFs in green, and the optimal route is shown with a red line. Wind direction and strength are represented by orange arrows on specific grids to illustrate the influence of the wind on the planned sea route.
Figure 5 shows a histogram of the wind directions assigned to all grid nodes in the entire area. The diagram clearly illustrates the frequency of the different wind directions in all grids and gives an insight into the prevailing directions and the variability of the wind within the analysed region.
Table 8 shows the results of applying the A* algorithm to determine the optimal route between the ports Start_port and WF_end (Wf3). The route includes 12 nodes, with a total length of 0.25314 and a total cost of 0.26235. The average resistance along the route is 0.44782, while the maximum resistance is 1. The average angular difference between the nodes is 83.86° and the average wind speed along the route is 2.21667, with a maximum of 4.8. The execution time of the algorithm is 0.53059 s, which proves the efficiency of the A* algorithm in route planning under wind conditions.
The interactive map in
Figure 6 visualises the optimal route calculated with the A* algorithm. The map allows the user to dynamically follow the path between the start (port) and destination (OWF), including the intermediate points along the route. The arrows on the map indicate the direction and strength of the wind and help to understand how the environmental conditions influence the choice of route. Colours and marker sizes can reflect important parameters such as wind speed or resistance, making the map very useful for analysing route efficiency and planning navigation. Interactive elements allow zooming and detailed inspection, which increases both clarity and practicality in maritime traffic simulations. In addition, the map includes a full legend and offers the ability to switch individual elements on or off, allowing users to selectively view certain features and better interpret the environmental and navigational data.”
The negative sign in the
wind_dir column in
Table 9 means that the wind is blowing in the opposite direction to the vessel’s planned course. This results from the use of the
atan2 function, which returns angles in the range from −
π to +
π. Negative values correspond to wind vectors that are on the opposite side of the reference direction, while positive values indicate wind vectors that support the motion of the vessel. Although these angles can be normalised to the range 0–360° if required, they are already converted to standard compass directions in the
dir_label column. The
wind_dir values directly reflect the deviation of the wind from the intended course of the vessel: positive values reduce the segment cost by supporting the movement, negative values increase the segment cost by counteracting it, and a zero value represents calm conditions that have no effect on the cost. This explanation illustrates how wind direction and strength are systematically included in the heuristics and cost calculation of the A* algorithm.
The difference between the total cost of the A* algorithm (0.26235)—
Table 9—and the cost obtained by summing per segment (0.3180)—
Table 10—is due to the fact that the segment-based cost includes additional factors such as average wind speed, drag, angle and normalisation, whereas the algorithm only sums the base cost associated with the distance and structure of the graph when calculating
.
The histogram in
Figure 7 shows the distribution of wind directions along the optimal route. Analysing the wind directions provides insight into the prevailing conditions affecting the movement of the vessel and helps to understand how different wind directions can affect the speed, resistance, and overall efficiency of the route. The histogram clearly shows the frequency of each wind direction, making it easier to interpret the data and plan navigation.
Table 10 shows a comparison of the Dijkstra and A* algorithms for all key route parameters—number of nodes, route length, total cost, average and maximum resistance, angle changes, wind speeds, execution time and theoretical complexity—and explains that the differences in resistance, angle, and execution time are due to the heuristics used by the A* algorithm.
Since the line length for both algorithms is 0.25314 in decimal coordinates and the line contains 12 nodes, the haversine formula allows the calculation of the actual distance of each segment between consecutive nodes () and ()—Equations (7) and (8).
This is crucial for determining the exact total length of the route, planning the navigation, estimating the journey time and calculating the route costs. The approximate total length of the route is 26475.55 m, 26.476 km or 15.38 nautical miles (NM).
Figure 8 shows the optimum route for both algorithms taking into account the wind direction. The figure illustrates how the wind influences the choice of route: the route is planned in such a way that favourable winds are used to the maximum, while areas with headwinds or strong winds are avoided. The arrows show the direction and strength of the wind at each section of the route, allowing a visual assessment of the interaction between the route and the wind conditions. Overall, the figure shows how the optimisation of the A* algorithm incorporates meteorological factors into the planning of the most efficient sea route.
Figure 9 shows the entire study area, with the wind directions shown as red arrows and the optimal route highlighted in black. The ports are shown as blue dots and the red dots indicate the locations of the wind farms.
3.2. Data and Results Validation
Validation of the input data is essential for reliable optimisation of the sea routes and precise determination of the costs of the individual route sections. The coordinates of the ports, OWFs, and polygonal obstacles used in the analysis were obtained from official and up-to-date geodetic sources, ensuring the consistency of the World Geodetic System 1984 (WGS84) decimal reference system. Each route segment was checked to ensure that it had the correct wind direction and speed. The number of nodes and route segments was checked for logic and consistency with the geometry of the sea area to eliminate possible errors such as duplicate points or missing nodes.
The meteorological data was also validated to ensure that the wind speeds and directions were within the expected ranges, with no negative values or incorrect units. Polygonal obstacles were checked as closed polygons without unwanted intersections to ensure that the algorithmic routes did not pass through obstacles due to inaccurate coordinates. To further verify the data integrity, the algorithms were tested on controlled cases of simple routes without obstacles and with constant wind to confirm the correctness of the implementation and the reliability of the input data.
The validation was also carried out through a visual inspection of the data on an interactive map, which made it possible to trace the logical sequence of nodes, the positions of ports, OWFs, and obstacles, and to detect irregularities in the route geometry. In addition, a statistical analysis of wind speeds and distances between consecutive nodes was performed to detect anomalies and ensure that extreme values do not affect the optimisation and interpretation of the results. All these checks guarantee that the input data is consistent, accurate, and suitable for a reliable assessment of the performance of the Dijkstra and A* algorithms, further increasing the credibility of the derived analyses and navigation recommendations.
4. Discussion
The results of Dijkstra’s algorithm, shown in
Table 7, show the optimal route between the start port (Pula) and the destination WF_end (Wf3) over 12 nodes.
The length of the route is 0.25314, while the total cost is 0.26235, which is due to a combination of distance, resistance, wind, and the presence of obstacles. The average and maximum resistance are 1.26504 and 4.61731, and the average angle change between segments is 85.91°, indicating the order of nodes chosen by the algorithm to minimise the total cost. The average and maximum wind speeds are 2.21667 m/s and 4.8 m/s, indicating moderate sailing conditions. The execution time on the computer with the configuration Intel Core i7-8565U, 4C/8T, 1.8 GHz, 64 GB RAM, NVMe SSD was 0.25899 s, which is as fast as expected for a small number of nodes.
For the experimental tests, R version 4.5.1 with the package igraph 1.4.1 was used, and the experiments were performed on a computer running Windows 11. The execution times (Dijkstra: 0.26 s; A*: 0.53 s) are given for a single typical run to illustrate the performance of the algorithms under real conditions. Given the stability and deterministic nature of both algorithms on known graphs, multiple runs would yield very similar results, so the conclusions are still considered representative. Nevertheless, averaging over multiple runs could be included in further studies to further evaluate robustness.
The results of the A* algorithm, listed in
Table 8, show that the number of nodes (12), the length of the route (0.25314), and the total cost (0.26235) are identical to those of Dijkstra’s algorithm, confirming that both algorithms find the truly optimal route. The average angle change between the segments is 83.86°, which is slightly lower than that of Dijkstra’s algorithm. The average and maximum resistance of the A* algorithm are 0.44782 and 1, which shows that the A* heuristic avoids segments with higher resistance. The execution time of the A* algorithm is 0.53059 s, which is longer than that of the Dijkstra algorithm due to the additional heuristic calculations per node. With a small number of nodes, the relative overhead is higher, but it enables a more targeted and efficient search.
Table 9 contains detailed coordinates of the optimal A* route, including wind speed and direction, corresponding direction labels, heuristic values, and segment costs. The heuristic estimates the remaining cost to the destination and allows the algorithm to prioritise nodes that are closer to the optimal path, while the last point, the destination node, has no heuristic value as the remaining cost is zero. The difference between the A* total cost (0.26235) and the sum of segment-based costs (0.3180) is due to the fact that the segment-based costs include additional factors such as average wind speed, drag, angle, and normalisation, while the algorithm only sums the basic costs related to distance and graph structure in
.
The analysis of the wind conditions shows that calm sequences indicate zones with no wind influence, while segments with increased wind speed (e.g., 4.8 m/s at coordinates 44,883, 13,773, and 44,823, 13,753,) significantly influence the selection of the optimal route. The histogram of wind directions (
Figure 7) clearly visualises the frequency of the individual directions and facilitates navigation planning.
This study clearly shows the technical differences between interport routes and existing route optimisation studies. In particular, the impact of OWFs on shipping is taken into account by analysing wind direction and speed, geographical constraints and traffic density. Unlike previous studies, which mainly focus on distance or fuel consumption, our approach allows for a quantitative assessment of navigational risk and safety. This integrated methodology represents the unique contribution of this research and its practical applicability in the Adriatic Sea.
In summary, the comparison of the Dijkstra and A* algorithms (
Table 10) confirms that the A* heuristic improves the node assessment order, reduces the average angle changes (83.86° vs. 85.91°) and the average resistance (0.44782 vs. 1.26504), while the total route cost remains identical. The execution time is higher due to the additional heuristic calculations, but the heuristic directs the algorithm to the target and enables a more efficient search, which is especially beneficial for larger and more complex graphs.
5. Conclusions
To summarise, this study combines empirical data with theoretical algorithms to fill a gap in the literature, as previous research rarely integrates real maritime conditions, explicit obstacles and dynamic winds into a single model. When analysing routes between the ports of Pula and Rijeka containing three OWFs and three polygonal obstacles, it is shown that the Dijkstra and A* algorithms identify optimal paths in terms of distance, total cost and wind conditions. The heuristics in the A* algorithm optimise node evaluation and reduce the average angle changes between segments, while accurate distance modelling using the Haversine formula and wind data enables reliable navigation planning. Limitations include the use of wind data only from 2023, the restriction to two ports and three OWFs, the simplified modelling of route costs and the exclusion of dynamic currents, waves, interactions between multiple vessels and seasonal variations. The A* heuristic cannot always guarantee global optimisation in complex scenarios. Future research should incorporate dynamic real-time data, extend area coverage, incorporate advanced heuristic and adaptive algorithms, simulate vessel interactions and integrate environmental and economic criteria such as energy efficiency and CO2 reduction. Improving spatial and temporal resolution, including seabed topography and local microclimate, will further optimise navigation strategies, reduce operating costs and increase maritime safety, thus contributing to sustainable and energy-efficient vessel operations.
Furthermore, the practical importance of this study is emphasised by the ability of the presented methodology to support navigation and operational decision-making in the real world. The integrated approach enables vessel operators to plan safer and more efficient routes in advance, dynamically adapt to changing environmental conditions, reduce navigational risks and improve logistical efficiency. These results can feed directly into operations, increase route reliability and support maintenance and inspection activities for OWFs, bringing clear benefits to day-to-day vessel operations.