August 26, 2024

P85 - Graph isomorphism.

Two graphs G1(N1,E1) and G2(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 method that determines whether two graphs are isomorphic.

> Graph.fromString("[a-b]").isIsomorphicTo(Graph.fromString("[5-7]"))
  res0: Boolean = true
Be first to comment
Leave a reply