Colour refinement 2026-11-05
Colour refinement repeatedly separates vertices of a graph according to the colours of their neighbours. Its colours are labels for classes of vertices with the same currently visible structure; they are not a proper vertex colouring requiring adjacent vertices to differ. In individualization-refinement graph search, colour refinement reduces ambiguity before the algorithm branches.[ref]
Practical graph isomorphism, II by Brendan D. McKay and Adolfo Piperno. Section3.1, equitable refinement and Algorithm1
Let be a vertex's colour after round . One conceptual update assigns a common new colour exactly when both the previous colour and neighbour-colour multiset agree:The encoding must give distinct labels to distinct signatures. Retaining prevents old classes from merging. When no class splits, the resulting partition of a set is an equitable partition: vertices in the same cell have equal numbers of neighbours in every cell.
For an original example, start all vertices of the six-vertex path graph with the same colour. The first round separates endpoints from internal vertices . The next separates , which each have an endpoint neighbour, from , which do not. The three cellsare then stable. Reflection of the path exchanges the two vertices in each cell, so the remaining pairs are compatible with a genuine graph automorphism.
Colour refinement is invariant under vertex relabeling. To compare two graphs, colour signatures must be encoded consistently across both, for example by refining their disjoint union of graphs with shared initial colour meanings. A different count of vertices in a resulting colour class certifies graph non-isomorphism.
Agreement is weaker than isomorphism. Starting with one colour, both the complete bipartite graph and the triangular prism graph remain one six-vertex cell because every vertex has three neighbours. Yet the prism has triangles and has none. This failure motivates individualizing vertices and searching further; stable colour classes are not, in general, proof that all their vertices are related by graph automorphisms.
Equitable partition 2026-11-05
An equitable partition of a finite graph groups vertices so that any two vertices in one cell have the same number of neighbours in each cell. For a simple graph with cells , this means that numbersdo not depend on which in is selected. Here denotes the set of neighbours of . These counts form the equitable quotient matrix . An equitable partition need not be a proper vertex colouring and need not have cells of equal sizes.[ref]
Practical graph isomorphism, II by Brendan D. McKay and Adolfo Piperno. Section3.1 and footnote1, equitable-partition terminology
An original five-vertex path graph has an equitable partitionEach endpoint has one neighbour in ; each member of has one neighbour in and one in ; the middle vertex has two neighbours in . Although the graph is undirected, is not symmetric matrix, because its entries count neighbours per vertex rather than total edges between cells. Counting those edges from both ends gives .
The counts also compress an exact part of the adjacency matrix. Let be that matrix and let have one column per cell, with for and zero otherwise. ThenIndeed, counts neighbours of in , which is exactly . Hence implies . Since nonempty disjoint cells make the columns of linearly independent, gives : every eigenvalue of is an eigenvalue of . For the displayed example, these include and .
An equitable partition preserves neighbour counts, not all adjacency information. The disjoint union of graphs of a triangle and a four-vertex cycle has an equitable one-cell partition, since every vertex has two neighbours. Nevertheless, no graph automorphism can send a triangle vertex to a four-cycle vertex: their connected components of a graph are not isomorphic. This distinguishes equitable cells from symmetry orbits and explains why colour refinement may leave ambiguity.
Individualization-refinement graph search 2026-11-05
Individualization-refinement graph search explores possible vertex labelings while repeatedly distinguishing vertices by their adjacency structure. It combines inexpensive colour refinement with branching when refinement leaves indistinguishable vertices. This is a framework for canonical graph labeling and graph automorphism computation, rather than a claim that degree information alone decides graph isomorphism.[ref]
Practical graph isomorphism, II by Brendan D. McKay and Adolfo Piperno. Sections2.3–2.4, search tree and canonical forms; §3.1, refinement
Start with an ordered partition of a set of the vertex set, representing any prescribed vertex colours. Within each cell, compare the number of neighbours each vertex has in every current cell. Split a cell whenever those count vectors differ, and repeat until no further split occurs. The result is an equitable partition. A discrete partition of a set, with one vertex per cell, gives a candidate vertex ordering.
If a cell still has several vertices, choose a target cell by a rule preserved under relabeling. For each possible chosen vertex in that cell, make that vertex a singleton, refine again and continue recursively. The leaves provide candidate encodings of the adjacency matrix. Choosing a fixed extremal encoding over the complete search gives a canonical representative. Implementations use valid node invariants and discovered graph automorphisms to prune branches without changing the result.[ref]
For an original example, label a six-vertex cycle graph temporarily as , with adjacency modulo6. Starting with one cell, every vertex has two neighbours, so colour refinement alone leaves one cell. Individualizing vertex0and refining givesVertices1and5remain indistinguishable because reflection fixing0exchanges them. Individualizing one of them resolves the remaining pairs. The temporary names explain the search; they cannot be used as invariant tie-breakers that silently discard the other possible labeling.
By contrast, two disjoint triangles also begin with six vertices of degree2, but after individualizing one vertex the refined cell sizes are1,2,3. The cycle's sizes are1,2,2,1. Thus this branch detects structure that initial degree refinement misses. Highly symmetric graphs can still require extensive search; refinement is a reduction of the search space, not a universal small bound on it.