We study the problem of estimating the value of sums of the form S p x i p when one has the ability to sample x i ≥ 0 with probability proportional to its magnitude. When p = 2, this problem is equivalent to estimating the selectivity of a self-join query in database systems when one can sample rows randomly. We also study the special case when {x i } is the degree sequence of a graph, which corresponds to counting the number of p-stars in a graph when one has the ability to sample edges randomly. Our algorithm for a (1 ± ε)-multiplicative approximation of S p has query and time complexities O m log log n 2 S almost all cases, even when {x i } is a degree sequence and one is allowed to use the structure of the graph to try to get a better estimate. We are not aware of any prior lower bounds on the problem of join selectivity estimation. For the graph problem, prior work which assumed the ability to sample only vertices uniformly gave algorithms with matching lower bounds (Gonen et al. in SIAM J Comput 25:1365-1411. With the ability to sample edges randomly, we show that one can achieve faster algorithms for approximating the number of star subgraphs, bypassing the lower bounds in this prior work. For example, in the regime where S p ≤ n, and p = 2, our upper bound isÕ(n/S 1/2 p ), in contrast to their Ω(n/S 1/3 p ) lower bound when no random edge queries are available. In addition, we consider the problem of counting the number of directed paths of length two when the graph is directed. This problem is equivalent to estimating the selectivity of a join query between two distinct tables. We prove that the general version of this problem cannot be solved in sublinear time. However, when the ratio between in-degree and out-degree is bounded-or equivalently, when the ratio between the number of occurrences of values in the two columns being joined is bounded-we give a sublinear time algorithm via a reduction to the undirected case.
Recently, Aliakbarpour et al. REF used random edge sampling to estimate the number of stars in a graph.
Sublinear-Time Algorithms for Counting Star Subgraphs via Edge Sampling
Algorithmica
Algorithmica
Mathematics Computer Science