Repeating merge-and-average until one cluster remains gives the full UPGMA tree.

highlighted = computed this step

Repeat merge and average

After each merge, UPGMA averages distances to the new cluster and looks for the next closest pair. Repeating that process to the end leaves one rooted tree.

merge, average, repeat\text{merge, average, repeat}
UPGMA treeThe dendrogram is recomputed from the distance matrix.03WX1Y2Z3

The merge order becomes the tree

W and X join at height 1; that cluster joins Y at height 2; then Z joins at height 3.

WX:1, WXY:2, WXYZ:3\text{WX}: 1,\ \text{WXY}: 2,\ \text{WXYZ}: 3
UPGMA treeThe dendrogram is recomputed from the distance matrix.03WX1Y2Z3