## 2 Methods
### Cluster Analysis Method of Driving Behavior
#### 2.2.2 Risk Measurement Results Clustering Algorithm  
The k-means clustering algorithm, also known as k-means algorithm, treats data as points in K-dimensional space and performs clustering analysis based on the distance. The variable K represents the clustering into K clusters, and means represents taking the mean of the data in each cluster as the center of the cluster. In the assessment of the driving behavior, K-means clustering exhibits exceptional applicability and convenience [14].  
Based on the K-means clustering algorithm, this study defined four cluster centers, namely, dangerous, aggressive, safe, and conservative behaviors. The conservative type of behavior means that the driving behavior is too conservative during driving. This behavior has a high degree of safety but is not conducive to improving the actual traffic capacity of a road. The safe type of behavior means that the driving behavior is in an ideal state and ensures driving safety, which is most conducive to the improvement of the actual traffic capacity of a road. The aggressive type of behavior means that the driver has some aggressive driving behaviors, such as frequent acceleration and deceleration during driving, which are dangerous. The dangerous type of behavior means that the driver adopts extremely dangerous driving behaviors, such as sudden braking and frequent overtaking, which are extremely dangerous.  
The 301,111 driving behavior risk measurement results from the trajectory data of 600 vehicles were clustered in the four cluster centers: dangerous, aggressive, safe, and conservative. The initial cluster center points of the four types of data from large to small were taken as the initial cluster center points from the 301,111 trajectory data, and the distance among the four cluster centers and the risk measurement results of each driving behavior were determined. According to the principle of the smallest distance, each driving behavior risk measurement result was assigned to the four clusters: dangerous, aggressive, safe, and conservative. Then, the calculation of the new cluster center point was performed, and iteration was repeated until convergence [39].  
The distance between the driving behavior risk measurement results and the four cluster centers adopts the Euclidean distance [40,41]. The formula is shown in Equation (13).  
\[dis\bigl{(}X_{i},C_{j}\bigr{)}=\sqrt{\sum_{t=1}^{m}\bigl{(}X_{it}-C_{jt}\bigr{)} ^{2}} \tag{13}\]  
where \(X_{i}\) represents the risk measurement of the i-th driving behavior \(1\leq i\leq n\), \(C_{j}\) represents the risk measurement cluster center of the j-th driving behavior \(1\leq j\leq k\), \(X_{it}\) represents the i-th driving behavior's risk measurement of the t-th trajectory data, \(1\leq t\leq m\), and \(C_{jt}\) represents the j-th driving behavior's risk measurement cluster center of the t-th trajectory data.  
The calculation of the cluster center [42] of the trajectory data of each driving behavior risk measurement cluster is presented in Equation (14).  
\[C_{t}=\frac{\sum_{X_{i}\in S_{t}}X_{i}}{|S_{t}|} \tag{14}\]  
where \(C_{l}\) represents the center of the l-th driving behavior risk measurement cluster, \(1\leq l\leq\kappa\), \(|S_{l}|\) represents the number of objects in the l-th driving behavior risk measurement cluster, and \(X_{i}\) represents the i-th object of the l-th driving behavior risk measurement cluster, \(1\leq i\leq|S_{l}|\).