Next Article in Journal
Navigational Risk Evaluation of One-Way Channels: Modeling and Application to the Suez Canal
Previous Article in Journal
Deformable USV and Lightweight ROV Collaboration for Underwater Object Detection in Complex Harbor Environments: From Acoustic Survey to Optical Verification
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dijkstra and A* Algorithms for Algorithmic Optimization of Maritime Routes and Logistics of Offshore Wind Farms

Faculty of Maritime Studies, University of Split, 21000 Split, Croatia
*
Author to whom correspondence should be addressed.
J. Mar. Sci. Eng. 2025, 13(10), 1863; https://doi.org/10.3390/jmse13101863
Submission received: 10 September 2025 / Revised: 24 September 2025 / Accepted: 25 September 2025 / Published: 26 September 2025
(This article belongs to the Section Ocean Engineering)

Abstract

Shipping in complex marine environments requires a balance between navigational safety, minimising travel time and optimising logistics management, which is particularly challenging in areas with geometric obstructions and Offshore Wind Farms (OWFs). This study focuses on the maritime route networks in the Croatian ports of Pula and Rijeka, including the main access routes to OWFs and zones characterised by multiple navigational challenges. The aim of the research is to develop an empirically based and practically applicable framework for the optimisation of sea routes that combines analytical precision with operational efficiency. The parallel application of Dijkstra and A* algorithms enables a comparative analysis between deterministic and heuristic approaches in terms of reducing navigation risk, optimising route costs and ensuring fast logistical access to OWFs. The applied methods include the analysis of real and simulated route networks, the evaluation of statistical route parameters and the visualisation of the results for the evaluation of logistical and operational efficiency. Adaptive heuristic modifications of the A* algorithm, combined with the parallel implementation of Dijkstra’s algorithm, enable dynamic route planning that takes into account real-world conditions, including variations in wind speed and direction. The results obtained provide a comprehensive framework for safe, efficient and logistically optimised navigation in complex marine environments, with direct applications in the maintenance, inspection and operational management of OWFs.

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%.
The data from Table 4 and Table 5 are shown graphically as wind roses in Figure 1 and Figure 2, with Figure 1 showing the conditions in Pula and Figure 2 those in Rijeka.
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):
d i s t × 1 + r e s i s t a n c e × w i n d _ s p e e d 20
Here, d i s t stands for the base distance between two nodes, in direct analogy to the edge weight in Dijkstra’s algorithm. If only d i s t 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):
r e s i s t a n c e = 1 c o s ( Θ ) 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 r e s i s t a n c e = 0 .
  • When the vessel moves against the wind ( Θ = 180 ° ) , cos(180°) = −1, hence r e s i s t a n c e = 1 . 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 Θ ( E + V l o g V ). Here, V denotes the number of nodes, E the number of edges, and l o g V 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 Θ ( V 2 ) , 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).
f n = g n + h ( n )
where g n —represents the actual cost from the start point to the current node n . In the maritime context of this study, it is defined as Equation (4):
g n = i = 1 k d i × 1 + v i 20 × 1 c o s ( Θ i ) 2
d i = x i + 1 x i 2 + y i + 1 y i 2
In Equation (5), d i represents the distance between consecutive nodes on the route v i is the wind speed at node i , and Θ is the difference between the vessel’s heading and the wind direction calculated as: Θ   i = Θ s h i p , i Θ w i n d , i . If Θ   i > π , it is calculated as 2 Θ i .
The term 1 c o s ( Θ   i ) 2 accounts for wind resistance.
h n = x g o a l x n 2 + y g o a l y n 2 × 1 + v ¯ 20 × 1 c o s ( Θ ) 2
In Equation (6)— h n —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 n and the destination, adjusted to account for the average wind effect along the path to the destination.
v ¯ = v n + v g o a l 2 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.
f n —is the total estimated cost of the path through node n . A* selects the node with the smallest f n 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.
ϕ = ϕ 2 ϕ 1
and
λ = λ 2 λ 1
d = 2 · R · a r c s i n s i n ­ 2 ϕ 2 + c o s ϕ 1 c o s ϕ 2 s i n ­ 2 λ 2
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 g ( n ) .
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 ( ϕ 1 , λ 1 ) and ( ϕ 2 , λ 2 )—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 g ( n ) .
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.

Author Contributions

Conceptualization, V.M.; methodology, V.M. and T.S.; software, V.M. and T.B.; formal analysis, V.M. and I.S.; investigation, V.M. and T.B.; resources, V.M.; data curation, V.M. and T.B.; writing—original draft preparation, V.M.; writing—review and editing, T.S. and I.S.; visualization, V.M.; supervision, T.S. and I.S.; project administration, V.M.; funding acquisition, V.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AGVAutomated Guided Vehicle
AISAutomatic Identification System
ASVAutonomous Surface Vehicle
DDRLDouble-Deep Reinforcement Learning
DWADynamic Window Approach
EEast
ENEEast-Northeast
ESEEast-Southeast
MLMachine Learning
NNorth
NENortheast
NMNautical Mile
NNENorth-Northeast
NNWNorth-Northwest
NWNorthwest
OWFOffshore Wind Farm
OWFsOffshore Wind Farms
PPOProximal Policy Optimisation
PSCPort State Control
SSouth
SESoutheast
SSESouth-Southeast
SSWSouth-Southwest
SWSouthwest
WWest
WGS84World Geodetic System 1984
WNWWest-Northwest
WSWWest-Southwest

References

  1. R Core Team. R: A Language and Environment for Statistical Computing (Version 4.5.1). R Foundation for Statistical Computing. 2023. Available online: https://www.R-project.org/ (accessed on 15 August 2025).
  2. Wnorowski, J.; Łebkowski, A. The Concept of Determining a Ship’s Route Based on the Capability Plot and Dijkstra’s Algorithm—Finding the Ship’s Route Between Anchorages. Appl. Sci. 2024, 14, 11205. [Google Scholar] [CrossRef]
  3. Silveira, P.; Teixeira, A.P.; Guedes Soares, C. AIS Based Shipping Routes Using the Dijkstra Algorithm. TransNav 2019, 13, 565–571. [Google Scholar] [CrossRef]
  4. Ding, D.; Zou, X. The Optimization of Logistics Distribution Route Based on Dijkstra’s Algorithm and C-W Savings Algorithm. In Proceedings of the 6th International Conference on Machinery, Materials, Environment, Biotechnology and Computer (MMEBC 2016), Tianjin, China, 11–12 June 2016; Available online: https://www.researchgate.net/publication/308113903_The_Optimization_of_Logistics_Distribution_Route_Based_on_Dijkstra%27s_Algorithm_and_C-W_Savings_Algorithm (accessed on 16 August 2025).
  5. Bokhari, S.W.A.; Ali, N.; Hussain, A. Optimizing maritime Routes: A Multi-Method Analysis from Shanghai to Vladivostok. Croat. Oper. Res. Rev. 2025, 16, 73–83. [Google Scholar] [CrossRef]
  6. Wang, H. Voyage Optimization Algorithms for Ship Safety and Energy-Efficiency. Thesis for the Degree of Licentiate of Engineering, Department of Mechanics and Maritime Sciences. Bachelor’s Thesis, Chalmers University of Technology, Gothenburg, Sweden, 2018. Available online: https://research.chalmers.se/publication/503070/file/503070_Fulltext.pdf (accessed on 1 August 2025).
  7. Wang, H. Development of Voyage Optimization Algorithms for Sustainable Shipping and Their Impact to Ship Design. Ph.D. Thesis, Department of Mechanics and Maritime Sciences, Chalmers University of Technology, Gothenburg, Sweden, 2020. Available online: https://research.chalmers.se/publication/516268/file/516268_Fulltext.pdf (accessed on 2 August 2025).
  8. Wang, H.; Mao, W.; Zhang, D. Voyage optimization for mitigating ship structural failure due to crack propagation. Proc. Inst. Mech. Eng. Part O J. Risk Reliab. 2018, 233, 1748006X1875497. [Google Scholar] [CrossRef]
  9. Rizki, A.C.; Athallah, K.R.; Siddiq, S.M.; Kusmanidar, Z.; Zakaria, D. Performance analysis of Dijkstra and A-star algorithm in maritime navigation pathfinding. J. Mechatronics Artif. Intell. 2025, 2, 31–50. [Google Scholar]
  10. Lee, H.-T.; Kim, M.-K. Optimal path planning for a ship in coastal waters with deep Q network. Ocean Eng. 2024, 307, 118193. [Google Scholar] [CrossRef]
  11. Xing, B.; Yu, M.; Liu, Z.; Tan, Y.; Sun, Y.; Li, B. A Review of Path Planning for Unmanned Surface Vehicles. J. Mar. Sci. Eng. 2023, 11, 1556. [Google Scholar] [CrossRef]
  12. Wu, Y.; Wang, T.; Liu, S. A Review of Path Planning Methods for Marine Autonomous Surface Vehicles. J. Mar. Sci. Eng. 2024, 12, 833. [Google Scholar] [CrossRef]
  13. Singh, Y.; Sharma, S.; Sutton, R.; Hatton, D. Towards Use of Dijkstra Algorithm for Optimal Navigation of an Unmanned Surface Vehicle in a Real-Time Marine Environment with Results from Artificial Potential Field. TransNav Int. J. Mar. Navig. Saf. Sea Transp. 2018, 12, 125–131. [Google Scholar] [CrossRef]
  14. Vagale, A.; Pizurica, A.; Acar, U. A Comparative Study of Path Planning Algorithms for Autonomous Surface Ships. J. Mar. Sci. Technol. 2021, 26, 1147–1162. [Google Scholar] [CrossRef]
  15. Gunawan, S.A.; Pratama, G.N.P.; Cahyadi, A.I.; Winduratna, B.; Yuwono, Y.C.H.; Wahyunggoro, O. Smoothed A-Star Algorithm for Nonholonomic Mobile Robot Path Planning. In Proceedings of the 2019 International Conference on Information and Communications Technology (ICOIACT), Yogyakarta, Indonesia, 24–25 July 2019; pp. 654–658. [Google Scholar] [CrossRef]
  16. Song, C.; Guo, T.; Sui, J. Ship Path Planning Based on Improved Multi-Scale A* Algorithm of Collision Risk Function. Sci. Rep. 2024, 14, 30418. [Google Scholar] [CrossRef]
  17. An, Z.; Rui, X.; Gao, C. Improved A* Navigation Path-Planning Algorithm Based on Hexagonal Grid. ISPRS Int. J. Geo Inf. 2024, 13, 166. [Google Scholar] [CrossRef]
  18. Li, H.; Qian, L.; Hong, M.; Wang, X.; Guo, Z. An Efficient Maritime Route Planning Method Based on an Improved A* with an Adaptive Heuristic Function and Parallel Computing Structure. Appl. Sci. 2023, 13, 10873. [Google Scholar] [CrossRef]
  19. Öztürk, Ü.; Akdağ, M.; Ayabakan, T. A Review of Path Planning Algorithms in Maritime Autonomous Surface Ships: Navigation Safety Perspective. Ocean Eng. 2022, 251, 111010. [Google Scholar] [CrossRef]
  20. Park, H.-M.; Cho, S.-W.; Seo, K.-M. Hybrid Path Planning Framework to Integrate Improved A*-DWA Algorithms for Enhancing Path Safety and Efficiency. Appl. Ocean Res. 2025, 157, 104497. [Google Scholar] [CrossRef]
  21. Huang, Y.; Zhao, S.; Zhao, S. Ship Trajectory Planning and Optimization via Ensemble Hybrid A* and Multi-Target Point Artificial Potential Field Model. J. Mar. Sci. Eng. 2024, 12, 1372. [Google Scholar] [CrossRef]
  22. Chen, X.; Hu, R.; Luo, K.; Wu, H.; Biancardo, S.A.; Zheng, Y.; Xian, J. Intelligent Ship Route Planning via an A* Search Model Enhanced Double-Deep Q-Network. Ocean Eng. 2025, 327, 120956. [Google Scholar] [CrossRef]
  23. Chen, Y.; Zhang, C.; Guo, Y.; Wang, Y.; Lang, X.; Zhang, M.; Mao, W. State-of-the-art optimization algorithms in weather routing—ship decision support systems: Challenge, taxonomy, and review. Ocean Eng. 2025, 331, 121198. [Google Scholar] [CrossRef]
  24. Li, K.; Liu, L.; Chen, J.; Yu, D.; Zhou, X.; Li, M.; Wang, C.; Li, Z. Research on Reinforcement Learning Based Warehouse Robot Navigation Algorithm in Complex Warehouse Layout. arXiv 2024, arXiv:2411.06128. [Google Scholar] [CrossRef]
  25. Elshaer, A.M.; Elmanfaloty, R.; Abou-Bakr, E.; Elrakaiby, M. Exploring Algorithmic Efficiency of A-Star and Dijkstra for Optimal Route Planning in Green Transportation. Int. J. Intell. Transp. Syst. Res. 2025, 23, 1–11. [Google Scholar] [CrossRef]
  26. Zhang, Y.; Li, L.; Lin, H.-C.; Ma, Z.; Zhao, J. Development of Path Planning Approach Based on Improved A-Star Algorithm in AGV System. In IoT as a Service, IoTaaS 2017; Lin, Y.-B., Deng, D.-J., You, I., Lin, C.-C., Eds.; Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering; Springer: Cham, Switzerland, 2018; Volume 246, pp. 276–279. [Google Scholar] [CrossRef]
  27. Zhou, Z.; Zhou, B.; Liu, H. DynamicRouteGPT: A Real-Time Multi-Vehicle Dynamic Navigation Framework Based on Large Language Models. arXiv 2024, arXiv:2408.14185. [Google Scholar]
  28. Zhen, R.; Gu, Q.; Shi, Z.; Suo, Y. An Improved A-Star Ship Path-Planning Algorithm Considering Current, Water Depth, and Traffic Separation Rules. J. Mar. Sci. Eng. 2023, 11, 1439. [Google Scholar] [CrossRef]
  29. Liu, H.; Shan, Q.; Cao, Y.; Xu, Q. Global Path Planning of Unmanned Surface Vehicle in Complex Sea Areas Based on Improved Streamline Method. J. Mar. Sci. Eng. 2024, 12, 1324. [Google Scholar] [CrossRef]
  30. Niu, H.; Lu, Y.; Savvaris, A.; Tsourdos, A. Efficient Path Planning Algorithms for Unmanned Surface Vehicle. IFAC PapersOnLine 2016, 49, 121–126. [Google Scholar] [CrossRef]
  31. Dai, C.; Xie, H.; Bai, W. Anti-Collision Warning of Offshore Wind Farm Based on Kalman Filter. In Proceedings of the 2023 International Annual Conference on Complex Systems and Intelligent Science, CSIS-IAC 2023, Shenzhen, China, 20–22 October 2023; pp. 854–858. Available online: https://ieeexplore.ieee.org/abstract/document/10364223 (accessed on 29 July 2025).
  32. Gao, H.; Xie, C.; Liu, K.; Chen, S.; Zhou, L.; Liu, Z.; Wang, R. Modeling of Safe Distance Between Ship Routes and Offshore Wind Farm Based on Tolerable Collision Probability. IEEE Access 2022, 10, 71777–71790. [Google Scholar] [CrossRef]
  33. Wawruch, R.; Stupak, T. Modelling of Safety Distance Between Ships’ Route and Wind Farm. Arch. Transp. 2011, 23, 413–420. [Google Scholar] [CrossRef]
  34. Lv, P.; Zhen, R.; Shao, Z. A Novel Method for Navigational Risk Assessment in Wind Farm Waters Based on the Fuzzy Inference System. Math. Probl. Eng. 2021, 2021, 4588333. [Google Scholar] [CrossRef]
  35. Mehdi, R.A.; Schröder-Hinrichs, J.U.; van Overloop, J.; Nilsson, H.; Pålsson, J. Improving the coexistence of offshore wind farms and shipping: An international comparison of navigational risk assessment processes. WMU J. Marit. Aff. 2018, 17, 397–434. [Google Scholar] [CrossRef]
  36. Milin, V.; Skoko, I.; Leksic, Ž.; Boko, Z. Navigational Safety Hazards Posed by Offshore Wind Farms: A Comprehensive Literature Review and Bibliometric Analysis. J. Mar. Sci. Eng. 2025, 13, 1330. [Google Scholar] [CrossRef]
  37. Mou, J.; Jia, X.; Chen, P.; Chen, L. Research on Operation Safety of Offshore Wind Farms. J. Mar. Sci. Eng. 2021, 9, 881. [Google Scholar] [CrossRef]
  38. Yu, Q.; Liu, K. An AIS Data-Based Framework for Ship Allision Risk Assessment Near the Offshore Wind Farm. In Proceedings of the 6th International Conference on Transportation Information and Safety: New Infrastructure Construction for Better Transportation, ICTIS, Wuhan, China, 22–24 October 2021; pp. 10–15. Available online: https://ieeexplore.ieee.org/document/9798624 (accessed on 20 August 2025).
  39. Itoh, H. Method for Prediction of Ship Traffic Behaviour and Encounter Frequency. J. Navig. 2022, 75, 106–123. [Google Scholar] [CrossRef]
  40. Rawson, A.; Brito, M. Assessing the Validity of Navigation Risk Assessments: A Study of Offshore Wind Farms in the UK. Ocean Coast. Manag. 2022, 219, 106078. [Google Scholar] [CrossRef]
  41. Zhang, Z. Maritime Safety Supervision and Navigation Service of Offshore Wind Farms in China. Master’s Thesis, World Maritime University, Dalian, China, 2021. Available online: https://commons.wmu.se/msem_dissertations/406/ (accessed on 17 August 2025).
  42. Boko, Z.; Skoko, I.; Sanchez-Varela, Z.; Pincetic, T. Application of Advanced Algorithms in Port State Control for Offshore Vessels Using a Classification Tree and Multi-Criteria Decision-Making. J. Mar. Sci. Eng. 2024, 12, 1905. [Google Scholar] [CrossRef]
  43. Boko, Z.; Skoko, I.; Sanchez Varela, Z.; Milin, V. Advancing Maritime Safety: A Literature Review on Machine Learning and Multi-Criteria Analysis in PSC Inspections. J. Mar. Sci. Eng. 2025, 13, 974. [Google Scholar] [CrossRef]
  44. Lin, C.; Zhao, H.; Yu, Z.; Zhang, S. Robust Navigation of Unmanned Surface Vehicles Using Distributional Reinforcement Learning. arXiv 2023, arXiv:2307.16240. [Google Scholar]
  45. DHMZ—Državni Hidrometeorološki Zavod. DHMZ, n.d. Available online: https://meteo.hr (accessed on 17 August 2025).
  46. Dijkstra, E.W. A note on two problems in connexion with graphs. Numer. Math. 1959, 1, 269–271. [Google Scholar] [CrossRef]
  47. Duan, R.; Mao, J.; Mao, X.; Shu, X.; Yin, L. Breaking the Sorting Barrier for Directed Single-Source Shortest Paths. arXiv 2025, arXiv:2504.17033. [Google Scholar] [CrossRef]
  48. 36Kr. Available online: https://eu.36kr.com/en/p/3419098143837833 (accessed on 2 September 2025).
  49. Duchoň, F.; Babinec, A.; Kajan, M.; Beňo, P. Path Planning with Modified A Star Algorithm for a Mobile Robot. Procedia Eng. 2014, 96, 129–137. [Google Scholar] [CrossRef]
Figure 1. Wind Rose—Pula, 2023.
Figure 1. Wind Rose—Pula, 2023.
Jmse 13 01863 g001
Figure 2. Wind Rose—Rijeka, 2023.
Figure 2. Wind Rose—Rijeka, 2023.
Jmse 13 01863 g002
Figure 3. Overview of the research methodology for the empirical planning of sea routes.
Figure 3. Overview of the research methodology for the empirical planning of sea routes.
Jmse 13 01863 g003
Figure 4. Optimal route using Dijkstra’s algorithm.
Figure 4. Optimal route using Dijkstra’s algorithm.
Jmse 13 01863 g004
Figure 5. Histogram of the wind directions for all grid nodes.
Figure 5. Histogram of the wind directions for all grid nodes.
Jmse 13 01863 g005
Figure 6. Optimal route using A* algorithm.
Figure 6. Optimal route using A* algorithm.
Jmse 13 01863 g006
Figure 7. Histogram of the wind directions for the optimal route.
Figure 7. Histogram of the wind directions for the optimal route.
Jmse 13 01863 g007
Figure 8. Optimal route with both algorithms.
Figure 8. Optimal route with both algorithms.
Jmse 13 01863 g008
Figure 9. Optimal route with wind direction.
Figure 9. Optimal route with wind direction.
Jmse 13 01863 g009
Table 1. Geographic coordinates of ports.
Table 1. Geographic coordinates of ports.
Port NameLatitude (x)Longitude (y)
Pula44.87713.780
Rijeka45.32214.433
Table 2. Geographic coordinates of OWFs.
Table 2. Geographic coordinates of OWFs.
OWFLatitude (x)Longitude (y)
Wf144.55514.111
Wf244.43313.921
Wf344.66613.683
Table 3. Polygon coordinates of islands and obstacles.
Table 3. Polygon coordinates of islands and obstacles.
Island/LandLatitude (x)Longitude (y)Island/LandLatitude (x)Longitude (y)
Island145.1814.32Island344.8713.79
Island145.1614.30Island344.8613.79
Island145.1214.27Island344.8013.87
Island145.0014.35Island344.7513.89
Island144.9214.28Island344.7613.95
Island144.7814.29Island344.8014.00
Island144.7014.27Island344.8614.00
Island144.6614.23Island344.9414.08
Island144.6314.22Island344.9514.15
Island144.5214.28Island344.9814.18
Island144.6314.56Island345.0714.17
Island145.1814.32Island345.1214.21
Island244.7214.16Island345.1414.23
Island244.7214.18Island345.1814.25
Island244.7314.18Island345.2314.26
Island244.7314.16Island345.3114.29
Island244.7214.16Island345.3314.31
Island344.8713.79
Table 4. Wind frequency and speed near the port of Pula, 2023.
Table 4. Wind frequency and speed near the port of Pula, 2023.
Wind DirectionFrequency (%)Speed (m/s)Full Direction Name
N2.92.2North
NNE0.92.6North-Northeast
NE5.14.4Northeast
ENE14.24.8East-Northeast
E12.93.1East
ESE11.72.8East-Southeast
SE4.33.6Southeast
SSE0.73.1South-Southeast
S1.33.6South
SSW0.33.7South-Southwest
SW3.53.2Southwest
WSW3.73.6West-Southwest
W8.83.5West
WNW0.62.4West-Northwest
NW4.22.9Northwest
NNW2.12.9North-Northwest
Calm22.80Calm (no wind)
Table 5. Wind frequency and speed near the port of Rijeka, 2023.
Table 5. Wind frequency and speed near the port of Rijeka, 2023.
Wind DirectionFrequency (%)Speed (m/s)
N11.31.5
NNE20.92.3
NE2.31.5
ENE19.83
E42.1
ESE3.61.9
SE0.51.3
SSE4.42.1
S9.32.2
SSW4.91.7
SW1.92.3
WSW9.61.8
W1.31.5
WNW11.3
NW0.40.8
NNW41.2
Calm0.70
Table 6. Comparison of Dijkstra and A* algorithms in the optimisation of sea routes.
Table 6. Comparison of Dijkstra and A* algorithms in the optimisation of sea routes.
SegmentDijkstra AlgorithmA* Algorithm
Algorithm typeDeterministicHeuristic
Aim of the searchShortest path from the start node to all nodesShortest or practically optimal path from the start node to the destination
Search strategy“Closest first”—selects the node with the lowest cost and extends the minimum distances through the graphCombination of actual costs g n and heuristic h n to select the node for the extension; the search is goal-oriented
Segment   g n Equation (1)Equation (4)
Heuristic   h n NoneEquation (6)
Influence of the windResistance factor scales the wind effect with the segment costsContained in g n and h n ; influences the actual and estimated route costs and enables energy optimisation
EfficiencyMust process all nodes; slower for large graphsHeuristic reduces the number of processed nodes; faster finding of a practically optimal route
Complexity Θ ( V 2 ) Θ ( V ) in the best case, Θ ( V 2 ) in the worste case
Maritime applicationFinds minimum segment costs, processes all nodes, reliable for theoretically shortest routesFinds the practically optimal route; takes distance, wind, energy and safety into account; particularly efficient for complex waterways
AdvantagesSimple, robust, provides exact shortest pathsMore efficient for targeted routes; flexible for additional environmental factors
LimitationsSlow for large graphs; does not use heuristicsRequires good heuristics; suboptimal if heuristics overestimate costs
Table 7. Dijkstra algorithm results.
Table 7. Dijkstra algorithm results.
ParameterValueUnit
Start_portPula
WF_endWf3
Number_of_nodes12
Route_length0.25314degrees (latitude/longitude)
Total_cost0.26235dimensionless
Average_resistance1.26504dimensionless
Maximum_resistance4.61731dimensionless
Average_angle_difference85.91degrees
Average_wind_speed2.21667m/s
Maximum_wind_speed4.8m/s
Execution_time_sec0.25899seconds
Table 8. A* algorithm results.
Table 8. A* algorithm results.
Start_PortPula
WF_endWf3
Number_of_nodes12
Route_length0.25314
Total_cost0.26235
Average_resistance0.44782
Maximum_resistance1
Average_angle_difference83.86
Average_wind_speed2.21667
Maximum_wind_speed4.8
Execution_time_sec0.53059
Table 9. Optimal route waypoints and heuristic and cost segment values for algorithm A*.
Table 9. Optimal route waypoints and heuristic and cost segment values for algorithm A*.
XYWind_SpeedWind_DirDir_LabelHeuristicCostHeuristic + Cost
44.88313.7734.8−2.75ENE0.02000.02020.0402
44.86313.77300.00Calm0.02000.02020.0402
44.84313.7732.8−3.53ESE0.02910.03330.0624
44.82313.7534.8−2.75ENE0.02000.02020.0402
44.80313.75300.00Calm0.02000.03000.0500
44.78313.75300.00Calm0.02860.03280.0614
44.76313.7333.1−3.14E0.02850.02960.0581
44.74313.7134.4−2.36NE0.02920.03830.0675
44.72313.69300.00Calm0.02000.03000.0500
44.70313.69300.00Calm0.02150.03990.0615
44.68313.6933.61.57S0.02050.02350.0440
44.66313.6933.1−3.14E
Table 10. Comparative analysis of Dijkstra and A algorithms for optimal maritime routing.
Table 10. Comparative analysis of Dijkstra and A algorithms for optimal maritime routing.
DijkstraA*Explanation of Difference
Start_portPulaPula
WF_endWf3Wf3
Number_of_nodes1212Both algorithms find the same optimal route.
Route_length0.253140.25314Identical, route geometry unchanged.
Total_cost0.262350.26235Both algorithms yield the same overall cost.
Average_resistance1.265040.44782A* uses a heuristic to prioritize nodes closer to the destination, resulting in a smoother route with lower average resistance.
Maximum_resistance4.617311A* avoids highly resistant segments due to heuristic guidance.
Average_angle_difference85.9183.86Heuristic in A* favors straighter paths, reducing average angular changes.
Average_wind_speed2.216672.21667Wind conditions are identical for both routes.
Maximum_wind_speed4.84.8
Execution_time_sec0.258990.53059A* requires additional heuristic calculations, increasing execution time on small graphs.
Theoretical complexity Θ ( V 2 ) (or
Θ E + V l o g V ) for priority queue)
Θ E with good heuristicDijkstra: explores all nodes without heuristics.
A*: The heuristic directs the search to the target and reduces the number of evaluated nodes.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Milin, V.; Stanivuk, T.; Skoko, I.; Bulić, T. Dijkstra and A* Algorithms for Algorithmic Optimization of Maritime Routes and Logistics of Offshore Wind Farms. J. Mar. Sci. Eng. 2025, 13, 1863. https://doi.org/10.3390/jmse13101863

AMA Style

Milin V, Stanivuk T, Skoko I, Bulić T. Dijkstra and A* Algorithms for Algorithmic Optimization of Maritime Routes and Logistics of Offshore Wind Farms. Journal of Marine Science and Engineering. 2025; 13(10):1863. https://doi.org/10.3390/jmse13101863

Chicago/Turabian Style

Milin, Vice, Tatjana Stanivuk, Ivica Skoko, and Toma Bulić. 2025. "Dijkstra and A* Algorithms for Algorithmic Optimization of Maritime Routes and Logistics of Offshore Wind Farms" Journal of Marine Science and Engineering 13, no. 10: 1863. https://doi.org/10.3390/jmse13101863

APA Style

Milin, V., Stanivuk, T., Skoko, I., & Bulić, T. (2025). Dijkstra and A* Algorithms for Algorithmic Optimization of Maritime Routes and Logistics of Offshore Wind Farms. Journal of Marine Science and Engineering, 13(10), 1863. https://doi.org/10.3390/jmse13101863

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop