A Density Peaks Clustering Algorithm With Sparse Search and K-d Tree

Yunxiao Shan, Shu Li, Fuxiang Li, Yuxin Cui, Ming Zhou, Xiang LiIEEE Access 2022

Abstract

Density Peaks Clustering (DPC) is a powerful density-based clustering method capable of identifying clusters of arbitrary shapes. However, its widespread application is hindered by two primary limitations: the $O(n^2)$ computational complexity required for distance matrix calculations and the necessity for manual intervention in selecting cluster centers. This paper introduces SKTDPC, an optimized algorithm that integrates K-d trees and a sparse search strategy to reduce computational complexity to $O(n(n^{1-1/K} + k))$. Furthermore, an adaptive center determination method based on second-order differences is proposed to automate the selection process. Experimental results across synthetic and real-world datasets demonstrate that SKTDPC maintains high clustering accuracy while significantly outperforming traditional DPC variants in execution speed.

Introduction

Introduced in 2014, Density Peaks Clustering (DPC) operates on the premise that cluster centers are characterized by a higher local density than their neighbors and a relatively large distance from any points with even higher densities. While effective, the original algorithm requires calculating the distance between every pair of points, leading to a quadratic growth in computation time that makes it unsuitable for large-scale datasets. Additionally, the standard DPC workflow requires users to manually interpret a "decision graph" to identify centers, a process that is subjective and difficult to integrate into automated data pipelines.

SKTDPC addresses these bottlenecks by transforming the exhaustive search into a localized, sparse search and replacing manual selection with a mathematically grounded automation technique.

Methodology

1. K-d Tree and Sparse Distance Matrix

To avoid the $O(n^2)$ cost of a full distance matrix, SKTDPC utilizes a K-d tree to organize the dataset. This spatial data structure allows for efficient $k$-nearest neighbor (kNN) retrieval. By calculating local density ($\rho$) based only on these $k$ neighbors, the algorithm constructs a sparse distance matrix, focusing computational resources on the most relevant local structures.

2. The Sparse Search Strategy

The most innovative aspect of SKTDPC is the calculation of relative separation ($\delta$), defined as the distance to the nearest point with a higher density. In the original DPC, this requires an exhaustive search. SKTDPC introduces a "sparse search" trick: the algorithm first checks if a point with higher density exists within the pre-calculated kNN set. For the vast majority of points within a cluster, this higher-density neighbor is physically close. If found within the kNN set, the exhaustive search is bypassed entirely, drastically reducing the number of distance calculations.

3. Adaptive Center Determination

To eliminate manual center selection, the algorithm utilizes decision values $\gamma_i = \rho_i \times \delta_i$. The points are sorted by $\gamma$ in descending order, and a second-order difference method is applied to the resulting curve. By identifying the "mutation point"—where the rate of change in decision values shifts dramatically—the algorithm can automatically distinguish true cluster centers from noise or secondary points.

Experimental Results

Efficiency and Scalability

The computational complexity of SKTDPC is dominated by the K-d tree operations, resulting in a complexity of approximately $O(n(n^{1-1/K} + k))$, where $K$ is the dimensionality. In empirical tests on the A3 dataset (7,500 points), SKTDPC completed in 12.86 seconds, compared to 40.06 seconds for the original DPC. Similar performance gains were observed on the Parking Birmingham dataset, where SKTDPC was nearly twice as fast as other optimized DPC variants.

Accuracy and Robustness

SKTDPC was evaluated against six algorithms, including DBSCAN and K-means, using both synthetic and UCI real-world datasets:

  • Synthetic Performance: The algorithm achieved 100% accuracy on the Flame and Spiral datasets, demonstrating its ability to handle non-convex shapes.
  • Real-World Data: On higher-dimensional UCI datasets like Pendigits (16D), SKTDPC remained competitive, especially when paired with dimensionality reduction techniques like PCA.
  • Parameter Stability: The algorithm proved robust across a range of $k$ values (typically between 2 and 10), indicating that it is not overly sensitive to hyperparameter tuning.

Conclusion

SKTDPC successfully modernizes the Density Peaks Clustering framework for the big data era. By combining K-d tree acceleration with a sparse search strategy, it overcomes the $O(n^2)$ bottleneck. Furthermore, the introduction of the second-order difference method provides a reliable path toward fully autonomous clustering. While the efficiency of K-d trees can degrade in very high-dimensional spaces (the "curse of dimensionality"), SKTDPC represents a significant step forward for efficient, automated, and accurate clustering in low-to-medium dimensional applications.

Summary updated

BibTeX
@inproceedings{shan2022density,
  author = {Yunxiao Shan and Shu Li and Fuxiang Li and Yuxin Cui and Shuai Li and Ming Zhou and Xiang Li},
  title = {{A Density Peaks Clustering Algorithm With Sparse Search and K-d Tree}},
  booktitle = {IEEE Access},
  year = {2022},
}
Figure