Isomorphism#
- stereomolgraph.algorithms.isomorphism.vf2pp_all_isomorphisms(g1: MolGraph | StereoMolGraph | CondensedReactionGraph | StereoCondensedReactionGraph, g2: MolGraph | StereoMolGraph | CondensedReactionGraph | StereoCondensedReactionGraph, atom_labels: None | tuple[Mapping[AtomId, int], Mapping[AtomId, int]] = None, stereo: bool = False, stereo_change: bool = False, subgraph: bool = False) Iterator[dict[AtomId, AtomId]]#
Find all isomorphisms between two graphs.
Defined in: https://doi.org/10.1021/acs.jcim.5c02523
- Parameters:
g1 (
MolGraph|StereoMolGraph|CondensedReactionGraph|StereoCondensedReactionGraph) – First graphg2 (
MolGraph|StereoMolGraph|CondensedReactionGraph|StereoCondensedReactionGraph) – Second graphatom_labels (
None|tuple[Mapping[int,int],Mapping[int,int]]) – Optional precomputed atom labels for both graphs, if none defaults to color refinement. (default:None)stereo (
bool) – Whether to consider stereochemistry in the isomorphism (default:False)stereo_change (
bool) – Whether to consider stereochemistry changes in the isomorphism (default:False)subgraph (
bool) – Whether to find subgraph isomorphisms instead of graph isomorphisms (Currently only limited support and not well tested.) (default:False)
- Return type:
Iterator[dict[int,int]]- Returns:
An iterator of all isomorphisms, where each isomorphism is represented as a dictionary mapping atom ids of g1 to atom ids of g2.