Combining Sampling and Synopses with Worst-Case Optimal Runtime and Quality Guarantees for Graph Pattern Cardinality Estimation
Kyoungmin Kim, Hyeonji Kim, George Fletcher, Wook-Shin Han
Abstract
Graph pattern cardinality estimation is the problem of estimating the number of embeddings |M| of a query graph in a data graph. This fundamental problem arises, for example, during query planning in subgraph matching algorithms. There are two major approaches to solving the problem: sampling and synopsis. Synopsis (or summary)-based methods are fast and accurate if synopses capture information of graphs well. However, these methods suffer from large errors due to loss of information during summarization and inherent assumptions. Sampling-based methods are unbiased but suffer from large estimation variance due to large sample space.
To address these limitations, we propose Alley, a hybrid method that combines both sampling and synopses. Alley employs 1) a novel sampling strategy, random walk with intersection, which effectively reduces the sample space, 2) branching to further reduce variance, and 3) a novel mining approach that extracts and indexes tangled patterns as synopses which are inherently difficult to estimate by sampling. By using them in the online estimation phase, we can effectively reduce the sample space while still ensuring unbiasedness. We establish that Alley has worst-case optimal runtime and approximation quality guarantees for any given error bound ๐ and required confidence ๐. In addition to the theoretical aspect of Alley, our extensive experiments show that Alley outperforms the state-of-the-art methods by up to orders of magnitude higher accuracy with similar efficiency.
- corresponding author used in fast approximate query answering when calculating the exact answer takes too long, and approximate results are sufficient for data analytics. An online aggregation method can even progress the estimation towards a more accurate answer [28].
In this paper, we focus on combining two major approachessampling and synopses -to solve the graph pattern cardinality estimation problem. Synopsis-based methods pre-build summary structures in the offline phase and use the structures to perform cardinality estimation in the online phase. Sampling-based methods perform sampling, calculate weights of samples, and aggregate these weights to estimate the cardinality in the online phase.
Synopsis-based methods have been mainly developed for RDF graphs. C-SET [35] summarizes the data graph into a set of starshaped structures, while SumRDF summarizes it into a smaller graph. These methods are fast and accurate if synopses capture information of data graphs well. However, it is a well-known problem that the information loss in summarization and the ad-hoc assumptions (e.g., uniformity and independence) in computing the estimates may produce large errors [27,31,38]. On various real and synthetic datasets, a very recent work by Park et al. [38] shows that these methods actually suffer from serious under-estimation problems due to these limitations.
Sampling-based methods have been mainly developed for relational data, but show good performance on graph data. Park and colleagues further show that, surprisingly, an online aggregation method designed for relational data, WanderJoin, significantly outperforms all techniques designed for graph data [38]. However, sampling-based methods suffer from large sample space that leads to large estimation variance and a high probability of sampling failures (i.e., samples have zero-weights). The failures lead to significant under-estimation in sampling-based methods, including WanderJoin, which we will show in Section 3. Here, the sample space is the set of all possible random walks following a particular sampling strategy and order. The set of candidates for each vertex/edge in order is called the local sample space. We illustrate these problems using an example in Figure 1 and WanderJoin.
WanderJoin for relational data can be translated into an estimator for graph data which performs edge-at-a-time sampling, by regarding query edges as relations and overlapping query vertices as join keys. For example, the query graph in Figure 1a is equivalent to a join graph in Figure 1c. WanderJoin first determines the order of query edges, e.g., โจ(๐ข 1 , ๐ข 2 ), (๐ข 2 , ๐ข 4 ), (๐ข 1 , ๐ข 4 ), (๐ข 1 , ๐ข 3 ), (๐ข 3 , ๐ข 4 ), (๐ข 4 , ๐ข 5 )โฉ. Following the order, it breaks cycles and transforms the query graph into a tree with split vertices, as in Figure 1b. For example, ๐ข 4 is first split into ๐ข 4 and ๐ข โฒ 4 since the first three edges form a cycle and ๐ข 4 is the latest visited. ๐ข 4 is then split into ๐ข 4 and ๐ข โฒโฒ 4 again due to (๐ข 3 , ๐ข 4 ). The sampling order is defined on the edges
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 2337c785-075d-48c6-8ae0-86d8b0fa8849Cited by top-tier papers5
- Cardinality Estimation of Subgraph Matching: A Filtering-Sampling ApproachWonseok Shin, Siwoo Song, Kunsoo Park, Wook-Shin HanVLDB 2024 ยท 12 citations
- COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality EstimationKyle B. Deeds, Diandre Sabale, Moe Kayali, Dan SuciuVLDB 2025 ยท 4 citations
- Efficient and Accurate Subgraph Counting: A Bottom-up Flow-learning based ApproachQiuyu Guo, Jianye Yang, Wenjie Zhang, Hanchen Wang et al.VLDB 2025 ยท 3 citations
- Efficient GPU-Accelerated Local Subgraph CountingQiao He, Yiran Li, Man Lung Yiu, Jieming ShiVLDB 2026
- NeuSO: Neural Optimizer for Subgraph QueriesLinglin Yang, Lei Zou, Chunshan ZhaoSIGMOD 2026
Builds on3
- In-Memory Subgraph Matching: An In-depth StudyShixuan Sun, Qiong LuoSIGMOD 2020 ยท 159 citations
- GSI: GPU-friendly Subgraph IsomorphismLi Zeng, Lei Zou, M. Tamer รzsu, Lin Hu et al.ICDE 2020 ยท 62 citations
- G-CARE: A Framework for Performance Benchmarking of Cardinality Estimation Techniques for Subgraph MatchingYeonsu Park, Seongyun Ko, Sourav S. Bhowmick, Kyoungmin Kim et al.SIGMOD 2020 ยท 59 citations
Related papers
- RapidMatch: A Holistic Approach to Subgraph Query ProcessingShixuan Sun, Xibo Sun, Yulin Che, Qiong Luo et al.VLDB 2021 ยท 105 citations
- Path-centric Cardinality Estimation for Subgraph MatchingZhengdong Wang, Qiang Yin, Longbin LaiVLDB 2025 ยท 1 citation
- SPACE: Cardinality Estimation for Path Queries Using Cardinality-Aware Sequence-based LearningMehmet Aytimur, Theodoros Chondrogiannis, Michael GrossniklausSIGMOD 2025 ยท 2 citations
- HOPS: Probabilistic Subtree Mining for Small and Large GraphsPascal Welke, Florian Seiffarth, Michael Kamp, Stefan WrobelKDD 2020 ยท 5 citations
- Cardinality Estimation over Knowledge Graphs with Embeddings and Graph Neural NetworksTim Schwabe, Maribel AcostaSIGMOD 2024 ยท 17 citations
