To determine if we have added a sufficient number of layers, we need to check if the generated SMIRKS patterns match the input clusters. This approach utilizes a simplified version of the scoring function developed for SMIRKY. Each fragment (i.e. bond) has two types, the current type assigned by the SMIRKS patterns and a reference type based on its input cluster. Using NetworkX, a bipartite graph is created where each current type has a node on side A and each reference type has a node on side B. For every fragment in every molecule we draw an edge connecting its current type to its reference type. In ChemPer we do not allow partial matches between the current and reference types. That means if any node has more than one edge the current list of SMIRKS pattern is rejected because it does not match the input clusters.