The following algorithms are for generating hierarchical clusterings by the single-link and complete-link methods. When the proximity matrix contains no ties, clusterings are numbered 0, 1, ..., (n-1) and the mth clustering, Wm, contains n - m clusters.
= min d(i,j) : the maximal subgraph of G(d(i,j) defined by is connected
Clusters and are merged to form the next clustering in the single-link hierarchy if
= min
= min d(i,j) : the maximal subgraph of G(d(i,j)) defined by is complete
Cluster is merged with cluster under the complete-link method if = min
The word "maximal" in the definitions of functions and means that all nodes of the two clusters and must be considered when establishing connectedness or completeness. Only existing clusters can be merged at the next level.