After the closest pair merges, UPGMA averages distances from the new cluster to every remaining cluster.

highlighted = computed this step

Merge the closest pair

W and X are the closest pair, so UPGMA replaces them with one cluster, WX. Their join height is 1, half of their distance.

W,XWX at height 1\text{W,X} \longrightarrow \text{WX at height } 1

Average the distances

The new distance from WX to Y is 4, and from WX to Z is 6. Each comes from adding the two old distances and dividing by 2. We now repeat closest-pair search on the reduced 3 by 3 matrix.

d(WX,Y)=4+42=4,d(WX,Z)=6+62=6d(\text{WX},Y)=\frac{4+4}{2}=4,\quad d(\text{WX},Z)=\frac{6+6}{2}=6
Reduced matrixAfter W and X merge, distances are averaged into a smaller matrix.·WXYZWX046Y406Z660