## 3 Hierarchical Trajectory Clustering Algorithm
### Data Preprocessing
#### 3.1.2 Similarity Measure-Dimension Reduction Combination Cluster Performance Comparison  
This study evaluated the clustering performance of preprocessed data using the silhouette score with a combination of four ship trajectory similarity measurement methods (MHD, WSD, DTW, and LCSS) and two-dimensionality reduction methods (PCA and CMDS). The Silhouette score, designed by [PERSON] [40], is a quantitative measurement standard used to evaluate the efficiency of a clustering algorithm. It measures the cohesion within a cluster by comparing the separation of clusters with other clusters. The internal consistency of each cluster was determined by evaluating the closeness of a data point to other data points within the same cluster and data points in other clusters. The value range of the silhouette score, Equation (11), is from \(-1\) to \(1\). A value close to \(-1\) means that the data are close to data in another cluster, indicating poor clustering, and a value close to \(0\) means that the data are on the border of two clusters. The closer it is to \(1\), the better the formation of the cluster.  
\[\text{S}_{i}=\frac{\beta_{i}-\alpha_{i}}{\{\max(\alpha_{i},\beta_{i})\}},S_{i}= \left\{\begin{array}{cc}1-\frac{\alpha_{i}}{\beta_{i}},&if\ \alpha_{i}<\beta_{i}\\ 0,&if\ \alpha_{i}=\beta_{i}\\ \frac{\beta_{i}}{\alpha_{i}}-1,&if\ \alpha_{i}>\beta_{i}\end{array}\right. \tag{11}\]  
The results of the DBSCAN clustering analysis were evaluated using the Silhouette score and visually represented via a graph (Figure 3). The y-axis represents the clusters determined by the DBSCAN algorithm, where \(-1\) indicates the noise cluster. The length of the y-axis reflects the number of samples in each cluster. The length of the bars along the x-axis represents the Silhouette score of the samples, and the final evaluation of the DBSCAN clustering results is expressed as the average Silhouette score of all samples, excluding those in the noise cluster.  
Compared with the scores of other clustering evaluation methods, the Silhouette score is useful for comprehensively assessing cluster density and separation. It provides an intuitive and effective method for evaluating the clustering quality, particularly in unsupervised learning. Moreover, it offers superior consistency and reliability.  
The DBSCAN cluster analysis results of the eight datasets processed through the ship route similarity measurement and dimensionality reduction processes are summarized in Table 2. The dataset that measured the similarity between ship trajectories using MHD and reduced the dimensionality using PCA had the highest silhouette score of 0.785840; therefore, it was selected as the dataset for cluster analysis in this study.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Division** & **Silhouette Score** & **Epsilon** & **MinPts** & **No. of Clusters** \\ \hline
**MHD-PCA** & 0.785840 & 0.0102880 & 41 & 6 \\ \hline
**MHD-CMDS** & 0.700152 & 0.0066911 & 63 & 3 \\ \hline
**WSD-PCA** & 0.783158 & 0.0095889 & 52 & 5 \\ \hline
**WSD-CMDS** & 0.639089 & 0.0051330 & 43 & 3 \\ \hline
**DTW-PCA** & 0.756204 & 0.0154610 & 68 & 4 \\ \hline
**DTW-CMD** & 0.768799 & 0.0953910 & 62 & 4 \\ \hline
**LCSS-PCA** & 0.695913 & 0.0098910 & 45 & 5 \\ \hline
**LCSS-CMDS** & 0.657749 & 0.0057198 & 35 & 3 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Silhouette score of similarity measure-dimension reduction combination.  
Figure 3: DBSCAN cluster analysis silhouette score graph of the MHD-PCA dataset.