Abstract
Graph isomorphism testing is usually approached via the comparison of graph invariants. Two popular alternatives that offer a good trade-off between expressive power and computational efficiency are combinatorial (i.e., obtained via the Weisfeiler-Leman (WL) test) and spectral invariants. While the exact power of the latter is still an open question, the former is regularly criticized for its limited power, when a standard configuration of uniform pre-coloring is used. This drawback hinders the applicability of Message Passing Graph Neural Networks (MPGNNs), whose expressive power is upper bounded by the WL test. Relaxing the assumption of uniform pre-coloring, we show that one can increase the expressive power of the WL test ad infinitum. Following that, we propose an efficient pre-coloring based on spectral features that provably increase the expressive power of the vanilla WL test. The above claims are accompanied by extensive synthetic and real data experiments. The code to reproduce our experiments is available at https://github.com/TPFI22/Spectral-and-Combinatorial
Introduction
The expressive power of Graph Neural Networks (GNNs) is fundamentally linked to the Weisfeiler-Leman (WL) graph isomorphism test. Most Message Passing GNNs (MPGNNs) are bounded by the 1-WL test, which fails to distinguish certain non-isomorphic graphs that share identical local neighborhood structures. A prominent example is the pair of molecules Decalin and Bicyclopentyl. Under standard uniform pre-coloring, where every node begins with the same label, 1-WL assigns identical descriptors to these distinct structures because local message passing cannot break their inherent symmetry.
Methods
This research proposes a novel approach to bypass the 1-WL limitation by modifying node initialization through pre-coloring. Instead of uniform initialization, the authors introduce equivariant features computed prior to the GNN's operation.
Theoretical Framework
The paper proves that using a pre-coloring that refines a previous one results in a strictly more powerful WL test. Theoretically, using the diagonal of the $k$-WL test as a pre-coloring for 1-WL allows one to traverse the entire WL hierarchy, effectively reaching "infinite" expressive power.
Spectral Pre-coloring
To make this practical, the authors leverage Spectral Graph Theory. They utilize the Heat Kernel ($H_t = e^{-tL}$), derived from the graph Laplacian ($L$). For each node, the pre-coloring includes:
- The "heat" remaining at the node after a diffusion process.
- Quantiles of the heat distribution across other nodes.
To ensure scalability for large graphs, Model Order Reduction (MOR) techniques approximate the heat kernel using only the smallest eigenvalues, avoiding full eigendecomposition.
Experimental Results
The proposed Spectral Pre-processed (SP) GNNs were evaluated across synthetic and real-world datasets.
- Synthetic Benchmarks: On the Decalin/Bicyclopentyl test, a standard GIN model achieved only ~64% accuracy. With spectral pre-coloring (SP-GIN), accuracy soared to 99%.
- Social Networks: The method proved exceptionally effective on social networks, which often lack node features. On the COLLAB dataset, SP-GAT improved classification accuracy by 22% compared to the vanilla version.
- Bio/Molecular Data: Improvements were also observed across standard benchmarks like MUTAG, PTC, and PROTEINS.
Discussion and Conclusion
The core insight is that GNN expressivity can be enhanced by injecting global structural information into local message-passing architectures. Spectral features provide a "global map" of the graph, which local layers then refine. While the method introduces hyperparameters like time scales for the heat kernel, it offers a robust way to improve performance without altering the underlying GNN architecture. This work opens new avenues for exploring other equivariant pre-colorings to balance computational cost and expressive power.
Summary updated