I was wondering if someone has a good idea for checking whether two graphs are the same (for example, based on an adjacency matrix). Ideally, in a computational efficient manner that can be done on large collections of small graphs (3-30 nodes)
To illustrate the probblem, depending on how I enumerate the different nodes in the same graph, the same nodes may appear in different places of the adjacency matrix. Or in other words, we have a many-to-one mapping scenario where many different adjacency matrix can encode the same graph.
For instance, assume I have a undirected, unweighted graph like this:
a) The adjacency matrix rotated, transposed, or otherwise modified could yield the same graph. Similar, changing the node numbering in the graph
would result in a adjacency matrix that has different entries as the one shown above but encodes the same graph:
$$ \begin{bmatrix} 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 1 & 1 \\ 2 & 0 & 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 & 1 & 0 \end{bmatrix} $$
Do you know a way for checking whether two adjacency matrices encode the same graph?