Abstract
Density-Based Spatial Clustering of Applications with Noise (DBSCAN) is a fundamental tool for discovering clusters of arbitrary shapes and identifying outliers. Despite its utility, standard implementations suffer from a near-quadratic $O(n^2)$ time complexity, rendering them impractical for modern massive datasets. We present a novel DBSCAN variant that achieves near-linear running time by replacing expensive $k$-nearest neighbor searches with a combination of grid-based density estimation and Locality Sensitive Hashing (LSH). Our algorithm demonstrates up to 100x speedups on datasets with millions of points, such as YouTube8M, while maintaining near-optimal theoretical accuracy and scaling linearly with data dimensionality.
Introduction
DBSCAN identifies clusters by estimating density level sets—regions where data points are sufficiently "thick." A point is classified as a "core point" if its $\epsilon$-radius neighborhood contains at least $k$ points. While effective, the requirement to perform neighborhood searches for every point leads to a computational bottleneck. In high-dimensional spaces, even approximate nearest neighbor structures struggle, often reverting to $O(n^2)$ behavior. As datasets grow to millions or billions of points, a more scalable approach is required.
Methodology
The proposed "Near Linear Time DBSCAN" eliminates the $k$-NN bottleneck through two key innovations:
1. Grid-Based Core Point Construction
Instead of spherical neighborhood searches, the algorithm discretizes the space into a grid of hypercubes (cells) with side length $2\epsilon$. By counting the points within each cell, the algorithm can identify dense regions efficiently. If a cell contains at least $k$ points, all points within it are designated as core points. This discretization transforms a complex geometric search into a linear-time $O(n)$ counting and sorting task.
2. LSH-Based Graph Construction
To form clusters, core points must be connected. The authors utilize Locality Sensitive Hashing (LSH) to map similar points into the same "buckets" with high probability. By constructing a graph where edges exist between points sharing hash buckets, the algorithm identifies connected components (clusters) rapidly. The total complexity is reduced to $\tilde{O}(ntD)$, where $n$ is the number of points, $D$ is the dimension, and $t$ is the number of hash functions.
Experimental Results
The algorithm was evaluated against standard DBSCAN and the DBSCAN++ approximation across various real-world and synthetic datasets, including the high-dimensional YouTube8M dataset (760,000 points, 128 dimensions).
Scalability and Speed
On synthetic datasets with up to $10^8$ points, the proposed algorithm completed in approximately 708 seconds, whereas DBSCAN++ was projected to exceed 24 hours. This near-linear scaling is visually evident when compared to existing methods.
The performance advantage is even more pronounced on large-scale real-world data. On the YouTube8M dataset, the new algorithm achieved a completion time of 56.69 seconds, representing a massive improvement over the thousands of seconds required by DBSCAN++ variants.
Clustering Quality
Despite the approximations introduced by grid discretization and LSH, the algorithm maintains high clustering quality. Across 11 real-world benchmarks (e.g., MNIST, Iris, Wine), it achieved Adjusted Rand Index (ARI) scores comparable to or exceeding those of exact DBSCAN and DBSCAN++.
Conclusion
By shifting from exact neighborhood searches to a discretized density estimation framework, this work provides a practical path for applying DBSCAN to massive, high-dimensional datasets. The algorithm's design is inherently parallel, making it suitable for modern distributed computing environments like MapReduce. Future work may extend this grid-based density estimation to other tasks such as anomaly detection and manifold learning.
Summary updated