August 21, 2024

P85 - Graph isomorphism

Two graphs (n1 e1) and (n2 e2) are isomorphic if there is a bijection f: n1 -> n2 such that for any nodes x,y of n1, x and y are adjacent if and only if f(x) and f(y) are adjacent.

Write a function that determines whether two graphs are isomorphic. Hint: Use an open-ended list to represent the function f.

Be first to comment
Leave a reply