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,X⟶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.