English

Join Sampling under Acyclic Degree Constraints and (Cyclic) Subgraph Sampling

Databases 2023-12-21 v1 Data Structures and Algorithms

Abstract

Given a join with an acyclic set of degree constraints, we show how to draw a uniformly random sample from the join result in O(polymat/max{1,OUT})O(\mathit{polymat}/ \max \{1, \mathrm{OUT} \}) expected time after a preprocessing of O(IN)O(\mathrm{IN}) expected time, where IN\mathrm{IN}, OUT\mathrm{OUT}, and polymat\mathit{polymat} are the join's input size, output size, and polymatroid bound, respectively. This compares favorably with the state of the art (Deng et al.\ and Kim et al., both in PODS'23), which states that a uniformly random sample can be drawn in O~(AGM/max{1,OUT})\tilde{O}(\mathrm{AGM} / \max \{1, \mathrm{OUT}\}) expected time after a preprocessing phase of O~(IN)\tilde{O}(\mathrm{IN}) expected time, where AGM\mathrm{AGM} is the join's AGM bound. We then utilize our techniques to tackle {\em directed subgraph sampling}. Let G=(V,E)G = (V, E) be a directed data graph where each vertex has an out-degree at most λ\lambda, and let PP be a directed pattern graph with O(1)O(1) vertices. The objective is to uniformly sample an occurrence of PP in GG. The problem can be modeled as join sampling with input size IN=Θ(E)\mathrm{IN} = \Theta(|E|) but, whenever PP contains cycles, the converted join has {\em cyclic} degree constraints. We show that it is always possible to throw away certain degree constraints such that (i) the remaining constraints are acyclic and (ii) the new join has asymptotically the same polymatroid bound polymat\mathit{polymat} as the old one. Combining this finding with our new join sampling solution yields an algorithm to sample from the original (cyclic) join (thereby yielding a uniformly random occurrence of PP) in O(polymat/max{1,OUT})O(\mathit{polymat}/ \max \{1, \mathrm{OUT}\}) expected time after O(E)O(|E|) expected-time preprocessing. We also prove similar results for {\em undirected subgraph sampling} and demonstrate how our techniques can be significantly simplified in that scenario.

Keywords

Cite

@article{arxiv.2312.12797,
  title  = {Join Sampling under Acyclic Degree Constraints and (Cyclic) Subgraph Sampling},
  author = {Ru Wang and Yufei Tao},
  journal= {arXiv preprint arXiv:2312.12797},
  year   = {2023}
}
R2 v1 2026-06-28T13:57:12.817Z