Fig. exemplifies our approach to similarity where, starting from the chemical space, molecular formulas of the form A a ...Q q ...Z z in the dataset, are rewritten in the form A a ...Q q-n ...Z z -Q n , which makes it explicit that n atoms of type Q are replaceable. This leads to create templates of the form R-X n , with R representing the remaining molecular formula after extracting X n from the original compound. The "co-ocurrence matrix" (Methods 6.2) is then calculated as the number of such templates common to a pair of elements, and the similarity matrix is calculated as a normalised version of it. Introduction of new chemicals to the chemical space, possibly containing new elements and new (types of) substances, updates the similarity matrix. This shows how similarities are affected by the evolution of the chemical space, which has grown exponentially over the history of chemistry (Fig. ), a fact that further motivates a large scale study of the interplay between the chemical space and the periodic system.