---
title: Graph Isomorphism Problem
url: https://www.emergentmind.com/topics/graph-isomorphism-problem
type: topic
---

# Graph Isomorphism Problem

The graph isomorphism problem (GI) is the algorithmic question of determining whether there exists a bijection between the vertex sets of two given graphs that preserves adjacency. This problem occupies a unique complexity-theoretic intermediate position: although it lies in NP, it is not known to be either NP-complete or solvable in polynomial time for all general graphs. Graph isomorphism has achieved particular prominence due to its role in combinatorics, theoretical computer science, quantum computation, group theory, and numerous practical domains spanning chemistry to social network analysis. Over decades, diverse algorithmic paradigms—combinatorial, group-theoretic, spectral, optimization-based, and quantum—have been developed, each bringing fundamentally distinct insights and partial breakthroughs to the structural theory and practical solvability of GI.

## 1. Formal Problem Statement and Mathematical Framework

Given two simple undirected graphs \( G=(V,E) \) and \( H=(U,F) \), with \(|V| = |U| = n\), the graphs are isomorphic (denoted \( G \cong H \)) if there exists a bijection \( f: V \rightarrow U \) such that
\[
\{v, w\} \in E \iff \{f(v), f(w)\} \in F \quad \forall\, v, w \in V.
\]
Equivalently, for their adjacency matrices \( A_G, A_H \in \mathbb{R}^{n \times n} \), we have \( A_H = P A_G P^\top \) for some permutation matrix \( P \). Thus, testing isomorphism is tantamount to checking whether \( A_G \) and \( A_H \) are permutation-similar. This permutation-matrix formulation underpins most optimization, spectral, and algebraic approaches [2311.16912, 1611.00711, 1808.02070, 1411.0969].

## 2. Combinatorial and Group-Theoretic Algorithms

Classical combinatorial algorithms often operate via vertex and edge invariants, canonical labeling, or refinement of colorings (partitions) on the vertex set. The Weisfeiler–Lehman (WL) color refinement hierarchy is the central technique here: the $d$-dimensional WL algorithm successively refines colorings of $d$-tuples, with power increasing in $d$, but does not solve the general problem due to known indistinguishable (CFI) counterexamples [1012.2081]. 

Group-theoretic methods, notably the Babai–Luks framework, leverage permutation group decomposition, composition series, and setwise stabilizer computations, with sub-exponential worst-case time \( 2^{O(\sqrt{n \log n})} \) for bounded-degree graphs, and Babai’s 2016 quasi-polynomial breakthrough for general graphs [1012.2081, 1602.08371]. For unit square graphs, a reduction to bounded-degree quotients and Luks-style recursion yields polynomial time despite NP-hardness of geometric recognition [1602.08371].

The uniqueness tree method generates a leveled tree rooted at each vertex, encoding iterative propagation of vertex uniqueness along neighborhoods, and compares these structures with worst-case \(O(n^7)\) but much better average scaling [1606.06399].

Classes with strong local structural uniqueness admit specialized polynomial algorithms. For example, when every pair of immediate neighbors have distinct local degree-profiles (as formalized via neighborhood-degree lists), a unique invariant signature (“UID”) can be derived in $O(n^4)$ time [1711.08222].

## 3. Spectral, Linear, and Semidefinite Relaxation Methods

Spectral methods exploit the adjacency spectrum and eigenstructure: isomorphic graphs are cospectral, but not all cospectral graphs are isomorphic. For “friendly” graphs (distinct eigenvalues, nonzero sum eigenvectors), the isomorphism reduces to a linear assignment via matching eigenvectors, yielding polynomial time, and the approach extends to arbitrary graphs via handling eigenspace symmetries using eigenpolytopes, cost matrices, and iterative symmetry-breaking perturbations [1411.0969]. Linear programming and convex relaxations (LP, SDP) further generalize these ideas: under certain combinatorial reductions (such as the auxiliary compatibility or “clique” graph), a single SDP’s optimum reveals whether the original graphs are isomorphic, and rounding recovers the bijection. The recent claim of a strict polynomial-time SDP for GI, if fully substantiated, would place GI ∈ P [1908.06320].

Randomized determinant-based fingerprinting, as introduced in [1808.02070], compares the determinants of masked random polynomial functions of the adjacency matrices. For nearly all pairs, this Monte Carlo test identifies isomorphism in $O(n^{2.373})$ time, with negligible failure probability for all but a measure-zero set of highly symmetric pairs.

Continuous relaxations replace the discrete permutation polytope with the set of orthogonal or doubly-stochastic matrices. By penalizing non-permutation solutions, Frank–Wolfe or conditional gradient algorithms efficiently converge to isomorphisms in practice, especially on highly symmetric graphs [2311.16912].

## 4. Algebraic, Category-Theoretic, and Canonical Forms

Algebraic approaches recast isomorphism as orbit equivalence under the action of $S_n$ on adjacency matrices: GI becomes an instance of the general orbit problem—testing G-orbit equivalence in a representation $V$ [1012.2081]. Approximating this with finite “approximate categories” $C_d(V)$, one obtains a hierarchy strictly refining the Weisfeiler–Lehman algorithms, distinguishing otherwise undetectable pairs (e.g., Cai–Fürer–Immerman graphs) in polynomial time for each fixed $d$. The unresolved question is whether bounded $d$ suffices for all graphs, which would imply GI ∈ P.

Graph canonization seeks unique (often order-invariant) representations of each isomorphism class. For certain structural classes (e.g., the “permissible” graphs of [1711.08222]), UID traversals give such canonical forms in polynomial time. For general graphs, canonical forms via spectral or algebraic invariants encounter challenges from symmetries and isospectral non-isomorphic cases [1411.0969, 2111.09696].

Foundational work also connects vertex graphs and edge graphs via duality and matrix canonicalization, reducing GI to checking equality of canonical adjacency forms after prescribed normalization transformations [1007.1059].

## 5. Quantum and Quantum-Inspired Algorithms

Quantum algorithms for GI have pursued three primary directions:

- **Quantum Annealing**: Encoding the adjacency structure into an Ising Hamiltonian and reading out global quantum observables (energy, spin-glass order parameter, etc.) yields “graph fingerprints”; numerical evidence shows that even strongly regular, cospectral graph pairs are distinguished by these signatures [1207.1712].
- **Adiabatic and Variational Quantum Algorithms**: Encoding GI as a quadratic unconstrained binary optimization (QUBO) instance (with $n^2$ variables), one can use adiabatic evolution or Quantum Approximate Optimization Algorithm (QAOA) or Variational Quantum Eigensolver (VQE). Isomorphic pairs display clustering in the variational energy landscape, allowing isomorphism detection even in small systems [1304.5773, 2111.09821].
- **Quantum Invariant Extraction**: Quantum circuits compute graph invariants unavailable to classical spectral methods. Notably, the histogram of induced-subgraph edge counts obtained via phase estimation on graph-encoded unitaries distinguishes more strongly regular graph pairs than spectrum alone, and is invariant under isomorphism. However, some non-isomorphic pairs remain indistinguishable, so completeness remains open [2209.14914].

Quantum computation thus introduces new invariants and practical algorithms that, within current limits, surpass classical invariants in discriminatory power for small graphs and strongly regular families.

## 6. Extensions, Limitations, and Open Problems

Numerous special cases admit polynomial-time algorithms: planar graphs, graphs of bounded degree or treewidth, and intersection graphs of specific geometric classes (e.g., unit-square graphs) [1602.08371]. However, for general graphs, Babai’s quasi-polynomial algorithm remains the most general deterministic guarantee [1012.2081]. Many theoretically powerful relaxations—SDP, LP, spectral, and categories—achieve polynomial time only under additional algebraic/spectral hypotheses or for fixed hierarchy depth.

Several limitations remain:

- No proof exists that any spectral or quantum invariant completely characterizes isomorphism classes [2209.14914].
- LP and SDP relaxations may require infeasibly large instances for practical large-scale graphs [1908.06320, 1611.00711].
- The minimum gap in adiabatic or quantum annealing schemes is not well-understood; possible exponential slowdowns remain unaddressed [1304.5773, 1207.1712].
- For highly symmetric graphs, randomized or heuristic algorithms (including determinant fingerprints and LP techniques) may fail or require impractical repetition [1808.02070, 1611.00711].

The frontier continues to shift: fundamental open problems include whether the graph isomorphism problem is in P, whether category-theoretic or SDP-based relaxations are universally complete, and what the ultimate power of quantum invariants and algorithms is for this archetypal problem.

---

**Table: Algorithmic Paradigms for GI**

| Paradigm           | Worst-case Complexity       | Completeness/Remarks                              |
|--------------------|----------------------------|---------------------------------------------------|
| Weisfeiler–Lehman  | Poly($n$) for fixed $d$    | Fails for CFI graphs unless $d = \Omega(n)$       |
| Babai–Luks         | Quasi-polynomial [Babai '16]| Deterministic, general graphs                     |
| Spectral Assignment| Poly($n$) for friendly/compact| Breaks down for high symmetry; heuristic extensions|
| LP/SDP Relaxation  | Poly($n$) (size-dependent)  | Claimed for full GI in [1908.06320]; scale limits |
| Quantum Invariant  | Poly($n$), O($n^4$)        | Strictly refines spectrum; not universally complete|
| Annealing/QAOA/VQE | Poly($n$) (small $n$)      | Empirical clustering in small instances           |

References: [1012.2081], [1602.08371], [1606.06399], [1411.0969], [1908.06320], [1808.02070], [2311.16912], [1611.00711], [2209.14914], [1304.5773], [2111.09821], [1207.1712], [1711.08222], [1007.1059], [1710.09526], [2111.09696]

Source: https://www.emergentmind.com/topics/graph-isomorphism-problem