Abstract
Graph learning is crucial in the fields of bioinformatics, social networks, and chemicals. Although high-order graphlets, such as cycles, are critical to achieving an informative graph representation for node classification, edge prediction, and graph recognition, modeling high-order topological characteristics poses significant computational challenges, restricting its widespread applications in machine learning. To address this limitation, we introduce the concept of message detouring to hierarchically characterize cycle representation throughout the entire graph, which capitalizes on the contrast between the shortest and longest pathways within a range of local topologies associated with each graph node. The topological feature representations derived from our message detouring landscape demonstrate comparable expressive power to high-order Weisfeiler-Lehman (WL) tests but much less computational demands. In addition to the integration with graph kernel and message passing neural networks, we present a novel message detouring neural network, which uses Transformer backbone to integrate cycle representations across nodes and edges. Aside from theoretical results, experimental results on expressiveness, graph classification, and node classification show message detouring can significantly outperform current counterpart approaches on various benchmark datasets.
Introduction: The MPNN Expressivity Gap
Standard Message Passing Neural Networks (MPNNs) are widely used in graph learning but suffer from a fundamental theoretical limitation: they are no more expressive than the 1-Weisfeiler-Lehman (1-WL) isomorphism test. This "blind spot" prevents them from distinguishing between graphs that are locally similar but globally distinct, particularly regarding high-order structures like cycles.
While high-order tests such as 3-WL can identify these cycles, their computational complexity—scaling exponentially with the number of nodes ($O(V^k)$)—makes them impractical for large-scale applications in chemistry or social network analysis.
Methodology: Message Detouring
To overcome this, we propose Message Detouring, a method that characterizes cycles by examining the contrast between shortest paths and alternative "detour" paths.
Detour Number (k-DeN)
For any given edge, the detour number is defined as the count of alternative paths (detours) of length up to $k$ that connect the same endpoints. The presence of a detour path directly implies the existence of a cycle. Crucially, we prove that a 1-WL test initialized with these detour numbers can achieve the expressive power of high-order $k$-WL tests.
Implementation Architectures
We present three ways to leverage message detouring:
- WL DeN: A graph kernel using detour-initialized labels.
- DeN-weighted MPNN: Using detour numbers as edge weights in standard GNNs (e.g., GCN, GIN).
- Message Detouring Neural Network (MDNN): A Transformer-based architecture that processes "message tokens" combining node features, positional encodings, and detour numbers via multi-head self-attention.
Experimental Results
Our approach was evaluated across synthetic and real-world benchmarks:
- Expressivity: On the EXP and CEXP datasets, which are designed to be indistinguishable by 1-WL and 2-WL tests, MDNN achieved 100% accuracy.
- Graph Classification: MDNN consistently outperformed baselines. For instance, on the MUTAG dataset, it showed a 3.31% improvement over the standard GIN model.
- Node Classification: The impact was most significant in node-level tasks. On the Wisconsin dataset, adding MDNN features to a GIN model resulted in a 37.38% accuracy boost.
Conclusion
Message Detouring provides a computationally efficient bridge between simple message passing and expensive high-order WL tests. By explicitly modeling cycles through local detour searches, it enables GNNs to capture critical topological features with minimal overhead. Future work will explore extending this logic to directed graphs and even more scalable architectures.
Summary updated