In graph theory and theoretical computer science, the colour refinement algorithm also known as the naive vertex classification, or the 1-dimensional version of the Weisfeiler-Leman algorithm, is a routine used for testing whether two graphs are isomorphic. While it solves graph isomorphism on almost all graphs, there are graphs such as all regular graphs that cannot be distinguished using colour refinement.
Description.
The algorithm takes as an input a graph formula_1 with formula_2 vertices. It proceeds in iterations and in each iteration produces a new colouring of the vertices. Formally a "colouring" is a function from the vertices of this graph into some set (of "colours"). In each iteration, we define a sequence of vertex colourings formula_3 as follows:
In other words, the new colour of the vertex formula_6 is the pair formed from the previous colour and the multiset of the colours of its neighbours.
This algorithm keeps refining the current colouring. At some point it stabilises, i.e., formula_12. This final colouring is called the "stable colouring".
Graph Isomorphism.
Colour refinement can be used as a subroutine for an important computational problem: graph isomorphism. In this problem we have as input two graphs formula_13 and our task is to determine whether they are isomorphic. Informally, this means that the two graphs are the same up to relabelling of vertices.
To test if formula_14 and formula_15 are isomorphic we could try the following. Run colour refinement on both graphs. If the stable colourings produced are different we know that the two graphs are not isomorphic. However, it could be that the same stable colouring is produced despite the two graphs not being isomorphic; see below.
Complexity.
It is easy to see that if colour refinement is given a formula_2 vertex graph as input, a stable colouring is produced after at most formula_17 iterations. Conversely, there exist graphs where this bound is realised. This leads to a formula_18 implementation where formula_19 is the number of vertices and formula_20 the number of edges. This complexity has been proven to be optimal under reasonable assumptions.
Expressivity.
We say that two graphs formula_14 and formula_15 are "distinguished" by colour refinement if the algorithm yields a different output on formula_14 as on formula_15. There are simple examples of graphs that are not distinguished by colour refinement. For example, it does not distinguish a cycle of length 6 from a pair of triangles (example V.1 in ). Despite this, the algorithm is very powerful in that a random graph will be identified by the algorithm asymptotically almost surely. Even stronger, it has been shown that as formula_2 increases, the proportion of graphs that are "not" identified by colour refinement decreases exponentially in order formula_2.
The expressivity of colour refinement also has a logical characterisation: two graphs can be distinguished by colour refinement if and only if they can be distinguished by the two variable fragment of first order logic with counting.
References.
 ;templatestyles src="Reflist/styles.css" / ;