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 by node_partitions and edge_colors, respectively.


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}.


The found permutations. This is a set of frozensets of pairs of node keys which can be exchanged without changing subgraph.

dict[, set[]]

The found co-sets. The co-sets is a dictionary of {node key: set of node keys}. Every key-value pair describes which values can be interchanged without changing nodes less than key.