## 2 Materials and Methods
### Measuring Similarity Between Ship Trajectories  
In the data preprocessing stage for clustering ship routes, various analytical methods exist for measuring similarities, including distance- and angle-based approaches. Recent advancements in object tracking have enabled the acquisition of spatiotemporal movement trajectories, allowing for additional analysis of hidden information. Although route extraction has been continuously researched, studies that accurately compare routes and secondary products of the tracking process are relatively scarce. A key issue in evaluating the performance of the tracking results is the distance-based measurement method for determining trajectory similarity. Further analyses, such as behavior recognition and event detection, depend heavily on the accuracy of the similarity assessment. Conventional measurement methods calculate the average distance between the corresponding positions of two trajectories of the same duration. To expand the similarity description, auxiliary statistics such as variance, median, minimum, and maximum distances have also been proposed. [PERSON] et al. [10] combined ideas from two spectral clustering methods as a new approach for clustering vehicle trajectories by utilizing the MHD measure to assess trajectory similarity. [PERSON] et al. [24] used the Wasserstein Distance (WSD) for graph feature extraction, focusing on trajectory-based methods rather than relying solely on Neighborhood Information Aggregation as a means of measuring the similarity between graphs. [PERSON] and [PERSON] [25] evaluated various similarity measurements and clustering methodologies to understand trajectory patterns, obtaining good results with DTW trajectory clustering. [PERSON] et al. [26] presented a method for analyzing and searching trajectories by formalizing nonmetric similarity functions based on LCSS in two- or three-dimensional spaces. This study measured the similarity between ship trajectories using four statistical trajectory distance measurement methods adopted and verified in previous studies. MHD  
The Hausdorff distance is commonly used when comparing two sets of different sizes; however, it is unsuitable for comparing trajectories as it does not consider order. Looking at the MHD, e \(D_{MHD}\left(F_{i},\ F_{j}\right)\) in Equation (1) is designed to consider the temporal order of points while reducing the sensitivity to outliers [10]. \[ \begin{split} D_{MHD}\left(F_{i},F_{j}\right)&=N \left(\max\left(h\left(F_{i},F_{j}\right),h\left(F_{j},F_{i}\right)\right) \right)\\ &=ord_{f_{j}\in F_{i}}^{a}h\left(F_{f,t},F_{j}\right)\end{split}  \tag{1}\]  
\(\text{F}_{i},\text{F}_{j}\): Two trajectories to be compared, \(\alpha\): Upper bound  
\(\text{N}()\) is the region used to determine the value of a point, and C(f\({}_{i,t}\)) represents the point in F\({}_{j}\) corresponding to the point f\({}_{i,t}\) in F\({}_{i}\). \(ord_{f_{j}\in F_{i}}^{a}h\left(F_{f,t},F_{j}\right)\). It is a value that measures the relationship or similarity between the point f\({}_{i,t}\) in F\({}_{i}\) and F\({}_{j}\). It refers to a specific value \(h\left(F_{f,t},F_{j}\right)\) among all h values greater than the \(\alpha\) percentile in Equation (2). \[h\left(f_{i,k},F_{j}\right)=min_{f_{j,t}\in N\left(C\left(f_{i,t}\right) \right)}d_{E}\left(f_{i,k},f_{j,\tau}\right) \tag{2}\]  
\(\text{d}_{E}\): Euclidean distance function  
Calculate the Euclidean distance between the kth feature point of f\({}_{i}\) and all feature points of f\({}_{j}\), and select the value with the minimum distance. WSD is a method of measuring the distance between two probability distributions and indicates the difference between the two distributions, as shown in Equation (3) [27]. \[\mathbf{D}_{\text{WSD}}\left(F_{i},F_{j}\right)=\left( \begin{pmatrix}\infty \\ \gamma\in\prod\left(F_{i},F_{j}\right)\end{pmatrix} E_{\left(x,y\right)\sim \gamma}\left[d(x,y)\right]\right) \tag{3}\]F\({}_{i}\), F\({}_{j}\): Two trajectories to compare, \(\gamma\): Joint probability distribution, E: Expected value according to \(\gamma\).