roveac.isomorphism_hasher
Isomorphism Hashers
This module provides the IsomorphismHasher class, which defines a method for hashing a graph to check for isomorphisms among known keys in a dictionary.
Classes
- IsomorphismHasher
Class for hashing graphs and checking for isomorphisms.
Classes
Class for hashing graphs and retrieving matching isomorphic keys. |
- class roveac.isomorphism_hasher.IsomorphismHasher
Class for hashing graphs and retrieving matching isomorphic keys.
Methods
- hash(G: nx.Graph, mapping: dict, method: str) -> tuple[list, dict]
Hashes the given graph and returns a list of matching isomorphic keys from the dictionary.
- classmethod hash(G: Graph, mapping: dict, method: str = 'triangle') tuple[list, dict]
Takes in a graph known to be among the keys of mapping and hashes it, returning a matching list of isomorphic keys and the corresponding isomorphism data.
The last key in the returned list should represent a graph for the time being.
Parameters
- Gnx.Graph
The graph to be hashed and checked for isomorphisms.
- mappingdict
A dictionary where keys are graph representations to check for isomorphism with G.
- methodstr
Denotes which method to use to hash.
Returns
- tuple[list, dict]
A tuple containing:
A list of keys in mapping that are isomorphic to G.
A dictionary representing the isomorphism data for the matches.