# Ward's Hierarchical Clustering Method: Clustering Criterion and Agglomerative Algorithm

Ward clustering implementations disagree because of squaring and height-scale conventions

Fionn Murtagh, Pierre Legendre · arXiv · 2011-11-27

- **Problem** Common software gives different trees for Ward hierarchical clustering on the same dissimilarity matrix. Users cannot tell which input convention and height scale each implementation expects, so they can misread heights.
- **Method** The authors separate two Ward variants, Ward1 and Ward2, by whether inputs are squared and whether heights are square-rooted. Ward2 updates distances directly, while Ward1 updates squared distances.
- **Results** With matched inputs and scales, agnes and hclust.PL gave identical sorted node heights on one random 20 by 4 data set.

## Why one Ward name gives two outputs

Users of hclust in R and agnes in the cluster package both request Ward clustering, yet on the same dissimilarity matrix they return different trees. The authors trace the confusion to three sources: whether the input dissimilarities are squared, whether node heights are square-rooted, and a subtle difference in the loop structure of the stepwise algorithm.

This matters because a user who assumes one convention can read heights on the wrong scale or pass the wrong kind of input.

The key idea is that both variants minimize the same change in variance, so the difference lies in conventions rather than in the objective. Ward1 takes squared Euclidean distances as its initial dissimilarities and reports heights on a squared-distance scale. Ward2 also starts from squared Euclidean distances, but its update works with distances, so its heights sit on a distance scale.

The two can produce the same output only when the inputs and the reported scale are set consistently.

## How the Lance-Williams update drives the merges

The algorithm starts from singleton clusters, merges the closest pair at each step, and then recomputes the dissimilarities between the new cluster and every other cluster. The update weights each old dissimilarity by the cardinalities of the clusters involved, so the size of each cluster shapes the next merge. Ward1 applies this recurrence directly to squared Euclidean inputs.

Ward2 uses the same weights, but its update takes the square root of the weighted squared terms, so the quantity it updates is a distance. Writing the squared quantity as D equal to the square of the distance turns this update into the Lance-Williams form, with the same coefficients as before. \\\[ D(i\\cup i',i'') = \\frac{w\_i + w\_{i''}}{w\_i + w\_{i'} + w\_{i''}} D(i,i'') + \\frac{w\_{i'} + w\_{i''}}{w\_i + w\_{i'} + w\_{i''}} D(i',i'') - \\frac{w\_{i''}}{w\_i + w\_{i'} + w\_{i''}} D(i,i') \\\]

Once the Ward1 inputs match the Ward2 squared inputs, the two updates have the same form, so the outputs can be made identical. What remains different is the scale on which the heights are read.

## What the four case studies show

The authors generated one random matrix of 20 observations on 4 attributes, using a fixed seed, and ran hclust, agnes and hclust.PL on it.

agnes with the ward option and hclust.PL with ward.D2 gave identical sorted node heights, running from 0.1573864 to 1.8584163. Their dendrograms look the same apart from node order that can be swivelled without changing the tree.

hclust on squared distances with the ward option matched hclust.PL with ward.D on squared distances. The authors report these heights as the squares of the heights from Experiment 1.

Feeding non-squared distances to the ward options gives a well-defined tree that differs from the Ward result. Its node heights are not monotonic relative to those of Experiments 1 and 2.

Taking square roots of the heights from squared input recovers the Ward2 heights, for both hclust with the ward option and hclust.PL with ward.D. The authors conclude that the height scale, not the tree shape, separates the two outputs.

## Which height scale to prefer

Ward2 values lie on a distance scale, so they can be compared directly with the input distances. Ward1 values lie on a squared scale and need a square root before that comparison. This is why the authors favour Ward2 when they use cophenetic correlations to check a dendrogram against its input.

The authors state that, on the same dissimilarity matrix, only Ward2 minimizes the Ward clustering criterion. They add that Ward1 on squared input and Ward2 on unsquared input can optimize the same criterion and yield the same clustering levels, once the square root of the Ward1 levels is taken.

## Limits of the evidence

All case studies use one random 20 by 4 data set with one seed, and they use only R functions. The claim that only Ward2 minimizes the criterion rests on the authors' analysis, not on a separate optimality test in the experiments.

The authors note that the error sum of squares criteria are NP-complete to optimize exactly, so practical implementations are heuristics. Dissimilarities between non-singleton clusters break the triangular inequality even when the process starts from a Euclidean distance. Whether the outputs of the two implementations keep matching on other data sets was not tested.

## Paper info

- **Authors**: Fionn Murtagh, Pierre Legendre
- **Venue**: arXiv · Preprint
- **First published**: 2011-11-27
- **Added**: 2026-11-12
- **Updated**: 2011-12-11
- **Version**: v2
- **arXiv**: 1111.6285
- **DOI**: 10.1007/s00357-014-9161-z
- **Category**: stat.ML · cs.CV · stat.AP
- **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/1111.6285v2) · [PDF ↗](https://arxiv.org/pdf/1111.6285v2)

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

Fionn Murtagh, Pierre Legendre (2011). Ward's Hierarchical Clustering Method: Clustering Criterion and Agglomerative Algorithm. arXiv:1111.6285v2. https://doi.org/10.1007/s00357-014-9161-z

**BibTeX**

```
@article{murtagh2011ward,
  title = {{Ward's Hierarchical Clustering Method: Clustering Criterion and Agglomerative Algorithm}},
  author = {Fionn Murtagh and Pierre Legendre},
  year = {2011},
  eprint = {1111.6285},
  archivePrefix = {arXiv},
  doi = {10.1007/s00357-014-9161-z},
  url = {https://arxiv.org/abs/1111.6285v2}
}
```

## Related papers

- [Methods of Hierarchical Clustering](https://refivu.com/en/papers/b67289cf-e579-4f78-a7ff-bdea1acaa376-methods-of-hierarchical-clustering.md)

## Other paper commentary

- [DARTS: Differentiable Architecture Search](https://refivu.com/en/papers/e93ed790-8383-46f1-928b-765de23e1c42-darts-differentiable-architecture-search.md)
- [Residual Dense Network for Image Super-Resolution](https://refivu.com/en/papers/01bf3f14-f3f5-49d6-9844-02a897713390-residual-dense-network-for-image-super-resolution.md)
- [AutoAugment: Learning Augmentation Policies from Data](https://refivu.com/en/papers/4b6d74c6-1851-4ea4-8417-b325823c633e-autoaugment-learning-augmentation-policies-from-data.md)
- [CNN Features off-the-shelf: an Astounding Baseline for Recognition](https://refivu.com/en/papers/7a883e97-7894-49b3-9ad9-4cec774f4e63-cnn-features-off-the-shelf-an-astounding-baseline.md)
- [Learning without Forgetting](https://refivu.com/en/papers/3784f887-f12a-406c-9f7c-0b1573555ee3-learning-without-forgetting.md)
- [Learning Deconvolution Network for Semantic Segmentation](https://refivu.com/en/papers/9a41459e-1e6d-4d79-b532-13493bd8cf30-learning-deconvolution-network-for-semantic-segmentation.md)
- [Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles](https://refivu.com/en/papers/e87c2499-044c-4894-99c5-2fcf0e56d999-simple-and-scalable-predictive-uncertainty-estimation-using.md)
- [StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation](https://refivu.com/en/papers/b61e89a8-05ef-4482-bc67-b5bed59283d8-stargan-unified-generative-adversarial-networks-for-multi.md)
- [A Survey on Evaluation of Large Language Models](https://refivu.com/en/papers/46dfd405-ef56-4804-b283-8d9be353baaf-a-survey-on-evaluation-of-large-language-models.md)
- [Are Transformers Effective for Time Series Forecasting?](https://refivu.com/en/papers/a7a6536f-e2ff-47d4-b119-2c6e9038e858-are-transformers-effective-for-time-series-forecasting.md)
- [Knowledge Distillation: A Survey](https://refivu.com/en/papers/20b6ef99-85b3-42b7-9c02-384c6383f2ff-knowledge-distillation-a-survey.md)
- [Concrete Problems in AI Safety](https://refivu.com/en/papers/a0a18b13-f86b-4c61-807b-da6798f08495-concrete-problems-in-ai-safety.md)

## Terms in this paper

- [ultrametric](https://refivu.com/en/terms/1437f4978e5b-ultrametric)
- [variance](https://refivu.com/en/terms/181e9562b0e0-variance)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/f6ffd1cf-34b4-43fb-8682-2d02bbee1019-ward-s-hierarchical-clustering-method-clustering-criterion)
