# Methods of Hierarchical Clustering

Hierarchical clustering methods can be run far faster than the naive approach

Murtagh, Fionn, Contreras, Pedro · arXiv · 2011-4-30

- **Problem** Stored-dissimilarity clustering recomputes dissimilarities at every merge, costing O(n3) time without speed-ups. That makes it a poor base for an efficient program.
- **Method** NN-chain grows a chain of nearest neighbors from any starting point. Instead of scanning all dissimilarities, it merges each reciprocal nearest-neighbor pair as soon as the chain finds it.
- **Results** Cited early single link implementations run in O(n2) time, against O(n3) for the stored data approach.

## Why stored dissimilarities get expensive

Agglomerative clustering merges two clusters at each step until one cluster remains, so the cost of each merge decides the total cost. The stored data approach is the simplest version: it examines all interpoint dissimilarities, merges the closest two points, and replaces them with a representative point or cluster fragment. Its storage stays at O(n) for the objects and the clusters.

Time is the real problem, because recalculating dissimilarities at each step gives an overall complexity of O(n3) when no algorithmic speed-ups are applied. So the procedure explains the idea well but is a poor base for an efficient program. The question the rest of the article pursues is whether the same hierarchy can be built without repeating that work.

## One update formula for many criteria

The Lance-Williams dissimilarity update avoids going back to the raw data after a merge. When i and j merge into cluster i ∪ j, the dissimilarity to any other point k is updated with the formula \\\[ d(i \\cup j, k) = \\alpha\_i d(i,k) + \\alpha\_j d(j,k) + \\beta d(i,j) + \\gamma \\lvert d(i,k) - d(j,k) \\rvert \\\] The coefficients alpha\_i, alpha\_j, beta and gamma define the criterion, and Table 1 lists them for each method.

Single linkage is the simplest case: alpha\_i and alpha\_j are one half, beta is 0, and gamma is minus one half. With these values the update becomes the smaller of d(i,k) and d(j,k). Other linkage methods change only the coefficients, so they can be implemented in much the same way.

Center-based methods such as centroid, median and minimum variance also need cluster center coordinates. For these methods the Euclidean distance must be used, and each center is an average or weighted average of the member vectors. For minimum variance the dissimilarity is a size-weighted distance between two cluster centers, and the agglomerands are the pair that minimizes it.

## Inversions and the reducibility property

The shortcut works only when the hierarchy has no inversions. An inversion means a later merge happens at a lower dissimilarity than an earlier one, so the space appears to shrink after an agglomeration. Figure 2 shows this cross-over, and normally one wants to avoid it.

The reducibility property, which the authors tie to Bruynooghe's work, guards against inversions. If d(i,j) is below both d(i,k) and d(j,k), the merged dissimilarity must stay above d(i,j), written \\(d(i,j) \< d(i \\cup j,k)\\). Under this property, c and d in Figure 1 can be merged at once, because no other point could have joined either of them.

Under the Lance-Williams update, minimum variance and the linkage methods avoid inversions. Median and centroid can't be guaranteed free of inversions, so their hierarchy may not be unique.

## Nearest neighbor chains

Instead of scanning all dissimilarities at every step, the NN-chain grows a chain of nearest neighbors from an arbitrary starting point. Each point in the chain is the nearest neighbor of the one before it, so the chain continues until two consecutive points are each other's nearest neighbors. That reciprocal pair is agglomerated as soon as it's found, and the chain resumes from the point that preceded it.

After a merge, only the nearest neighbors of nearby points need updating. The shortcut reproduces the stored data hierarchy only under the no-inversion condition.

Cited work gives O(n2) time and O(n) space implementations for Ward's, centroid and median methods using this approach. Early single link and a non-unique complete link method were given O(n2) implementations.

## Grid and density methods

The grid and density families skip pairwise merging and look for dense cells or regions in space instead. A typical grid method creates a grid, computes each cell's density, sorts the cells, identifies cluster centers and traverses neighboring cells.

STING divides the area into rectangular cells arranged in a hierarchy of levels, and its complexity is O(K).

OptiGrid splits data recursively with cutting planes placed through points of minimal density. Its time complexity is given as O(n · m), a figure the paper takes from Gan et al. (2007).

DBSCAN treats clusters as dense regions separated by low-density regions.

## Baire distance for linear-time clustering

The m-adic approach expands values in base m, and the Baire distance compares them by their longest common prefix. A longer shared prefix gives a smaller distance, and the paper states that this distance is an ultrametric.

Each leaf of this 10-way hierarchy is a grid cell, and all pairs inside one cell share one distance. The authors state that this expansion allows clustering in linear time for large data sets. The Baire distance has been applied to chemoinformatics, astronomy and text retrieval.

## Limitations

The text reports no timing runs of its own. Its complexity figures come from earlier work, such as O(n2) for early single link implementations and O(n · m) for OptiGrid.

The O(n3) bound and the O(n2) bounds describe different procedures on different data, so they suggest scale rather than measure speed. Centroid and median criteria stay without a guarantee against inversions, and the text offers no fix for them.

The scaling of STING to high dimensions is flagged as hard, while OptiGrid's cost is cited rather than derived.

## Paper info

- **Authors**: Murtagh, Fionn, Contreras, Pedro
- **Venue**: arXiv · Preprint
- **First published**: 2011-4-30
- **Added**: 2026-11-12
- **Updated**: 2011-4-30
- **Version**: v1
- **arXiv**: 1105.0121
- **Category**: cs.IR · cs.CV · math.ST · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1105.0121v1) · [PDF ↗](https://arxiv.org/pdf/1105.0121v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Murtagh, Fionn, Contreras, Pedro (2011). Methods of Hierarchical Clustering. arXiv:1105.0121v1. https://arxiv.org/abs/1105.0121v1

**BibTeX**

```
@misc{fionn2011methods,
  title = {{Methods of Hierarchical Clustering}},
  author = {Murtagh, Fionn and Contreras, Pedro},
  year = {2011},
  eprint = {1105.0121},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1105.0121v1}
}
```

## Other paper commentary

- [TSM: Temporal Shift Module for Efficient Video Understanding](https://refivu.com/en/papers/e7e3764b-d00b-4555-9a23-62f113a3fdfe-tsm-temporal-shift-module-for-efficient-video-understanding.md)
- [Learning Deep CNN Denoiser Prior for Image Restoration](https://refivu.com/en/papers/e6af5c0e-57ae-4b96-acf1-3a40058beb53-learning-deep-cnn-denoiser-prior-for-image-restoration.md)
- [Self-critical Sequence Training for Image Captioning](https://refivu.com/en/papers/04b028af-36f0-4ffd-b470-072e66a024c9-self-critical-sequence-training-for-image-captioning.md)
- [Bilinear CNNs for Fine-grained Visual Recognition](https://refivu.com/en/papers/6ca2f2f1-4711-4b74-898b-dcb3662ffa1f-bilinear-cnns-for-fine-grained-visual-recognition.md)
- [Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision](https://refivu.com/en/papers/fe9f3871-e0e0-4933-a807-febf612d4db8-scaling-up-visual-and-vision-language-representation.md)
- [Visual Prompt Tuning](https://refivu.com/en/papers/4a26cca4-3c81-4721-817d-3a94b5d6b0f5-visual-prompt-tuning.md)
- [Designing Network Design Spaces](https://refivu.com/en/papers/37f6e2ac-519b-4565-a6cb-673b7ed0265a-designing-network-design-spaces.md)
- [Towards Principled Methods for Training Generative Adversarial Networks](https://refivu.com/en/papers/b0f4dfa6-159a-4785-ba9c-7a882bcab62f-towards-principled-methods-for-training-generative.md)
- [The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables](https://refivu.com/en/papers/a2b9da66-2864-4212-85c2-c935a02c48cf-the-concrete-distribution-a-continuous-relaxation-of.md)
- [Personalized Top-N Sequential Recommendation via Convolutional Sequence Embedding](https://refivu.com/en/papers/7c1f4e3a-96df-4fe9-a8b5-6c36b294a565-personalized-top-n-sequential-recommendation-via.md)
- [Deep metric learning using Triplet network](https://refivu.com/en/papers/f6dd7198-0b7a-4f6a-a88a-eb7bbe1ff7ee-deep-metric-learning-using-triplet-network.md)
- [Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting](https://refivu.com/en/papers/d52df827-0d8c-42c3-97e1-3063d2cc1256-autoformer-decomposition-transformers-with-auto-correlation.md)

## Terms in this paper

- [spectral clustering](https://refivu.com/en/terms/21fd8dbd5474-spectral-clustering)
- [inversion](https://refivu.com/en/terms/21403fae189b-inversion)
- [ultrametric](https://refivu.com/en/terms/1437f4978e5b-ultrametric)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/b67289cf-e579-4f78-a7ff-bdea1acaa376-methods-of-hierarchical-clustering)
