Colour refinement algorithm

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

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.[1] While it solves graph isomorphism on almost all graphs, there are graphs such as all regular graphs that cannot be distinguished using colour refinement.

History

[edit | edit source]

The colour refinement algorithm appears in a chemistry paper in 1965.[2]

Description

[edit | edit source]

The algorithm takes as an input a graph G with n 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 λi as follows:

  • λ0 is the initial colouring. If the graph is unlabelled, the initial colouring assigns a trivial colour λ0(v) to each vertex v. If the graph is labelled, λ0 is the label of vertex v.
  • For all vertices v, we set λi+1(v)=(λi(v),{{λi(w)w is a neighbor of v}}).

In other words, the new colour of the vertex v 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., λi+1(u)=λi+1(v) if and only if λi(u)=λi(v). This final colouring is called the stable colouring.

Graph Isomorphism

[edit | edit source]

Colour refinement can be used as a subroutine for an important computational problem: graph isomorphism. In this problem we have as input two graphs G,H 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 G and H 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

[edit | edit source]

It is easy to see that if colour refinement is given a n vertex graph as input, a stable colouring is produced after at most n1 iterations. Conversely, there exist graphs where this bound is realised.[3] This leads to a O((n+m)logn) implementation where n is the number of vertices and m the number of edges.[4] This complexity has been proven to be optimal under reasonable assumptions.[5]

Expressivity

[edit | edit source]

We say that two graphs G and H are distinguished by colour refinement if the algorithm yields a different output on G as on H. 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 [6]). Despite this, the algorithm is very powerful in that a random graph will be identified by the algorithm asymptotically almost surely.[7] Even stronger, it has been shown that as n increases, the proportion of graphs that are not identified by colour refinement decreases exponentially in order n.[8]

Equivalent Characterizations

[edit | edit source]

For two graphs G and H, the following conditions are equivalent:

History

[edit | edit source]

References

[edit | edit source]
  1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  9. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  12. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  13. ^ Grohe, Martin. "Finite variable logics in descriptive complexity theory." Bulletin of Symbolic Logic 4.4 (1998): 345-398.
  14. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  15. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).