Weisfeiler–Leman Algorithm
   HOME

TheInfoList



OR:

In
graph theory In mathematics, graph theory is the study of ''graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conne ...
and
theoretical computer science Theoretical computer science (TCS) is a subset of general computer science and mathematics that focuses on mathematical aspects of computer science such as the theory of computation, lambda calculus, and type theory. It is difficult to circumsc ...
, 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 In mathematics, an isomorphism is a structure-preserving mapping between two structures of the same type that can be reversed by an inverse mapping. Two mathematical structures are isomorphic if an isomorphism exists between them. The word is ...
or not.


History


Description

We define a sequence of vertex colourings cr^t defined as follows: * cr^0is the initial colouring. If the graph is unlabeled, the initial colouring assigns a trivial color cr^0(v) to each vertex v. If the graph is labeled, cr^0(v) is the label of vertex v. * For all vertices v, we set cr^(v) = \left(cr^t(v), \\right). In other words, the new color of the vertex v is the pair formed from the previous color and the
multiset In mathematics, a multiset (or bag, or mset) is a modification of the concept of a set that, unlike a set, allows for multiple instances for each of its elements. The number of instances given for each element is called the multiplicity of that e ...
of the colors of its neighbors. This algorithm keeps refining the current colouring. At some point, before n steps, where n is the number of vertices, it stabilises: cr^tdoes not change anymore when t increases. This final colouring is called the ''stable colouring''.


Expressivity

This algorithm does not distinguish a cycle of length 6 from a pair of triangles (example V.1 in ).


Complexity

The stable colouring is computable in O((n+m)log n) where n is the number of vertices and m the number of edges. This complexity has been proven to be optimal for some class of graphs.


References

{{ci, date=September 2022 Graph algorithms Isomorphism theorems