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 rr_\infty when the coloring ceases to change (χrχr+1\chi^{r_\infty} \equiv \chi^{r_\infty+1}). The stabilized coloring is denoted χ3:=χr\chi^3 := \chi^{r_\infty}.

  • Distinguishing Power:

Two structures GG and HH are distinguished by 3-WL if the multiset of stabilized 3-colors differs between GG and HH (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 t=(v1,v2,v3)t = (v_1,v_2,v_3), build multiset MtM_t of all triples formed by replacing one coordinate with wVw \in V.
    • New color is given by an injective encoding of previous color and sorted multiset (Kiefer et al., 2017, Babel et al., 2010).
    • 1
      2
      3
      
      for t in V^3:
          M_t = { (χ(w,v2,v3), χ(v1,w,v3), χ(v1,v2,w)) for w in V }
          newχ[t] = encode(χ[t], sort_multiset(M_t))
  • Complexity:
    • Number of triples: O(n3)O(n^3) for graph of nn vertices.
    • Per round: O(n4logn)O(n^4 \log n) in careful implementations.
    • Number of rounds: Upper bound O(3n2logn)O(3 n^2 \log n) (Grohe et al., 2023), with naive theoretical bound O(n3)O(n^3) (Kiefer et al., 2017).
    • Total runtime: Typically O(n7logn)O(n^7 \log n) in naive form, but O(n4logn)O(n^4 \log n) 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):

rO(3n2logn)r_\infty \leq O(3 n^2 \log n)

This result uses algebraic embedding techniques, associating partitions of V3V^3 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Ω(n3/2)on graphs[2308.11970]r_\infty \geq \Omega(n^{3/2}) \quad \text{on graphs} \qquad [2308.11970]

Another construction gives larger lower bounds on relational structures:

rnΩ(3)r_\infty \geq n^{\Omega(3)}

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 k=3k=3):

Bound Type Structure Type Lower Bound Upper Bound
Worst-case Graph Simple graphs Ω(n3/2)\Omega(n^{3/2}) O(3n2logn)O(3 n^2 \log n)
Relational 3-ary structures nΩ(3)n^{\Omega(3)} O(3n2logn)O(3 n^2 \log n)

4. Logical Characterizations and Connections to First-order Counting

The iteration number required by the 3-WL procedure to distinguish GG and HH corresponds precisely to the quantifier rank of sentences in the 4-variable fragment C4C_4 of first-order logic with counting quantifiers. Formally:

  • 3-WL splits G,HG,H after rr rounds iff there exists a C4C_4-sentence of quantifier rank at most rr distinguishing them (Grohe et al., 2023).
  • Therefore, upper and lower bounds on rr_\infty translate into bounds on the quantifier rank necessary in C4C_4. Specifically:

$\text{Separation in $C_4$} \implies \text{Quantifier rank } O(n^2 \log n)$

  • Dually, lower bounds show the existence of graph pairs requiring quantifier rank nΩ(1)n^{\Omega(1)} in C4C_4.

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

The 3-WL algorithm generalizes naturally to graphons (measurable symmetric functions W:[0,1]2[0,1]W:[0,1]^2\to[0,1] as limit objects for dense graphs):

  • Color refinement for graphons:

Colors points (x1,x2,x3)X3(x_1,x_2,x_3) \in X^3 by distributions of edge values W(xi,xj)W(x_i, x_j) and recursively refines using probability measures over multisets derived from WW (Böker, 2021).

  • Homomorphism-density characterization:

3-WL indistinguishability of graphons U,WU, W is equivalent to equality of homomorphism densities t(F,U)=t(F,W)t(F,U) = t(F,W) for every multigraph FF of treewidth 2\leq 2.

In the graphon setting, parallel edges affect homomorphism densities; thus, the multigraph version of kk-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 W(G)W(G) generated by the adjacency matrix A(G)A(G), encapsulating automorphism orbits and providing a powerful algebraic invariant:

  • For most molecular and combinatorial graphs, W(G)W(G) coincides with the centralizer algebra of the automorphism group Aut(G)\mathrm{Aut}(G).
  • The stable partition returned by 3-WL (or its equivalent depth-one stabilization) matches the orbit partition of Aut(G)\mathrm{Aut}(G) 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 qq 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-$1$ stabilization" (Chen et al., 2023)
  • "Weisfeiler-Leman Indistinguishability of Graphons" (Böker, 2021)

Topic to Video (Beta)

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.