Graph TheoryTopic #24 of 40

Graph Isomorphism

Isomorphic graphs, graph invariants, and determining when two graphs are isomorphic.

Definition

Two graphs G1=(V1,E1)G_1 = (V_1, E_1) and G2=(V2,E2)G_2 = (V_2, E_2) are isomorphic if there exists a bijection f:V1V2f: V_1 \to V_2 such that: (u,v)E1    (f(u),f(v))E2(u, v) \in E_1 \iff (f(u), f(v)) \in E_2

Notation: G1G2G_1 \cong G_2

Intuitively, isomorphic graphs have the same structure — only vertex labels differ.

Graph Invariants

Properties preserved under isomorphism. If G1G2G_1 \cong G_2, they must have the same:

Basic Invariants

  • Number of vertices V|V|
  • Number of edges E|E|
  • Degree sequence (multiset of all degrees)

Structural Invariants

  • Number of connected components
  • Number of cycles of each length
  • Diameter (longest shortest path)
  • Girth (length of shortest cycle)
  • Chromatic number
  • Number of spanning trees

Spectral Invariants

  • Eigenvalues of adjacency matrix
  • Eigenvalues of Laplacian matrix

Using Invariants

Invariants can prove graphs are NOT isomorphic.

Example:

  • G1G_1: degree sequence (2,2,2,2)(2, 2, 2, 2)
  • G2G_2: degree sequence (3,2,2,1)(3, 2, 2, 1)

G1≇G2G_1 \not\cong G_2 because degree sequences differ.

Warning: Equal invariants don't prove isomorphism!

Degree Sequence Analysis

Matching Vertices

Vertices with the same degree in isomorphic graphs can only map to each other.

Neighbors' Degrees

If vv maps to ww, then neighbors of vv must map to neighbors of ww with matching degrees.

Algorithm for Small Graphs

  1. Check basic invariants (if different, not isomorphic)
  2. Partition vertices by degree
  3. Try to match vertices of same degree
  4. Verify adjacency relationships
  5. If a valid bijection exists, graphs are isomorphic

Examples

Non-Isomorphic Detection

Graphs with 4 vertices, 4 edges:

  • Square C4C_4: degree sequence (2,2,2,2)(2, 2, 2, 2)
  • K4K_4 minus edge: degree sequence (3,3,2,2)(3, 3, 2, 2)

Not isomorphic (different degree sequences).

Isomorphism Verification

Example: Are these isomorphic?

  • G1G_1: vertices {1,2,3,4}\{1,2,3,4\}, edges {(1,2),(2,3),(3,4),(4,1)}\{(1,2), (2,3), (3,4), (4,1)\}
  • G2G_2: vertices {a,b,c,d}\{a,b,c,d\}, edges {(a,b),(b,c),(c,d),(d,a)}\{(a,b), (b,c), (c,d), (d,a)\}

Both are 4-cycles with degree sequence (2,2,2,2)(2,2,2,2).

Bijection: 1a,2b,3c,4d1 \to a, 2 \to b, 3 \to c, 4 \to d preserves adjacency.

Therefore G1G2G_1 \cong G_2.

Automorphisms

An automorphism of a graph is an isomorphism from the graph to itself.

Automorphism Group

The set of all automorphisms forms a group under composition, denoted Aut(G)\text{Aut}(G).

Examples

  • Complete graph KnK_n: Aut(Kn)=n!|\text{Aut}(K_n)| = n!
  • Path PnP_n: Aut(Pn)=2|\text{Aut}(P_n)| = 2 (identity and reversal)
  • Cycle CnC_n: Aut(Cn)=2n|\text{Aut}(C_n)| = 2n (rotations and reflections)

Vertex-Transitive Graphs

A graph is vertex-transitive if for any two vertices u,vu, v, there exists an automorphism mapping uu to vv.

Examples: Complete graphs, cycles, hypercubes.

Labeled vs. Unlabeled Graphs

Labeled Graphs

Vertices have distinct labels. Two labeled graphs are isomorphic if there's a label-preserving bijection (i.e., they're identical).

Unlabeled Graphs

We consider graphs the same if isomorphic.

Counting

nnLabeled simple graphsUnlabeled simple graphs
111
222
384
46411
5102434

Labeled: 2(n2)2^{\binom{n}{2}} (each potential edge is present or not)

Computational Complexity

Graph Isomorphism Problem

Given two graphs, determine if they're isomorphic.

  • Not known to be in P
  • Not known to be NP-complete
  • Quasipolynomial time algorithm exists (Babai, 2015)

Subgraph Isomorphism Problem

Given GG and HH, is HH isomorphic to a subgraph of GG?

This problem is NP-complete.

Canonical Forms

A canonical form assigns a unique representative to each isomorphism class.

Canonical Labeling

Relabel vertices in a standard way so isomorphic graphs get identical representations.

Applications

  • Graph databases
  • Chemical structure comparison
  • Network analysis