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 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.
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
- Neural Subgraph Counting with Wasserstein EstimatorHanchen Wang, Rong Hu, Ying Zhang, Lu Qin et al.SIGMOD 2022 · 37 citations
