Another category of hierarchical clustering methods such as centroid linkage and Ward linkage perform directly on data features, instead of pairwise dissimilarities. Centroid linkage computes a representative for each cluster and defines the inter-cluster distances according to those representatives. Similar to the case of \(K\) -means, shifting the data features by a constant does not change the pairwise inter-cluster distances. The Ward linkage [1]} aims at minimizing the within-cluster variance at each step, i.e., the \(dist(\mathbf {u},\mathbf {v})\)  is defined as
\(dist(\mathbf {u},\mathbf {v}) = \frac{|\mathbf {u}||\mathbf {v}|}{|\mathbf {u}|+|\mathbf {v}|} ||\mathbf {g}_{\mathbf {u}} - \mathbf {g}_{\mathbf {v}}||^2 \, ,\) 
