No labels, no k to guess up front. Start with every point alone, keep gluing the two closest groups together, and read the whole story off a tree.
Everything starts from distances. Here are the straight-line (Euclidean) distances between the first six points. The smallest distance in this six-point subset is highlighted. In the full dataset, the algorithm merges whichever pair of clusters has the smallest distance under the selected linkage, so the first merge may involve points not shown here.
d(p, q) = √((xp − xq)² + (yp − yq)²). Hierarchical clustering only needs this table, never the labels.
Each U-shape is one merge. Its height is the distance at which the two groups joined. Drag the white line up or down: everything below it is glued together, and the branches it crosses are your clusters.
Highlighted rows are the merges already done at your current k. A merge that happens at a much greater height than the one before it joins groups that are really far apart.
The only choice that really matters is step 2: how to measure the distance between two groups. That is the linkage.
Numbers below update live with your data, linkage and k.
Closest pair across groups. Can chain long snakes together.
Farthest pair. Prefers compact, similar-size groups.
Mean over all cross pairs. A balanced middle ground.
Merge that increases within-cluster variance the least (c = centroid).
Ward convention. The increase in within-cluster sum of squares is ΔSSE = (nAnB/(nA+nB)) · ‖cA − cB‖². This page reports the distance form dW = √(2·ΔSSE), the same scaling used by SciPy, so it is directly comparable to the height axis. Some textbooks and tools use ΔSSE itself as the merge cost; the merge order is identical, only the height scale differs. Because Ward is built on variance, it assumes Euclidean distances and should not be combined with arbitrary metrics. Its value also differs in definition from single, complete and average linkage, so compare it to them with care.
The same two clusters, measured four different ways. Whichever linkage you pick decides who merges first.
Two blobs joined by a thin bridge, with single linkage. Watch them fuse into one long chain.
Add a distant outlier under complete linkage. Watch how long it remains separate before joining the hierarchy.
Cycle through all four linkages on the same points and see how the tree changes shape.