Distance-Restricted Folklore Weisfeiler-Leman GNNs with Provable Cycle Counting Power
Junru Zhou, Jiarui Feng, Xiyuan Wang, Muhan Zhang
Abstract
The ability of graph neural networks (GNNs) to count certain graph substructures, especially cycles, is important for the success of GNNs on a wide range of tasks. It has been recently used as a popular metric for evaluating the expressive power of GNNs. Many of the proposed GNN models with provable cycle counting power are based on subgraph GNNs, i.e., extracting a bag of subgraphs from the input graph, generating representations for each subgraph, and using them to augment the representation of the input graph. However, those methods require heavy preprocessing, and suffer from high time and memory costs. In this paper, we overcome the aforementioned limitations of subgraph GNNs by proposing a novel class of GNNs-d-Distance-Restricted FWL(2) GNNs, or d-DRFWL(2) GNNs, based on the well-known FWL(2) algorithm. As a heuristic method for graph isomorphism testing, FWL(2) colors all node pairs in a graph and performs message passing among those node pairs. In order to balance the expressive power and complexity, d-DRFWL(2) GNNs simplify FWL(2) by restricting the range of message passing to node pairs whose mutual distances are at most d. This way, d-DRFWL(2) GNNs exploit graph sparsity while avoiding the expensive subgraph extraction operations in subgraph GNNs, making both the time and space complexity lower. We theoretically investigate both the discriminative power and the cycle counting power of d-DRFWL(2) GNNs. Our most important finding is that d-DRFWL(2) GNNs have provably strong cycle counting power even with d = 2: they can count all 3, 4, 5, 6-cycles. Since 6-cycles (e.g., benzene rings) are ubiquitous in organic molecules, being able to detect and count them is crucial for achieving robust and generalizable performance on molecular tasks. Experiments on both synthetic datasets and molecular datasets verify our theory. To the best of our knowledge, 2-DRFWL(2) GNN is the most efficient GNN model to date (both theoretically and empirically) that can count up to 6-cycles.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 95e10295-1495-47e0-aa59-c5f230caca2aCited by top-tier papers7
- Beyond Weisfeiler-Lehman: A Quantitative Framework for GNN ExpressivenessBohang Zhang, Jingchu Gai, Yiheng Du, Qiwei Ye et al.ICLR 2024 · 59 citations
- K-hop Hypergraph Neural Network: A Comprehensive Aggregation ApproachLinhuang Xie, Shihao Gao, Jie Liu, Ming Yin et al.AAAI 2025 · 7 citations
- Weisfeiler and Leman Go Loopy: A New Hierarchy for Graph Representational LearningRaffaele Paolino, Sohir Maskey, Pascal Welke, Gitta KutyniokNeurIPS 2024 · 4 citations
- Graph As Point SetXiyuan Wang, Pan Li, Muhan ZhangICML 2024 · 4 citations
- Towards Stable, Globally Expressive Graph Representations with Laplacian EigenvectorsJunru Zhou, Cai Zhou, Xiyuan Wang, Pan Li et al.KDD 2026 · 2 citations
Builds on21
- Open Graph Benchmark: Datasets for Machine Learning on GraphsWeihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong et al.NeurIPS 2020 · 3,935 citations
- Simple and Deep Graph Convolutional NetworksMing Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding et al.ICML 2020 · 1,910 citations
- Strategies for Pre-training Graph Neural NetworksWeihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik et al.ICLR 2020 · 1,744 citations
- Directional Message Passing for Molecular GraphsJohannes Klicpera, Janek Groß, Stephan GünnemannICLR 2020 · 1,079 citations
- Principal Neighbourhood Aggregation for Graph NetsGabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò et al.NeurIPS 2020 · 914 citations
Related papers
- Boosting the Cycle Counting Power of Graph Neural Networks with I-GNNsYinan Huang, Xingang Peng, Jianzhu Ma, Muhan ZhangICLR 2023 · 3 citations
- Can Graph Neural Networks Count Substructures?Zhengdao Chen, Lei Chen, Soledad Villar, Joan BrunaNeurIPS 2020 · 392 citations
- Graph Neural Networks Can (Often) Count SubstructuresPaolo Pellizzoni, Till Hendrik Schulz, Karsten M. BorgwardtICLR 2025
- On the Power of the Weisfeiler-Leman Test for Graph Motif ParametersMatthias Lanzinger, Pablo BarcelóICLR 2024 · 11 citations
- Going Deeper into Permutation-Sensitive Graph Neural NetworksZhongyu Huang, Yingheng Wang, Chaozhuo Li, Huiguang HeICML 2022 · 35 citations
