The idea would be to have the nodes have a representation of themselves which reference their characteristic variables (their name, the name/module of any incoming functions, args, kwargs, etc.) plus their order in the execution and their parent. All of this will be hashed. Thus to check if a graph is different from another we can check if any of the nodes has a different characteristic hash.
Note that these hashes may not be unique, since source nodes would all look the same, but that may be ok. As a consequence we won't be able to use these as node names for networkx.
The idea would be to have the nodes have a representation of themselves which reference their characteristic variables (their name, the name/module of any incoming functions, args, kwargs, etc.) plus their order in the execution and their parent. All of this will be hashed. Thus to check if a graph is different from another we can check if any of the nodes has a different characteristic hash.
Note that these hashes may not be unique, since source nodes would all look the same, but that may be ok. As a consequence we won't be able to use these as node names for networkx.