rmgpy.molecule.vf2.VF2

class rmgpy.molecule.vf2.VF2(graphA=None, graphB=None)

An implementation of the second version of the Vento-Foggia (VF2) algorithm for graph and subgraph isomorphism.

feasible(self, Vertex vertex1, Vertex vertex2) → bool

Return True if vertex vertex1 from the first graph is a feasible match for vertex vertex2 from the second graph, or False if not. The semantic and structural relationship of the vertices is evaluated, including several structural “look-aheads” that cheaply eliminate many otherwise feasible pairs.

findIsomorphism(self, Graph graph1, Graph graph2, dict initialMapping) → list

Return a list of dicts of all valid isomorphism mappings from graph graph1 to graph graph2 with the optional initial mapping initialMapping. If no valid isomorphisms are found, an empty list is returned.

findSubgraphIsomorphisms(self, Graph graph1, Graph graph2, dict initialMapping) → list

Return a list of dicts of all valid subgraph isomorphism mappings from graph graph1 to subgraph graph2 with the optional initial mapping initialMapping. If no valid subgraph isomorphisms are found, an empty list is returned.

isIsomorphic(self, Graph graph1, Graph graph2, dict initialMapping) → bool

Return True if graph graph1 is isomorphic to graph graph2 with the optional initial mapping initialMapping, or False otherwise.

isSubgraphIsomorphic(self, Graph graph1, Graph graph2, dict initialMapping) → bool

Return True if graph graph1 is subgraph isomorphic to subgraph graph2 with the optional initial mapping initialMapping, or False otherwise.