Hierarchical Agglomerative Clustering via Relaxed Representatives

Eduardo Sany Laber, Miguel A. BatistaNeurIPS 2026

TL;DR

Clustering data into a tree of nested groups is much easier to interpret when every cluster has a single "representative" data point summarizing it, yet existing methods are either painfully slow or mathematically messy. By simply letting merged clusters inherit a representative from one of their parents rather than recomputing a brand-new one from scratch, the authors turn cubic-time bottlenecks into fast quadratic-time algorithms. Better yet, this "relaxed" approach guarantees clean, untangled cluster trees and delivers state-of-the-art theoretical bounds on cluster compactness.

What Problem Does This Paper Address?

Hierarchical Agglomerative Clustering (HAC) is a data science staple: start with $n$ individual data points, repeatedly merge the two closest groups, and record the history in a tree diagram called a dendrogram.

When you summarize each cluster using a single "representative" point (like a centroid or medoid), humans can easily inspect what a cluster actually represents. Unfortunately, popular representative-based methods force an unpleasant choice:

  • The centroid method is fast, but its representatives are averages that may not exist in your actual dataset (imagine a "representative" patient with 0.4 diseases), and it only works in Euclidean-like spaces. Worse, it suffers from inversions—where a later merge happens at a smaller distance than an earlier merge, causing the dendrogram branches to tangle backward and ruining visual interpretability.
  • The minimax method picks real data points as representatives, avoids inversions, and builds wonderfully compact clusters. However, finding the optimal new representative at every merge takes $O(n^3)$ time, making it far too slow for even moderate datasets.

Methods

The authors introduce relaxed-representative clustering. Standard algorithms recompute an optimal representative from all points inside a newly merged cluster $A \cup B$. Here, the merged cluster simply inherits either $A$'s representative ($c_A$) or $B$'s representative ($c_B$). Once the entire dendrogram is built, a fast $O(n^2)$ post-processing pass computes the true exact center for each cluster.

Using this framework, they design two algorithms:

  1. $\text{RMM}^*$ (Relaxed Minimax): A drop-in, fast cousin of minimax. It measures distance between $A$ and $B$ by testing both $c_A$ and $c_B$ to see which one minimizes the maximum distance to all points in $A \cup B$, and promotes the winner.
  2. $\text{CRM}^*$ (Closest-Relaxed-Medoids): A clean alternative to centroid. It merges the two clusters whose current representatives are closest, picking the surviving representative using a cheap, maintained upper bound on cluster radius. Because it relies purely on pairwise distances, it works in any metric space and admits a fast $O(m \log n + n \log^2 n)$ implementation for sparse graphs ($n$ nodes, $m$ edges).

Because representatives are inherited rather than moved to arbitrary new locations, both methods satisfy mathematical properties that let them run in $O(n^2)$ time via the classic Nearest-Neighbor Chain algorithm—and provably never produce inversions.

Datasets

No new benchmarks were introduced; the authors evaluated their methods across synthetic data and established real-world tabular, biological, text, rating, and graph datasets:

  • Runtime & Compactness ($k$-center cost): Allen Brain, Anuran, BookRating, Ecoli, Geographical Music, MovieLens, News20 (Newsgroups), Ozone, Parkinsons, Reuters, Rice, and Wine.
  • Classification / Clustering Quality (Adjusted Rand Index): Dry Bean (beans), banknote, anuran, rice, mice, iris, pendigits, Letter Recognition (LetterRec), and BreastCancer.
  • Large Sparse Graphs: Vertex-induced subgraphs of the Orkut social network (up to $3.1 \times 10^6$ nodes and $1.17 \times 10^8$ edges) and the Condensed Matter physics coauthorship network ($23,133$ nodes and $1,166,152$ derived Jaccard-distance edges).

Key Insights and Ideas

  • Laziness pays off theoretically: Refusing to recompute representatives mid-flight doesn't just save time—it unlocks strict guarantees. Both $\text{RMM}^*$ and $\text{CRM}^*$ achieve an $O(\min\{k, \log n\})$ approximation for maximum cluster diameter and the $k$-center objective (minimizing the worst-case distance from any point to its representative). No other $O(n^2)$ linkage method achieves this; classical single, complete, and average linkage can degrade to $O(n)$ in general metric spaces.
Table 1: Comparison of running times and available bounds on the maximum diameter of a k- clustering
  • Hierarchical beats flat in practice: Even though Gonzalez's famous flat $k$-center algorithm isn't constrained to build a consistent tree across all $k$, $\text{RMM}^*$ empirically beat it on 83% of tested $(\text{dataset}, k)$ pairs for $k \le 100$.
  • Fixing centroid without losing its soul: By restricting representatives to actual input points via inheritance, $\text{CRM}^*$ completely eliminates dendrogram inversions while matching centroid in clustering accuracy and noise robustness.

Key Results

  • 100x Speedups: On moderate datasets like MovieLens and BookRating, minimax took $1214.9\text{s}$ and $1075.4\text{s}$, whereas $\text{RMM}^*$ finished in $12.4\text{s}$ and $8.5\text{s}$—roughly 100 times faster.
  • Near-Minimax Compactness: $\text{RMM}^*$ consistently achieved lower $k$-center costs than all other subcubic hierarchical baselines, staying within 10% of cubic-time minimax in 80% of cases ($k \le 100$).
  • Competitive Accuracy: Across 9 classification datasets, $\text{RMM}^*$ achieved an average Adjusted Rand Index (ARI) of 0.41, essentially tying minimax (0.42) and beating complete (0.38) and average (0.29) linkage. $\text{CRM}^*$ (0.21) matched centroid (0.22) while producing zero inversions.
  • Massive Graph Scaling: On Orkut subgraphs scaling up to nearly 120 million edges, the sparse graph version of $\text{CRM}^*$ scaled near-linearly, completing full clustering and center-finding in under 400 seconds.
Figure 1: Running time in seconds of CRM∗and the dendrogram construction (CRM) for samples of Orkut dataset as a function of the number of edges.

Limitations and Future Work

  • Memory bottlenecks for $\text{RMM}^*$: While $\text{RMM}^*$ runs in optimal $O(n^2)$ time (assuming all pairwise distances are read), it also requires $O(n^2)$ memory in the worst case, limiting its use to moderate-sized datasets (around $10^4$ points).
  • Compactness vs. Scalability: While $\text{CRM}^*$ scales to massive sparse graphs where $\text{RMM}^*$ cannot go, $\text{CRM}^*$ is noticeably less competitive at producing tightly compact clusters under the $k$-center objective than $\text{RMM}^*$ or average-link.
  • Future research directions are not explicitly discussed in the paper.

Summary updated

Abstract

Due to their simplicity and interpretability, linkage methods are a central class of hierarchical agglomerative clustering (HAC). In particular, representative-based methods, such as centroid and medoid approaches, are appealing because their representatives provide intuitive summaries of the clusters. However, many representative-based linkage methods suffer from important drawbacks, such as high computational cost and the generation of inversions, which limit their broader applicability. We introduce *relaxed-representative clustering*, a principled generalization of representative-based linkages that preserves their interpretability while addressing these limitations. This framework yields (i) RMM*, a quadratic-time variant of the cubic-time Minimax method, and (ii) RC*, an inversion-free variant of the Centroid method whose representatives belong to the input set. On the theoretical side, we prove that for every $k$ our methods are $O(\min\{k,\log n\})$-approximation algorithms for the $k$-center objective. Empirically, experiments on tabular, biological, and textual datasets show that RMM* consistently outperforms several baselines and achieves clustering quality comparable to Minimax at a fraction of the computational cost. Meanwhile, RC* remains competitive with the Centroid method while producing inversion-free dendrograms and interpretable representatives.
BibTeX
@inproceedings{laber2026hierarchical,
  author = {Eduardo Sany Laber and Miguel A. Batista},
  title = {{Hierarchical Agglomerative Clustering via Relaxed Representatives}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Fxc3acAsk6},
}
Figure