# Near-Optimal Weather Routing by Using Improved A* Algorithm
## 4 Case Study
### Result and Discussion  
To carry out the routing simulation, one ship with real AIS data was chosen as the target vessel, and the target route was set to the seaway from the port of Gwang-Yang, Korea, to Westshore Terminal, Canada. The name of the ship has been withheld owing to confidentiality reasons. Because the marine weather data used were defined in a resolution of 0.5\({}^{\circ}\) for latitude and longitude, 2D linear interpolation was used to enable its application to the 0.1\({}^{\circ}\) resolution of the base map. The target ship traveled continuously from Jan. 11 to Jan. 29, 2018, without any stopovers. Therefore, the heuristic array was precalculated on the basis of marine weather data from 11 January to 30 January 2018, and the daily heuristic cost was calculated according to the change of path cost. In addition, the simulation was performed with a draft value of 18 m and a gross tonnage value of 92,353, referring to the historical operation data of the target ship. Figure 7 is a schematic diagram of the total wave height from the climate data of 20 January 2018, and Figure 8 represents the SOG map of the target vessel predicted through the obtained learning model. The SOG map shown in Figure 8 was calculated for 16 directions for ships going east as of 20 January 2018, and route optimization was performed using Equation (9) to minimize the ETA values derived from the SOG map for the 16 directions. As shown in  
The simulation was conducted for four cases, 8-way or 16-way search combined with adaptive or non-adaptive grids. The simulation results using four methods were compared with the sailing time and traveled distance calculated from actual operational data of the target ship, as given in Table 11. Figure 9 shows the real AIS trajectory and simulation results using the 16-way search method with adaptive grids. It shows a map of already finished route optimization, so only the \"closed\" region is shown, and the red border indicates the area used as \"open\". The A* algorithm contains adjacent nodes of nodes adopted as current nodes in the open set first, and the nodes with the lowest cost in the open set are adopted as current nodes, repeatedly storing them in the closed set, a set of nodes that have been already explored. Thus, while the closed set is around the optimal route, the node in the open set that is not selected as the current node appears to surround the boundary of the closed set as shown in Figure 9.  
However, the optimized route through the grid has a sharp edge, so it is necessary to smooth through smoothing curves such as Beizer curve, b-spline, etc. In this study, Beige curve, commonly used for path smoothing, was used as it is easy to generate and control. As the Figure 9 shows, the predicted traveled distance is much shorter when operating on a more optimized route than the actual AIS trajectory, and the smoothed route can better represent the real ship route with a smooth curve shape. Likewise, as shown in Table 11, 16-way search has lower values for all ETAs, distances, searched nodes, and path nodes than 8-way search because it selects routes smoother than those of 8-way search. Similarly, adaptive grids do not allow unnecessary grid search, so either 8- or 16-way searches combined with adaptive grids have more efficiency in the ship route optimization process than the ones without \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Method** & \multicolumn{2}{c}{**8-Way Search**} & \multicolumn{2}{c}{**16-Way Search**} & \multirow{2}{*}{**AIS Trajectory**} \\ \hline
**Grid type** & **Non-Adaptive** & **Adaptive** & **Non-Adaptive** & **Adaptive** \\ \hline ETA & 445,68 & 438.75 & 436.57 & 429.33 & 455.6 \\
[hour] & 9066.38 & 8900.79 & 8893.00 & 8777.16 & 9899.26 \\ Searched nodes & 324,729 & 311,496 & 325,412 & 309,816 & - \\ Path nodes & 1097 & 980 & 873 & 634 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Simulation results. Figure 9: Result of 16-way search with adaptive grid. adaptive grids.