# Dominant Partitioning of Discontinuities of Rock Masses Based on DBSCAN Algorithm
## 2 Methods
### Spatial Density-Based Clustering Algorithm: DBSCAN  
DBSCAN is a density-based spatial clustering algorithm [38; 39; 40]. This algorithm is a clustering algorithm proposed by [PERSON] et al. It has the advantages of being anti-noise and being able to handle arbitrary shape clustering. The DBSCAN algorithm has two key parameters--\(\epsilon\) and _MinPts_ global variables. Firstly, the region with sufficient density is divided into clusters. If the density in the \(\epsilon\) range of a certain sample exceeds _MinPts_, the sample is regarded as the core point, and the sample in the \(\epsilon\) range and the core point belong to the same cluster. Samples that cannot be connected within the range of any core point r are regarded as noise and do not belong to any cluster.  
The DBSCAN algorithm does not need to specify the number of clusters in advance, can find data structures of any shape and can also identify noise points or isolated values. However, the clustering effect of the DBSCAN algorithm depends largely on the two hyperparameters of r and Td. Small differences may lead to clustering results with large differences, and these two hyperparameters are difficult to specify and mainly rely on empirical selection. The basic definitions involved in its algorithm are as follows [41; 42; 43] (Figure 3).  
**Definition 1**.: \(\epsilon\) _neighborhood. Pick a region within the radius, \(\epsilon\), of the body._  
**Definition 2**.: _Key target. If a target covers a minimum of MinPts targets in a neighborhood smaller than \(\epsilon\), the object is the key target._  
**Definition 3**.: _Direct density reachability. For a data set, \(D\), if \(p\) is within the \(\epsilon\) neighborhood of \(q\), while \(q\) belongs to the key target definition, then target \(p\) is said to be density-reachable from target \(q\) with respect to \(\epsilon\) and MinPts._  
**Definition 4**.: _Density-reachable. Given a sample set, \(D\), assign a series of sample points \(p_{1}\), \(p_{2}\),... \(p_{n}\), \(p=p_{1}\), \(q=p_{n}\). If target \(p_{i}\) is directly density-accessible from \(p_{i-1}\), target \(q\) is density-accessible to target \(p\)._  
**Definition 5**.: _Density interconnection. If any object exists, \(o\in D\), for which object \(p\) and object \(q\) are density-reachable from \(o\) with respect to \(\varepsilon\) and MinPts, then object \(p\) and object \(q\) are density interconnections with respect to \(\varepsilon\) and MinPts._  
**Definition 6**.: _Noise. Objects that are not in the range of any cluster are treated as noise._  
Based on the above definitions of the DBSCAN algorithm, it is not difficult to see that the idea of the DBSCAN algorithm involves starting from any point, \(o\), in a given data set, \(D\), and then finding each point in \(D\) related to \(\varepsilon\) and _MinPts_ that can be reached from \(o\) density. If \(o\) is the core object, then every point in its neighborhood will belong to the same category as \(o\), and this part of the point will be the next search target (seed point), which will then be constantly updated; if \(o\) does not belong to the core object, then \(o\) points are processed by noise points. Repeat the above process until the new class is determined to end.  
When the input parameters \(\varepsilon\) and _MinPts_ are determined, the algorithm follows the following steps:  
1. Arbitrarily select a point, \(o\), in the data set, \(D\), and then search it for the region;
2. If \(o\) is the core object, then find the point from the \(o\) density up until the point when a class containing \(o\) points is generated;
3. Otherwise, \(o\) is treated as a noise point;  
Figure 3: Definitions based on density clustering (adapted with permission from Ref. [43], [PERSON], 2022). (**a**) Kernel object. (**b**) Direct density. (**c**) Density reachability. (**d**) Density interconnection.  
Query the next point in data set \(D\) and repeat the above process. When each point of the data set is processed, the task ends.