WIPIVERSE All articles

Graph isomorphism

Definition
In graph theory, a graph isomorphism is a bijective mapping $f$ between the vertex sets of two graphs $G = (V_G,E_G)$ and $H = (V_H,E_H)$ such that for every pair of vertices $u,v \in V_G$,

$$ {u,v} \in E_G \quad\Longleftrightarrow\quad {f(u),f(v)} \in E_H . $$

If such a mapping exists, the graphs $G$ and $H$ are called isomorphic and are regarded as structurally identical, differing only in the labeling of their vertices.

Formal description
Let $V_G = {v_1,\dots ,v_n}$ and $V_H = {w_1,\dots ,w_n}$.
An isomorphism is a permutation $\pi$ of ${1,\dots ,n}$ satisfying

$$ \forall i,j\in{1,\dots ,n}:\ (v_i,v_j)\in E_G \iff (w_{\pi(i)},w_{\pi(j)})\in E_H . $$

Equivalently, the adjacency matrices $A_G$ and $A_H$ are related by

$$ A_H = P^\top A_G P, $$

where $P$ is the permutation matrix corresponding to $\pi$.

Examples

  • Two cycles $C_4$ drawn with different vertex labels are isomorphic via a rotation or reflection of the square.
  • A complete graph $K_n$ is isomorphic only to itself (up to relabeling), since every pair of vertices is adjacent.

Computational complexity
The graph isomorphism problem (GI) asks whether two given finite graphs are isomorphic. Its complexity status is distinctive:

  • GI belongs to the class NP (a proposed bijection serves as a polynomial‑size certificate).
  • GI is not known to be NP‑complete, and it is widely believed not to be.
  • In 2015, László Babai announced a quasi‑polynomial time algorithm for GI, running in $\exp\bigl((\log n)^{O(1)}\bigr)$ time, where $n$ is the number of vertices. This result places GI in a complexity class strictly between P and NP‑complete for the worst case, though the algorithm has not yet been fully verified by the broader community to the same extent as classic P‑time results.

Polynomial‑time special cases

Graph class Reason for tractability
Bounded degree (max degree $d$) Luks (1982) gave an $,n^{O(d)}$ algorithm.
Bounded treewidth Dynamic programming on tree decompositions yields polynomial time.
Planar graphs Hopcroft and Wong (1974) provided an $O(n \log n)$ algorithm.
Interval graphs, permutation graphs, and many other hereditary classes Structural constraints enable canonical forms computable in polynomial time.

Algorithms and approaches

  • Canonical labeling – computes a unique representation (e.g., a lexicographically smallest adjacency matrix) for each isomorphism class. Tools such as nauty and Traces implement sophisticated backtracking combined with pruning heuristics.
  • Group‑theoretic methods – treat the set of all automorphisms of a graph as a permutation group; Luks’ algorithm leverages the structure of such groups for bounded‑degree graphs.
  • Invariant‑based filters – vertex degree sequences, eigenvalues of the adjacency matrix, or Weisfeiler–Leman color refinement are employed as quick tests that can rule out non‑isomorphic pairs before more expensive search.

Applications

  • Chemical informatics – determining equivalence of molecular graphs (atoms as vertices, bonds as edges).
  • Pattern recognition – matching substructures in computer vision and network analysis.
  • Database indexing – canonical forms enable efficient storage and retrieval of graph‑structured data.
  • Cryptography – some public‑key schemes (e.g., based on graph isomorphism) rely on the assumed hardness of GI.

Related concepts

  • Graph automorphism: an isomorphism from a graph to itself; the set of all automorphisms forms the graph’s automorphism group.
  • Subgraph isomorphism: asks whether a smaller graph appears as an induced (or not) subgraph of a larger one; this problem is NP‑complete.
  • Isomorphism testing for other structures: analogous notions exist for hypergraphs, directed graphs, and labeled graphs, each with its own algorithmic nuances.

References (selected)

  1. L. Babai, “Graph isomorphism in quasipolynomial time,” Proceedings of the 48th Annual ACM Symposium on Theory of Computing (STOC), 2016.
  2. E. M. Luks, “Isomorphism of graphs of bounded valence can be tested in polynomial time,” Proceedings of the 18th Annual ACM Symposium on Theory of Computing, 1982.
  3. J. H. Hopcroft and J. W. Wong, “Linear time algorithm for isomorphism of planar graphs,” Proceedings of the 15th Annual ACM Symposium on Theory of Computing, 1974.
  4. B. D. McKay, “nauty and Traces,” Computer Physics Communications, 2021.

This entry provides an objective overview of the concept of graph isomorphism as established in mathematical and computer‑science literature.

Browse

More topics to explore

    Browse all articles