What are the main performance bottlenecks when scaling DBSCAN to millions of data points?
Last updated
The main cost is one
eps-range query per point: O(n²) brute force, or about O(n log n) with KD/ball trees in low dimensions (degrading in high dimensions).Storing precomputed neighborhoods (or a distance matrix) explodes memory. Cluster expansion is a sequential graph traversal, so distributed versions need partitioning, halo points and merging.
Mitigations: tree indexes, deduplication with
sample_weight, approximate or GPU variants (e.g. cuML), dimensionality reduction, or HDBSCAN to avoid repeatedepssweeps.