Sampling and Counting Edges via Vertex Accesses

07/08/2021
by   Jakub Tětek, et al.
0

We consider the problems of sampling and counting edges from a graph on n vertices where our basic access is via uniformly sampled vertices. When we have a vertex, we can see its degree, and access its neighbors. Eden and Rosenbaum [SOSA 2018] have shown it is possible to sample an edge ϵ-uniformly in O(√(1/ϵ)n/√(m)) vertex accesses. Here, we get down to expected O(log(1/ϵ)n/√(m)) vertex accesses. Next, we consider the problem of sampling s>1 edges. For this we introduce a model that we call hash-based neighbor access. We show that, w.h.p, we can sample s edges exactly uniformly at random, with or without replacement, in Õ(√(s)n/√(m) + s) vertex accesses. We present a matching lower bound of Ω(√(s)n/√(m) + s) which holds for ϵ-uniform edge multi-sampling with some constant ϵ>0 even though our positive result has ϵ=0. We then give an algorithm for edge counting. W.h.p., we count the number of edges to within error ϵ in time Õ(n/ϵ√(m) + 1/ϵ^2). When ϵ is not too small (for ϵ≥√(m)/n), we present a near-matching lower-bound of Ω(n/ϵ√(m)). In the same range, the previous best upper and lower bounds were polynomially worse in ϵ. Finally, we give an algorithm that instead of hash-based neighbor access uses the more standard pair queries (“are vertices u and v adjacent”). W.h.p. it returns 1+ϵ approximation of the number of edges and runs in expected time Õ(n/ϵ√(m) + 1/ϵ^4). This matches our lower bound when ϵ is not too small, specifically for ϵ≥m^1/6/n^1/3.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset