Papers
Topics
Authors
Recent
Search
2000 character limit reached

3D Weisfeiler-Leman Algorithm

Updated 16 January 2026
  • The 3-dimensional WL algorithm is a refinement method that colors vertex triples to capture higher-order structural information in graphs and relational systems.
  • It employs iterative multiset hashing and efficient encoding procedures that provide strong discriminative power and clear bounds on iteration rounds.
  • Applications span graph isomorphism testing, logical characterization in finite model theory, and connections to cellular algebras in algebraic combinatorics.

The 3-dimensional Weisfeiler-Leman algorithm (3-WL) is a canonical combinatorial refinement procedure that operates on ordered triples of vertices in a graph or, more generally, within a finite relational structure. As a central tool in graph isomorphism testing, algebraic combinatorics, and finite model theory, 3-WL generalizes the color refinement algorithm (often termed 1-WL), providing substantially greater discriminative power by considering colored structures and homomorphism counts of treewidth at most 2. Recent work has deepened the understanding of its complexity, lower and upper bounds on iteration counts, its logical characterization, extensions to graphons, and connections to coherent algebras.

1. Formal Definition and Iterative Procedure

The 3-WL algorithm associates a coloring χr:V3Colors\chi^r : V^3 \to \mathrm{Colors} to the set of ordered vertex triples of a given relational structure G=(V,...)G = (V, ...), iteratively refining this coloring to encode increasingly fine-grained structural information.

  • Initialization (r=0r=0):

χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)

where atpG\mathrm{atp}_G is the isomorphism type of the induced substructure on {v1,v2,v3}\{v_1, v_2, v_3\} (including equality patterns and edge-relations).

  • Refinement (one round):

χr+1(v1,v2,v3):=(χr(v1,v2,v3),Mr(v1,v2,v3))\chi^{r+1}(v_1, v_2, v_3) := \left( \chi^r(v_1, v_2, v_3), \, M^r(v_1, v_2, v_3) \right)

where MrM^r is a multiset over all wVw \in V of the triples:

{(χr(w,v2,v3),χr(v1,w,v3),χr(v1,v2,w))wV}\left\{ (\chi^r(w, v_2, v_3),\, \chi^r(v_1, w, v_3),\, \chi^r(v_1, v_2, w)) \mid w \in V \right\}

  • Termination and Stability:

The process stabilizes after a finite number of rounds G=(V,...)G = (V, ...)0 when the coloring ceases to change (G=(V,...)G = (V, ...)1). The stabilized coloring is denoted G=(V,...)G = (V, ...)2.

  • Distinguishing Power:

Two structures G=(V,...)G = (V, ...)3 and G=(V,...)G = (V, ...)4 are distinguished by 3-WL if the multiset of stabilized 3-colors differs between G=(V,...)G = (V, ...)5 and G=(V,...)G = (V, ...)6 (Grohe et al., 2023, Babel et al., 2010, Grohe et al., 2023).

2. Algorithmic Implementation and Complexity

Algorithmic instantiations center on iteratively updating the coloring of triples via hashing, multisets, and efficient encoding schemes:

  • Pseudocode highlights:
    • For each triple G=(V,...)G = (V, ...)7, build multiset G=(V,...)G = (V, ...)8 of all triples formed by replacing one coordinate with G=(V,...)G = (V, ...)9.
    • New color is given by an injective encoding of previous color and sorted multiset (Kiefer et al., 2017, Babel et al., 2010).
    • χr+1(v1,v2,v3):=(χr(v1,v2,v3),Mr(v1,v2,v3))\chi^{r+1}(v_1, v_2, v_3) := \left( \chi^r(v_1, v_2, v_3), \, M^r(v_1, v_2, v_3) \right)4
  • Complexity:
    • Number of triples: r=0r=00 for graph of r=0r=01 vertices.
    • Per round: r=0r=02 in careful implementations.
    • Number of rounds: Upper bound r=0r=03 (Grohe et al., 2023), with naive theoretical bound r=0r=04 (Kiefer et al., 2017).
    • Total runtime: Typically r=0r=05 in naive form, but r=0r=06 is attainable through careful splitting and data structures (Babel et al., 2010).

3. Upper and Lower Bounds on Iteration Number

Recent work provides the first nontrivial bounds on the required number of refinement rounds for stabilization:

Upper Bound (3-WL):

r=0r=07

This result uses algebraic embedding techniques, associating partitions of r=0r=08 to semisimple matrix algebras, and leverages the chain length bound for increasing chains of semisimple subalgebras (Grohe et al., 2023).

Lower Bound (Worst-case):

r=0r=09

Another construction gives larger lower bounds on relational structures:

χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)0

The lower bounds are realized through Cay–Fürer–Immerman (CFI) constructions and compressed XOR gadgets that force the color refinement process to survive super-linear (and even polynomial) numbers of rounds.

Summary Table (Specialized to χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)1):

Bound Type Structure Type Lower Bound Upper Bound
Worst-case Graph Simple graphs χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)2 χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)3
Relational 3-ary structures χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)4 χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)5

4. Logical Characterizations and Connections to First-order Counting

The iteration number required by the 3-WL procedure to distinguish χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)6 and χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)7 corresponds precisely to the quantifier rank of sentences in the 4-variable fragment χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)8 of first-order logic with counting quantifiers. Formally:

  • 3-WL splits χ0(v1,v2,v3):=atpG(v1,v2,v3)\chi^0(v_1, v_2, v_3) := \mathrm{atp}_G(v_1, v_2, v_3)9 after atpG\mathrm{atp}_G0 rounds iff there exists a atpG\mathrm{atp}_G1-sentence of quantifier rank at most atpG\mathrm{atp}_G2 distinguishing them (Grohe et al., 2023).
  • Therefore, upper and lower bounds on atpG\mathrm{atp}_G3 translate into bounds on the quantifier rank necessary in atpG\mathrm{atp}_G4. Specifically:

atpG\mathrm{atp}_G5

  • Dually, lower bounds show the existence of graph pairs requiring quantifier rank atpG\mathrm{atp}_G6 in atpG\mathrm{atp}_G7.

5. Extensions: Graphons, Homomorphism Densities, and Linear Equation Systems

The 3-WL algorithm generalizes naturally to graphons (measurable symmetric functions atpG\mathrm{atp}_G8 as limit objects for dense graphs):

  • Color refinement for graphons:

Colors points atpG\mathrm{atp}_G9 by distributions of edge values {v1,v2,v3}\{v_1, v_2, v_3\}0 and recursively refines using probability measures over multisets derived from {v1,v2,v3}\{v_1, v_2, v_3\}1 (Böker, 2021).

  • Homomorphism-density characterization:

3-WL indistinguishability of graphons {v1,v2,v3}\{v_1, v_2, v_3\}2 is equivalent to equality of homomorphism densities {v1,v2,v3}\{v_1, v_2, v_3\}3 for every multigraph {v1,v2,v3}\{v_1, v_2, v_3\}4 of treewidth {v1,v2,v3}\{v_1, v_2, v_3\}5.

In the graphon setting, parallel edges affect homomorphism densities; thus, the multigraph version of {v1,v2,v3}\{v_1, v_2, v_3\}6-WL is strictly stronger than its simple graph variant. For ordinary graphs, the distinction vanishes due to integrality (Böker, 2021).

  • Linear/fractional isomorphism system:

Non-distinguishability by 3-WL is equivalent to the solvability of a system of linear equations on partial isomorphisms between graphs (and their infinite-dimensional analogue for graphons).

6. Algebraic Combinatorics and Cellular Algebras

The output of stabilized 3-WL colorings corresponds to the cellular algebra {v1,v2,v3}\{v_1, v_2, v_3\}7 generated by the adjacency matrix {v1,v2,v3}\{v_1, v_2, v_3\}8, encapsulating automorphism orbits and providing a powerful algebraic invariant:

  • For most molecular and combinatorial graphs, {v1,v2,v3}\{v_1, v_2, v_3\}9 coincides with the centralizer algebra of the automorphism group χr+1(v1,v2,v3):=(χr(v1,v2,v3),Mr(v1,v2,v3))\chi^{r+1}(v_1, v_2, v_3) := \left( \chi^r(v_1, v_2, v_3), \, M^r(v_1, v_2, v_3) \right)0.
  • The stable partition returned by 3-WL (or its equivalent depth-one stabilization) matches the orbit partition of χr+1(v1,v2,v3):=(χr(v1,v2,v3),Mr(v1,v2,v3))\chi^{r+1}(v_1, v_2, v_3) := \left( \chi^r(v_1, v_2, v_3), \, M^r(v_1, v_2, v_3) \right)1 in generic cases (Babel et al., 2010, Chen et al., 2023).
  • Efficient implementations allow handling graphs of several thousand vertices in practice.

7. Applications, Special Classes, and Limitations

Planar Graphs:

The WL-dimension of all finite planar graphs is at most 3, meaning 3-WL suffices to characterize them up to isomorphism. This improves previously best-known bounds from dimension 14 to 3 and ensures definability in first-order logic with counting using at most 4 variables. Exceptional 3-connected planar graphs with fixing number 3 require individualization of certain vertices, but 3-WL still resolves their orbits correctly (Kiefer et al., 2017).

Coherent Configurations and Depth-1 Stabilization:

A simplified depth-1 version of Weisfeiler’s deep stabilization ("W₁⁄₂", Editor's term) matches the distinguishing power of non-recursive 3-WL projected to pairs, both in terms of coherent configurations and computational complexity (Chen et al., 2023).

Limitations:

Some structures, such as incidence graphs of projective planes of order χr+1(v1,v2,v3):=(χr(v1,v2,v3),Mr(v1,v2,v3))\chi^{r+1}(v_1, v_2, v_3) := \left( \chi^r(v_1, v_2, v_3), \, M^r(v_1, v_2, v_3) \right)2 with at least two non-isomorphic planes, require WL-dimension at least 4 for identification.

References

  • "The Iteration Number of the Weisfeiler-Leman Algorithm" (Grohe et al., 2023)
  • "Compressing CFI Graphs and Lower Bounds for the Weisfeiler-Leman Refinements" (Grohe et al., 2023)
  • "The Weisfeiler-Leman Dimension of Planar Graphs is at most 3" (Kiefer et al., 2017)
  • "Algebraic Combinatorics in Mathematical Chemistry. Methods and Algorithms. II. Program Implementation of the Weisfeiler-Leman Algorithm" (Babel et al., 2010)
  • "On the Weisfeiler algorithm of depth-χr+1(v1,v2,v3):=(χr(v1,v2,v3),Mr(v1,v2,v3))\chi^{r+1}(v_1, v_2, v_3) := \left( \chi^r(v_1, v_2, v_3), \, M^r(v_1, v_2, v_3) \right)3 stabilization" (Chen et al., 2023)
  • "Weisfeiler-Leman Indistinguishability of Graphons" (Böker, 2021)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to 3-dimensional Weisfeiler-Leman Algorithm.