Graph Isomorphism: Same Adjacency Pattern, Different Names and Drawings

What an isomorphism is

A drawing of a graph is only one way to display a set of vertices and a set of edges. Two drawings can look completely different and still describe the same structure. The formal statement is:


Definition. Simple graphs G and H are isomorphic, written G ≅ H, if there is a bijection f : V(G) → V(H) such that for every pair of vertices u, v, uv is an edge of G if and only if f(u)f(v) is an edge of H. Such an f is an isomorphism.


Both directions of the “if and only if” matter. A bijection that merely sends edges to edges could send a path on three vertices into a triangle, landing on two of the triangle's three edges while the triangle has an extra edge with no preimage.


If the two graphs have the same number of edges, edges-to-edges is enough, because a bijection that sends each edge to a distinct edge then uses up every edge of H.


In matrix language, G ≅ H exactly when some permutation matrix P satisfies P AG PT = AH, where AG and AH are the adjacency matrices: relabelling vertices permutes rows and columns together.

Worked example: two drawings of a 5-cycle

Let G be the pentagon with vertices 1, 2, 3, 4, 5 in order and edges 12, 23, 34, 45, 51. Let H be the five-pointed star with vertices v1, …, v5 around a circle and edges joining every second point: v1v3, v3v5, v5v2, v2v4, v4v1.


The star has crossings and the pentagon has none, yet following the star's edges traces a single closed route through all five vertices.


The map 1→v1, 2→v3, 3→v5, 4→v2, 5→v4 sends the five edges of G to the five edges of H, and both graphs have five edges, so it is an isomorphism.


The “obvious” map 1→v1, 2→v2, … fails immediately, because 12 would go to v1v2, which is not an edge of the star. Failure of one bijection proves nothing about isomorphism; only the failure of every bijection, or a differing invariant, proves non-isomorphism.

Invariants: fast proofs that two graphs differ

An invariant is any quantity or property that every isomorphism preserves. Useful ones include:


  • the number of vertices and the number of edges;
  • the degree sequence, because an isomorphism sends each vertex to a vertex with the same number of neighbours;
  • connectedness and the number of connected components;
  • the number of cycles of each length, and the length of the shortest cycle;
  • local patterns, such as “a vertex of degree 3 adjacent to two vertices of degree 1”.


Properties of a drawing are not invariants. Whether edges cross, how long they look, where a vertex sits, and what the vertices are named all change under redrawing without changing the graph.

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.


Example. The 6-cycle C6 and the graph made of two separate triangles both have six vertices, six edges and every degree equal to 2.


Their degree sequences agree, yet C6 is connected and the two triangles form two components. Connectedness is an invariant, so they are not isomorphic. One differing invariant proves non-isomorphism.


Agreement on commonly checked invariants such as vertex count, edge count, degree sequence, connectedness, and selected cycle counts does not in general prove isomorphism; these particular invariants are not complete.


An explicit adjacency-preserving bijection, or an equivalent complete-invariant argument, can prove isomorphism; for the graphs in this concept, exhibiting and checking the bijection is the practical route.

Building a mapping systematically

  1. Check the cheap invariants first: vertex count, edge count, degree sequence.
  2. Match vertices by degree, then by the degrees of their neighbours. A degree-3 vertex whose neighbours have degrees (3, 2, 1) can only map to a degree-3 vertex with the same neighbour-degree multiset.
  3. Fix the forced choices, make one free choice at a time, and propagate: once u → x is chosen, neighbours of u must go to neighbours of x.
  4. Verify every edge of the first graph lands on an edge of the second and that the edge counts match.


Matching degrees is necessary but not sufficient. A degree-preserving bijection can still send an edge to a non-edge, so step 4 is not optional.

Counting isomorphisms

If f : G → H is one isomorphism, every other isomorphism is f composed with an automorphism of G (an isomorphism from G to itself). So the number of isomorphisms from G to H equals the number of automorphisms of G.


For the 4-cycle with vertices 1, 2, 3, 4 in order, vertex 1 can go to any of the 4 positions, and its two neighbours can then be placed in 2 orders; everything else is forced.


That gives 4 × 2 = 8 automorphisms, the rotations and reflections of a square. Counting this way, by following which choices remain genuinely free, is far more reliable than listing bijections.

Let G and H be simple graphs, and let f : V(G) → V(H) be a function. Which condition on f is exactly the definition of f being a graph isomorphism?

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Refer to the figure. Graphs A and C each have six vertices and nine edges, and every vertex in both graphs has degree 3. Which observation, on its own, proves that A and C are not isomorphic?

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Graph G has vertex set {1, 2, 3, 4, 5, 6} and the adjacency matrix below (a 1 in row i, column j means i and j are adjacent).


1

2

3

4

5

6

1

0

1

1

1

0

0

2

1

0

1

0

1

0

3

1

1

0

0

0

0

4

1

0

0

0

0

1

5

0

1

0

0

0

0

6

0

0

0

1

0

0

Graph H has vertex set {q, r, s, t, u, v} and edge list qt, qu, qv, rs, st, tv.

Each proposed bijection below sends every vertex of G to a vertex of H with the same degree. Which one is an isomorphism from G to H?

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Three simple graphs, each with six labelled vertices and nine edges. Graph A has vertices a–f, graph B has vertices 1–6, and graph C has vertices p–u. Edges cross only where no vertex dot is drawn; a crossing is not a vertex.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors