Enumerating Chemical Structures, Stereoisomers, and Stereogenic Units with Analytic Combinatorics
The enumeration of chemical structures traditionally relies on graph- and group-theoretic techniques, including P\'olya theory, in order to account for stereochemical symmetries. These methods require bespoke derivations and methods for each molecular family of interest, and quickly become very intricate for nontrivial classes. In this work, we demonstrate that analytic combinatorics provides a unifying, highly extensible, and relatively simple framework for enumeration problems. Using the symbolic method, we show that classical counting problems, such as the enumeration of acyclic alkanes and other hydrocarbon families, can be naturally solved via concise combinatorial specifications of the class of interest. We first demonstrate the simplicity of this approach by replicating existing results in this framework, requiring significantly less work than previously necessary, and then extend these ideas to more complex problems, counting broader classes of molecules accounting for both tetrahedral and E/Z stereoisomerism, counting the distribution of stereogenic units, and enumerating achiral and meso compounds. All results are made reproducible through CombOL, our open-source software package which automates the translation of combinatorial specifications into generating functions using the symbolic method, and performs both univariate and multivariate enumeration.