## 1 Introduction  
### Background and Purpose  
The global maritime industry is currently transitioning to the Maritime Autonomous Surface Ship (MASS) era [1], and interest in artificial intelligence (AI) applications derived from maritime data are increasing [2]. Advanced technologies for ships, defined as MASS (Maritime Autonomous Surface Ships) by the International Maritime Organization (IMO), include sophisticated smart sensors, comprehensive wireless network systems, robust cybersecurity measures, and AI algorithms suitable for processing and learning large volumes of big data [3]. The introduction of MASS is expected to increase the profit potential of shipping companies through reduced economic operating costs and route optimization, achieved by cutting labor expenses and improving transportation and operational efficiency. Additionally, the enhanced safety of MASS is anticipated to reduce maritime accidents, consequently lowering property losses and decreasing costs associated with marine environmental pollution, insurance, and liability [4]. A key technology for the commercialization of MASS is route clustering using pattern extraction from ship navigation data, which aims to provide the following information:  
First, ships use similar routes for economic operation and safety purposes. In the era of globalization, this technology enables the systematic establishment of optimal routes and can provide the fastest and collision-avoidance routes by analyzing traffic patterns [5]. Second, maritime accidents or suspicious movements can be detected by developing new surveillance and monitoring systems that do not rely solely on human supervision and analyzing abnormal ship trajectories, preventing crime and terrorism [6]. These innovations play a pivotal role in the development of MASS and represent significant changes in maritime and shipping industry strategies. In this study, we aimed to develop an algorithm that includes a sub-route clustering process capable of exploring the main routes and customary port routes by clustering the similarity of ship trajectories based on ship location data from vessel navigation data. Unlike previous methods that considered routes as a series of points, [PERSON] and [PERSON] [7] assumed each route was an observation of a statistical model. They fit a Gaussian mixture Hidden Markov Model (HMM) to the given point sequence of a route and then the HMM model to the route. They proposed a route clustering method by calculating the likelihood of route X being generated from route Y using this model. [PERSON] et al. [8] applied the Longest Common Subsequence (LCSS) for gesture classification during recognition. Dynamic Time Warping (DTW) is also used to define the similarity or dissimilarity between two trajectories. DTW uses dynamic programming to determine the best match between two spatiotemporal sequences. In video surveillance studies, DTW has been applied to distance metrics. [PERSON] and [PERSON] [9] proposed a Piciarelli-Foresti (PF) distance measure using a route cluster model with variance. This model models route clusters using representative routes and the variance of each point on the representative route. [PERSON] et al. [10] proposed the Modified Hausdorff distance (MHD) measure to measure trajectory similarity for traffic surveillance. [PERSON] and [PERSON] [11] applied DTW to extract representative trajectories from trajectory groups by comparing two trajectories in virtual reality training simulator applications. [PERSON] et al. [12] applied DTW to route clustering using Automatic Identification System (AIS) data. [PERSON] et al. [13] analyzed ship movement patterns using AIS data and performed hierarchical clustering of trajectories by combining Frechet distance and Principal Component Analysis (PCA). [PERSON] et al. [14] noted that conventional trajectory similarity calculation methods, such as LCSS and DTW, often struggle because of their high computational costs and sensitivity to noise.