The splitting scheme described in Sec. III computes new SMARTS patterns S j that are each a subset of the existing SMARTS S 0 they were split from. We represent the set of SMARTS as a hierarchy using a tree data structure. Nodes in a tree have exactly one parent and zero or more children. This relationship is formed by an edge in the hierarchy, and this edge represents a subset relation. For some split S j from the existing SMARTS S 0 , these two SMARTS patterns are connected and have the relation S 0 ⊃ † S j ; we describe why this form is needed in the following section. Because S 0 is a super set, it will match everything that S j matches, and it is also possible that a chemical environment can match multiple SMARTS patterns in the hierarchy. However, there is only one intended SMARTS pattern for each chemical environment, and so the SMARTS needs to have a particular order. The SMIRNOFF format uses a flat list of SMARTS sorted by ascending priority. Chemical environments are assigned to SMARTS patterns that matched last, or most recently. With the BESMARTS encoding scheme, the flat list of SMARTS in the SMIRNOFF format can be explicitly structured as a hierarchy using a subset relation. Generally, this hierarchy can be thought of as a decision tree. As the hierarchy is traversed, chemical environments are queried against each SMARTS node in the tree. If the chemical environment matches the SMARTS of a given node, it will proceed to the children of the node because the children SMARTS, as subsets, represent specialized SMARTS and therefore are more exotic chemical environments. We prefer that these specialized SMARTS are assigned over the more general SMARTS. Once the traversal has terminated, the chemical environment will be assigned to the pattern that most recently matched. As such, the ordering of the SMARTS hierarchy and the way it is traversed is important to the performance and accuracy of the perception model it represents. In the following sections, we describe how this tree is ordered and traversed. We conclude this section by then describing how to merge two hierarchies together, which should be a valuable operation for bottom-up approaches to SMARTS clustering.