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, orFalse
if not. The semantic and structural relationship of the vertices is evaluated, including several structural “look-aheads” that cheaply eliminate many otherwise feasible pairs.
- find_isomorphism(self, Graph graph1, Graph graph2, dict initial_mapping, bool save_order=False, bool strict=True) list ¶
Return a list of dicts of all valid isomorphism mappings from graph graph1 to graph graph2 with the optional initial mapping initial_mapping. If no valid isomorphisms are found, an empty list is returned.
- find_subgraph_isomorphisms(self, Graph graph1, Graph graph2, dict initial_mapping, bool save_order=False) list ¶
Return a list of dicts of all valid subgraph isomorphism mappings from graph graph1 to subgraph graph2 with the optional initial mapping initial_mapping. If no valid subgraph isomorphisms are found, an empty list is returned.
- is_isomorphic(self, Graph graph1, Graph graph2, dict initial_mapping, bool save_order=False, bool strict=True) bool ¶
Return
True
if graph graph1 is isomorphic to graph graph2 with the optional initial mapping initial_mapping, orFalse
otherwise.
- is_subgraph_isomorphic(self, Graph graph1, Graph graph2, dict initial_mapping, bool save_order=False) bool ¶
Return
True
if graph graph1 is subgraph isomorphic to subgraph graph2 with the optional initial mapping initial_mapping, orFalse
otherwise.