Introduction
Graph kernels are fundamental for measuring similarity between structured data, such as molecules or social networks. For over a decade, the Weisfeiler-Lehman (WL) subtree kernel has been the gold standard. However, the WL method is inherently "rigid"—it treats two node neighborhoods as either identical or completely different. This paper introduces the Relaxed Weisfeiler-Lehman ($R-WL$) kernel, which uses Wasserstein clustering and a specialized tree edit distance to recognize similar neighborhoods, significantly improving performance on complex and noisy datasets.
The Problem: Rigid Equality in Graph Comparison
The standard WL kernel works by iteratively relabeling nodes based on their neighbors. Each label represents an unfolding tree, a hierarchical representation of a node's neighborhood structure.
As shown above, even minor differences in graph structure lead to distinct unfolding trees. In the standard WL kernel, if two trees differ by even a single edge or node, they are treated as entirely different. In dense or noisy graphs, this "all-or-nothing" approach causes the kernel to lose its ability to find meaningful patterns, as almost every node quickly receives a unique label—a phenomenon known as "shattering" the node set.
The Proposed Solution: Relaxed Weisfeiler-Lehman ($R-WL$)
The authors propose a "finer grade" of similarity by relaxing the strict equality constraint. Instead of binary matching, they cluster similar unfolding trees together and relabel nodes based on their cluster identity.
Key Innovations
- SDTED (Structure and Depth Preserving Tree Edit Distance): A specialized tree edit distance for unfolding trees. Unlike general tree edit distance, SDTED can be calculated in polynomial time by enforcing that nodes can only be mapped to others at the same depth.
- The Wasserstein Connection: The authors proved that SDTED is mathematically equivalent to the Wasserstein distance (Earth Mover's Distance) between vectors representing the trees. This allows the use of efficient optimal transport algorithms.
- Wasserstein k-means Clustering: Nodes are relabeled based on cluster IDs rather than raw labels. Two neighborhoods are considered "equivalent" if they are structurally similar enough to fall into the same cluster. This effectively "slows down" the WL process, allowing the model to aggregate statistics over similar structures.
Experimental Results
The $R-WL$ kernel was evaluated across social networks, molecular graphs, and a new benchmark of dense "ego networks" (EGONETS).
- Dominance on Dense Graphs: On the
EGONETSdatasets, the $R-WL^*$ variant (a faster approximation) outperformed standard WL and other state-of-the-art methods by a staggering margin—often over 20% in accuracy. - Robustness to Noise: In synthetic tests with added structural noise, the $R-WL$ kernel maintained 100% accuracy while competitors' performance degraded rapidly as noise increased.
- Molecular Data: On simple molecular graphs (e.g.,
MUTAG), the method performed on par with existing kernels. The authors note that in chemistry, rigid comparisons are often preferred because a tiny structural change (like one atom) can completely change a molecule's properties.
Conclusion
The Relaxed Weisfeiler-Lehman kernel provides a powerful alternative to traditional graph kernels, particularly for dense and noisy data where structural similarity is more informative than exact isomorphism. By bridging the gap between rigid symbolic labeling and continuous distance metrics, $R-WL$ enables more robust machine learning on complex graph structures.
Summary updated