## 2 Results and Discussion
### Methods
#### 2.1.1 Algorithm
The mistakes, which arise due to rounding error and measures on discrete data, are compensated for identically ordered datasets. There is small, but nonzero probability, that different structures have identical 12-byte hash code, which is used for sorting. Such event was never observed by us for databases, which contain some millions of available compounds. The suggested algorithm involves the following steps:  
1. Generating hash codes for all chemical structures in the initial dataset. At this stage all topological duplicates are removed automatically - they have identical hash codes. 2. Setting the initial number of clusters (\(K\)=1) and starting the similarity threshold (\(R\)=0.0). 3. Requesting the number of steps (\(Nst\)) for further calculation of the difference between similarity thresholds (\(Rd\)=1/\(Nst\)). The \(Nst\) value equals the number of levels in the resultant hierarchy. 4. Diversity sorting in each cluster \(C\) for similarity threshold \(R\). Forming the set of probe molecules [14]\(S\), namely:  
a. Selecting the compound most dissimilar to all molecules in the cluster and putting it into set \(S\). b. Selecting compound \(M\) which is the most dissimilar to structures in set \(S\) (\(MinMax\) diverse selection). At first step, the compound M is most dissimilar to single compound, selected in step a). At next steps M has maximal average distance to all compounds in set S.  
c. Calculating similarity of compound \(M\) to all compounds in set \(S\). If maximal similarity ratio is greater than \(R\)+\(Rd\), set \(S\) remains unchanged. Otherwise, compound \(M\) is added to set \(S\). The algorithm then proceeds to Point b for selecting the next compound. The number of compounds in probe set \(S\) is equal to the number of clusters plus the number of singletons. Thus, the number of resultant clusters is not determined beforehand-it is calculated from diversity of dataset. 5. Calculating similarity of each remaining compound to compounds in set \(S\). Assigning compounds to the cluster with maximal similarity. 6. Setting similarity threshold (\(R\)=\(R\)+\(Rd\)). Assigning this value to all clusters generated from cluster \(C\). The algorithm then proceeds to Step 4. It is repeated until similarity threshold reaches value 1 (Figure 3). Figure 3 shows a part of the tree generated by proposed algorithm (compare with Figure 1). Many clusters are generated at each step, while traditional divisive hierarchical clustering algorithms divide a cluster into two at each step [23] or combine two clusters into one in agglomerative algorithms. Information about exact value of similarity of a pair of clusters is lost, but performance is increasing, since one step is used instead of several steps to divide a cluster. 2D molecular structural fragments are used for calculating a bit vector required for molecular similarity calculations. The described algorithm uses circular, not linear, fragments with a variable sphere radius around the selected atom [24-26]. The sphere radius is a topological distance between the central atom and the maximally remote one. Value 1 is assigned to the length of each bond. Central atoms are selected one after another to split a molecule into spherical fragments. Then fragments with sphere radius 1, 2, etc. are sorted in succession. The suggested algorithm makes it possible to use information on the cycle size. To do this, an additional cycle size attribute was assigned to a chemical bond in addition to the bond order. This is a distinguishing feature of the algorithm. The single bond in the aliphatic chain differs from the single bond in cyclopropane, which, in turn, differs from that in cyclopentane. If a bond belongs to two rings, a smaller size descriptor is used. Such distinctions are not made for cycles of size 6 and higher. This splitting method is also rational from the point of chemistry - it accounts for reactivity of small cycles. The suggested algorithm distinguishes bonds in 5 and 6-membered aromatic rings [20].