## 4 Simulation Results and Analysis  
The test map based on the image of the port area is an example of a complex environment from the point of view of route calculation using the A* method due to the following factors:  
* A large map size of 14,490,000 pixels;
* A large number of occupied pixels (obstacles);
* Non-regular and trap-shaped obstacles (e.g., U-shaped or V-shaped). Due to the map dimensions' adjustment to the area's actual dimensions in a ratio corresponding to 1 pixel-1 m\({}^{2}\), the path length obtained in the simulation was directly determined in meters. This allowed for comparing the proposed approach with the basic one in conditions close to real ones. Since the map was created based on surface obstacles, it was assumed that in the case of AUVs, the vehicle moved at a constant depth, and the elements protruding above the water surface had the same shape at the depth of the AUV. In the simulation, a path was determined between the seven waypoints. The subsequent waypoints' locations were selected to achieve a complicated path. The path length for both methods was calculated based on the determined path coordinates between waypoints. The computation time for both methods was also measured during the simulation based on the in-build MATLAB function. In this case, in order to fairly compare the effectiveness of the proposed method with the basic A*, and in particular, the computation time, the raw path determined by both algorithms was used. The path length determined for individual cases is presented in Table 5, the calculation times are included in Table 6, and the minimal distance to the obstacle and number of calculated waypoints are in Table 7. Visualisations of the paths are shown in Figure 10a-f. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Scaling factor & 0.2 \\ \hline Structural element shape & Square \\ \hline Structural element size & 4 \(\times\) 4 pixels \\ \hline Morphological operations & Dilation + closing \\ \hline Threshold segmentation & 75/255 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Key parameters of used map processing approach. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{3}{c}{**Path Length**} \\ \hline
**Case** & **A* with Map Processing [m]** & **A* [m]** & **Difference in Path Length [m]** \\ \hline
**1** & 1932 & 1932 & 0 \\ \hline
**2** & 3081.5 & 3010.4 & 71.1 \\ \hline
**3** & 1092.5 & 695.5 & 397 \\ \hline
**4** & 2385.6 & 2378.5 & 7.1 \\ \hline
**5** & 3019.2 & 2937 & 82.2 \\ \hline
**6** & 5673.5 & 5635.7 & 37.8 \\ \hline
**Total**1 & 16,091.8 & 15,893.6 & 198.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Results of path calculations in terms of path length. Case 3 (marked in red in Tables 5 and 6) was not taken into account during the comparative analysis of the route length and calculation time due to the high risk of collision in the case of the route determined by the basic A* algorithm (see Figure 10c). Even though the occupancy grid created as a result of threshold segmentation did not show an obstacle at the route, from a practical point of view, the path was risky because it led to the pier. Figure 10 shows the routes calculated for each case by the traditional A* and modified A* by zooming in on the most important parts of the routes. All the resulting figures (.png) and their MATLAB source figures (.fig) are available in the Supplementary Materials (S1). It can be seen that the route planned by the basic A* operated very close to the obstacles, which made the route shorter than in the proposed algorithm. However, from the point of view of path planning for ASVs and AUVs, a safe distance must be maintained in order to ensure the collision-free execution of the designed mission. Based on Figure 10, it is clearly visible that the proposed approach provides safe path planning with a larger distance from obstacles than the basic A*. Moreover, based on Figure 10c,e, it can be seen that the proposed approach tends to avoid the narrow paths between closely located obstacles.