Why does standard agglomerative hierarchical clustering fail to scale to large datasets?

Last updated 11 November 2026

  • It needs the full pairwise distance matrix: O(n²) memory (100k points is about 40 GB). Repeated search and update costs O(n²) to O(n³) time.

  • Merges are greedy and final, so there is no cheap mini-batch or streaming update like k-means offers.

  • Workarounds: a sparse k-NN connectivity graph, pre-clustering (BIRCH or many k-means centroids), sampling then assigning the rest, or HDBSCAN.

  • https://en.wikipedia.org/wiki/Hierarchical_clustering
  • https://www.pento.ai/blog/clustering-algorithms
  • https://vizlearn.in/machine_learning/hierarchical_clustering.html
All Clustering interview questions