Parallel Hierarchical Agglomerative Clustering in Low Dimensions

MohammadHossein Bateni, Laxman Dhulipala, Willem Fletcher, Kishen N. Gowda, D. Ellis Hershkowitz, Rajesh Jayaram, Jakub LackiarXiv 2025

Abstract

Hierarchical Agglomerative Clustering (HAC) is an extensively studied and widely used method for hierarchical clustering in $\mathbb{R}^k$ based on repeatedly merging the closest pair of clusters according to an input linkage function $d$. Highly parallel (i.e., NC) algorithms are known for $(1+\epsilon)$-approximate HAC for certain linkage functions that monotonically increase as merges are performed. However, no such algorithms are known for many important but non-monotone linkage functions such as centroid and Ward's linkage. In this work, we show that a general class of non-monotone linkage functions—which include centroid and Ward's distance—admit efficient NC algorithms for $(1+\epsilon)$-approximate HAC in low dimensions. Our algorithms are based on a structural result: the height of the hierarchy resulting from any constant-approximate HAC on $n$ points for this class of linkage functions is at most $\operatorname{poly}(\log n)$ as long as $k = O(\log \log n / \log \log \log n)$. Complementing our upper bounds, we show that NC algorithms for HAC with these linkage functions in arbitrary dimensions are unlikely to exist by showing that HAC is CC-hard when $d$ is centroid distance and $k = n$.

Introduction

Hierarchical Agglomerative Clustering (HAC) is a cornerstone of unsupervised machine learning, favored for its ability to produce a multi-scale representation of data without requiring a pre-specified number of clusters. The process is intuitively simple: starting with each data point as its own cluster, the algorithm repeatedly identifies and merges the closest pair of clusters based on a linkage function. This process continues until a single cluster remains, forming a tree structure known as a dendrogram.

Overview of the HAC process: (a) input points, (b) nested clustering, and (c) the resulting dendrogram.

While sequential implementations of HAC are well-understood, parallelizing the process—especially for popular linkage functions like Centroid and Ward’s distance—has remained a significant challenge. This paper addresses this gap by providing the first efficient, highly parallel (NC) algorithms for these non-monotone linkages in low-dimensional Euclidean spaces.

The Challenge of Non-Monotonicity

The primary obstacle to parallelizing HAC lies in the nature of the linkage function. "Monotone" linkages, such as single-linkage, ensure that the distance between merged clusters never decreases as the algorithm progresses. This property allows for relatively straightforward parallelization.

In contrast, "non-monotone" linkages like Centroid and Ward’s distance do not provide this guarantee. In these cases, merging two clusters can actually decrease the distance to a third cluster. This creates complex sequential dependencies: a merge in one part of the dataset might suddenly invalidate or change the optimal merge in another part. These "dependency chains" have historically made non-monotone HAC appear inherently sequential, resisting efficient parallelization even when approximation is allowed.

Algorithmic Framework: The "Bounce-Back" Approach

The authors overcome these dependencies through a combination of structural theory and a novel parallel algorithm. They define a class of "well-behaved" linkage functions characterized by three properties:

  1. Packability: A constraint on how many clusters can be "close" to each other in Euclidean space.
  2. Weight-Stability: Ensuring that merges do not cause drastic, unpredictable changes in cluster distances.
  3. Average-Reducibility: A property that relates the distance of a merged cluster to its components.

The Height Bound

A key theoretical breakthrough in this work is proving that for well-behaved linkages in low dimensions ($k$), the resulting dendrogram has a height of at most $\operatorname{poly}(\log n)$. Since the depth of a parallel algorithm is often tied to the height of the tree it constructs, this bound is essential for achieving polylogarithmic depth.

The Algorithm

The algorithm operates in phases using distance thresholds (bucketing). Within each phase, it attempts to merge all pairs of clusters whose distance falls within the current $(1+\epsilon)$ threshold. To handle the non-monotonicity problem, the authors introduce a "bounce-back path." If a merge causes a cluster's distance to its neighbors to drop below the current threshold, the algorithm follows a sequence of local merges until the distances rise back above the threshold, ensuring progress is maintained without violating the approximation guarantees.

Key Results and Complexity

The research provides both upper and lower bounds for the complexity of parallel HAC:

  • Efficiency in Low Dimensions: For constant dimensions ($k = O(1)$), the algorithm achieves $\tilde{O}(n)$ expected work and $\tilde{O}(1)$ depth. This makes it nearly as work-efficient as sequential algorithms while being significantly faster on parallel architectures.
  • Ward’s Linkage: The results extend to slightly higher dimensions, specifically $k = O(\log \log n / \log \log \log n)$, while still maintaining polylogarithmic depth.
  • Hardness in High Dimensions: The authors prove that parallelizing Centroid HAC in arbitrary dimensions ($k=n$) is CC-hard (Comparator Circuit hard). This suggests that the difficulty of parallelizing HAC is not just an algorithmic failure but an inherent property of high-dimensional data.

Conclusion

By demonstrating that the dependency chains of non-monotone HAC are primarily a high-dimensional phenomenon, this work opens the door for efficient parallel clustering in many practical low-dimensional applications. The "bounce-back" mechanism and the structural height bound provide a robust framework for handling non-monotonicity, bridging the gap between theoretical parallel computing and widely used data science heuristics.

Summary updated

BibTeX
@misc{bateni2025parallel,
  author = {MohammadHossein Bateni and Laxman Dhulipala and Willem Fletcher and Kishen N. Gowda and D. Ellis Hershkowitz and Rajesh Jayaram and Jakub Lacki},
  title = {{Parallel Hierarchical Agglomerative Clustering in Low Dimensions}},
  year = {2025},
  eprint = {2507.20047},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.20047},
}
Figure