Optimal non-adaptive algorithm for edge estimation

Arijit Bishnu, Debabrata Chanda, B. Das, Arijit Ghosh, Gopinath MishraarXiv 2025 · DOI

Abstract

We present a simple nonadaptive randomized algorithm that estimates the number of edges in a simple, unweighted, undirected graph, possibly containing isolated vertices, using only degree and random edge queries. For an $n$-vertex graph, our method requires only $\widetilde{O}(\sqrt{n})$ queries, achieving sublinear query complexity. The algorithm independently samples a set of vertices and queries their degrees, and also independently samples a set of edges, using the answers to these queries to estimate the total number of edges in the graph. We further prove a matching lower bound, establishing the optimality of our algorithm and resolving the non-adaptive query complexity of this problem with respect to degree and random-edge queries.

Introduction

In the era of massive networks, counting the exact number of edges in a graph by inspecting every vertex is often computationally prohibitive. Researchers instead utilize sublinear-time algorithms to estimate graph parameters by querying only a small fraction of the graph. Historically, achieving a high-accuracy $(1 \pm \epsilon)$-approximation of the edge count ($m$) required algorithms to be adaptive.

An adaptive algorithm chooses its next query based on the results of previous queries (e.g., finding a random neighbor of a previously queried vertex). While efficient in query count, adaptive algorithms are inherently sequential and difficult to parallelize. This research addresses a fundamental theoretical gap: designing a non-adaptive algorithm—where all queries are decided in advance—that achieves a $(1 \pm \epsilon)$-approximation of the edge count using sublinear queries. Non-adaptive algorithms are highly desirable for their ability to be executed massively in parallel or in offline environments.

Methodology

The proposed approach assumes access to two query types: Deg(v) (returns the degree of vertex $v$) and RandEdge (returns a uniformly random edge from the graph). The non-adaptive strategy is bifurcated into two regimes based on graph density:

1. The Dense Regime ($m \ge n/2$)

In dense graphs, the algorithm partitions vertices into "buckets" based on their degrees, focusing on "heavy" buckets containing many vertices.

  • Vertex Sampling: It samples $\widetilde{O}(\sqrt{n})$ vertices uniformly to estimate the total degree sum of these heavy buckets.
  • Edge Sampling: It samples $\widetilde{O}(\sqrt{n})$ edges via RandEdge, picks a random endpoint, and checks how many fall into the heavy buckets. This estimates the proportion of total edges connected to heavy buckets.
  • Estimation: By dividing the estimated degree sum of the heavy buckets by twice the estimated proportion of edges in those buckets, the algorithm derives the total edge count.

2. The Sparse Regime ($m \le n$)

For graphs with very few edges, the bucketing approach is less effective. Instead, the authors employ a technique inspired by the Birthday Paradox. By sampling $\Theta(\sqrt{n})$ random edges and counting "collisions" (instances where the same edge is sampled more than once), the algorithm can mathematically infer the total number of edges. The collision rate serves as a direct, non-adaptive proxy for the graph's size.

Key Results and Theoretical Context

The primary contribution of this work is the establishment of the first optimal non-adaptive algorithm for edge estimation. The algorithm, FullNonAdaptiveEdge, outputs a $(1 \pm \epsilon)$-approximation using $\widetilde{O}(n^{1/2}\epsilon^{-2.5})$ queries. Crucially, the authors also provide a matching lower bound, proving that any non-adaptive randomized algorithm requires $\Omega(\sqrt{n})$ queries, even when given stronger query types.

Comparison of edge estimation algorithms across different query models and adaptivity constraints.

As shown in the table above, while some adaptive algorithms achieve lower query complexities (e.g., $n^{1/3}$ or $n^{1/4}$), they require sequential execution. This work is the first to achieve a $(1 \pm \epsilon)$ approximation with sublinear complexity without requiring adaptivity.

Key Insights and Future Work

  • Decoupling for Parallelism: Previous state-of-the-art algorithms relied on weighted sampling, which necessitated adaptive queries. This paper demonstrates that decoupling vertex sampling from edge sampling allows for independent, non-adaptive queries that can still be combined to estimate $m$.
  • Robustness: Unlike several recent adaptive algorithms that fail if the graph contains isolated (degree-zero) vertices, this non-adaptive method remains robust regardless of isolated nodes.
  • Future Directions: While the theoretical bounds are optimal, the $\widetilde{O}(\cdot)$ notation hides logarithmic factors and constants related to $\epsilon$. Future empirical research could implement this algorithm in distributed frameworks like Apache Spark to evaluate its real-world performance and wall-clock speedup compared to sequential adaptive methods.

Summary updated

BibTeX
@misc{bishnu2025optimal,
  author = {Arijit Bishnu and Debabrata Chanda and B. Das and Arijit Ghosh and Gopinath Mishra},
  title = {{Optimal non-adaptive algorithm for edge estimation}},
  year = {2025},
  eprint = {2512.11994},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.11994},
  howpublished = {arXiv},
}
Figure