Agglomerative clustering supports compound selection by starting with one cluster per molecule and repeatedly merging the closest clusters until all compounds form one hierarchy. Molecular similarity can use Morgan fingerprints with Tanimoto distance, while intercluster distance can use single, complete, average, or Ward linkage. section 7.2.3
A dendrogram exposes alternative cluster cuts, allowing the selection strategy to match the number of compounds or the desired diversity of a screening library. section 7.2.3
Fit and sample diverse compounds
Convert molecules to fingerprints, fit scikit-learn AgglomerativeClustering with Ward linkage, choose a cluster count, then sample molecules closest to each cluster center. Compare the resulting library using fingerprint similarity and redundancy.

