## 3 Materials and Methods
### Cluster Analysis  
As an essential method for studying classification problems, cluster analysis groups similar things together as much as possible and separates things that are more different (Figure 6). The fundamental laws within things can be more clearly recognized by cluster analysis, which plays an essential role in several scientific fields [41; 42; 43; 44; 45; 46]. There are certain drawbacks to the traditional clustering method: (1) artificially determining the number of groups and (2) artificially selecting the clustering center. However, the result of such division is mainly affected by human factors, which makes the final division unreliable [47; 48; 49; 50; 51].  
The affinity propagation clustering algorithm overcomes the shortcomings of traditional clustering analysis. Its principle is to achieve efficient and accurate data clustering by iteratively transmitting attraction and attribution information between data points in a given data set. It is a clustering algorithm based on the \"information transfer\" between data points. It takes the similarity between a pair of data points as input and exchanges accurate and valuable information between data points until an optimal set of class representative points and clustering are gradually formed. The main advantages include: (1) the number of clusters and the cluster center can be obtained by calculation, which does not need to be specified manually; (2) each data point can be used as a potential cluster center; (3) the clustering results are unique; (4) the starting condition of the algorithm is the input correlation matrix, and (5) there is no requirement for the symmetry of the matrix. The specific algorithm flow is as follows [52; 53].  
(1) Calculate data point correlation matrix.  
Figure 6: Cluster Analysis.  
Determining the size of \(p\) (Preference) and the number of iterations.
3. Calculate the responsibility information and the availability information between monitoring points.
4. Update the responsibility information and availability information.
5. Calculate the cluster center.
6. The maximum number of cycles is reached, and the final result is obtained.  
In the study of debris flow classification, traditional clustering analysis methods require the manual determination of classification numbers, which is subjective. However, using the affinity propagation clustering algorithm to classify debris flows can be completed without specifying the number of classifications and clustering centers in advance. The calculation results are unique and reasonable. However, an essential parameter in the affinity propagation algorithm is the reference \(p\)-value, which refers to the reliability of using data points as clustering centers. The size of the reference \(p\)-value directly affects the clustering results, and its size is directly proportional to the number of clusters. Improper selection of \(p\)-values can lead to poor clustering results [54]. In general, when there is no prior knowledge, the \(p\)-value is set as the median of the similarity matrix and remains unchanged during the clustering process. However, selecting the median of the similarity matrix may not necessarily result in the optimal result [55]. Considering that the basis of algorithm startup is a correlation matrix, and different \(p\)-values input in the calculation process will also lead to different calculation results, therefore, determine the correlation between debris flows before calculation, and use quantum particle swarm optimization (QPSO) [56] to optimize the \(p\)-value, find the \(p\)-value under the optimization condition of the objective function, and obtain the classification result of debris flows under the optimization \(p\)-value condition.