graph structures
Graph Isomorphism
You should know: graph basics
Overview
Two graphs are isomorphic if there exists a bijection between their vertex sets that preserves adjacency: an edge exists between two vertices in one graph exactly when an edge exists between their corresponding vertices in the other. Isomorphic graphs are structurally identical — they may look different when drawn (different vertex labels, positions) but represent the same abstract structure. Checking two graphs are NOT isomorphic is often easy using invariants (properties preserved by isomorphism, like degree sequence, number of vertices/edges, or number of triangles) that must match if the graphs are isomorphic; but proving two graphs ARE isomorphic, or finding an efficient general algorithm, remains a famously open problem — graph isomorphism is one of the few problems believed to be neither NP-complete nor solvable in polynomial time.
Intuition
Imagine two org charts drawn with employees at different positions on the page, using different names, but representing the exact same reporting structure. If you could relabel one chart's names to match the other and every reporting line would line up perfectly, the charts are isomorphic — same underlying structure, different surface presentation. Graph isomorphism asks exactly this: strip away labels and layout, and ask whether two graphs are 'the same shape'.
Formal Definition
Graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there is a bijection f preserving adjacency:
Worked Examples
Try the mapping f: 1→a, 2→b, 3→c. Check each edge of G1 maps to an edge of G2: edge 1-2 maps to a-b (present); edge 2-3 maps to b-c (present).
Both graphs have exactly 2 edges and the mapping preserves all of them with no extras, so f is a valid isomorphism.
Answer: Yes, isomorphic via f(1)=a, f(2)=b, f(3)=c (both are the path graph on 3 vertices).
Practice Problems
Graph G1 has 5 vertices and 6 edges. Graph G2 has 5 vertices and 7 edges. Can they be isomorphic?
Two companies each model their internal communication network as a graph with the same number of employees and the same degree sequence. Does matching degree sequences guarantee the networks are isomorphic?
Why is the graph isomorphism problem considered theoretically unusual in computational complexity?
Quiz
Summary
- Two graphs are isomorphic if an adjacency-preserving bijection exists between their vertices — they're structurally identical despite different labels/drawings.
- Invariants like degree sequence, edge count, and triangle count must match for isomorphic graphs, giving an easy way to disprove isomorphism.
- No efficient general algorithm for graph isomorphism is known, and its complexity status (neither known P nor believed NP-complete) remains a celebrated open problem.
Mathematics