Table of Contents
Fetching ...

Distance-Restricted Folklore Weisfeiler-Leman GNNs with Provable Cycle Counting Power

Junru Zhou, Jiarui Feng, Xiyuan Wang, Muhan Zhang

TL;DR

The paper addresses the limited cycle-counting power of standard GNNs by introducing distance-restricted d-DRFWL(2) GNNs, which pass messages only between node pairs within a fixed distance $d$. The authors formalize distance-restricted FWL(2) tests, prove a hierarchy where expressive power increases with $d$, and establish concrete cycle-counting capabilities: 2-DRFWL(2) can count up to 6-cycles, while 3-DRFWL(2) reaches 7-cycles, all with significantly improved time/space efficiency over subgraph GNNs. They provide detailed theoretical results and empirical validation on synthetic substructure counting and molecular property tasks, showing competitive or superior performance and substantially lower preprocessing memory costs. The approach balances expressive power and scalability, enabling robust cycle-aware representations essential for chemistry and related domains, though it faces scalability challenges on graphs with large average degree and future work is needed to further optimize preprocessing.

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. $d$-DRFWL(2) GNNs use node pairs whose mutual distances are at most $d$ as the units for message passing to balance the expressive power and complexity. By performing message passing among distance-restricted node pairs in the original graph, $d$-DRFWL(2) GNNs avoid the expensive subgraph extraction operations in subgraph GNNs, making both the time and space complexity lower. We theoretically show that the discriminative power of $d$-DRFWL(2) GNNs strictly increases as $d$ increases. More importantly, $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, our model is the most efficient GNN model to date (both theoretically and empirically) that can count up to 6-cycles.

Distance-Restricted Folklore Weisfeiler-Leman GNNs with Provable Cycle Counting Power

TL;DR

The paper addresses the limited cycle-counting power of standard GNNs by introducing distance-restricted d-DRFWL(2) GNNs, which pass messages only between node pairs within a fixed distance . The authors formalize distance-restricted FWL(2) tests, prove a hierarchy where expressive power increases with , and establish concrete cycle-counting capabilities: 2-DRFWL(2) can count up to 6-cycles, while 3-DRFWL(2) reaches 7-cycles, all with significantly improved time/space efficiency over subgraph GNNs. They provide detailed theoretical results and empirical validation on synthetic substructure counting and molecular property tasks, showing competitive or superior performance and substantially lower preprocessing memory costs. The approach balances expressive power and scalability, enabling robust cycle-aware representations essential for chemistry and related domains, though it faces scalability challenges on graphs with large average degree and future work is needed to further optimize preprocessing.

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 -- -Distance-Restricted FWL(2) GNNs, or -DRFWL(2) GNNs. -DRFWL(2) GNNs use node pairs whose mutual distances are at most as the units for message passing to balance the expressive power and complexity. By performing message passing among distance-restricted node pairs in the original graph, -DRFWL(2) GNNs avoid the expensive subgraph extraction operations in subgraph GNNs, making both the time and space complexity lower. We theoretically show that the discriminative power of -DRFWL(2) GNNs strictly increases as increases. More importantly, -DRFWL(2) GNNs have provably strong cycle counting power even with : 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, our model is the most efficient GNN model to date (both theoretically and empirically) that can count up to 6-cycles.
Paper Structure (64 sections, 37 theorems, 123 equations, 7 figures, 14 tables)

This paper contains 64 sections, 37 theorems, 123 equations, 7 figures, 14 tables.

Key Result

Theorem 3.1

In terms of the ability to distinguish between non-isomorphic graphs, the $d$-DRFWL(2) test is strictly more powerful than WL(1), for any $d\geqslant 1$.

Figures (7)

  • Figure 1: Neighbor aggregation in 2-DRFWL(2) for 2-tuple $(u,v)$.
  • Figure 2: Illustrations of node-level counts of certain substructures.
  • Figure 3: Illustration on the counterexample used in the proof of the separation result in Theorem \ref{['power_and_separation_of_drfwl2']}. Here we take $d=3$ and a $(3d+1)$-cycle, or 10-cycle, is shown. It is clear that for a distance-$(d+1)$ tuple there are nodes on both the inferior arc and the superior arc that contribute to its update. Contrarily, for a distance-$d$ tuple only nodes on the inferior arc contribute.
  • Figure 4: Illustrations of certain substructure counts.
  • Figure 5: The four types of redundant 4-walks requiring subtraction in the proof of Lemma \ref{['can_pair_level_count_4_path_lemma']}. Each of the 4 situations is obtained by coalescing one or more node pairs from $(u,z)$, $(x,z)$ and $(x,v)$ in a 4-walk $u\rightarrow x\rightarrow y\rightarrow z\rightarrow v$, while subject to constraints $u\ne y$ and $y\ne v$.
  • ...and 2 more figures

Theorems & Definitions (74)

  • Definition 2.1: Graph-level count
  • Definition 2.2: Node-level count
  • Theorem 3.1
  • Theorem 3.2
  • Definition 4.1
  • Definition 4.2
  • Theorem 4.3
  • Theorem 4.4
  • Theorem 4.5
  • Theorem 4.6
  • ...and 64 more