The mapping functions described above in Sec. II C are interesting in that they always find a subgraph isomorphism between two graphs, and does so by modifying either one or both of the graph operands. Subgraph isomorphisms are found using node and edge weights to find the best mapping. For example, we want carbons to map to carbons but allow mapping to other atoms if necessary. This approach causes the mapping functions to be bijections, where we always have an exact one-to-one mapping between the atoms and bonds of two SMARTS patterns. This is necessary for defining the bitwise operations on the SMARTS primitives.