# A Novel Minimum Spanning Tree Clustering Algorithm Based on Density Core

Authors: Qiang Gao; Qin-Qin Gao; Zhong-Yang Xiong; Yu-Fang Zhang; Min Zhang
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

Clustering analysis is an unsupervised learning method, which has applications across many fields such as pattern recognition, machine learning, information security, and image segmentation. The density-based method, as one of the various clustering algorithms, has achieved good performance. However, it works poor in dealing with multidensity and complex-shaped datasets. Moreover, the result of this method depends heavily on the parameters we input. Thus, we propose a novel clustering algorithm (called the MST-DC) in this paper, which is based on the density core. Firstly, we employ the reverse nearest neighbors to extract core objects. Secondly, we use the minimum spanning tree algorithm to cluster the core objects. Finally, the remaining objects are assigned to the cluster to which their nearest core object belongs. The experimental results on several synthetic and real-world datasets show the superiority of the MST-DC to Kmeans, DBSCAN, DPC, DCore, SNNDPC, and LDP-MST.


---

## Body

## 1. Introduction

Clustering analysis, which classifies the unlabeled data into some clusters, refers to a task to discover the internal structure of data or the potential data models [1]. Since the early 1950s, quite a few clustering algorithms have been put forward [2, 3]. These algorithms can be roughly classified into four categories: partition-based clustering algorithms [4, 5], hierarchical clustering algorithms [6, 7], density-based clustering algorithms [8, 9], and graph-based clustering algorithms [10–12]. Thanks to the predominant capability of discovering clusters of different shapes and sizes along with outliers, density-based and partition-based clustering technologies are widely used in the fields of health care [13], information security [14], the Internet [15], etc. Besides, clustering is also a vital key for analyzing big data.Partition-based clustering algorithms are the simplest and most fundamental clustering algorithms. They organize the data objects into several nonoverlapping partitions where each partition represents a cluster, and each data object belongs to one cluster [16]. Nevertheless, traditional partition-based methods usually cannot find clusters with arbitrary shapes.However, identifying clusters with arbitrary shapes is a very important task in the applications of clustering algorithms. Since the density-based clustering algorithm does not need to know the number of clusters in the dataset in advance and can effectively process datasets with arbitrary shapes, it has always been the focus of research in clustering algorithms. The idea of the density-based clustering algorithm [17] is that the clusters in the dataset are a collection of dense data regions separated by sparse data regions. DBSCAN [18] and DPC [8] are two typical algorithms among density-based algorithms. The DBSCAN algorithm manually sets the neighborhood radius ε and the minimum density points Minpts, and it classifies data points into core points, boundary points, and outliers. Besides, DBSCAN can be effectively applied to datasets with complex shapes, and outliers can be detected during the clustering process. However, the algorithm gets poor clustering results for multidensity datasets. Furthermore, for different datasets, setting different parameters in DBSCABN will get unstable clustering results. The DPC (density peak clustering) algorithm was published in the journal Science in 2014, and it holds the idea that cluster centers are characterized by a higher density and a relatively longer distance [8]. However, the DPC still has some drawbacks. Firstly, a threshold dc needs to be set by users. Besides, the cluster centers are obtained by the decision graph, which has certain human factors.To improve the performance of DPC, DPC-KNN-PCA [19] and SNN-DPC [20] have been proposed. DPC-KNN-PCA integrates PCA, DPC, and KNN to avoid the defects of DPC. However, this density-based algorithm still cannot recognize clusters containing manifold distributions [21]. To solve the defect of the use of threshold dc, paper [20] proposed a shared-nearest-neighbor-based clustering by the fast search and find of density peak (SNN-DPC) algorithm. The computation of its local density ρ and distance from the nearest larger density point δ takes the information of the nearest neighbors and the shared neighbors into consideration. The assignment process in DPC is sensitive and of low fault tolerance. For example, if a data point is assigned incorrectly, then the subsequent assignment will magnify the error, resulting in more errors that will have a seriously negative impact on the clustering process. Therefore, the paper [20] adopted a two-step assignment to solve the drawbacks of DPC. Yet, SNN-DPC still has several apparent defects. Firstly, the number of shared nearest neighbors k needs to be set through manual experience. Besides, SNN-DPC still utilizes a decision graph to select cluster centers. MST-based clustering methods [22, 23] do not assume that data points are grouped around centers or separated by regular geometric curve. Instead, they use tree edge information to divide a dataset into clusters and are able to recognize clusters with arbitrary shapes. Clustering algorithms based on the minimum spanning tree (MST) are able to detect clusters with arbitrary shapes; however, they are time-consuming and susceptible to noise points. The algorithm in [24] uses a new distance between local density peaks based on shared neighbors to construct a minimum spanning tree on the local density peaks, which excludes the interference of noise points and reduces the running time of MST-based clustering algorithms. Nevertheless, LDP-MST still needs input parameters, which means that the algorithm cannot exclude the interference of human factors.To resolve the problem mentioned above, we propose a novel clustering algorithm (called the MST-DC). Firstly, we automatically get the reverse neighbors of each object based on the concept of natural neighbor searching. Secondly, we obtain the core objects according to the number of reverse neighbors of each object. Thirdly, based on the Prim algorithm in the graph theory, we construct a minimum spanning tree of the core objects to obtain the clustering result of core objects. Lastly, unallocated objects are marked as the label of their nearest local core objects. There is no need to set parameters in MST-DC. Furthermore, MST-DC can be applied to complex patterns with extremely large variations in density.The remainder of this paper is organized as follows: Section2 presents a brief overview of density core and natural neighbors; Section 3 presents the clustering algorithm (MST-DC); Section 4 presents the analysis of synthetic datasets and real datasets; and finally, Section 5 presents the summary of this paper and future work.


## 2. Related Work

We review related works on density core [25] and natural neighbors [26] in this section, which are originally mentioned by Dai et al. [25].


### 2.1. Density Core

There exist some intrinsic defects in centroid-based clustering methods, including shape loss, false distances, and false peaks, which cause centroid-based methods to fail when applied to complex patterns [27]. Thence, Chen et al. [27] proposed a hybrid decentralized approach named DCore, which was used to overcome these defects in centroid-based clustering methods. Density cores can roughly maintain the shape of the cluster and be located far from each other.As is known to all, the mean shift algorithm can identify nonspherical patterns by shifting tracks. Thus, DCore uses mean shift andk-center to obtain convergence points. DCore is a hybrid method that can decentralize each density peak into a loose density core, which can refrain some intrinsic defects in centroid-based clustering approaches. The application of DCore in different datasets indicates that it can perform well in many complex datasets. Nevertheless, it still has some obvious limitations:(1)
DCore algorithm uses a global fastened scanning radius to search convergent points and density cores. For a dataset with multiple density levels, it cannot obtain an ideal density representative point using a global fastened scanning radius, and thus cannot obtain ideal clustering results.(2)
In order to filter noise, the DCore algorithm adopts three filtering strategies. However, it is usually difficult to determine a specific pattern, so it is difficult to select the corresponding strategy to detect outliers and noise.(3)
The DCore algorithm needs to adjust five parameters to attain better clustering results. It is difficult to find the ideal combination of parameters to make the clustering perform better.


### 2.2. Natural Neighbor

Natural neighbor [26] is a new concept that originates from the reality that the number of one’s real friends should be the number of how many people are taken him or her as friends, and he or she takes them as friends at the same time. For example, if object p regards object q as a neighbor and object q regards object p as a neighbor at the same time, then object q is one of the natural neighbors of object p. To put it another way, the main idea of the natural neighbor stable structure is that objects lying in sparse regions possess a small number of neighbors. In contrast, objects lying in dense regions possess a large number of neighbors [28]. Thus, the natural neighbor stable structure of objects is formulated as follows:(1)∀p∃qk∈N∧p≠q⟶q∈KNNkp∧p∈KNNkq,where KNNkp is the k nearest neighbor of object p.Definition 1.
(k nearest neighbors). Thek nearest neighbors of object p are a set of objects q in dataset X with distp,q≤distp,o, that is,(2)KNNkp=q∀q∈X,distp,q≤distp,o,where distp,o is the distance between the object p and the kth object o.Definition 2.
(Reverse neighbors). The reverse neighbors of objectp are a set of objects q that regard p as its k nearest neighbor, i.e., RNNkp=q∈Xp∈KNNkq.The natural neighbor stable structure’s formation process is represented as follows: continuously expand the neighbor searching rangek increasing from 1 to λ (λ is named natural neighbor eigenvalue (NaNE)) [26]; in each searching process, calculate the number of reverse neighbors of each object and judge the following two conditions: (1) all objects have reverse neighbors and (2) the number of objects without reverse neighbors remains unchanged; and when one of these conditions is met, the natural neighbor stable structure is formed. The searching range k is equal to the natural characteristic value λ at this moment. Therefore, λ is obtained by(3)λ=mink∑p=1nfnbkp=0or∑p=1nfnbkp=∑p=1nfnbk−1p,where k is initialized with 1, nbkp is the number of object p’s reverse neighbor in the kth iteration (note that nbkp≥0), and fx is defined as follows:(4)fx=0,otherwise,1,ifx==0.Based on the above concepts, the natural neighbor is defined as follows:Definition 3.
(Natural neighbors). For each objectp, the k nearest neighbors are natural neighbors, denoted as NaNp, where k is equal to the natural characteristic value λ.Apparently, each object has the same number of natural neighbors in this paper. The details of the natural neighbor searching algorithm are shown in Algorithm 1.Algorithm 1: Natural neighbor searching algorithm (NaN-searching).
Input:X (the dataset)Output:λ(the natural characteristic value), NaN(natural neighbors)(1)
Initialk=1,number1=0,nbp=0,KNNkp=∅,RNNkp=∅;(2)
create a KD-treeT from the dataset X;(3)
whiletruedo(4)
for each object p in Xd(5)
find thekth neighbor q of p using T(6)
nbq=nbq+1;(7)
KNNkp=KNNk−1p∪q;(8)
RNNkq=RNNk−1q∪p;(9)
end for(10)
nbk=nb;(11)
numberk=lengthfindnbk=0;(12)
ifnumberk==0ornumberk==numberk−1then(13)
break;(14)
end if(15)
k=k+1;(16)
end while(17)
λ=k;(18)
for each object p in Xdo(19)
NaNp=KNNλp;(20)
end for(21)
Returnλ, NaN


## 2.1. Density Core

There exist some intrinsic defects in centroid-based clustering methods, including shape loss, false distances, and false peaks, which cause centroid-based methods to fail when applied to complex patterns [27]. Thence, Chen et al. [27] proposed a hybrid decentralized approach named DCore, which was used to overcome these defects in centroid-based clustering methods. Density cores can roughly maintain the shape of the cluster and be located far from each other.As is known to all, the mean shift algorithm can identify nonspherical patterns by shifting tracks. Thus, DCore uses mean shift andk-center to obtain convergence points. DCore is a hybrid method that can decentralize each density peak into a loose density core, which can refrain some intrinsic defects in centroid-based clustering approaches. The application of DCore in different datasets indicates that it can perform well in many complex datasets. Nevertheless, it still has some obvious limitations:(1)
DCore algorithm uses a global fastened scanning radius to search convergent points and density cores. For a dataset with multiple density levels, it cannot obtain an ideal density representative point using a global fastened scanning radius, and thus cannot obtain ideal clustering results.(2)
In order to filter noise, the DCore algorithm adopts three filtering strategies. However, it is usually difficult to determine a specific pattern, so it is difficult to select the corresponding strategy to detect outliers and noise.(3)
The DCore algorithm needs to adjust five parameters to attain better clustering results. It is difficult to find the ideal combination of parameters to make the clustering perform better.


## 2.2. Natural Neighbor

Natural neighbor [26] is a new concept that originates from the reality that the number of one’s real friends should be the number of how many people are taken him or her as friends, and he or she takes them as friends at the same time. For example, if object p regards object q as a neighbor and object q regards object p as a neighbor at the same time, then object q is one of the natural neighbors of object p. To put it another way, the main idea of the natural neighbor stable structure is that objects lying in sparse regions possess a small number of neighbors. In contrast, objects lying in dense regions possess a large number of neighbors [28]. Thus, the natural neighbor stable structure of objects is formulated as follows:(1)∀p∃qk∈N∧p≠q⟶q∈KNNkp∧p∈KNNkq,where KNNkp is the k nearest neighbor of object p.Definition 1.
(k nearest neighbors). Thek nearest neighbors of object p are a set of objects q in dataset X with distp,q≤distp,o, that is,(2)KNNkp=q∀q∈X,distp,q≤distp,o,where distp,o is the distance between the object p and the kth object o.Definition 2.
(Reverse neighbors). The reverse neighbors of objectp are a set of objects q that regard p as its k nearest neighbor, i.e., RNNkp=q∈Xp∈KNNkq.The natural neighbor stable structure’s formation process is represented as follows: continuously expand the neighbor searching rangek increasing from 1 to λ (λ is named natural neighbor eigenvalue (NaNE)) [26]; in each searching process, calculate the number of reverse neighbors of each object and judge the following two conditions: (1) all objects have reverse neighbors and (2) the number of objects without reverse neighbors remains unchanged; and when one of these conditions is met, the natural neighbor stable structure is formed. The searching range k is equal to the natural characteristic value λ at this moment. Therefore, λ is obtained by(3)λ=mink∑p=1nfnbkp=0or∑p=1nfnbkp=∑p=1nfnbk−1p,where k is initialized with 1, nbkp is the number of object p’s reverse neighbor in the kth iteration (note that nbkp≥0), and fx is defined as follows:(4)fx=0,otherwise,1,ifx==0.Based on the above concepts, the natural neighbor is defined as follows:Definition 3.
(Natural neighbors). For each objectp, the k nearest neighbors are natural neighbors, denoted as NaNp, where k is equal to the natural characteristic value λ.Apparently, each object has the same number of natural neighbors in this paper. The details of the natural neighbor searching algorithm are shown in Algorithm 1.Algorithm 1: Natural neighbor searching algorithm (NaN-searching).
Input:X (the dataset)Output:λ(the natural characteristic value), NaN(natural neighbors)(1)
Initialk=1,number1=0,nbp=0,KNNkp=∅,RNNkp=∅;(2)
create a KD-treeT from the dataset X;(3)
whiletruedo(4)
for each object p in Xd(5)
find thekth neighbor q of p using T(6)
nbq=nbq+1;(7)
KNNkp=KNNk−1p∪q;(8)
RNNkq=RNNk−1q∪p;(9)
end for(10)
nbk=nb;(11)
numberk=lengthfindnbk=0;(12)
ifnumberk==0ornumberk==numberk−1then(13)
break;(14)
end if(15)
k=k+1;(16)
end while(17)
λ=k;(18)
for each object p in Xdo(19)
NaNp=KNNλp;(20)
end for(21)
Returnλ, NaN


## 3. The Proposed Algorithm

Based on the idea of density core, we apply the reverse nearest neighbors in the natural neighbor searching algorithm to extract density core sets. And density core sets can maintain the general shape of clusters well. Subsequently, we construct a minimum spanning tree of density core points for clustering. Besides, we use the reverse nearest neighbors in the process of natural neighbor searching, which does not require any parameter settings. MST-DC can recognize extremely complicated clusters with large variations in density.


### 3.1. Density Core Set

According to Algorithm 1, we calculate the number of reverse nearest neighbors for each object. Since the number of core objects’ reverse nearest neighbors are greater than that of noncore objects’ reverse nearest neighbors, we use the number of reverse nearest neighbors to extract core objects. The definition of the core object is as follows:Definition 4.
(Core object). If one object can be considered as a core object, it must satisfy the following formula:(5)RCore=p∀p∈SRNNp≥k,where SRNN(p) represents the number of reverse nearest neighbors of object p, and k represents the natural characteristic value.As is mentioned above, each data point regards its neighbor point as a potential density core point. This neighbor point is a true density core point when there are enough data objects to treat it as a potential density core point. Figure1(a) shows an original dataset with three clusters. After the core point extraction process, as shown in Figure 1(b), the red regions represent potential clusters, and each point in the red regions is a core object. The gray points are noncore objects. Algorithm 2 presents the process of finding core sets, which can roughly retain the shape of clusters.Figure 1
Density core points extracted based on a reverse nearest neighbor number.
(a)(b)Algorithm 2: Find core set (find-cores).
Input:D(the dataset)Output:RCore(density core)(1)
Initialize:RCore=NULL;(2)
λ,RNN,DIS=RNN−SearchD;(3)
for each point p in Ddo(4)
SRNNp=sizeRNNp(5)
ifSRNNp≥λthen(6)
RCore=RCore∪p(7)
end if(8)
end for


### 3.2. Clustering Core Objects

After we obtain the density core points, how to cluster the density core points becomes a key task. We propose a method of clustering density core points based on the minimum spanning tree. The density core sets extracted in the dataset retain the general shape of the cluster, while the distance between the density core sets is further apart. After constructing the minimum spanning tree, it is easier to find the longest edge of the tree for cutting.The process of clustering the density core points based on the minimum spanning tree is as follows: Firstly, we construct a minimum spanning tree based on the set of density core points, and secondly, we cut off the edges whose length is greater than the trimming threshold. Afterwards, we can obtain the cluster of the density core sets according to tree structure information after trimming. The trimming thresholdcutθ is defined as follows:where meanEdge represents the average value of all the edge weights in the minimum spanning tree, and stdEdge represents the standard deviation of all the edge weights in the minimum spanning tree. ω is an empirical value, and its value range is [2, 5], which has been verified by a large number of experiments. When ω = 3, it meets the requirements of most datasets. In this article, we choose ω = 3 as the experimental parameter. The setting of the trimming threshold is based on statistical principles, which can check whether there are outliers in the data. The length of the edge of the minimum spanning tree constructed conforms to the Gaussian distribution, and the edge we need to trim is the longer one located between different clusters.Definition 5.
(Trimming threshold). The threshold is derived from the overall minimum spanning tree.(6)cutθ=meanEdge+ω∗stdEdge,The steps of clustering density core points are as follows:(1)
We utilize the Prim algorithm to construct the minimum spanning tree on all the density core points. The length of the edge, which is computed based on the Euclidean distance, is used as the weight in the minimum spanning tree. The minimum spanning tree we build based on the density core points is shown in Figure2.(2)
After building the minimum spanning tree, we get a minimum spanning tree edge set. Since we build the minimum spanning tree based on the density core, the weight of the tree in the same cluster is relatively small, and the change of weight is small as well. The weight of the edge between different clusters is larger, so it is easier for us to find the edges connecting different clusters and cut them off. As shown in Figure3(a), the colored dots represent the weights of the edges of the minimum spanning tree. The weights of the two edges (red dots) are much larger than the weights of the other edges (blue dots). The red dotted line indicates the trimming threshold we calculated, and the trimming threshold can effectively identify the longer sides in the minimum spanning tree; Figure 3(b) shows the minimum spanning tree of the subcluster after cutting off the edge greater than the trimming threshold. From the figure, we can see that the red density core points have been divided into three parts, and each part of the density core has a minimum spanning tree after cutting.(3)
We cluster the density cores according to the minimum spanning subtree structure retained by the density core points of each cluster after trimming, namely, assigning the points on the same minimum spanning subtree to the same cluster.Figure 2
Minimum spanning tree based on density core points.Figure 3
Obtaining each subcluster based oncutθ.
(a)(b)According to the description of the above steps, the specific steps of clustering density core points are shown in Algorithm 3.Algorithm 3: Clustering core object.
Input:RCore(the core set)Output:CL(the result of clustering)(1)
Initialize the Core Set CL=∅;(2)
TreeEdge=PrimRCore,Dis;(3)
cutθ=meanEdge+ω∗stdEdge;(4)
for each edge e in TreeEdgedo(5)
ifvaluee>cutθthen(6)
cut this edge;(7)
end if(8)
end for(9)
for each object p in RCoredo(10)
ifCLp==0then(11)
ClusterID=maxCL+1;(12)
TreeCP=qp,g∈TreeEdge;(13)
CLp=ClusterID;(14)
while∃x∈TreeCP&&CLx==0do(15)
CLx=ClusterID;(16)
TreeCP=TreeCP∪qp,g∈TreeEdge;(17)
end while(18)
end if(19)
end for(20)
ReturnCL


### 3.3. The MST-DC Clustering Algorithm

In this section, we introduce a novel clustering algorithm, namely, MST-DC. The basic steps are as follows: firstly, we find the reverse nearest neighbors of each object according to the natural neighbor searching algorithm; secondly, we use formula (5) to get the core objects; thirdly, we build the minimum spanning tree of the density core set RCore, and the edge between the clusters is cut according to formula (6), and then, the density cores are clustered according to the obtained subcluster tree; fourthly, we apply the concept of outlier clusters in paper [29] to eliminate erroneous clusters. In this paper, a novel outlier cluster detection algorithm called ROCF is proposed based on the concept of mutual neighbor graph and on the idea that the size of outlier clusters is usually much smaller than the normal clusters; and finally, the noncore points are assigned to the clusters to which their closest density core points belong. The overall steps of the MST-DC algorithm are shown in Algorithm 4.Algorithm 4: MST-DC.
Input:D (the dataset)Output: Cluster Label CL(1)
Initialize the core objects set RCore=NULL;(2)
Initialize the dataset CL=∅;(3)
λ,RNN,DIS=RNN−SearchD;(4)
RCore=Find−CoresRNN,λ;(5)
CL=CoreCutClusterRCore,DIS;(6)
eliminate erroneous clusters;(7)
for each object p which is unallocated do(8)
CLp= the label of p′s nearest core object;(9)
end for(10)
ReturnCL


### 3.4. The Complexity Analysis

Based on the description of the MST-DC clustering algorithm in the previous sections, the time complexity of MST-DC depends on following parts: (1) we use the natural neighbor algorithm optimized byKD−tree [30] to obtain the reverse nearest neighbors of each data point, the natural eigenvalue, and the Euclidean distance of the data points, and its time complexity is Onlogn; (2) the process of extracting core points is equivalent to traversing data points, and its time complexity is On; (3) the time complexity of clustering the core points based on the minimum spanning tree is mainly focused on the Prim algorithm to establish the minimum spanning tree. This paper uses the heap-optimized Prim algorithm, whose time complexity is Omlogm, where mm≪n represents the number of obtained core points; and (4) we assign the remaining points to their nearest density core with time complexity of Ol, where ll<n,n=l+m represents the number of remaining noncore points. In summary, the total time complexity of MST-DC is Onlogn.


## 3.1. Density Core Set

According to Algorithm 1, we calculate the number of reverse nearest neighbors for each object. Since the number of core objects’ reverse nearest neighbors are greater than that of noncore objects’ reverse nearest neighbors, we use the number of reverse nearest neighbors to extract core objects. The definition of the core object is as follows:Definition 4.
(Core object). If one object can be considered as a core object, it must satisfy the following formula:(5)RCore=p∀p∈SRNNp≥k,where SRNN(p) represents the number of reverse nearest neighbors of object p, and k represents the natural characteristic value.As is mentioned above, each data point regards its neighbor point as a potential density core point. This neighbor point is a true density core point when there are enough data objects to treat it as a potential density core point. Figure1(a) shows an original dataset with three clusters. After the core point extraction process, as shown in Figure 1(b), the red regions represent potential clusters, and each point in the red regions is a core object. The gray points are noncore objects. Algorithm 2 presents the process of finding core sets, which can roughly retain the shape of clusters.Figure 1
Density core points extracted based on a reverse nearest neighbor number.
(a)(b)Algorithm 2: Find core set (find-cores).
Input:D(the dataset)Output:RCore(density core)(1)
Initialize:RCore=NULL;(2)
λ,RNN,DIS=RNN−SearchD;(3)
for each point p in Ddo(4)
SRNNp=sizeRNNp(5)
ifSRNNp≥λthen(6)
RCore=RCore∪p(7)
end if(8)
end for


## 3.2. Clustering Core Objects

After we obtain the density core points, how to cluster the density core points becomes a key task. We propose a method of clustering density core points based on the minimum spanning tree. The density core sets extracted in the dataset retain the general shape of the cluster, while the distance between the density core sets is further apart. After constructing the minimum spanning tree, it is easier to find the longest edge of the tree for cutting.The process of clustering the density core points based on the minimum spanning tree is as follows: Firstly, we construct a minimum spanning tree based on the set of density core points, and secondly, we cut off the edges whose length is greater than the trimming threshold. Afterwards, we can obtain the cluster of the density core sets according to tree structure information after trimming. The trimming thresholdcutθ is defined as follows:where meanEdge represents the average value of all the edge weights in the minimum spanning tree, and stdEdge represents the standard deviation of all the edge weights in the minimum spanning tree. ω is an empirical value, and its value range is [2, 5], which has been verified by a large number of experiments. When ω = 3, it meets the requirements of most datasets. In this article, we choose ω = 3 as the experimental parameter. The setting of the trimming threshold is based on statistical principles, which can check whether there are outliers in the data. The length of the edge of the minimum spanning tree constructed conforms to the Gaussian distribution, and the edge we need to trim is the longer one located between different clusters.Definition 5.
(Trimming threshold). The threshold is derived from the overall minimum spanning tree.(6)cutθ=meanEdge+ω∗stdEdge,The steps of clustering density core points are as follows:(1)
We utilize the Prim algorithm to construct the minimum spanning tree on all the density core points. The length of the edge, which is computed based on the Euclidean distance, is used as the weight in the minimum spanning tree. The minimum spanning tree we build based on the density core points is shown in Figure2.(2)
After building the minimum spanning tree, we get a minimum spanning tree edge set. Since we build the minimum spanning tree based on the density core, the weight of the tree in the same cluster is relatively small, and the change of weight is small as well. The weight of the edge between different clusters is larger, so it is easier for us to find the edges connecting different clusters and cut them off. As shown in Figure3(a), the colored dots represent the weights of the edges of the minimum spanning tree. The weights of the two edges (red dots) are much larger than the weights of the other edges (blue dots). The red dotted line indicates the trimming threshold we calculated, and the trimming threshold can effectively identify the longer sides in the minimum spanning tree; Figure 3(b) shows the minimum spanning tree of the subcluster after cutting off the edge greater than the trimming threshold. From the figure, we can see that the red density core points have been divided into three parts, and each part of the density core has a minimum spanning tree after cutting.(3)
We cluster the density cores according to the minimum spanning subtree structure retained by the density core points of each cluster after trimming, namely, assigning the points on the same minimum spanning subtree to the same cluster.Figure 2
Minimum spanning tree based on density core points.Figure 3
Obtaining each subcluster based oncutθ.
(a)(b)According to the description of the above steps, the specific steps of clustering density core points are shown in Algorithm 3.Algorithm 3: Clustering core object.
Input:RCore(the core set)Output:CL(the result of clustering)(1)
Initialize the Core Set CL=∅;(2)
TreeEdge=PrimRCore,Dis;(3)
cutθ=meanEdge+ω∗stdEdge;(4)
for each edge e in TreeEdgedo(5)
ifvaluee>cutθthen(6)
cut this edge;(7)
end if(8)
end for(9)
for each object p in RCoredo(10)
ifCLp==0then(11)
ClusterID=maxCL+1;(12)
TreeCP=qp,g∈TreeEdge;(13)
CLp=ClusterID;(14)
while∃x∈TreeCP&&CLx==0do(15)
CLx=ClusterID;(16)
TreeCP=TreeCP∪qp,g∈TreeEdge;(17)
end while(18)
end if(19)
end for(20)
ReturnCL


## 3.3. The MST-DC Clustering Algorithm

In this section, we introduce a novel clustering algorithm, namely, MST-DC. The basic steps are as follows: firstly, we find the reverse nearest neighbors of each object according to the natural neighbor searching algorithm; secondly, we use formula (5) to get the core objects; thirdly, we build the minimum spanning tree of the density core set RCore, and the edge between the clusters is cut according to formula (6), and then, the density cores are clustered according to the obtained subcluster tree; fourthly, we apply the concept of outlier clusters in paper [29] to eliminate erroneous clusters. In this paper, a novel outlier cluster detection algorithm called ROCF is proposed based on the concept of mutual neighbor graph and on the idea that the size of outlier clusters is usually much smaller than the normal clusters; and finally, the noncore points are assigned to the clusters to which their closest density core points belong. The overall steps of the MST-DC algorithm are shown in Algorithm 4.Algorithm 4: MST-DC.
Input:D (the dataset)Output: Cluster Label CL(1)
Initialize the core objects set RCore=NULL;(2)
Initialize the dataset CL=∅;(3)
λ,RNN,DIS=RNN−SearchD;(4)
RCore=Find−CoresRNN,λ;(5)
CL=CoreCutClusterRCore,DIS;(6)
eliminate erroneous clusters;(7)
for each object p which is unallocated do(8)
CLp= the label of p′s nearest core object;(9)
end for(10)
ReturnCL


## 3.4. The Complexity Analysis

Based on the description of the MST-DC clustering algorithm in the previous sections, the time complexity of MST-DC depends on following parts: (1) we use the natural neighbor algorithm optimized byKD−tree [30] to obtain the reverse nearest neighbors of each data point, the natural eigenvalue, and the Euclidean distance of the data points, and its time complexity is Onlogn; (2) the process of extracting core points is equivalent to traversing data points, and its time complexity is On; (3) the time complexity of clustering the core points based on the minimum spanning tree is mainly focused on the Prim algorithm to establish the minimum spanning tree. This paper uses the heap-optimized Prim algorithm, whose time complexity is Omlogm, where mm≪n represents the number of obtained core points; and (4) we assign the remaining points to their nearest density core with time complexity of Ol, where ll<n,n=l+m represents the number of remaining noncore points. In summary, the total time complexity of MST-DC is Onlogn.


## 4. Experiments and Analysis

### 4.1. Experimental Design and Environment

In this section, we demonstrate the effectiveness of the proposed clustering algorithm, respectively, on some artificial datasets and UCI real datasets. And we compare the MST-DC with well-known and state-of-the-art clustering methods, including Kmeans [5], DBSCAN [18], DPC [8], DCore [27], SNN-DPC [20], and LDP-MST [24].The experiment is conducted on a MATLAB 2018a computer equipped with Intel Core 2.20 GHz CPU, 8 GB RAM, and Windows 10 operating system. The MATLAB code is available fromhttps://github.com/qczggaoqiang/MST-DC


### 4.2. Metrics for Measurement

We adoptAccuracy [31], F−Measure [32], and NMI (normalized mutual information) [33] to test the performance of our proposed algorithm MST-DC and six comparison algorithms. The upper limit of the three indexes is 1. The larger the values of the three indexes are, the better the clustering result is.We choseAccuracy as the first evaluation indicator. For n objects xi∈Dj, pi and ci are the intrinsic category label and the predicted cluster label of xi, respectively, and the calculation formula of Accuracy is as follows:(7)Accuracy=∑i=1nδpi,mapcin,where map. is a mapping function that maps the predicted cluster label and its intrinsic cluster label by the Hungarian algorithm [34]; let δa,b equal to 1 if a=b or equal to 0 otherwise. Accuracy∈0,1; namely, the higher the values of the Accuracy are, the better the clustering performance will be.F−Measure includes both the precision P and the recall R. P is the ratio between the number of correct positive results and the number of all positive results returned by the classifier. R is the ratio between the number of correct positive results and the number of all samples that should have been identified as positive P, R, and F−Measure, which are defined by formulas (8)–(10). Mj is a set of the number of all samples that should have been identified as positive. Ci is a set of the number of all positive results returned by the classifier.(8)PMj,Ci=Mj∩CiCi,(9)RMj,Ci=Mj∩CiMj,(10)FMj,Ci=2×PMj,Ci×RMj,CiPMj,Ci+RMj,Ci.The mutual informationMI [32] can be used to measure the information shared by two clusters, given a set S of N data points, and two partitions of set S, namely, X=X1,X2,…,Xr, and Y=Y1,Y2,…,Ys. Suppose that we select a point at random from S, then the probability that the point belongs to cluster Xi is(11)Pi=XiN.Entropy can be described as the information conveyed by the uncertainty that a randomly selected point belongs to a certain cluster. The entropy of the clusterX is given by the following formula:(12)HX=−∑i=1rPi×logPi.TheMI between the clusters X and Y is defined by (13)MIX,Y=∑i=1r∑j=1sPi,j×logPi,jPiPj.TheNMI is calculated as follows:(14)NMIX,Y=2×MIX,YHX+HY.


### 4.3. Experiments on Synthetic Datasets

We first conduct comparison experiments based on ten synthetic datasets. As shown in Table1, the characteristics of ten synthetic datasets are described. Moreover, ten original synthetic datasets are displayed in Figure 4. D1 and D2 contain spherical clusters with a different number of clusters and densities. D1 contains three clusters and a total of 600 objects. D2 consists of five clusters with skewed distribution, and a total of 6699 objects. In contrast, the remaining synthetic datasets contain clusters with arbitrary shapes. D3 is composed of four-line clusters and a total of 1268 objects. D4 has a spherical cluster in the middle of two ring clusters and a total of 1897 objects. D5 is composed of two moon manifold clusters with 1532 objects, including noise objects. D6 includes four manifold clusters and a total of 630 objects. D7 has four spherical clusters in two right-angle line clusters with some noise objects, and a total of 1916 objects. D8 has three spherical clusters in one manifold cluster with several noise objects, and a total of 1427 objects. D9 is composed of six square clusters that cross and parallel with each other, and a total of 8000 data objects including some noise objects. D10 consists of three circle clusters, two spiral clusters, and two spherical clusters with a total of 8533 objects, including some noise objects.Table 1
Characteristics of synthetic datasets.
DatasetsNumber of instancesNumber of attributesNumber of clustersD160023D2669925D3126824D4189723D5153222D663024D7191626D8142724D9800026D10853327Figure 4
Ten original synthetic datasets. (a) D1, (b) D2, (c) D3, (d) D4, (e) D5, (f) D6, (g) D7, (h) D8, (i) D9, and (j) D10.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)The parameter settings of each clustering algorithm in the ten synthetic datasets are displayed in Table2. As for the Kmeans algorithm, N represents the number of clusters in the dataset, and the initial clustering center is randomly selected. DBSCAN needs two parameters: Eps and Minpts. The cutoff distance dc of DPC is set as 2%. SNNDPC needs the parameter K to find k nearest neighbors. We test different K to achieve better results. The results of DCore are affected by the selection of parameters r1, r2, T1, Tn, and R. We use different parameter settings to achieve better results. The LDP-MST algorithm needs to set the parameter N manually. Concerning MST-DC, there is no need to set parameters. In Table 2, the symbol “ — ” indicates that there is no need to set parameters in MST-DC.Table 2
Parameter settings of each clustering method in the ten synthetic datasets.
DatasetsKmeansDBSCANDPC (%)DCoreSNNDPCLDP-MSTMST-DCD1N = 3Eps = 0.5Minpts = 5dc = 2r1 = 0.5; r2 = 0.25; R = 0.6; T1 = 30; Tn = 4K = 5N = 3−D2N = 5Eps = 0.8Minpts = 5dc = 2r1 = 0.5; r2 = 0.45; R = 0.5; T1 = 50; Tn = 15K = 4N = 5−D3N = 4Eps = 10Minpts = 5dc = 2r1 = 14; r2 = 13; R = 15; T1 = 40; Tn = 8K = 10N = 4−D4N = 3Eps = 20Minpts = 5dc = 2r1 = 20; r2 = 18; R = 20; T1 = 30; Tn = 8K = 10N = 3−D5N = 2Eps = 0.1Minpts = 8dc = 2r1 = 0.3; r2 = 0.1; R = 0.2; T1 = 20; Tn = 5K = 5N = 2−D6N = 4Eps = 15Minpts = 5dc = 2r1 = 20; r2 = 18; R = 21; T1 = 10; Tn = 6K = 10N = 4−D7N = 6Eps = 6Minpts = 5dc = 2r1 = 14; r2 = 13; R = 14; T1 = 40; Tn = 8K = 5N = 6−D8N = 4Eps = 0.25Minpts = 4dc = 2r1 = 0.4; r2 = 0.35; R = 0.5; T1 = 10; Tn = 5K = 10N = 4−D9N = 6Eps = 6Minpts = 5dc = 2r1 = 15; r2 = 15; R = 15; T1 = 35; Tn = 15K = 15N = 6−D10N = 7Eps = 2Minpts = 10dc = 2r1 = 1; r2 = 0.9; R = 2; T1 = 30; Tn = 10K = 15N = 7−The experimental result of D1 is shown in Figure5. It shows that all clustering algorithms can find correct clusters in D1, which means that these algorithms are effective for uniformly distributed spherical datasets. However, except MST-DC, other algorithms need parameter settings.Figure 5
Results of 7 clustering algorithms in D1. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure6 shows that DPC, LDP-MST, and MST-DC can get the correct clustering on D2, while Kmeans, DBSCAN, DCore, and SNNDPC cannot. The number of clusters in the Kmeans algorithm is input by users. Because it cannot recognize clusters with different densities, the low-density area is mistakenly recognized as the same cluster, while the high-density area is erroneously partitioned as well. Because the choice of Eps is too large, DBSCAN aggregates D2 into four clusters. Because of the improper choices of parameters, DCore and SNNDPC cannot correctly identify clusters in the D2 dataset. Therefore, Figure 6 displays that using global fixed parameter settings for multidensity patterns is not applicable.Figure 6
Results of 7 clustering algorithms in D2. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The experimental results on D3 are shown in Figure7. It shows that except Kmeans and SNNDPC, other algorithms can well find the correct clusters. It also illustrates that Kmeans cannot be applied to line cluster datasets. Moreover, the incorrect setting of parameters leads to incorrect clustering results.Figure 7
Results of 7 clustering algorithms in D3. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The experimental results on D4 are shown in Figure8. It demonstrates whether those algorithms can process circle clusters or not. It shows that Kmeans, DPC, DCore, and SNNDPC algorithms are not suitable for datasets containing circular clusters, and the correct clustering results cannot be obtained. DBSCAN, LDP-MST, and MST-DC algorithms can find the correct clusters for D4.Figure 8
Results of 7 clustering algorithms in D4. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The clustering results displayed in Figures9–11 demonstrate whether those algorithms can process clusters with the arbitrary shape or not. The results of DBSCAN, LDP-MST, and MST-DC are similar. Three of them can find the clusters of the three datasets correctly. As shown in Figure 9(d), DCore mistakenly identifies only two points in D5. Besides, none of Kmeans, DPC, DCore, and SNNDPC can find the right clusters of D5, D6, and D7 datasets.Figure 9
Results of 7 clustering algorithms in D5. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure 10
Results of 7 clustering algorithms in D6. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure 11
Results of 7 clustering algorithms in D7. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The clustering results shown in Figure12 display that MST-DC, LDP-MST, and DCore have recognized the D8 datasets correctly, while Kmeans, DBSCAN, DPC, and SNNDPC have not. In other words, MST-DC, LDP-MST, and DCore can be good at dealing with manifold structure datasets. In Figure 12(b), DBSCAN can detect the manifold cluster. Yet, it does not work for the datasets combined with spherical clusters and manifold cluster.Figure 12
Results of 7 clustering algorithms in D8. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The experimental results displayed in Figures13 and 14 are used to evaluate the clustering performance on D9 and D10, which are more complex patterns. As shown in Figure 13, only DCore, LDP-MST, and MST-DC can detect rectangle clusters. Because of inappropriate parameter settings, DBSCAN and SNNDPC did not get impressive clustering results, and neither did Kmeans and DPC. The clustering results shown in Figure 14 demonstrate that only the LDP-MST and MST-DC algorithms obtained the correct clusters. DBSCAN and DPC have similar results that both of them cannot deal with spiral clusters and circle clusters. Although SNNDPC can detect the spiral clusters, they fail to handle the circle clusters. DCore can detect circle clusters; however, it cannot detect the spiral clusters. Thence, MST-DC can be applied to more complex situations without parameter settings.Figure 13
Results of 7 clustering algorithms in D9. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure 14
Results of 7 clustering algorithms in D10. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)From Figures5–14, we can see that MST-DC performs better than other algorithms. Moreover, there is no need to set any parameters so that several intrinsic flaws of other algorithms can be avoided.The running time of seven clustering algorithms on the synthetic datasets is shown in Table3. It is obvious that although MST-DC runs slower than Kmeans, DBSCAN, and LDP-MST, it runs faster than DPC and SNNDPC evidently. What is more, the consuming time of MST-DC is similar to that of DCore.Table 3
Consuming time of seven clustering methods on synthetic datasets.
DatasetsKmeansDBSCANDPCDCoreSNNDPCLDP-MSTMST-DCD10.00410.01242.55670.16061.55010.03220.1264D20.01610.6175260.20965.192950.05670.76364.6564D30.01290.02796.02320.21554.01690.08630.2552D40.01590.03949.54060.43285.01900.12590.3316D50.07310.06624.87710.41482.93750.10181.1598D60.01050.01143.66840.13302.57390.07380.0841D70.01360.05079.69710.45146.64090.10840.6224D80.00880.02774.99690.32563.81730.07210.4609D90.06131.0585563.79269.951288.21141.85269.5622D100.08710.7014685.852413.535093.74071.95089.5915


### 4.4. Experiments on Real-World Datasets

To further prove the superiority of the MST-DC algorithm, we also apply the proposed method to six real-world datasets, including Segmentation, Pageblock, Iris, Control, Column2C, and Breast, obtained from the University of California, Irvine (UCI) Machine Learning Repository. The characteristics of six real datasets are displayed in Table4. Table 5 illustrates the parameter setting of each clustering algorithm in six real-world datasets of UCI, and the symbol “ — ” indicates that there is no need to set parameters in MST-DC. Table 6 shows the clustering performance of seven clustering algorithms according to three external criteria, namely, Accuracy, F−Measure, and NMI. Table 7 shows the running time of each algorithm, where “ — ” indicates that the algorithm has not run within the specified time (20 minutes).Table 4
Characteristics of UCI datasets.
DatasetsSamplesAttributesCategoriesSegmentation2310197[35]Pageblock5473105[35]Iris15043[35]Control600606[35]Column2C31062[35]Breast699102[35]Table 5
Parameter setting of each clustering algorithm in six real-world datasets.
DatasetsKmeansDBSCANDPC (%)DCoreSNNDPCLDP-MSTMST-DCSegmentationN = 7Eps = 10Minpts = 4dc = 2r1 = 150; r2 = 140; R = 150; T1 = 30; Tn = 10K = 15N = 7−PageblockN = 5Eps = 1Minpts = 4dc = 2r1 = 0.2; r2 = 0.15; R = 0.2; T1 = 10; Tn = 2K = 10N = 5−IrisN = 3Eps = 1Minpts = 4dc = 2r1 = 0.3; r2 = 0.2; R = 0.15; T1 = 5; Tn = 4K = 10N = 3−ControlN = 6Eps = 1Minpts = 4dc = 2r1 = 15; r2 = 13; R = 16; T1 = 10; Tn = 2K = 8N = 6−Column2CN = 2Eps = 11Minpts = 5dc = 2r1 = 13; r2 = 12; R = 16; T1 = 20; Tn = 15K = 3N = 2−BreastN = 2Eps = 1Minpts = 4dc = 2r1 = 0.4; r2 = 0.3; R = 0.15; T1 = 2; Tn = 0k = 7N = 2−Table 6
Comparison of accuracy,F-measure, and NMI between six real UCI datasets.
DatasetsKmeansDBSCANDPCDCoreSNNDPCLDP-MSTMST-DCSegmentationAccuracy0.51170.56100.48830.28440.14290.61470.6134F-measure0.54220.29830.54990.38660.25000.64690.6782NMI0.48680.40290.52060.33830.28160.68700.7044PageblockAccuracy0.89930.90240.89830.89800.89830.89770.9077F-measure0.81360.86080.85790.86000.85790.80910.9461NMI0.05500.07970.03280.03550.03270.03410.2010IrisAccuracy0.66670.66670.66670.66670.66000.97300.6667F-measure0.68840.77780.77780.60610.77480.99890.7778NMI0.58370.73370.73370.52630.71750.90100.7337ControlAccuracy0.57170.33670.50000.62500.50170.67800.6667F-measure0.67650.38330.65460.65360.53870.68330.7093NMI0.70780.33690.71980.67310.65280.70000.7928Column2CAccuracy0.67740.67740.67740.73230.67740.75480.7581F-measure0.67440.73610.70330.74070.70330.76230.8077NMI0.13330.16160.00390.22620.00390.30330.2442BreastAccuracy0.95710.83120.82690.92120.94130.95470.9614F-measure0.95690.83060.80850.95110.56700.95320.9612NMI0.72950.46420.38630.63230.35540.68680.7501Table 7
Running time of 7 clustering algorithms on six real UCI datasets (unit: second).
DatasetsKmeansDBSCANDPCDCoreSNNDPCLDP-MSTMST-DCSegmentation0.02790.062435.21430.81787.62590.25600.6584Pageblock0.03590.0350—3.201234.76880.47153.2736Iris0.0040.00153.09860.03152.23130.01340.0156Control0.01070.006215.0410.30873.07570.08510.0869Column2C0.00420.002115.0410.05411.47050.01490.0417Breast0.00450.00593.63500.14742.08120.08770.1525As shown in Table6, except for the Iris dataset, the clustering performance of the MST-DC algorithm is superior to the Kmeans, DBSCAN, DPC, DCore, SNNDPC, and LDP-MST algorithms on other datasets. The LDP-MST algorithm obtains the optimal clustering results on the Iris dataset in terms of Accuracy, NMI, and F−Measure. Besides, LDP-MST achieves the best results on Segmentation and Control datasets in terms of Accuracy, and on Column2C dataset in terms of NMI. On relatively simple datasets, the Accuracy, NMI, and F−Measure values of the Kmeans, DBSCAN, DPC, and SNNDPC algorithms are high; however, on datasets with higher dimensions or complex structures, the four algorithms have poor performances. Except for the Segmentation dataset, the DCore algorithm can obtain a relatively good clustering effect on multiple datasets. However, the DCore algorithm has a major flaw that it needs to set five parameters manually. It is usually very difficult to adjust the parameter combination for better clustering results.According to Table7, MST-DC is slower than the Kmeans, DBSCAN, and LDP-MST algorithms on the UCI dataset. However, the MST-DC algorithm is much faster than the DPC and SNNDPC algorithms. The running time of the MST-DC and DCore algorithms is similar on most datasets.From the above analysis, we conclude that MST-DC provides an overall good performance in clustering compared with the other existing methods. Firstly, the MST-DC algorithm employs a natural neighbor algorithm to obtain the reverse neighbor information and then extracts the density core point according to the number of reverse neighbors and natural characteristic value. This process does not need to set parameters, while other algorithms need to set parameters manually. Secondly, MST-DC only utilizes the density core points instead of all points to build the minimum spanning tree, which reduces the computational cost while excluding the interference of noise points. Thirdly, the MST-DC algorithm can recognize complex datasets efficiently and accurately. However, compared with Kmeans, DBSCAN, and LDP-MST, the time efficiency of the MST-DC algorithm is not optimal, which is worth further exploration.


## 4.1. Experimental Design and Environment

In this section, we demonstrate the effectiveness of the proposed clustering algorithm, respectively, on some artificial datasets and UCI real datasets. And we compare the MST-DC with well-known and state-of-the-art clustering methods, including Kmeans [5], DBSCAN [18], DPC [8], DCore [27], SNN-DPC [20], and LDP-MST [24].The experiment is conducted on a MATLAB 2018a computer equipped with Intel Core 2.20 GHz CPU, 8 GB RAM, and Windows 10 operating system. The MATLAB code is available fromhttps://github.com/qczggaoqiang/MST-DC


## 4.2. Metrics for Measurement

We adoptAccuracy [31], F−Measure [32], and NMI (normalized mutual information) [33] to test the performance of our proposed algorithm MST-DC and six comparison algorithms. The upper limit of the three indexes is 1. The larger the values of the three indexes are, the better the clustering result is.We choseAccuracy as the first evaluation indicator. For n objects xi∈Dj, pi and ci are the intrinsic category label and the predicted cluster label of xi, respectively, and the calculation formula of Accuracy is as follows:(7)Accuracy=∑i=1nδpi,mapcin,where map. is a mapping function that maps the predicted cluster label and its intrinsic cluster label by the Hungarian algorithm [34]; let δa,b equal to 1 if a=b or equal to 0 otherwise. Accuracy∈0,1; namely, the higher the values of the Accuracy are, the better the clustering performance will be.F−Measure includes both the precision P and the recall R. P is the ratio between the number of correct positive results and the number of all positive results returned by the classifier. R is the ratio between the number of correct positive results and the number of all samples that should have been identified as positive P, R, and F−Measure, which are defined by formulas (8)–(10). Mj is a set of the number of all samples that should have been identified as positive. Ci is a set of the number of all positive results returned by the classifier.(8)PMj,Ci=Mj∩CiCi,(9)RMj,Ci=Mj∩CiMj,(10)FMj,Ci=2×PMj,Ci×RMj,CiPMj,Ci+RMj,Ci.The mutual informationMI [32] can be used to measure the information shared by two clusters, given a set S of N data points, and two partitions of set S, namely, X=X1,X2,…,Xr, and Y=Y1,Y2,…,Ys. Suppose that we select a point at random from S, then the probability that the point belongs to cluster Xi is(11)Pi=XiN.Entropy can be described as the information conveyed by the uncertainty that a randomly selected point belongs to a certain cluster. The entropy of the clusterX is given by the following formula:(12)HX=−∑i=1rPi×logPi.TheMI between the clusters X and Y is defined by (13)MIX,Y=∑i=1r∑j=1sPi,j×logPi,jPiPj.TheNMI is calculated as follows:(14)NMIX,Y=2×MIX,YHX+HY.


## 4.3. Experiments on Synthetic Datasets

We first conduct comparison experiments based on ten synthetic datasets. As shown in Table1, the characteristics of ten synthetic datasets are described. Moreover, ten original synthetic datasets are displayed in Figure 4. D1 and D2 contain spherical clusters with a different number of clusters and densities. D1 contains three clusters and a total of 600 objects. D2 consists of five clusters with skewed distribution, and a total of 6699 objects. In contrast, the remaining synthetic datasets contain clusters with arbitrary shapes. D3 is composed of four-line clusters and a total of 1268 objects. D4 has a spherical cluster in the middle of two ring clusters and a total of 1897 objects. D5 is composed of two moon manifold clusters with 1532 objects, including noise objects. D6 includes four manifold clusters and a total of 630 objects. D7 has four spherical clusters in two right-angle line clusters with some noise objects, and a total of 1916 objects. D8 has three spherical clusters in one manifold cluster with several noise objects, and a total of 1427 objects. D9 is composed of six square clusters that cross and parallel with each other, and a total of 8000 data objects including some noise objects. D10 consists of three circle clusters, two spiral clusters, and two spherical clusters with a total of 8533 objects, including some noise objects.Table 1
Characteristics of synthetic datasets.
DatasetsNumber of instancesNumber of attributesNumber of clustersD160023D2669925D3126824D4189723D5153222D663024D7191626D8142724D9800026D10853327Figure 4
Ten original synthetic datasets. (a) D1, (b) D2, (c) D3, (d) D4, (e) D5, (f) D6, (g) D7, (h) D8, (i) D9, and (j) D10.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)The parameter settings of each clustering algorithm in the ten synthetic datasets are displayed in Table2. As for the Kmeans algorithm, N represents the number of clusters in the dataset, and the initial clustering center is randomly selected. DBSCAN needs two parameters: Eps and Minpts. The cutoff distance dc of DPC is set as 2%. SNNDPC needs the parameter K to find k nearest neighbors. We test different K to achieve better results. The results of DCore are affected by the selection of parameters r1, r2, T1, Tn, and R. We use different parameter settings to achieve better results. The LDP-MST algorithm needs to set the parameter N manually. Concerning MST-DC, there is no need to set parameters. In Table 2, the symbol “ — ” indicates that there is no need to set parameters in MST-DC.Table 2
Parameter settings of each clustering method in the ten synthetic datasets.
DatasetsKmeansDBSCANDPC (%)DCoreSNNDPCLDP-MSTMST-DCD1N = 3Eps = 0.5Minpts = 5dc = 2r1 = 0.5; r2 = 0.25; R = 0.6; T1 = 30; Tn = 4K = 5N = 3−D2N = 5Eps = 0.8Minpts = 5dc = 2r1 = 0.5; r2 = 0.45; R = 0.5; T1 = 50; Tn = 15K = 4N = 5−D3N = 4Eps = 10Minpts = 5dc = 2r1 = 14; r2 = 13; R = 15; T1 = 40; Tn = 8K = 10N = 4−D4N = 3Eps = 20Minpts = 5dc = 2r1 = 20; r2 = 18; R = 20; T1 = 30; Tn = 8K = 10N = 3−D5N = 2Eps = 0.1Minpts = 8dc = 2r1 = 0.3; r2 = 0.1; R = 0.2; T1 = 20; Tn = 5K = 5N = 2−D6N = 4Eps = 15Minpts = 5dc = 2r1 = 20; r2 = 18; R = 21; T1 = 10; Tn = 6K = 10N = 4−D7N = 6Eps = 6Minpts = 5dc = 2r1 = 14; r2 = 13; R = 14; T1 = 40; Tn = 8K = 5N = 6−D8N = 4Eps = 0.25Minpts = 4dc = 2r1 = 0.4; r2 = 0.35; R = 0.5; T1 = 10; Tn = 5K = 10N = 4−D9N = 6Eps = 6Minpts = 5dc = 2r1 = 15; r2 = 15; R = 15; T1 = 35; Tn = 15K = 15N = 6−D10N = 7Eps = 2Minpts = 10dc = 2r1 = 1; r2 = 0.9; R = 2; T1 = 30; Tn = 10K = 15N = 7−The experimental result of D1 is shown in Figure5. It shows that all clustering algorithms can find correct clusters in D1, which means that these algorithms are effective for uniformly distributed spherical datasets. However, except MST-DC, other algorithms need parameter settings.Figure 5
Results of 7 clustering algorithms in D1. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure6 shows that DPC, LDP-MST, and MST-DC can get the correct clustering on D2, while Kmeans, DBSCAN, DCore, and SNNDPC cannot. The number of clusters in the Kmeans algorithm is input by users. Because it cannot recognize clusters with different densities, the low-density area is mistakenly recognized as the same cluster, while the high-density area is erroneously partitioned as well. Because the choice of Eps is too large, DBSCAN aggregates D2 into four clusters. Because of the improper choices of parameters, DCore and SNNDPC cannot correctly identify clusters in the D2 dataset. Therefore, Figure 6 displays that using global fixed parameter settings for multidensity patterns is not applicable.Figure 6
Results of 7 clustering algorithms in D2. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The experimental results on D3 are shown in Figure7. It shows that except Kmeans and SNNDPC, other algorithms can well find the correct clusters. It also illustrates that Kmeans cannot be applied to line cluster datasets. Moreover, the incorrect setting of parameters leads to incorrect clustering results.Figure 7
Results of 7 clustering algorithms in D3. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The experimental results on D4 are shown in Figure8. It demonstrates whether those algorithms can process circle clusters or not. It shows that Kmeans, DPC, DCore, and SNNDPC algorithms are not suitable for datasets containing circular clusters, and the correct clustering results cannot be obtained. DBSCAN, LDP-MST, and MST-DC algorithms can find the correct clusters for D4.Figure 8
Results of 7 clustering algorithms in D4. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The clustering results displayed in Figures9–11 demonstrate whether those algorithms can process clusters with the arbitrary shape or not. The results of DBSCAN, LDP-MST, and MST-DC are similar. Three of them can find the clusters of the three datasets correctly. As shown in Figure 9(d), DCore mistakenly identifies only two points in D5. Besides, none of Kmeans, DPC, DCore, and SNNDPC can find the right clusters of D5, D6, and D7 datasets.Figure 9
Results of 7 clustering algorithms in D5. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure 10
Results of 7 clustering algorithms in D6. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure 11
Results of 7 clustering algorithms in D7. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The clustering results shown in Figure12 display that MST-DC, LDP-MST, and DCore have recognized the D8 datasets correctly, while Kmeans, DBSCAN, DPC, and SNNDPC have not. In other words, MST-DC, LDP-MST, and DCore can be good at dealing with manifold structure datasets. In Figure 12(b), DBSCAN can detect the manifold cluster. Yet, it does not work for the datasets combined with spherical clusters and manifold cluster.Figure 12
Results of 7 clustering algorithms in D8. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)The experimental results displayed in Figures13 and 14 are used to evaluate the clustering performance on D9 and D10, which are more complex patterns. As shown in Figure 13, only DCore, LDP-MST, and MST-DC can detect rectangle clusters. Because of inappropriate parameter settings, DBSCAN and SNNDPC did not get impressive clustering results, and neither did Kmeans and DPC. The clustering results shown in Figure 14 demonstrate that only the LDP-MST and MST-DC algorithms obtained the correct clusters. DBSCAN and DPC have similar results that both of them cannot deal with spiral clusters and circle clusters. Although SNNDPC can detect the spiral clusters, they fail to handle the circle clusters. DCore can detect circle clusters; however, it cannot detect the spiral clusters. Thence, MST-DC can be applied to more complex situations without parameter settings.Figure 13
Results of 7 clustering algorithms in D9. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)Figure 14
Results of 7 clustering algorithms in D10. (a) Kmeans, (b) DBSCAN, (c) DPC, (d) DCore, (e) SNNDPC, (f) LDP-MST, and (g) MST-DC.
(a)(b)(c)(d)(e)(f)(g)From Figures5–14, we can see that MST-DC performs better than other algorithms. Moreover, there is no need to set any parameters so that several intrinsic flaws of other algorithms can be avoided.The running time of seven clustering algorithms on the synthetic datasets is shown in Table3. It is obvious that although MST-DC runs slower than Kmeans, DBSCAN, and LDP-MST, it runs faster than DPC and SNNDPC evidently. What is more, the consuming time of MST-DC is similar to that of DCore.Table 3
Consuming time of seven clustering methods on synthetic datasets.
DatasetsKmeansDBSCANDPCDCoreSNNDPCLDP-MSTMST-DCD10.00410.01242.55670.16061.55010.03220.1264D20.01610.6175260.20965.192950.05670.76364.6564D30.01290.02796.02320.21554.01690.08630.2552D40.01590.03949.54060.43285.01900.12590.3316D50.07310.06624.87710.41482.93750.10181.1598D60.01050.01143.66840.13302.57390.07380.0841D70.01360.05079.69710.45146.64090.10840.6224D80.00880.02774.99690.32563.81730.07210.4609D90.06131.0585563.79269.951288.21141.85269.5622D100.08710.7014685.852413.535093.74071.95089.5915


## 4.4. Experiments on Real-World Datasets

To further prove the superiority of the MST-DC algorithm, we also apply the proposed method to six real-world datasets, including Segmentation, Pageblock, Iris, Control, Column2C, and Breast, obtained from the University of California, Irvine (UCI) Machine Learning Repository. The characteristics of six real datasets are displayed in Table4. Table 5 illustrates the parameter setting of each clustering algorithm in six real-world datasets of UCI, and the symbol “ — ” indicates that there is no need to set parameters in MST-DC. Table 6 shows the clustering performance of seven clustering algorithms according to three external criteria, namely, Accuracy, F−Measure, and NMI. Table 7 shows the running time of each algorithm, where “ — ” indicates that the algorithm has not run within the specified time (20 minutes).Table 4
Characteristics of UCI datasets.
DatasetsSamplesAttributesCategoriesSegmentation2310197[35]Pageblock5473105[35]Iris15043[35]Control600606[35]Column2C31062[35]Breast699102[35]Table 5
Parameter setting of each clustering algorithm in six real-world datasets.
DatasetsKmeansDBSCANDPC (%)DCoreSNNDPCLDP-MSTMST-DCSegmentationN = 7Eps = 10Minpts = 4dc = 2r1 = 150; r2 = 140; R = 150; T1 = 30; Tn = 10K = 15N = 7−PageblockN = 5Eps = 1Minpts = 4dc = 2r1 = 0.2; r2 = 0.15; R = 0.2; T1 = 10; Tn = 2K = 10N = 5−IrisN = 3Eps = 1Minpts = 4dc = 2r1 = 0.3; r2 = 0.2; R = 0.15; T1 = 5; Tn = 4K = 10N = 3−ControlN = 6Eps = 1Minpts = 4dc = 2r1 = 15; r2 = 13; R = 16; T1 = 10; Tn = 2K = 8N = 6−Column2CN = 2Eps = 11Minpts = 5dc = 2r1 = 13; r2 = 12; R = 16; T1 = 20; Tn = 15K = 3N = 2−BreastN = 2Eps = 1Minpts = 4dc = 2r1 = 0.4; r2 = 0.3; R = 0.15; T1 = 2; Tn = 0k = 7N = 2−Table 6
Comparison of accuracy,F-measure, and NMI between six real UCI datasets.
DatasetsKmeansDBSCANDPCDCoreSNNDPCLDP-MSTMST-DCSegmentationAccuracy0.51170.56100.48830.28440.14290.61470.6134F-measure0.54220.29830.54990.38660.25000.64690.6782NMI0.48680.40290.52060.33830.28160.68700.7044PageblockAccuracy0.89930.90240.89830.89800.89830.89770.9077F-measure0.81360.86080.85790.86000.85790.80910.9461NMI0.05500.07970.03280.03550.03270.03410.2010IrisAccuracy0.66670.66670.66670.66670.66000.97300.6667F-measure0.68840.77780.77780.60610.77480.99890.7778NMI0.58370.73370.73370.52630.71750.90100.7337ControlAccuracy0.57170.33670.50000.62500.50170.67800.6667F-measure0.67650.38330.65460.65360.53870.68330.7093NMI0.70780.33690.71980.67310.65280.70000.7928Column2CAccuracy0.67740.67740.67740.73230.67740.75480.7581F-measure0.67440.73610.70330.74070.70330.76230.8077NMI0.13330.16160.00390.22620.00390.30330.2442BreastAccuracy0.95710.83120.82690.92120.94130.95470.9614F-measure0.95690.83060.80850.95110.56700.95320.9612NMI0.72950.46420.38630.63230.35540.68680.7501Table 7
Running time of 7 clustering algorithms on six real UCI datasets (unit: second).
DatasetsKmeansDBSCANDPCDCoreSNNDPCLDP-MSTMST-DCSegmentation0.02790.062435.21430.81787.62590.25600.6584Pageblock0.03590.0350—3.201234.76880.47153.2736Iris0.0040.00153.09860.03152.23130.01340.0156Control0.01070.006215.0410.30873.07570.08510.0869Column2C0.00420.002115.0410.05411.47050.01490.0417Breast0.00450.00593.63500.14742.08120.08770.1525As shown in Table6, except for the Iris dataset, the clustering performance of the MST-DC algorithm is superior to the Kmeans, DBSCAN, DPC, DCore, SNNDPC, and LDP-MST algorithms on other datasets. The LDP-MST algorithm obtains the optimal clustering results on the Iris dataset in terms of Accuracy, NMI, and F−Measure. Besides, LDP-MST achieves the best results on Segmentation and Control datasets in terms of Accuracy, and on Column2C dataset in terms of NMI. On relatively simple datasets, the Accuracy, NMI, and F−Measure values of the Kmeans, DBSCAN, DPC, and SNNDPC algorithms are high; however, on datasets with higher dimensions or complex structures, the four algorithms have poor performances. Except for the Segmentation dataset, the DCore algorithm can obtain a relatively good clustering effect on multiple datasets. However, the DCore algorithm has a major flaw that it needs to set five parameters manually. It is usually very difficult to adjust the parameter combination for better clustering results.According to Table7, MST-DC is slower than the Kmeans, DBSCAN, and LDP-MST algorithms on the UCI dataset. However, the MST-DC algorithm is much faster than the DPC and SNNDPC algorithms. The running time of the MST-DC and DCore algorithms is similar on most datasets.From the above analysis, we conclude that MST-DC provides an overall good performance in clustering compared with the other existing methods. Firstly, the MST-DC algorithm employs a natural neighbor algorithm to obtain the reverse neighbor information and then extracts the density core point according to the number of reverse neighbors and natural characteristic value. This process does not need to set parameters, while other algorithms need to set parameters manually. Secondly, MST-DC only utilizes the density core points instead of all points to build the minimum spanning tree, which reduces the computational cost while excluding the interference of noise points. Thirdly, the MST-DC algorithm can recognize complex datasets efficiently and accurately. However, compared with Kmeans, DBSCAN, and LDP-MST, the time efficiency of the MST-DC algorithm is not optimal, which is worth further exploration.


## 5. Conclusions

In this paper, we propose a novel clustering algorithm named MST-DC. The process of the algorithm has the following four steps: firstly, we automatically obtain the reverse neighbors of each object based on the concept of natural neighbor searching without any parameters set by the user; secondly, we obtain the core objects according to the number of reverse neighbors of each object; thirdly, we construct a minimum spanning tree of the core objects to obtain the clustering result of core objects; and finally, unallocated objects are marked as the label of their nearest local core objects.The experimental results of synthetic and real-world datasets demonstrate that MST-DC can detect quite complex patterns with large variations in density. Besides, unlike most clustering methods, there is no need to set parameters in MST-DC. The concept of natural neighbor can automatically obtain the only parameterk used by MST-DC. Therefore, our proposed algorithm, MST-DC, is superior to other algorithms.Nevertheless, there are several aspects to be improved in this paper. Firstly, the similarity measure based on the Euclidean distance is used when acquiring natural neighbor information, extracting density cores, and assigning remaining points; however, the Euclidean distance is prone toDimensionalCurse in high-dimensional data spaces, resulting in poor clustering effects. Therefore, we will explore the adaptability of this algorithm to high-dimensional data in the future. Secondly, the approach to assign the remaining points in this paper is to directly assign them to the cluster where the closest density core is located. Subsequently, we will study the new method of allocating the remaining points.



---

*Source: 8496265-2022-10-05.xml*