= Graph Isomorphism

Test whether two graphs have the same structure (a bijection between vertices
that preserves edges).

[cols="1,1,3"]
|===
| Algorithm | Complexity | When to use

| xref:algorithms/isomorphism/isomorphism.adoc[Isomorphism]
| _O(\|V\|!)_ worst case
| Test if two graphs are isomorphic (same structure, same size). Simple
  backtracking implementation.

| xref:algorithms/isomorphism/vf2_sub_graph_iso.adoc[VF2 Subgraph Isomorphism]
| _O(V^2^)_ best / _O(V! · V)_ worst
| Test if one graph is isomorphic to an induced subgraph of another.
  Also exposes `vf2_graph_iso` for full-graph isomorphism and
  `vf2_subgraph_mono` for non-induced subgraphs. Finds all matches via a
  callback.

| xref:algorithms/isomorphism/mcgregor_common_subgraphs.adoc[McGregor Common Subgraphs]
| Exponential
| Find the largest subgraph common to two graphs.
|===

NOTE: All graph isomorphism algorithms have exponential worst-case complexity.
In practice they are fast on most real-world graphs due to pruning, but they
can be slow on highly symmetric or regular graphs.
