## 3 Hierarchical Trajectory Clustering Algorithm
### DBSCAN Algorithm with Automated Parameter Tuning
#### 3.2.2 Parameter Settings  
DBSCAN is an attractive technique used in various fields to process large-scale data based on the density cluster analysis algorithm, which can cluster all clusters and identify noise in the data. In addition, there is a significant advantage in that data category information is not required when analyzing DBSCAN clusters. However, a fundamental problem is correctly choosing the two input parameters: the epsilon radius and the MinPts density threshold. If the two input variables are incorrectly set, the quality of cluster analysis deteriorates. The Variable Density Clustering Algorithm (VDBSCAN) by [PERSON] and [PERSON] [45] extends DBSCAN by allowing Epsilon to vary according to the local density of points, enabling better detection of clusters with varying densities. It calculates the Epsilon value based on the k-distance graph across different densities, allowing the algorithm to adjust for varying density levels. [PERSON] et al. [46] assumed that all sudden changes in the k-distance graph correspond to changes in density levels. Therefore, to find all possible Epsilon values,they calculated the slopes at regular intervals in the k-distance graph and determined the differences between these slopes. The knee point was identified from these slope differences, and values from the knee region were repeatedly used, with the already clustered points being excluded from subsequent iterations. [PERSON] et al. [47] used a k-distance graph to determine Epsilon in their Adaptive and Fast Density-Based Spatial Clustering of Applications with Noise (AF-DBSCAN) and applied curve fitting techniques to accurately identify the knee region. The knee region was set between high-density and low-density areas, and the inflection points of the curve were identified using a polynomial regression model to set Epsilon. Once Epsilon is determined, MinPts is calculated based on the distribution of points within each Epsilon neighborhood by computing the average number of points in the Epsilon neighborhood for each point in the dataset. Based on previous research, we used the k-distance graph to identify the knee region in the present study. Many researchers have used the k-distance graph to set the Epsilon parameter. The k-distance graph is created by sorting the distance to the k-th nearest neighbor for each point using the k-nearest neighbor algorithm. To define the knee region, where there is a sudden increase or decrease in the data points on the k-distance graph,  
Figure 4: Comparison of cluster analysis methods. (**a**) DBSCAN cluster analysis results. (**b**) OPTICS cluster analysis results. (**c**) K-means cluster analysis results. (**d**) Mean-shift cluster analysis results. this study applies a moving average technique, similar to how [PERSON] et al. modified the k-distance graph. We propose a method for determining Epsilon from the knee region and setting MinPts based on the selected Epsilon. You need to determine the threshold by looking at the k-dist graph, and the point range where there is a large sudden change in distance is defined as 'knee', 'valley', or 'elbow'. In previous studies, it was difficult to discover the knee section automatically; therefore, a threshold had to be specified after visually checking the graphs. Setting the parameters Epsilon and MinPts of DBSCAN cluster analysis followed the order shown in Figure 5.  
First, as shown in Figure 6a, a k-distance graph of the dataset was created. Second, as illustrated in Figure 6b, a moving average technique was applied to create a moving average k-distance graph. The reason for creating the moving average k-distance graph was that in a typical k-distance graph, it is difficult to set the knee region in the next step; this was conducted to automatically set the parameters.