Lune

SIGMOD2021Top-tier venue

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.

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 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.

Questions to start from

Lune can draw on

the full paper ยท the top-tier papers that cite it ยท related work

Get the answer

Free to start. No credit card required.

Lineage

  • COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality Estimation cites G-CARE: A Framework for Performance Benchmarking of Cardinality Estimation Techniques for Subgraph Matching
  • COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality Estimation cites In-Memory Subgraph Matching: An In-depth Study
  • COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality Estimation cites Cardinality Estimation of Subgraph Matching: A Filtering-Sampling Approach
  • Efficient GPU-Accelerated Local Subgraph Counting cites GSI: GPU-friendly Subgraph Isomorphism
  • Efficient GPU-Accelerated Local Subgraph Counting cites G-CARE: A Framework for Performance Benchmarking of Cardinality Estimation Techniques for Subgraph Matching
  • Efficient GPU-Accelerated Local Subgraph Counting cites In-Memory Subgraph Matching: An In-depth Study
  • Efficient GPU-Accelerated Local Subgraph Counting cites Cardinality Estimation of Subgraph Matching: A Filtering-Sampling Approach
  • NeuSO: Neural Optimizer for Subgraph Queries cites In-Memory Subgraph Matching: An In-depth Study
  • NeuSO: Neural Optimizer for Subgraph Queries cites Cardinality Estimation of Subgraph Matching: A Filtering-Sampling Approach
  • Efficient and Accurate Subgraph Counting: A Bottom-up Flow-learning based Approach cites In-Memory Subgraph Matching: An In-depth Study
  • Efficient and Accurate Subgraph Counting: A Bottom-up Flow-learning based Approach cites Cardinality Estimation of Subgraph Matching: A Filtering-Sampling Approach
  • Cardinality Estimation of Subgraph Matching: A Filtering-Sampling Approach cites G-CARE: A Framework for Performance Benchmarking of Cardinality Estimation Techniques for Subgraph Matching
  • Cardinality Estimation of Subgraph Matching: A Filtering-Sampling Approach cites In-Memory Subgraph Matching: An In-depth Study
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Cardinality Estimation of Subgraph Matching: A Filtering-Sampling ApproachWonseok Shin, Siwoo Song, Kunsoo Park, Wook-Shin HanVLDB 2024 ยท 12 citations
  2. COLOR: A Framework for Applying Graph Coloring to Subgraph Cardinality EstimationKyle B. Deeds, Diandre Sabale, Moe Kayali, Dan SuciuVLDB 2025 ยท 4 citations
  3. 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
  4. Efficient GPU-Accelerated Local Subgraph CountingQiao He, Yiran Li, Man Lung Yiu, Jieming ShiVLDB 2026
  5. NeuSO: Neural Optimizer for Subgraph QueriesLinglin Yang, Lei Zou, Chunshan ZhaoSIGMOD 2026

Builds on3

  1. In-Memory Subgraph Matching: An In-depth StudyShixuan Sun, Qiong LuoSIGMOD 2020 ยท 159 citations
  2. GSI: GPU-friendly Subgraph IsomorphismLi Zeng, Lei Zou, M. Tamer ร–zsu, Lin Hu et al.ICDE 2020 ยท 62 citations
  3. 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

  1. RapidMatch: A Holistic Approach to Subgraph Query ProcessingShixuan Sun, Xibo Sun, Yulin Che, Qiong Luo et al.VLDB 2021 ยท 105 citations
  2. SPACE: Cardinality Estimation for Path Queries Using Cardinality-Aware Sequence-based LearningMehmet Aytimur, Theodoros Chondrogiannis, Michael GrossniklausSIGMOD 2025 ยท 2 citations
  3. Path-centric Cardinality Estimation for Subgraph MatchingZhengdong Wang, Qiang Yin, Longbin LaiVLDB 2025 ยท 1 citation
  4. HOPS: Probabilistic Subtree Mining for Small and Large GraphsPascal Welke, Florian Seiffarth, Michael Kamp, Stefan WrobelKDD 2020 ยท 5 citations
  5. Accurate Summary-based Cardinality Estimation Through the Lens of Cardinality Estimation GraphsJeremy Chen, Yuqing Huang, Mushi Wang, Semih Salihoglu et al.VLDB 2022 ยท 30 citations
Dusk over the sea between two cliffs drawn in fine vertical lines