Five 1-D points are A=0, B=1, C=3, D=7 and E=8. With agglomerative clustering, what merges and merge heights do (a) single linkage and (b) complete linkage give, and how do the two linkages differ in practice?

Unsupervised learning, Clustering
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can update distances between clusters correctly under each linkage, and know what kind of clusters each tends to produce.

Key idea

Agglomerative clustering starts with every point as its own cluster and repeatedly merges the closest pair. Single linkage defines the distance between clusters P and Q as min⁡p∈P,q∈Qd(p,q) (closest pair); complete linkage uses max⁡ (farthest pair). The distance at which two clusters merge is the merge height in the dendrogram, the tree diagram of merges.

Steps

  1. List all pairwise distances: AB=1, DE=1, BC=2, AC=3, CD=4, CE=5, BD=6, AD=7, BE=7, AE=8.
  2. Both linkages first merge {A,B} at height 1 and {D,E} at height 1. Linkage does not matter yet, because all clusters are single points.
  3. (a) Single linkage: d({A,B},C)=min⁡(3,2)=2, d(C,{D,E})=min⁡(4,5)=4 and d({A,B},{D,E})=6. The smallest is 2, so merge {A,B,C} at 2. Then d({A,B,C},{D,E})=CD=4, so the final merge is at 4.
  4. (b) Complete linkage: d({A,B},C)=max⁡(3,2)=3, d(C,{D,E})=max⁡(4,5)=5 and d({A,B},{D,E})=8. Merge {A,B,C} at 3. Then d({A,B,C},{D,E})=AE=8, so the final merge is at 8.
  5. Compare: the tree shape is the same here but the heights differ. Cutting the dendrogram at height 5 gives two clusters, {A,B,C} and {D,E}, under complete linkage, but only one cluster under single linkage.
  6. Explain the practical difference. Single linkage follows chains of close points, so it can find long, curved clusters, but one noisy “bridge” point can join two clusters (this is called chaining). Complete linkage prefers compact clusters of similar size and resists chaining, but it can split one large cluster in two.

Common mistakes

How long your answer should be

A merge table for each linkage plus 2–3 sentences; about 4 minutes.

Last checked on 4 December 2026.

Read this

Previous in Unsupervised learning: What is k-means++ initialisation, and for the 1-D points {0,1,2,10,11} with k=2, if the first centre chosen is 0, what is the probability that each remaining point becomes the second centre?
Next in Unsupervised learning: A clustering of 1-D data gives cluster 1 ={0,2} and cluster 2 ={6,8,10}. What are the silhouette values of the points x=2 and x=6, and what do they tell you?