ISMAGS.analyze_symmetry#
- ISMAGS.analyze_symmetry(graph, node_partitions, edge_colors)[source]#
Find a minimal set of permutations and corresponding co-sets that describe the symmetry of
graph
, given the node and edge equalities given bynode_partitions
andedge_colors
, respectively.- Parameters:
- graphnetworkx.Graph
The graph whose symmetry should be analyzed.
- node_partitionslist of sets
A list of sets containing node keys. Node keys in the same set are considered equivalent. Every node key in
graph
should be in exactly one of the sets. If all nodes are equivalent, this should be[set(graph.nodes)]
.- edge_colorsdict mapping edges to their colors
A dict mapping every edge in
graph
to its corresponding color. Edges with the same color are considered equivalent. If all edges are equivalent, this should be{e: 0 for e in graph.edges}
.
- Returns:
- set[frozenset]
The found permutations. This is a set of frozensets of pairs of node keys which can be exchanged without changing
subgraph
.- dict[collections.abc.Hashable, set[collections.abc.Hashable]]
The found co-sets. The co-sets is a dictionary of
{node key: set of node keys}
. Every key-value pair describes whichvalues
can be interchanged without changing nodes less thankey
.