networkx 2.8.2 Pypi GitHub Homepage
Other Docs

During the construction of an isomorphism, the algorithm considers two candidate nodes n1 in G1 and n2 in G2. The graphs G1 and G2 are then compared with respect to properties involving n1 and n2, and if the outcome is good, then the candidate nodes are considered isomorphic. NetworkX provides a simple mechanism for users to extend the comparisons to include node and edge attributes.

Node attributes are handled by the node_match keyword. When considering n1 and n2, the algorithm passes their node attribute dictionaries to node_match, and if it returns False, then n1 and n2 cannot be considered to be isomorphic.

Edge attributes are handled by the edge_match keyword. When considering n1 and n2, the algorithm must verify that outgoing edges from n1 are commensurate with the outgoing edges for n2. If the graph is directed, then a similar check is also performed for incoming edges.

Focusing only on outgoing edges, we consider pairs of nodes (n1, v1) from G1 and (n2, v2) from G2. For graphs and digraphs, there is only one edge between (n1, v1) and only one edge between (n2, v2). Those edge attribute dictionaries are passed to edge_match, and if it returns False, then n1 and n2 cannot be considered isomorphic. For multigraphs and multidigraphs, there can be multiple edges between (n1, v1) and also multiple edges between (n2, v2). Now, there must exist an isomorphism from "all the edges between (n1, v1)" to "all the edges between (n2, v2)". So, all of the edge attribute dictionaries are passed to edge_match, and it must determine if there is an isomorphism between the two sets of edges.

Module to simplify the specification of user-defined equality functions for node and edge attributes during isomorphism checks.

Module to simplify the specification of user-defined equality functions for node and edge attributes during isomorphism checks.

During the construction of an isomorphism, the algorithm considers two candidate nodes n1 in G1 and n2 in G2. The graphs G1 and G2 are then compared with respect to properties involving n1 and n2, and if the outcome is good, then the candidate nodes are considered isomorphic. NetworkX provides a simple mechanism for users to extend the comparisons to include node and edge attributes.

Node attributes are handled by the node_match keyword. When considering n1 and n2, the algorithm passes their node attribute dictionaries to node_match, and if it returns False, then n1 and n2 cannot be considered to be isomorphic.

Edge attributes are handled by the edge_match keyword. When considering n1 and n2, the algorithm must verify that outgoing edges from n1 are commensurate with the outgoing edges for n2. If the graph is directed, then a similar check is also performed for incoming edges.

Focusing only on outgoing edges, we consider pairs of nodes (n1, v1) from G1 and (n2, v2) from G2. For graphs and digraphs, there is only one edge between (n1, v1) and only one edge between (n2, v2). Those edge attribute dictionaries are passed to edge_match, and if it returns False, then n1 and n2 cannot be considered isomorphic. For multigraphs and multidigraphs, there can be multiple edges between (n1, v1) and also multiple edges between (n2, v2). Now, there must exist an isomorphism from "all the edges between (n1, v1)" to "all the edges between (n2, v2)". So, all of the edge attribute dictionaries are passed to edge_match, and it must determine if there is an isomorphism between the two sets of edges.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/isomorphism/vf2userfunc.py#0
type: <class 'module'>
Commit: