## 2 Models
### The Gridded Path Constraint Model Based on the International Maritime Organization (IMO)
In this paper, we adopt one of the empirical formulas obtained from simulations with real measurement data [14, 15, 16,38]. \[v=v_{0}-(a_{1}h-a_{2}qh+a_{3}v_{W}\cos\delta)\times(1-a_{4}Dv_{0}), \tag{2}\]  
where \(a_{i},i=1,2,3,4\) denotes the coefficient determined by the size of the ship. \(v_{0}\) is assumed to be the constant speed maintained by the surface ship while sailing; \(q\) is the angle between the wave direction and the ship's heading; \(\delta\) is the angle between the wind direction and the ship's heading; \(D\) is the displacement of the ship; \(h\) is the wave height. Using Equation (2), the actual speed after stall at each extended node can be calculated, and thus the required sailing time for the route can be calculated. For each grid movement, the travel time is obtained by dividing the distance between the grids by the actual speed, which is calculated by Equation (3). \[G(i)=X_{k}/v_{i},~{}(k=1,2,3;~{}i=1,2,\cdots,n), \tag{3}\]  
where \(G(i)\) denotes the travel time cost of the \(i\)th component on planned path array \(P\); the three values of \(X_{k}\) are the distances between the grids for horizontal, vertical, and diagonal shifts, respectively; \(n\) denotes the number of components in the planned path array \(P\). The travel time is normalized to a dimensionless value of 0 to 1 by the \"arctan\" function to determine travel time cost \(\widetilde{G}\). Then \(f_{2}\) is calculated using Equation (4). \[\left\{ \begin{aligned} & f_{2}=\frac{\sum\limits_{i=1}^{n} \widetilde{G}(i)}{n}\\ &\widetilde{G}(i)=\arctan(G(i))\cdot\
icefrac{{2}}{{\pi}},i=1,2, \cdots,n\end{aligned} \right., \tag{4}\]  
where \(\widetilde{G}(i)\) represents the travel time cost of the \(i\)th component on planned path array \(P\); \(n\) denotes the number of components in the planned path array \(P\). According to the International Maritime Organization (IMO) recommendations for avoiding hazards in adverse weather and sea conditions. Ships passing through the grids satisfying constraints one and two below are prone to capsize and cross-sway hazards and should avoid these grids as much as possible. Therefore, hard limits can be imposed on these grids. When the path planning algorithm expands grid \(j\) at time \(k\), if grid \(j\) does not satisfy any of the above constraints, then it will be temporarily set as impassable. At the beginning of the \(k+1\) moment, the restriction is lifted, and the constraint is checked again. Constraint I: the angle between the wave direction, the ship's heading \(q\), and the actual velocity \(v\) in a grid are in the range found in Equation (5). \[135^{\circ}<q<225^{\circ}\;and\;v>\frac{1.8\sqrt{L_{\text{ship}}}}{\cos(180^{ \circ}-q)}, \tag{5}\]  
where \(L_{\text{ship}}\) is the length of the ship, the ship passing through these grid points will be prone to surf-riding and broaching-to, which increases the possibility of capsizing. Constraint II: the natural roll period in seconds \(T_{R}\) and the encountered period with waves in seconds \(T_{E}\) satisfy one of the two conditions found in Equation (6). \[|T_{E}-T_{R}|=\varepsilon\cdot T_{R}\;or\;|2\cdot T_{E}-T_{R}|=\varepsilon \cdot T_{R}, \tag{6}\]  
where \(\varepsilon\) is the relative tolerance in frequency matching in %. In summary, the average time cost of the grid passing the route under wind and wave conditions is taken as \(f_{2}\). Therefore, the model has fully considered scalar risk, vector risk, and IMO constraints on security. The analytic hierarchy process can be used to determine the weight coefficients of \(f_{1}\) and \(f_{2}\) in the cost function of A*, and the multi-objective programming problem can be transformed into a single-objective programming problem. In this paper, the weight coefficients of \(f_{1}\) and \(f_{2}\) are both 0.5.