Fast Local Subgraph Counting
Qiyan Li, Jeffrey Xu Yu
Abstract
We study local subgraph counting queries, Q = ( p, o ), to count how many times a given k -node pattern graph p appears around every node υ in a data graph G when the given center node o in p maps to υ. Such local subgraph counting becomes important in GNNs (Graph Neural Networks), where incorporating such counts for every node in G into the GNN architecture enhances the model's ability to capture complex relationships within the graph G. It is challenging to count by subgraph isomorphism, which is known to be NP-hard. In this paper, we propose a novel approach by tree-decomposition-based counting. For a complex pattern graph p in Q , we find its best tree decomposition T , where a node in T represents a subgraph of p , and a node in p may appear in multiple nodes in T. Let p ( T ) be the pattern represented by T. Our approach is to count p ( T ) by homomorphism with a constraint to count the subgraph in every tree node by subgraph isomorphism. We apply symmetry-breaking rules to reduce the cost of counting by subgraph isomorphism for every node in T , and we develop a new multi-join algorithm to compute such counts. We confirm that our approach on a single machine using a single core can outperform the others significantly.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Subgraph Enumeration: Beyond Tree Decomposition cites RapidMatch: A Holistic Approach to Subgraph Query Processing
- Subgraph Enumeration: Beyond Tree Decomposition cites Peregrine: a pattern-aware graph mining system
- Subgraph Enumeration: Beyond Tree Decomposition cites Subgraph Matching: A New Decomposition Based Approach
- Subgraph Enumeration: Beyond Tree Decomposition cites Versatile Equivalences: Speeding up Subgraph Query Processing and Subgraph Matching
- Ordered Subgraph Aggregation Networks cites Graph Neural Networks with Local Graph Parameters
- Subgraph Matching: A New Decomposition Based Approach cites RapidMatch: A Holistic Approach to Subgraph Query Processing
- Subgraph Matching: A New Decomposition Based Approach cites Versatile Equivalences: Speeding up Subgraph Query Processing and Subgraph Matching
- Efficient GPU-Accelerated Local Subgraph Counting cites Ordered Subgraph Aggregation Networks
- Efficient GPU-Accelerated Local Subgraph Counting cites Graph Neural Networks with Local Graph Parameters
Cited by top-tier papers5
- Subgraph Matching: A New Decomposition Based ApproachQiyan Li, Jeffrey Yu, Zongyan HeVLDB 2025 · 3 citations
- Subgraph Enumeration: Beyond Tree DecompositionQiyan Li, Jeffrey Xu Yu, Zongyan HeVLDB 2026
- Efficient and Adaptive Estimation of Local Triadic CoefficientsIlie Sarpe, Aristides GionisVLDB 2025
- Clique Number Estimation via Differentiable Functions of Adjacency Matrix PermutationsIndradyumna Roy, Eeshaan Jain, Soumen Chakrabarti, Abir DeICLR 2025
- Efficient GPU-Accelerated Local Subgraph CountingQiao He, Yiran Li, Man Lung Yiu, Jieming ShiVLDB 2026
Builds on14
- Peregrine: a pattern-aware graph mining systemKasra Jamshidi, Rakesh Mahadasa, Keval VoraEuroSys 2020 · 107 citations
- RapidMatch: A Holistic Approach to Subgraph Query ProcessingShixuan Sun, Xibo Sun, Yulin Che, Qiong Luo et al.VLDB 2021 · 105 citations
- Ordered Subgraph Aggregation NetworksChendi Qian, Gaurav Rattan, Floris Geerts, Mathias Niepert et al.NeurIPS 2022 · 81 citations
- Graph Neural Networks with Local Graph ParametersPablo Barceló, Floris Geerts, Juan L. Reutter, Maksimilian RyschkovNeurIPS 2021 · 81 citations
- Versatile Equivalences: Speeding up Subgraph Query Processing and Subgraph MatchingHyunjoon Kim, Yunyoung Choi, Kunsoo Park, Xuemin Lin et al.SIGMOD 2021 · 75 citations
Related papers
- Learning to Count Isomorphisms with Graph Neural NetworksXingtong Yu, Zemin Liu, Yuan Fang, Xinming ZhangAAAI 2023 · 24 citations
- Distributed Subgraph Counting: A General ApproachHao Zhang, Jeffrey Xu Yu, Yikai Zhang, Kangfei Zhao et al.VLDB 2020
- A Learned Sketch for Subgraph CountingKangfei Zhao, Jeffrey Xu Yu, Hao Zhang, Qiyan Li et al.SIGMOD 2021 · 43 citations
- Graph Neural Networks Can (Often) Count SubstructuresPaolo Pellizzoni, Till Hendrik Schulz, Karsten M. BorgwardtICLR 2025
- Improving Subgraph Matching by Combining Algorithms and Graph Neural NetworksShuyang Guo, Wenjin Xie, Ping Lu, Ting Deng et al.KDD 2025
