This paper provides a new, intuitive way to understand the Weisfeiler-Lehman (WL) distance—a metric used to compare graphs with node features—by framing it through the lens of stochastic processes and Causal Optimal Transport. By simplifying the underlying mathematics, the authors provide rigorous theoretical guarantees for Message Passing Graph Neural Networks (MP-GNNs), proving they are stable (Lipschitz continuous) and universal approximators under this distance metric.
What Problem Does This Paper Address?
The Weisfeiler-Lehman (WL) test is a cornerstone of graph theory, used to determine if two graphs are isomorphic (structurally identical). In recent years, it has become the primary tool for analyzing the expressive power of Graph Neural Networks.
However, the classic WL test is binary: graphs are either isomorphic or they aren't. To handle real-world noise and similarity, researchers recently developed the WL distance, which "metrizes" the test to measure how different two graphs are. While powerful, the original formulation of the WL distance was mathematically dense and difficult to apply to neural network analysis. This paper addresses that complexity, providing a more accessible interpretation and using it to bridge the gap between graph distance theory and the practical properties of GNNs, such as stability and universality.
Methods
The authors' primary contribution is a reinterpretation of the WL distance using Markovian couplings.
Standard Optimal Transport (like the Wasserstein distance) finds the cheapest way to transform one probability distribution into another. When comparing graphs, we can view them as Markov chains where "random walkers" move between nodes. A Markovian coupling is a way to "sync" two random walks—one on graph $X$ and one on graph $Y$—into a single walk on a product space $X \times Y$ (see Figure 1).
The authors prove that the WL distance of depth $k$ is equivalent to finding the optimal Markovian coupling that minimizes the expected distance between node labels at exactly step $k$. They further connect this to Causal Optimal Transport (COT), a specialized branch of transport theory designed for stochastic processes where the coupling at time $t$ cannot depend on future states.
Datasets
Not discussed in the paper. This is a theoretical work focusing on mathematical proofs and the development of new frameworks for graph comparison.
Key Insights and Ideas
- The "Step $k$" Intuition: The original WL distance was defined through a complex, recursive measure-theoretic process. This paper shows it is simply the expected difference between node labels after $k$ steps of a "smartly coupled" random walk (Figure 2). This makes the distance much easier to visualize and reason about.
- Bicausal Coupling Connection: By proving the WL distance is a form of bicausal COT, the authors link graph theory to a mature field of mathematics used in finance and sequence modeling. This suggests that efficient, existing algorithms (like Sinkhorn iterations) could be adapted to compute graph distances.
- Stability as a First-Class Citizen: The paper moves beyond just asking "can a GNN distinguish these graphs?" to "is the GNN stable?" By using the WL distance as a metric, they can formally define what it means for a GNN to be stable under small structural perturbations.
Key Results
- Equivalence to COT: The authors formally prove (Theorems 3.7 and 3.12) that the WL distance is exactly equivalent to a bicausal optimal transport problem between path distributions of Markov chains.
- GNN Discriminative Power: They show that even a very restricted class of MP-GNNs (those using simple multi-layer perceptrons with 1D hidden layers) is sufficient to match the full discriminative power of the WL distance (Theorem 4.3).
- Lipschitz Continuity: The paper proves that standard MP-GNNs are Lipschitz continuous with respect to the WL distance (Theorem 4.5). This provides a theoretical guarantee that these networks are stable: small changes in the input graph structure or labels lead to small changes in the network's output.
- Universal Approximation: They establish a universal approximation theorem (Theorem 4.7), showing that MP-GNNs can approximate any continuous function defined on a compact set of graphs, provided the distance between graphs is measured using the WL metric.
Limitations and Future Work
While the connection to Causal Optimal Transport is theoretically significant, the authors leave the development of practical, efficient algorithms for computing these distances for future research.
Additionally, the current framework assumes that the graphs being compared share the same label space (e.g., both have node features in $\mathbb{R}^d$). Extending the WL distance to handle graphs with entirely different types of node features is a suggested next step. Finally, the universal approximation results are currently limited to compact subspaces of graphs, which may not encompass all possible graph structures encountered in the wild.
Summary updated