Manuscript Offprint
arXiv:2610.23364Power of Conditional Sampling on Hypergraphs
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Let be a d-uniform hypergraph with and . Estimating m from uniformly random hyperedge samples requires samples by a standard birthday-paradox argument. We investigate the power of conditional sampling in this setting. We consider the following oracle. Given a subset , the oracle returns a hyperedge chosen uniformly at random from all hyperedges induced by X, provided that at least one such hyperedge exists. More generally, for an integer , we consider a hierarchy of conditional sampling oracles: given s pairwise disjoint subsets , the oracle returns a hyperedge chosen uniformly at random from all hyperedges that are contained in and intersect each set , , provided that at least one such hyperedge exists.
For every , we give a randomized algorithm that outputs an estimate satisfying with probability at least , using only conditional samples. Note that the exponent of the factor in the query complexity is an absolute constant, independent of both and . Consequently, conditional sampling yields an exponential separation in query complexity over algorithms that rely solely on uniformly random hyperedge samples.
We also study the corresponding decision version, in which the oracle only reports whether a qualifying hyperedge exists. For every , we prove that any algorithm using the s-colorful decision oracle requires polynomially many queries, namely . Thus, for every , access to uniformly random witness hyperedges (random certificates) is exponentially more powerful than mere existence queries. When , one could achieve the query complexity with the decision oracle also becomes , but the exponent of the factor is known to be . The colorful hierarchy thus exhibits a phase transition at : for , random certificates are essential for polylogarithmic-query estimation, whereas at , decision queries alone suffice, yet random certificates still provably reduce the exponent of the factor from to an absolute constant.
AI use statement. AI tools were used solely to improve the paper’s readability. All mathematical ideas and proofs presented in this work are the authors’ own. The authors take full responsibility for the content of the submitted manuscript.
Indian Statistical Institute, Kolkata, India
Institute of Mathematical Sciences, Chennai, India
Contents
1 Introduction 1
1.1 Models and our results 1
1.2 Comparison with prior work 3
1.3 Connections to related areas 4
1.4 Notations 5
1.5 Organization of the paper 5
2 Technical Overview 6
2.1 Upper Bounds 6
2.2 Lower Bounds 8
3 Hyperedge Estimation of s-Partite d-Hypergraph 10
3.1 Threshold checking 11
3.2 Graph sparsification 11
3.2.1 Procedure to find an approximation preserving subhypergraph 12
3.2.2 Procedure to find approximation preserving sequence 14
3.3 Procedure to hyperedge estimation of s-partite d-hypergraph 17
4 Hyperedge Estimation of d-hypergraph 20
5 Lower Bounds 22
5.1 Proof of the lower bound in dense hypergraphs 23
5.2 Proof of the lower bound in sparse hypergraphs 29
6 Discussion and Applications 30
7 Conclusion 31
A Threshold Checking 34
B Concentration Bounds 37
Let be a d-uniform hypergraph with and . The hyperedge estimation problem asks to estimate the number of hyperedges using query access to . More precisely, given an approximation parameter , the goal is to design a randomized algorithm that outputs an estimate satisfying with constant success probability while minimizing the number of queries made to the underlying oracle.
The query complexity of hyperedge estimation depends crucially on the type of oracle available to the algorithm. If the algorithm has access only to uniformly random hyperedge samples, then estimating requires samples by the classical birthday-paradox argument [MU05]. Using Consequently, obtaining substantially more efficient algorithms requires access to richer query primitives.
Among the many query models studied in the literature, conditional sampling has emerged as one of the most powerful and versatile primitives [CFGM13, CRS15, CRS14, BC18, CCK 21, BCP 24]. Instead of sampling a uniformly random hyperedge from the entire hypergraph, a conditional sampling oracle allows the algorithm to specify a collection of structural constraints and returns a uniformly random hyperedge satisfying those constraints.
1.1 Models and our results
A variety of global query oracles have been studied for graph and hypergraph estimation. One of the natural global query oracle for graphs is the independent set (IS) oracle [BHR 20, CLW20, AHL26], which, given a subset of vertices, reports whether the induced subgraph contains an edge. For graphs, a more powerful query oracle is the bipartite independent set (BIS) oracle [DL21, BHR 20], which, given two disjoint subsets of vertices, reports whether there exists an edge with one endpoint in each subset. Very recently, [CDGM26] introduced the independent set oracle with random certificates, which additionally returns a uniformly random witness edge whenever one exists. For general d-uniform hypergraphs, [BBGM19, DLM22, BBGM24] considered the d-colorful decision oracle, which, given d pairwise disjoint subsets , reports whether there exists a hyperedge intersecting every subset.
These oracle models have proved remarkably powerful for edge and hyperedge estimation. However, despite these developments, there has been no systematic study of the hierarchy of colorful query oracles. Existing work focuses on a few isolated points in this hierarchy—namely the IS oracle, the BIS oracle, the IS oracle with random certificates, and the d-colorful decision oracle—leaving the intermediate colorful query models essentially unexplored.
Motivated by this gap, as well as developments in the property testing of probability distributions through the lens of conditional sampling [CFGM13, CRS15, BC18], we introduce a unified hierarchy of s-colorful query oracles, parameterized by an integer . Given pairwise disjoint subsets , the s-colorful random certificate oracle, denoted by , returns a uniformly random hyperedge that is contained in and intersects every subset
, we suppress poly factors, and Similarly, we define and .
, provided that such a hyperedge exists. We also consider the corresponding s-colorful decision oracle, denoted by , which simply reports whether such a hyperedge exists. The hierarchy unifies all previously studied oracle models: for graphs , for and corresponds to the IS and BIS oracles, respectively, while coincides with the independent set oracle with random certificates. For general , the case coincides with the previously studied d-colorful decision oracle.
Our work is motivated by the following three fundamental questions.
Q1. How much more powerful is the s-colorful random certificate oracle cISC than uniformly random hyperedge sampling for hyperedge estimation?
Q2. For a fixed , how much additional algorithmic power does the s-colorful random certificate oracle cISC provide over the corresponding decision oracle cIS?
Q3. How does the relative power of cISC and cIS evolve as s increases from 1 to d? In particular, does a qualitative change occur at some s?
We answer all three questions. Our first result shows that a polylogarithmic number of s-colorful random certificate queries suffices to estimate the number of hyperedges.
Theorem 1. For every integer and , there exists a randomized algorithm that, given access to the s-colorful random certificate oracle cISC, outputs -approximation of the number of hyperedges with probability at least 2/3 using s-colorful random certificate queries in expectation.
Theorem 1 answers Q1 in the affirmative and demonstrates the power of conditional sampling for hyperedge estimation. While estimating the number of hyperedges from uniformly random hyperedge samples requires queries by the classical birthday-paradox argument, our algorithm uses only a polylogarithmic number of s-colorful random certificate queries. This yields an exponential separation between the query complexity of hyperedge estimation using uniformly random hyperedge sampling and using s-colorful random certificate queries. We note that our algorithm treats all values of s and d in a unified manner.
Since every s-colorful random certificate query reveals at least as much information as the corresponding decision query, it is immediate that cISC is at least as powerful as cIS. A natural question is whether this additional information leads to a genuine algorithmic advantage. The following theorem answers Q2 by showing that, for every , any algorithm using only the decision oracle cIS must make a polynomial number of queries to estimate the number of hyperedges.
Theorem 2. Let . Any randomized algorithm that, given access only to the s-colorful decision oracle cIS, outputs -approximation of the number of hyperedges with probability at least 2/3 must make s-colorful decision queries in the worst case.
Theorem 2, together with Theorem 1, establishes an exponential separation between the s-colorful random certificate oracle cISC and the corresponding decision oracle cIS for every .
A natural question is whether this exponential separation persists for all values of s. The answer is no. When s = d, [BBGM24, DLM22] showed that the number of hyperedges can be
By , we denote , where is a constant depending only on s and d. We also define analogously.
estimated using only d-colorful decision queries. Thus, unlike the case , random certificates are no longer necessary to obtain a polylogarithmic-query algorithm, albeit with a dependence on in the exponent of the factor. Combined with our lower bound for , the query complexity of hyperedge estimation in the decision model undergoes a transition from polynomial to polylogarithmic precisely at , thereby providing an answer to Q3.
1.2 Comparison with prior work
Our work also fits within the framework of hyperedge estimation under the global query access model, extending a growing body of work on graph and hypergraph estimation using global query oracles [DL21, DLM22, DLM24, BHR20, BBGM24, CDGM26, AMM22, CLW20, AHL26].
For graphs , [BHR20, CLW20] studied the independent set (IS) oracle, which coincides with our 1-colorful decision oracle cIS. They showed that estimating the number of edges requires IS queries. Subsequently, [BHR20, AMM22] considered the more expressive bipartite independent set (BIS) oracle, corresponding to our 2-colorful decision oracle. The latter work gave a -query algorithm for edge estimation.
For general -uniform hypergraphs, [BGK23, DLM22] introduced the -colorful decision oracle cIS. Over a series of works, increasingly efficient algorithms were developed for hyperedge estimation using -colorful decision queries, culminating in the -query algorithm of [DLM22, BBGM24]. Subsequently, Dell, Lapinskas, and Meeks [DLM24] proved a lower bound of -colorful decision queries, matching the upper bound up to a constant factor in the exponent of . Consequently, at , the exponent of the factor in the decision model is , whereas the exponent in Theorem 1 is an absolute constant.
Very recently, [CDGM26] introduced the random certificate analogue of the IS oracle, which is precisely our 1-colorful random certificate oracle cISC, and showed that edge estimation can be performed using only queries. Together with the lower bound for the IS oracle due to [CLW20], this establishes an exponential separation between the random certificate and decision variants in the graph setting.
| Oracle | Setting | Query complexity | Reference |
|---|---|---|---|
| IS decision | Graphs | [CLW20] | |
| BIS decision | Graphs | [AMM22] | |
| IS random certificate | Graphs | [CDGM26] | |
| -colorful decision | Theorem 19 | ||
| -colorful decision | [DLM22, BBGM24] | ||
| -colorful decision | [DLM24] | ||
| -colorful random certificate | Theorem 1 |
Table 1: Comparison of our results with prior work for hyperedge estimation. The dependence on is suppressed throughout; hides factors.
Table 1 compares our results with prior work. Our work unifies these developments. We provide the first systematic study of the hierarchy of colorful query oracles. On the algorithmic side, we establish polylogarithmic-query algorithms for every -colorful random certificate oracle cISC, thereby generalizing the recent result of [CDGM26]. On the lower-bound side, we prove polynomial lower bounds for the corresponding -colorful decision oracles cIS whenever , generalizing the lower bound for the IS oracle. Finally, we identify a sharp phase transition at , where the query complexity of hyperedge estimation in the decision model drops from polynomial to polylogarithmic.
A natural question arising from our work is whether the uniform randomness of the returned certificate is essential for obtaining polylogarithmic-query algorithms when . Our algorithm relies crucially on the uniformity of the returned hyperedge to obtain unbiased estimates, and this reliance is provably necessary: an oracle that returns an arbitrary certificate can be simulated using only -colorful decision (cIS) queries by binary search, and hence, by the lower bound in Theorem 2, cannot yield a polylogarithmic-query algorithm for any . Thus, the exponential speedup of Theorem 1 comes from the distribution of the returned witness. Interestingly, uniformity of the witness does not always confer such power: for approximate model counting, a SAT oracle returning a uniformly random satisfying assignment is provably no more powerful than an NP oracle [CCKM23, Theorem 1.2]. We return to this comparison through the lens of fine-grained complexity at the end of Section 1.3.
1.3 Connections to related areas
Our work is closely connected to several well-studied themes in query complexity and sublinear algorithms. The relationship between global query oracles and group testing has long been recognized, with the IS, BIS, and colorful decision oracles naturally viewed as structured group tests over the edge (or hyperedge) set [Dor43, AJS19, BHR 20, DLM22]. In this viewpoint, hyperedges play the role of defective items, while the underlying vertex sets impose structural constraints on the families of hyperedges that can be queried. Our hierarchy of colorful query oracles provides a unified framework for studying these structured group-testing primitives and their random-certificate counterparts.
Decision vs Counting: Our work is also related to the classical theme of decision versus counting, initiated by the seminal work of [Sto83, Sto85], which showed that approximate counting can often be reduced to decision queries. In our setting, we investigate a related question by comparing the power of the s-colorful decision oracle with its random certificate counterpart. Our results show that, for every , access to uniformly random witness hyperedges yields an exponential separation in query complexity, whereas such separation disappears when s = d.
Conditional Sampling with Structural Constraints: Furthermore, the s-colorful random certificate oracle may be viewed as a structured form of conditional sampling, a powerful primitive that has led to exponential improvements for numerous testing and estimation problems over probability distributions [CFGM13, CRS15, CRS14, BC18, CCK 21, BCP 24]. Instead of conditioning on an arbitrary subset of the domain, our oracle conditions on the set of hyperedges intersecting a prescribed collection of pairwise disjoint vertex subsets. Theorem 1 demonstrates that this structured form of conditional sampling also leads to an exponential improvement over uniformly random hyperedge sampling. Finally, our work is closely related to the recent study of the power of random certificates in structured query models [RT16, CRS15, CCKM23].
Fine-grained Complexity: Finally, our results connect to the fine-grained complexity framework of Dell and Lapinskas [DL21] and Dell, Lapinskas, and Meeks [DLM22]. In this framework, the witnesses of a computational problem (satisfying assignments, d-cliques, d-SUM solutions) form the hyperedges of a d-uniform hypergraph, and a decision procedure for restricted instances corresponds to a colorful decision oracle; their central insight is that approximate counting reduces to polylogarithmically many such decision calls when each of the coordinates of a witness can be restricted to its own prescribed set. We refine this picture along two axes. First, the parameter measures the granularity of control: an -colorful oracle models a solver supporting only distinct restriction classes, so that for distinct coordinates must share classes. Theorem 2 shows that this coarsening is severe, and not an artifact of known techniques: for every , approximate counting requires polynomially many decision calls, so the reductions of [DL21, DLM22] make essential, information-theoretic use of coordinate-wise restrictions. Second, many natural solvers do not merely decide but search: when a witness exists, they return one. The -colorful random certificate oracle models such a solver whose returned witness is uniformly distributed, and Theorem 1 shows that this search access suffices for polylogarithmic-query counting for every , including the entire regime where decision access provably does not. Thus, for approximate counting of size- witnesses, search with uniformly random certificates is exponentially more powerful than decision whenever the solver supports fewer than restriction classes, a fine-grained analogue of the classical decision-versus-search phenomenon. It is instructive to contrast this with the result of [CCKM23] discussed above. In both settings, a decision oracle is upgraded to return a uniformly random witness whenever one exists: the -colorful decision oracle cIS is upgraded to cISC in our setting, and the NP oracle is upgraded to a uniform-witness SAT oracle in theirs. The outcomes are opposite: in our setting the upgrade reduces the query complexity of approximate counting exponentially for every , whereas for approximate model counting it yields no reduction at all. The difference lies in the strength of the underlying decision oracle. For model counting, the decision oracle is already as powerful as the search oracle [CCKM23, Theorem 1.2], leaving no gap for a witness to close, whereas for every the -colorful decision oracle is provably weak (Theorem 2), and it is precisely this gap that uniformly random witnesses close. The power of search over decision for approximate counting is thus governed not by the witness distribution alone but by whether decision access is already sufficient in the given query model.
1.4 Notations
We denote to denote the set of integers . Given a vertex , we denote to be the set of neighbours of the vertex . Consequently, given a set of vertices , we denote to be the union of the neighbours of the vertices in .
Throughout, we use to denote a d-uniform hypergraph (or simply d-hypergraph) where V is the set of n vertices and is a family of m hyperedges. For any subhypergraph H of G, we denote its vertex set by , its set of hyperedges by , and its hyperedge count by .
s-partite d-hypergraph Let be mutually disjoint subsets of . We define the induced s-partite subhypergraph on sets, denoted by with vertex set , hyperedge set is
1.5 Organization of the paper
We begin with Section 2, which provides a technical overview of our upper bound (Theorem 1) and lower bound (Theorem 2). Section 3.3 presents our algorithm for hyperedge estimation in an s-partite d-hypergraph. We then extend this algorithm to general d-hypergraphs in Section 4.
Section 5 presents our lower bound, while Section 6 discusses applications of our results. Finally, Section 7 concludes the paper and discusses open problems.
2 Technical Overview
2.1 Upper Bounds
We outline the proof of our main upper bound (Theorem 1). The algorithm has two layers: an outer reduction from general d-hypergraphs to s-partite instances, and an inner estimator for s-partite d-hypergraphs (Theorem 3). The inner estimator combines three ingredients: a collision-based estimator for hypergraphs with few hyperedges, a sparsification step in which random certificates are used to verify that a randomly subsampled subhypergraph retains enough hyperedges, and a telescoping-product argument that assembles the final estimate.
Why the existing graph techniques fail For graphs , edge estimation with global queries typically proceeds by decomposing the graph into bipartite subgraphs: a uniformly random bipartition retains each edge with probability exactly 1/2 and, since the survival events of any two distinct edges are pairwise independent, a Chebyshev bound shows that the number of surviving edges concentrates around half the edge count. This is the route taken in [BHR 20] and [CDGM26]. For d-hypergraphs, pairwise independence is lost: two hyperedges may share up to vertices, so their survival events under a random coloring or vertex subsampling are strongly correlated, and the second-moment argument for a single random decomposition breaks down. The known hypergraph techniques [BBGM19, DLM22] circumvent this issue only in the fully colorful regime (cIS with ), where a hyperedge can be pinned down coordinate by coordinate, and do not extend to the case . Our algorithm sidesteps the lack of independence altogether. The key observation is that independence is only needed across repetitions, not within a decomposition: instead of proving that one random decomposition concentrates, we generate many independent candidate decompositions and then use uniformly random certificates to test which candidate is good; since the candidate counts are bounded random variables, Hoeffding's bound applies to their average with no assumptions on within-decomposition correlations. This estimate-then-verify strategy is what allows a single algorithm to handle all .
Reduction to multipartite hypergraphs Since a cISC query conditions on pairwise disjoint vertex classes, we first reduce the problem to -partite hypergraphs. The algorithm uniformly and independently partitions the vertex set into color classes . A fixed hyperedge survives in the induced -partite subhypergraph if and only if its vertices receive all colors, which happens with probability , where is the number of onto functions from to . Because of the correlations described above, a single random partition need not concentrate. However, each partition yields a hyperedge count in , and distinct partitions are mutually independent. Repeating the partition times therefore generates an ensemble of independent -partite instances such that, by a Hoeffding bound applied across the ensemble, the average hyperedge count, rescaled by the survival probability, is a -approximation of with probability . It thus suffices to estimate the hyperedge count of each instance up to accuracy with confidence , and to take a union bound over the ensemble.
Small hyperedge count estimation via collision statistics For a s-partite d-hypergraph H with partite sets , the query cISC( ) returns a uniformly random hyperedge of H, so standard birthday-paradox arguments [MU05] apply. They yield two procedures: a tester that distinguishes from using queries, and, whenever , an estimator that outputs a -approximation of using queries. We invoke these procedures only with set to a large constant , so each call costs queries. The details can be found in Section 3.1 and Appendix A.
Sparsification with verified selection To reduce a hypergraph with many hyperedges to the small-count regime, we sparsify: each vertex of each partite set is kept independently with probability , so that a hyperedge survives with probability exactly . Once again, no concentration holds for a single trial. Instead, we draw independent candidate subhypergraphs . Each count lies in and the candidates are mutually independent, so a Hoeffding bound shows that, with probability , at least one candidate satisfies .
The random certificates now enter crucially: we must identify a good candidate without being able to count. We draw random hyperedges from using cISC queries and, for each , compute the fraction of sampled hyperedges that survive in . Since the certificates are uniformly distributed, is an unbiased estimator of the true retained fraction , and by a Hoeffding bound every deviates from its mean by less than additively, simultaneously for all , with probability . Consequently, selecting any candidate with is sound in both directions: the good candidate guaranteed above passes the test, and any candidate that passes satisfies . We call a subhypergraph satisfying this property an approximation preserving subhypergraph; the lower bound on the retained fraction is what guarantees the quality of the final estimator. We emphasise that the decision oracle cIS offers no analogue of this verification step: it can certify that a candidate contains some hyperedge, but not that it retains a constant fraction of them. Indeed, as discussed in Section 1.2, an oracle returning an arbitrary certificate can be simulated by adaptive cIS queries, so by Theorem 2 it cannot support this step either: uniformity of the certificate is exactly what is being used.
Constructing an approximation preserving sequence The construction proceeds via an iterative loop, starting with . At each iteration , we run threshold checking on with the constant threshold : if the check reports , we halt and set ; otherwise, we sparsify and select an approximation preserving subhypergraph as above. Since the number of iterations is itself random, we run iteration with confidence parameter ; the resulting failure probabilities form a geometric series, so a union bound over all iterations costs only in total, regardless of when the loop halts. This yields a nested sequence of subhypergraphs with where, with probability , each satisfies and .
To control , observe that every vertex survives each round independently with probability , so the round in which a fixed vertex is removed is a geometric random variable, and is at most the maximum of such variables. Hence , which gives , , and ; these are the quantities that drive the query complexity below.
Telescoping estimation For each , define . The total number of hyperedges follows a telescoping product:
Instead of estimating each from scratch, we estimate only the ratios : we sample random hyperedges from via cISC queries and record the fraction that survive in . Because by construction of the approximation preserving sequence, a multiplicative -approximation of requires only queries, independent of and of . We take for every , which yields estimates satisfying with the desired probability.
Query complexity Within a single s-partite instance, the sequence construction costs queries and the birthday estimator queries; the dominant cost is ratio estimation. There are ratios, each estimated to accuracy with confidence , at a cost of queries per ratio, hence in total. Taking expectations over using gives an expected cost of per instance. One logarithm is thus the length of the approximation preserving sequence, and the other arises because each ratio must be estimated to accuracy . Both phenomena are governed solely by the vertex-halving rate , so the exponent of the factor is an absolute constant: the parameters and enter only through the constants , and hidden in . Finally, the outer reduction runs the instance estimator times with confidence parameter , contributing a factor and yielding the bound of Theorem 1. This is in sharp contrast to the decision-oracle setting at , where the exponent of the factor is [BBGM24, DLM24].
2.2 Lower Bounds
Let . We prove the lower bound in two regimes based on the number of hyperedges. In the dense regime, where , we prove a lower bound of queries. In the sparse regime, where , we prove a lower bound of queries. These two bounds match, up to polylogarithmic factors, when . So the worst case query complexity is , as stated in Theorem 2.
Dense regime. We prove the lower bound of queries for s-colorful cIS oracle access, where . The main idea is to hide a small set of vertices, each of which is part of many hyperedges. We show that finding even one such vertex takes many queries.
We prove the bound using Yao’s min-max principle. We define two distributions, and , over hypergraphs . In both distributions, the vertex set is split into parts uniformly at random. Every colorful tuple is made a hyperedge independently, with probability .
To build , we add one more step. We form a set by placing each vertex of into independently, with probability . For every vertex , we add all hyperedges of the form where for each . Hence, forms the small set of high degree vertices to establish the indistinguishability argument.
We choose the constants above so that the following hold with probability . First, and under both distributions. Second, a graph from has at most hyperedges. Third, a graph from has , and so has at least hyperedges. This means a graph from has at least twice as many hyperedges as a graph from .
A natural choice is to set . Then it yields a query complexity of , motivating a more careful choice of the parameter.
Let . We want to show that any algorithm making queries can not hit a vertex in the dense subset . However, this can not hold if the query sets can be arbitrarily large. On the other hand, due to the construction of the graph distributions, any large query sets contain an edge with high probability. We leverage these observations by considering two possible cases for the queries. Given a cIS query , and a fixed threshold , we consider the following cases: either for all , or for some .
If for some , we show that the query sets either contain an edge or there exists a small certificate to show that they are not independent. If each of the remaining query sets contain at least one colorful -tuple (i.e. vertices of different colors consisting of one from each of the remaining query sets), then the value of ensures that these query sets contains at least possible colorful tuples. This is the reciprocal of the hyperedge probability. Hence, we can use a Chernoff argument to establish that any such query throughout the algorithm contains an edge with probability .
On the other hand, if there are a subset of the query sets that does not contain a colorful tuple, we show that all query sets in this subset contain less than vertices. Observe that the coloring is chosen at random, and it does not depend on the query. So a large query set meets every color class with probability . By an argument using the Hall's marriage theorem, we show that any such set can not be part of such subsets. Based on these two results, we restrict the size of the query sets to for the remaining part of the proof.
We now bound the number of queries needed to tell apart from with probability at least 2/3. Since under , this task requires at least as many queries as are needed to touch a vertex of under . Here, touching means the query's vertex set meets . Since only small queries are useful, the chance that one such query touches is at most
So the number of queries needed to touch is at least , which is . For this argument to work, we need to be . This lets concentrate using Chernoff bounds. This is exactly why we need .
From non-adaptive to adaptive algorithms. The argument above only holds for non-adaptive algorithms. A non-adaptive algorithm fixes all its queries in advance, before seeing any answers. An adaptive algorithm can choose a query based on earlier answers. For example, it might learn the colors of the vertices it has already explored, and use them to grow a query set past while avoiding hyperedges, specifically to search for B more cheaply.
To handle this case, we describe an augmented oracle that simulates the cIS oracle but reveals more information. At each stage, the algorithm maintains a knowledge triplet , where is the set of explored vertices, labels each vertex of by the set among , containing it, and records the hyperedges among the vertices of . Given a query , the augmented oracle updates as follows. If some subset of the query sets cannot form a colorful tuple, it reveals a minimal such subset. If for all , it reveals all queried vertices. If for some , it samples a subset of size uniformly at random and reveals these vertices; if is an independent set, the oracle fails and reveals the entire graph. The answer to the original cIS query can always be determined from the updated triplet. Hence, it is enough to prove the lower bound for algorithms using the augmented oracle.
We view such an algorithm as a tree of depth q where q is the number of queries made by the algorithm. We say a node is good if no vertex of B has been revealed so far. The key observation is that, given the algorithm is at a good node, the conditional distribution of the unexplored graph retains sufficient randomness. The unexplored vertices are still assigned to and to independently at random. Moreover, every colorful -tuple containing an unexplored vertex is still a hyperedge independently with probability , exactly as in the construction. Hence, no matter how a query was chosen based on earlier answers, the algorithm has not seen the randomness that decides its answer. Using this, we show that each query takes the algorithm from a good node to a bad node with probability . If all query sets have size at most , the query hits with probability . A query set larger than meets every color class with high probability, so by Hall's marriage theorem it cannot be part of a minimal subset that fails to form a colorful tuple. Finally, if some query set is larger than , the sampled sets contain potential hyperedges in expectation, so by a Chernoff bound the oracle fails with probability . By a union bound over all queries, the algorithm reaches a bad node with probability .
To complete the argument, we couple and : we draw a graph from , and obtain a graph from by choosing and adding the corresponding hyperedges. As long as no vertex of is revealed, the algorithm behaves identically on both graphs. Hence, every good node is reached with probability no larger under than under , and the algorithm cannot distinguish the two distributions with probability more than . The formal analysis is presented in Section 5.
Sparse regime. The lower bound of , for the case , follows by a reduction from the dense regime.
Let , so that . Let be an instance of the dense regime on vertices. We build , where is a rank hypergraph on new vertices, disjoint from , respecting the same color partition, and containing no hyperedges. Then has vertices and the same number of hyperedges as , matching the input size a sparse regime algorithm is assumed to handle. Since , we get , so . Thus satisfies the requirement of the dense regime.
Every s-colorful cIS query on can be answered using exactly one query on : restrict each queried set to its intersection with . The answer is unchanged, since has no hyperedges and none exist between and .
Now suppose an algorithm violates the claimed sparse bound. Using the simulation above, it gives an algorithm on using queries. Substituting , this is exactly the bound ruled out by the dense regime. Hence, a contradiction. This establishes the lower bound holds for the sparse regime.
3 Hyperedge Estimation of s-Partite d-Hypergraph
In this section, we design a randomized algorithm to estimate the number of hyperedges in a s-partite d-hypergraph. Specifically, we will show that,
Theorem 3 (Hyperedge estimation of s-partite d-hypergraph). For every integer , and , there exists a randomized algorithm that, given access to the s-colorful random certificate oracle cISC of a s-partite d-hypergraph H, outputs -approximation of the number of hyperedges of H with probability at least using cISC queries.
In Section 3.1, we present the threshold checking procedures. Section 3.2 is organised into three parts that describe the procedure to generate an approximation preserving sequence. Section 3.2.1 introduces the sequential procedures EnsembleColorPartite (Lemma 9) and ApproxSubhypergraph (Lemma 10) to generate an approximation preserving subhypergraph. Section 3.2.2 presents the procedure ApproxSubsequence (Lemma 12) to generate an approximation preserving subsequence. Finally, in Section 3.3 we describe the procedure to estimate the hyperedge count in a s-partite d-hypergraph.
3.1 Threshold checking
Let a fixed threshold ( ) be given. We consider the following threshold-checking problem: given a s-partite d-hypergraph , determine whether . If this condition holds, the goal is to estimate the approximation of .
To address this task, we present two algorithms IsCollision and BirthdayEstimate based on the birthday paradox techniques [MU05, Chapter 5]. IsCollision distinguishes between the cases or (Lemma 4). BirthdayEstimate outputs an approximation of , if (Lemma 5). The corresponding guarantees are stated below. For details, refer to Appendix A.
Lemma 4 (Correctness of IsCollision). For a s-partite d-hypergraph H and a threshold , the following statements hold for IsCollision with probability at least :
(i) If , then IsCollision outputs 1.
(ii) If , then IsCollision outputs 0.
The number of cISC queries made is
Suppose that a collision is detected, i.e., IsCollision outputs 1. We can obtain a -approximation of using additional cISC queries. This estimation procedure is implemented in BirthdayEstimate.
Lemma 5 (Correctness of BirthdayEstimate). For a s-partite d-hypergraph H, threshold and approximation error . If , then BirthdayEstimate outputs an estimate of with probability at least . The number of cISC query made is .
3.2 Graph sparsification
In this section, we will describe a procedure to generate an approximation preserving sequence (formally defined below) with probability at least . Moreover, the expected query complexity of the procedure is .
Definition 6 (Approximation preserving subhypergraph). Let be subhypergraphs of such that , we say that is an approximation preserving subhypergraph of if
Definition 7 (Approximation preserving sequence). For a sequence of subhypergraphs with . We say that is an approximation preserving sequence if is an approximation preserving subset of for all .
Formally, we will prove the following lemma in this section.
Lemma 8 (Approximate sequence lemma). There exists an algorithm that outputs an approximation preserving sequence with probability at least . The expected value of is , and the expected number of cISC queries made is .
3.2.1 Procedure to find an approximation preserving subhypergraph
In this section, we describe two procedures EnsembleColorPartite and ApproxSubhypergraph (see Algorithm 2 and 1) for finding the approximation preserving subhypergraph of H, for any given s-partite d-hypergraph H.
EnsembleColorPartite takes a s-partite d-hypergraph H as input. It outputs multiple s-partite candidates for an approximation preserving subhypergraph. ApproxSubhypergraph takes the original hypergraph H and its subhypergraphs (output of EnsembleColorPartite) as input and generates an approximation preserving subhypergraph using the cISC queries.
These two procedures will be used in the next section for the construction of an approximation preserving sequence. Formally, we will prove the following:
Lemma 9 (Correctness of EnsembleColorPartite). For any s-partite d-hypergraph H with and . Let be the output of EnsembleColorPartite, then we have,
where .
Lemma 10 (Correctness of ApproxSubhypergraph). Let be the output of ApproxSubhypergraph that takes s-partite d-hypergraph H and its subhypergraphs as input. Then, is an approximation preserving subhypergraph of H with probability at least . The number of cISC queries made is .
Algorithm 1 EnsembleColorPartite(H, )
Require: s-partite d-hypergraph H with partite sets , confidence parameter .
Ensure: Subhypergraphs of H where
1: for to do
2: for to s do
3: Sample each vertex of with probability 1/2 and let be the subset of sampled vertices.
4: end for
5: Let .
6: end for
7: return
Now, we present the proof of Lemma 9
Proof of Lemma 9. Fix an s-partite d-hypergraph . For every hyperedge , define a indicator random variable
The expected number of hyperedges in is
Therefore,
Now, applying Hoeffding's Bound (lemma 35), with and , for all , we get
Therefore, we get
which completes the proof.
Algorithm 2 ApproxSubhypergraph(H, )
Require: Subhypergraphs of H where , cISC query access to H and a confidence parameter .
Ensure: A subhypergraph of H.
1: Uniformly and independently sample random hyperedges from H and let S be the multi-set of sampled hyperedges.
2: Compute for .
3: if There exists such that then
4: return
5: else
6: return Any arbitrarily.
7: end if
Lemma 11. With probability at least , the following statements hold for ApproxSubhypergraph
(i) If , then .
(ii) If , then .
The number of cISC queries made is samples.
Proof. Fix a graph for any . For each sampled hyperedge , define the indicator random variable
Observe that .
Define the fraction of sampled hyperedges that belong to by . where is the multiset of sampled hyperedges obtained via cISC queries on . Note that and hence
Now, applying Hoeffding's Bound (lemma 35), with we get
Using , we get the result in (i). Similarly, (ii) can be proved.
We are now ready to prove Lemma 10.
Proof of Lemma 10. Let denote the event that is an approximation-preserving subhypergraph of , that is, . Let be the event that there exists such that . By Lemma 9, .
Let us condition on the event . It suffices to bound . Under the event there exists such that , w.l.o.g assume . If there exists such that , then from Lemma 11, we have with probability at least and ApproxSubhypergraph will only output
. Hence,
Therefore,
3.2.2 Procedure to find approximation preserving sequence
We now describe the algorithm ApproxSubsequence (see Algorithm 3), which constructs an approximation preserving sequence used by the estimator.
Lemma 12 (Correctness of ApproxSubsequence). Consider ApproxSubsequence as described in (Algorithm 3). With probability at least , it outputs an approximation preserving sequence such that . Here is a large constant. The number of cISC queries made is .
Proof. Correctness: We can assume that is sufficiently large, that is, . If not, then from Lemma 4 IsCollision will output 1 with probability , and the algorithm will output nothing.
Algorithm 3 ApproxSubsequence(H, )
Require: cISC access to a s-partite d-hypergraph H.
Ensure: A nested sequence such that
1: Initialize ; coll ;
2: while true do
3: coll IsCollision( )
4: if coll equals 1 then
5: break
6: else
7: EnsembleColorPartite( )
8: ApproxSubhypergraph( )
9:
10: end if
11: end while
12: return
Now, we prove the claim by induction on . For each , let denote the event that the algorithm either terminates with or produces . Let denote the event that occurs for all , that is
First we claim that, If then where .
We consider two cases and , analyse them individually. In what follows, we assume that has occurred.
Case 1: . Let where be the event that IsCollision output 0, be the event that EnsembleColorPartite outputs and be the event that ApproxSubhypergraph outputs . So, from Lemma 4 we have , from Lemma 9 we have and from Lemma 10, we have . Then
Case 2: . In this case, we show that
regardless of whether ApproxSubhypergraph terminates after executing IsCollision or proceeds to execute EnsembleColorPartite and ApproxSubhypergraph.
In the former case, the claim follows directly from the definition of together with the fact that . In the latter case, EnsembleColorPartite and ApproxSubhypergraph produces , this occurs with probability . Hence
Therefore, taking the union bound over all iterations, the probability that the algorithm produces a valid sequence is:
Query Complexity: From Lemma 4, 9 and 10, the number of cISC queries made by IsCollision (for a constant threshold ), EnsembleColorPartite and ApproxSubhypergraph over iterations is,
Note that the number of iterations and the query complexity of ApproxSubsequence (as mentioned in the above lemma) are random variables. We will argue their expectation in the following lemma. Moreover, when we discuss the algorithm of estimating the hyperedge count of s-partite d-hypergraph in 3.3 (that uses ApproxSubsequence as a subroutine), we show that the query complexity of the this algorithm is , where is the number of iterations of ApproxSubsequence. The following lemmas will be useful in establishing the query complexity in 3.3.
Lemma 13. , , and .
Proof. Let be the output of ApproxSubhypergraph, where the vertices of is chosen independently with probability from the vertex set of , for all and .
Let be the number of rounds it takes for vertex in to be picked and removed. follows a geometric distribution where the probability of success of being removed on the -th round is
Then the total number of rounds, . Therefore,
Now, we will show that ,
can be shown in a similar manner.
3.3 Procedure to hyperedge estimation of s-partite d-hypergraph
In this section, we present the algorithm for estimating the number of hyperedges of s-partite d-hypergraph using cISC queries and prove Theorem 3.
EdgeEstimationPartite (Algorithm 5) begins by calling subseeq which outputs an approximation preserving sequence , where each is bounded below by a constant. This ensures that each ratio can be estimated efficiently. To estimate each , we use the subroutine MulEstimation which returns an -approximation of . The procedure MulEstimation is described in Algorithm 4 and its guarantee is established in Lemma 14.
Algorithm 4 MulEstimation( )
Require: A subhypergraph of and cISC access to the hypergraph .
Ensure: An estimate of
1: Uniformly and Independently sample random hyperedges from and let be the multi-set of sampled hyperedges.
2: return .
Lemma 14 (Correctness of MulEstimation). For hypergraph such that and , If , then MulEstimation outputs , where and with probability at least . The number of cISC queries made is .
Proof. Let be the indicator random variable such that,
Define the number of hyperedges sampled that belong to as , where is the multi-set of sampled hyperedges and the expected size of is
Therefore,
By the Chernoff Bound (see Lemma 36), we have
where the last step uses .
We prove Theorem 3 by proving Lemma 15 and Lemma 16.
Lemma 15. The expected query complexity of EdgeEstimationPartite is .
Algorithm 5 EdgeEstimationPartite(H, ε, δ)
Require: cISC access to the hypergraph H.
Ensure: An estimate of
1: for to do
2:
3:
4: Initialize , for all
5: for to do
6:
7: end for
8:
9: end for
10: return median
Proof. From Lemma 14, the number of cISC queries made by MulEstimation in every iteration is
Summing over iterations, we get
From Lemma 12, the number of ISC queries made by ApproxSubsequence is . Finally, from Lemma 5, the number of cISC queries made by BirthdayEstimate is . Combining all contributions, the query complexity of a single execution of the outer loop is dominated by MulEstimation, and hence is . From Lemma 13,
Since the outer loop is repeated times, the expected query complexity is
as claimed.
Lemma 16. EdgeEstimationPartite, outputs -approximation to with probability at least .
Proof. In the outer loop of EdgeEstimationPartite (Line 1), the algorithm is repeated times to boost its success probability to at least using the standard median-of-mean tricks. In what follows, we prove that a single execution of EdgeEstimationPartite outputs a -approximation to with probability at least 2/3.
Let , where be the event that ApproxSubsequence outputs an approximation-preserving sequence with . From lemma 12 we have .
be the event that BirthdayEstimate outputs an approximation of , from Lemma 5, we have . Therefore,
Let be the event that MulEstimation() outputs such that and for all , where . Therefore, using Lemma 14 and applying the union bound over all ,
Let be the event that . By Hoeffding's bound (Lemma 35),
(1)
Hence,
In what follows, we assume that all of the events , and occur. Since, , it is enough to argue that EdgeEstimationPartite returns an -approximation to when all , and holds.
Combining the output of MulEstimation over the iterations, we get,
Using the fact that for each , it can be shown that
Since event occurs,
Using the fact that for any , we have and . We get,
Since occurs, i.e., occurs, satisfies the following:
Combining (2) and (3), we get,
Since, for each and , . So, simplifying the above expression, we have
We are now ready to prove Theorem 3.
Proof of Theorem 3. The correctness of the algorithm follows from Lemma 16, and its query complexity follows from Lemma 15.
4 Hyperedge Estimation of d-hypergraph
In this section, we present the full algorithm for estimating the number of hyperedges of d-hypergraph using cISC queries and prove our main upper bound stated below.
Theorem 1. For every integer and , there exists a randomized algorithm that, given access to the s-colorful random certificate oracle cISC, outputs -approximation of the number of hyperedges with probability at least 2/3 using s-colorful random certificate queries.
EdgeEstimation (Algorithm 7) begins by calling EnsembleColor which outputs multiple s-partite d-hypergraphs by uniformly partition the vertex set into s classes. The procedure for EnsembleColor is described in Algorithm 6 and its guarantee is established in Lemma 18.
Algorithm 6 EnsembleColor(G, ε, δ)
Require: cISC query access to G, error parameter ε ∈ (0, 1) and a confidence parameter δ ∈ (0, 1).
1: for i = 1 to t = O (f²(s, d)ε⁻² log (δ⁻¹)) do
2: Uniformly and independently partition V into V₁, V₂, ..., Vₛ and let Gᵢ = G [V₁, V₂, ..., Vₛ].
3: end for
4: return G₁, G₂, ..., Gₜ
Lemma 18. Let , then EnsembleColor outputs a set of s-partite d-hypergraph where , such that we have,
Proof. Fix an s-hypergraph . For every hyperedge , define a indicator random variable
The expected number of hyperedges in is
Therefore,
Now, applying Hoeffding's Bound 35, with and , for all , we get
□
Algorithm 7 EdgeEstimation()
Require: cISC access to the hypergraph .
Ensure: An estimate of
1:
2: for to do
3:
4: end for
5: return
Now, we prove the main upper bound.
Proof of Theorem 1. Correctness: Let be the event that EnsembleColor outputs a set of -partite -hypergraph such that
Then, from Lemma 18, .
Let, for any , be the event that EdgeEstimationPartite outputs an -approximation of . By Lemma 16, . Let be the event that occurs for all , that is
Using the union bound, we can write which implies
Therefore, .
In what follows, we assume that events and have occurred. we show that EdgeEstimation outputs -approximation of when both and holds. we have,
Combining the above, we get
Using the fact that , , for any , we get
Query Complexity: EdgeEstimationPartite is executed times. So, from Lemma 15 the total query expected complexity is
where is function in terms of s and d.
5 Lower Bounds
In this section, we establish the main lower bound of our work. We show that for every , any randomized algorithm with access only to the s-colorful decision oracle (cIS) must make a polynomial number of queries to estimate the number of hyperedges in a d-uniform hypergraph.
We prove the following theorem in this section which is stronger that Theorem 2 in the sense that this is parametrized by the number of edges.
Theorem 19 (Main lower bound). Let , , and let satisfy . Any randomized algorithm that has access to an s-colorful cIS oracle must make
queries to distinguish whether a rank-d hypergraph has at most m hyperedges or at least 2m hyperedges, with probability at least 2/3.
Theorem 19 immediately implies Theorem 2. Indeed, setting in Theorem 19 yields a lower bound of
We remark that the lower bound in Theorem 19 continues to hold even if the algorithm is given access to a stronger s-colorful decision oracle (cIS), in which the s queried sets are allowed to overlap. For simplicity of notation, throughout this section we continue to use cIS to denote this stronger oracle.
We prove Theorem 19 by proving Lemma 20 and Lemma 21, stated below. Note that Lemmas 20 and 21 establish the desired lower bound when the number of hyperedges is large ( ) and small ( ), respectively. Here c is a suitable constant.
Lemma 20 (Lower bound for dense hypergraphs). Let . Any randomized algorithm that has access to an s-colorful cIS oracle must make
queries to distinguish whether a rank-d hypergraph has at most m hyperedges or at least 2m hyperedges, with probability at least 2/3. Here is a constant that depends only on s and d.
Lemma 21 (Lower bound for sparse hypergraphs). Let . Any randomized algorithm that has access to an s-colorful cIS oracle must make
queries to distinguish whether a rank-d hypergraph has at most m hyperedges or at least 2m hyperedges, with probability at least 2/3. Here is a constant that depends only on s and d.
We first prove Lemma 20 in We first prove Lemma 20 in Section 5.1. We then establish Lemma 21 in Section 5.2, whose proof relies on Lemma 20. Here is a constant that depends only on s and d.
5.1 Proof of the lower bound in dense hypergraphs
For technical reasons, we assume for some sufficiently small constant . Otherwise, the claimed lower bound is straightforward as hides polylog term.
To establish the lower bound for the case of dense hypergraphs, we argue using Yao’s principle [Yao77]. We design two hypergraph distributions that are indistinguishable by any deterministic algorithm that uses less than queries, where:
We start by describing the two distributions, and . Without loss of generality, we assume the vertex set of both the graphs to be for some .
- : The vertex set is partitioned into by putting each vertex in one of the independently and uniformly at random. For every -tuple such that for all , the graph has an edge with probability:
- : The graph is first constructed as is done for the case of . Additionally, we construct a set of vertices B by choosing each vertex of independently with probability:
For every , we add edges .
Both the probabilities above are less than 1 as we are working with .
We show (in Lemma 22) that, with probability , graphs sampled from contain almost twice as many edges as graphs sampled from . However, any algorithm that distinguishes between and must encounter at least one vertex in the set . We prove that, unless the algorithm makes queries, it encounters a vertex in with probability only . This forms the core of our lower-bound argument, which we formalize in the remainder of this section.
Lemma 22. With probability ,
-
A graph sampled from has at most edges, and
-
A graph sampled from has at least m edges.
Proof. We proceed by analysing and separately.
: For graphs generated by , there are at most d-tuples such that for all . Each of which forms an hyperedge with probability . Hence, the expected number of edges is . As each hyperedge is formed independently, the claim follows by a Chernoff bound argument.
: For graphs generated by , we first note that with probability , we have for all . Furthermore, with probability , we have . This is true since we assume . Note that each vertex in forms an edge with all -tuples of the form such that for all . Hence, by a union bound, we have that the graph has at least edges with probability .
Next, we want to show that the probability that an algorithm using queries hits a vertex in B is very small. However, such a claim is obviously false if the algorithm makes the queries set of vertices arbitrarily large. However, if the query set is too large, the hypergraph construction ensures that it is not independent with high probability. Hence, we can restrict meaningful queries to be of bounded size, say and argue based on that. For this purpose, we describe an augmented oracle that simulates the cIS query for graphs generated by or .
At each stage, an algorithm with access to the augmented oracle can maintain a triplet (K, , e) where is a set of vertices, , is a labelling function that denotes the set containing the vertices, and is the indicator function denoting whether the corresponding hyperedge exists or not. Initially, is initiated with . The augmented oracle takes as input the current state of and a set of vertices , and returns an updated with additional information updated as outlined below depending on the size of query sets , and a threshold where:
-
If such that no colorful -tuple can be formed using : First, we consider the case that a subset of queries prohibits the formation of a colorful tuple, i.e. there is no such that each belongs to a different color class in . This implies that the query set is an independent set according to the definition of the cIS oracle. The augmented oracle chooses a minimal such tuple , and returns an updated with , and updates for vertices in .
-
for all : The augmented oracle returns , and and are updated for the vertices in according to , , and the set of hyperedges in the sampled graph .
-
such that : The augmented oracle samples a subset of size uniformly at random, for all such that . For all such that , denote . If is not an independent set, the oracle returns , and returns and on the updated set of vertices. If is an independent set, the oracle fails, and returns the entire graph, i.e. , and and updated the vertices in according to , , and the set of hyperedges in the sampled graph .
Note that, without loss of generality, we can assume that all the queries consists of vertices not explored already, i.e. . Next, we show that the augmented oracle can simulate the original cIS queries. We formalize this in the following result.
Lemma 23. Given a deterministic algorithm A with access to cIS queries that makes q queries, there exists an algorithm with access to augmented oracle such that:
• makes q queries to the augmented oracle.
•
Proof. We show how to simulate the cIS queries using augmented queries. The algorithm then executes the algorithm A using the simulated cIS queries. We consider the cases whether is less than or equal to , or greater than separately:
• If such that no colorful -tuple can be formed using : The updated triplet contains the labels for vertices in . Given the updated labels, it can be checked that the query sets does not form a colorful tuple, i.e. the query forms an independent set.
-
for all : The updated triplet returned by the augmented oracle can be directly used to determine whether the queries vertices form an independent set or not based on the edges .
-
such that : We consider the two possible cases for the augmented oracle depending on whether is an independent set or not.
– If is not an independent set, then is also not an independent set.
– If is an independent set, then the augmented oracle reveals the graph completely. Hence, one can decide whether is an independent set or not.
25
□
We now focus on analyzing , and bound its ability to distinguish between graphs generated by and using queries. Observe that can be seen as a tree of depth whose each edge is labeled by a knowledge triplet , and each node is labeled by a query set . Given an edge , we define the knowledge triplet of the node to be the knowledge triplet associated with the incoming edge . Furthermore, each leaf node is additionally labeled either ‘yes’ or ‘no’ denoting the output of the algorithm . Below, we define the notion of good nodes that would be useful in our proof.
Definition 24 (Good and Bad Nodes). We say a node in the tree is good if its corresponding knowledge triplet satisfies , and say the node to be bad otherwise.
Now, we bound the probability that reaches a bad node. Note that can not reach a bad node if the graph G is generated by . Hence, we only bound the probability for the case when the graph G is generated by . Next, we outline the conditional distribution of the graph G given the algorithm is at a node v. The fact shows that given the algorithm is at a good node v, the conditional distribution of the unexplored graph retains sufficient randomness.
Fact 25. Let the algorithm arrive at a good node v with corresponding knowledge triplet . Then, the conditional distribution of the graph G is as follows:
-
: Assign each to as fixed in , and add edges as fixed in . Assign vertices in uniformly at random to one of . For any pair such that , add an edge with probability .
-
: Assign each to as fixed in , and add edges as fixed in . Assign vertices in uniformly at random to one of . For each such that , include in independently with probability . For any pair such that such that , add an edge with probability . For every , we add edges .
Next, we show that if the query sets does not form a colorful tuple, then all of the sets have their size bounded by with high probability. Note that, here the randomness comes from generating the graphs according to the underlying distribution.
Lemma 26. Let be a set such that , and be a minimal set of query sets such that no colorful -tuple can be formed using them. Then, with probability , .
Proof. We prove by contradiction. Assume that such that . We first show that any such query set intersects with all the colored partitions with high probability.
Recall that the vertices are assigned to the partitions uniformly, and independently at random. The probability that fails to intersect a specific partition is bounded by . By a union bound, the probability that misses any of the partitions is at most:
Where the second last inequality follows from the fact that and , and the last equality follows from the fact that .
Now, we show that if a query set spans all colors, it can not be part of a minimal set of queries that can not form a colorful tuple. Consider the bipartite graph where ,
, and if . If there exists a matching of in this graph, then there exists a colorful -tuple that can be formed using . Hence, we consider the case where no matching of exists in this graph. By Hall's Marriage Theorem, and the minimality of , we have:
Note that the query set is part of , and hence with probability ,
On the other hand, we have:
Hence, a contradiction.
Now, we bound the probability that reaches a bad node. Note that can not reach a bad node if the graph G is generated by . Hence, we only bound the probability for the case when the graph G is generated by .
Lemma 27.
Proof. Note that the root note is always good as . We now bound the probability that a query made by the algorithm causes it to reach a bad node given it started from a good node . We consider the cases whether for all or for some separately.
for all : In this case, the query sets must share a vertex with . Hence, we have:
Hence, by union bound, no query set intersect with with probability .
If such that no colorful -tuple can be formed using : By Lemma 26, we have that any such query can contain a such that with probability at most . Hence, all such queries reveals such that for all with probability at least . Conditioning on the fact, we can bound the probability of reaching a bad node by using the same argument as the previous case.
∃i ∈ [s] such that |Qi | > τ : In this case, there are two ways for A to reach a bad node: 1) If Ri ∩ B ̸= ∅ for some i ∈ [s], and 2) If R1, R2, ..., Rs is an independent set. The probability of the first event can be bounded as above. Hence, we focus on the second event. Observe that in this case there exits an i such that |Ri | ≥ τ . Let us denote Ri ∗ to be the largest query set Ri satisfying |Ri ∗ | ≥ τ . Observe that with probability 1 − 1 poly(n) , we have that Aj ∩ Ri ∗ = Ω τ d for all j ∈ [d]. Now, we consider the number of edges (v1, v2, ..., vd) such that (v1, v2, ..., vs−1) forms a colorful tuple formed by {Ri}i∈d \ Ri ∗ , and vs, vs, . . . , vd ∈ Ri ∗ . The existence of valid (s − 1)-colorful tuple ensures that the expected number of such edges is at least: Y d i=s Ω τ d = Ω Åτ d d−s+1ã = Ω (q) By Chernoff Bound, we have that with probability 1 − o Ä 1 q ä , there exists such an edge. Hence, by an union bound over all possible queries q, the algorithm A reaches a bad node with probability at most o (1). Next, we show that the probability of hitting a good node is not higher for a graph sampled from Dno compared to that sampled from Dyes. Lemma 28. For every good node v in the tree of A, we have: Pr G∼Dno [A(G) reaches v] ≤ Pr G∼Dyes [A(G) reaches v] Proof. We first show a coupling between the distributions Dyes, and Dno. First, draw a graph G from Dyes and obtain corresponding labeling A1, A2, ..., Ad. Then, we draw r ∈ {0, 1} |A1| where each bit is set to 1 independently with probability d dm log n nd . Next, we construct G′ from G by adding edges ⟨i, a2, a3, . . . , ad⟩|a2 ∈ A2, a3 ∈ A3, . . . ad ∈ Ad
for all i ∈ A1 such that ri = 1. This defines a coupling between Dyes and Dno as G′ has the marginal distribution Dno. Now, let us consider v to be a good node in the execution tree of the algorithm A, and let (K, ℓ, e) be its corresponding knowledge triple. A(G′ ) reaches v if A(G) reaches v and ri = 0 for all i ∈ ℓ −1 (A1). Hence, we have: Pr (G,G′) [A(G ′ ) reaches v] = Pr (G,G′) [A(G) reaches v and ri = 0, ∀i ∈ ℓ −1 (A1)] ≤ Pr (G,G′) [A(G) reaches v] Now we show that an algorithm A using augmented oracle can not distinguish between graphs generated from Dyes and Dno. Lemma 29. Let A be a deterministic algorithm using at most q augmented oracles. Then, we have: Pr G∼Dno [A(G) outputs “no”] − Pr G∼Dyes [A(G) outputs “no”] ≤ o (1) 28
Proof. Let denote the set of leaves in the execution tree of that are labeled “no”. Let denote the subset of good nodes in . Then, we have:
Note that the proof of Lemma 20 is done.
5.2 Proof of the lower bound in sparse hypergraphs
Let . Suppose, for the sake of contradiction, that there exists an algorithm which, for every -uniform hypergraph on vertices satisfying (the sparse case), distinguishes between and using -colorful cIS queries with probability at least 2/3, while making fewer than
queries, where is a constant to be fixed later. We use to contradict Lemma 20. Define , so that . That is, sits exactly on the dense/sparse threshold for , and in particular satisfies (with equality) the hypothesis of Lemma 20. Moreover, since , we get , so . Therefore the pair satisfies the assumptions of Lemma 20. Let be an arbitrary instance of Lemma 20, and construct , where is a vertex-disjoint -uniform hypergraph containing additional vertices and no hyperedges. The added vertices respect the given -color partition. Thus, has vertices and exactly the same number of hyperedges as .
Every -colorful cIS query made by to can be simulated using one query to . Suppose queries the sets . For every , let . Since the sets are pairwise disjoint, so are , and therefore they form a valid -colorful cIS query to . Furthermore, contains no hyperedges, and there are no hyperedges between and . Hence, the answer to the query on is identical to the answer to on . Consequently, simulates every query of using exactly one oracle query, and therefore has the same success probability and query complexity as .
A direct computation gives , so that, writing for a constant depending only on ,
Hence, the query bound assumed for (and hence for its simulation on ) can be rewritten as
We now set , where is the constant appearing in Lemma 20. On the other hand, Lemma 20 asserts that every algorithm for distinguishing whether or requires at least queries. This directly contradicts the query bound assumed for . Therefore, cannot exist, proving the desired lower bound. Hence, we are done with the proof of Lemma 21.
6 Discussion and Applications
Our main algorithm naturally yields a high-probability constant-factor approximation to the number of hyperedges. Such a coarse estimator is a fundamental primitive in the framework of [DLM22] for hyperedge estimation and almost-uniform hyperedge sampling. We observe that this framework, although originally developed for the d-colorful decision oracle, applies verbatim to the s-colorful random certificate oracle. Consequently, our main result immediately implies efficient algorithms for both problems.
By standard probability amplification, Theorem 1 immediately yields the following.
Corollary 30. For every integer , there exists a randomized algorithm that, given access to the s-colorful random certificate oracle cISC, outputs an estimate satisfying with probability at least using s-colorful random certificate queries.
Besides hyperedge estimation, another fundamental task is almost-uniform hyperedge sampling, where the goal is to output a hyperedge according to a distribution D satisfying
for every hyperedge e.
As observed by [BBGM24], the framework of [DLM22] reduces both hyperedge estimation and almost-uniform hyperedge sampling to the problem of obtaining a high-probability constant-factor estimate of the number of hyperedges.
Proposition 31 ([DLM22, BBGM24]). Suppose there exists an algorithm COARSE that, given access to the s-colorful random certificate oracle, makes q queries and outputs an estimate with probability at least . Then:
-
Hyperedge estimation can be solved using queries.
-
Almost-uniform hyperedge sampling can be solved using queries.
Instantiating Proposition 31 with the coarse estimator from Corollary 30 immediately yields the following theorem.
Theorem 32. For every integer , there exists a randomized algorithm that, given access to the s-colorful random certificate oracle cISC, computes a -approximation of the number of hyperedges using queries.
Moreover, there exists a randomized algorithm that outputs a hyperedge according to a distribution satisfying for every hyperedge , using queries.
Combining Theorem 1 with Theorem 32 (or the theorem obtained from Proposition 31) immediately yields the following corollary.
Corollary 33. For every integer , there exists a randomized algorithm that, given access to the s-colorful random certificate oracle cISC, computes -approximation of the number of hyperedges with probability at least using
s-colorful random certificate queries.
The above corollary combines the strengths of the two approaches. For , the direct algorithm of Theorem 1 yields the better query complexity, whereas for , the reduction through the coarse estimator and the framework of [DLM22] gives the better bound. In particular, while our direct algorithm provides the strongest known bounds for hyperedge estimation over a broad range of approximation parameters, the reduction via coarse estimation additionally yields an efficient algorithm for almost-uniform hyperedge sampling.
7 Conclusion
We introduced a hierarchy of s-colorful query oracles for hyperedge estimation and gave the first systematic study of their power. Our results show that, for every , a polylogarithmic number of s-colorful random certificate queries suffice for hyperedge estimation, with the exponent of the factor, is an absolute constant, independent of both s and d. In contrast, for every , any algorithm using only the corresponding s-colorful decision oracle requires polynomially many queries. Combined with the known bounds for the d-colorful decision oracle [DLM22, BBGM24, DLM24], this reveals a phase transition at : the decision query complexity drops from polynomial to polylogarithmic precisely at , yet even there a separation persists, as random certificates provably reduce the exponent of the factor from to an absolute constant. More broadly, our work unifies several previously studied global query models within a common framework, and exhibits a fine-grained decision-versus-search separation for approximate counting: search with uniformly random certificates is exponentially more powerful than decision access whenever the underlying solver supports fewer than d restriction classes. Determining the exact query complexity of the s-colorful decision oracle as a function of s, and characterizing the query models in which random certificates provably help, are natural directions for future work.
References
[AHL26] Tomer Adar, Yahel Hotam, and Amit Levi. When Local and Non-Local Meet: Quadratic Improvement for Edge Estimation with Independent Set Queries, 2026. arXiv:2601.21457.
[AJS19] Matthew Aldridge, Oliver Johnson, and Jonathan Scarlett. Group Testing: An Information Theory Perspective. Foundations and Trends in Communications and Information Theory, 15(3-4):196–392, 2019.
[AMM22] Raghavendra Addanki, Andrew McGregor, and Cameron Musco. Non-Adaptive Edge Counting and Sampling via Bipartite Independent Set Queries. In Proceedings of the 30th Annual European Symposium on Algorithms, ESA, pages 2:1–2:16, 2022.
[BBGM19] Anup Bhattacharya, Arijit Bishnu, Arijit Ghosh, and Gopinath Mishra. Hyperedge Estimation using Polylogarithmic Subset Queries. CoRR, abs/1908.04196, 2019.
[BBGM24] Anup Bhattacharya, Arijit Bishnu, Arijit Ghosh, and Gopinath Mishra. Faster Counting and Sampling Algorithms using Colorful Decision Oracle. ACM Transactions on Computation Theory, 16(2):12:1–12:19, 2024. A preliminary version of this paper appeared as an extended abstract in the proceedings of STACS 2022.
[BC18] Rishiraj Bhattacharyya and Sourav Chakraborty. Property Testing of Joint Distributions using Conditional Samples. ACM Transactions on Computation Theory, 10(4):16:1–16:20, 2018.
[BCD 25] Arijit Bishnu, Debarshi Chanda, Buddha Dev Das, Arijit Ghosh, and Gopinath Mishra. Optimal Non-Adaptive Algorithm for Edge Estimation. CoRR, abs/2512.11994, 2025.
[BCP 24] Rishiraj Bhattacharyya, Sourav Chakraborty, Yash Pote, Uddalok Sarkar, and Sayantan Sen. Testing Self-Reducible Samplers. In Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence (AAAI), pages 7952–7960, 2024.
[BCS26] Lorenzo Beretta, Deeparnab Chakrabarty, and C. Seshadhri. Faster Estimation of the Average Degree of a Graph Using Random Edges and Structural Queries. In Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 939–971, 2026.
[BGK 23] Arijit Bishnu, Arijit Ghosh, Sudeshna Kolay, Gopinath Mishra, and Saket Saurabh. Almost optimal query algorithm for hitting set using a subset query. Journal of Computer and System Sciences, 137:50–65, 2023. A preliminary version of this paper appeared as an extended abstract in the proceedings of ISAAC 2018, under the title “Parameterized Query Complexity of Hitting Set using Stability of Sunflowers”.
[BHR 20] Paul Beame, Sariel Har-Peled, Sivaramakrishnan Natarajan Ramamoorthy, Cyrus Rashtchian, and Makrand Sinha. Edge Estimation with Independent Set Oracles. ACM Transactions on Algorithms, 16(4):52:1–52:27, 2020.
[BT24] Lorenzo Beretta and Jakub Tetek. Better Sum Estimation via Weighted Sampling. ACM Transactions on Algorithms, 20(3):27: 1 – 33, 2024. An extended abstract of this paper appeared in the proceedings of SODA 2022.
[CCK 21] Clément L. Canonne, Xi Chen, Gautam Kamath, Amit Levi, and Erik Waingarten. Random Restrictions of High Dimensional Distributions and Uniformity Testing with Subcube Conditioning. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 321–336, 2021.
[CCKM23] Diptarka Chakraborty, Sourav Chakraborty, Gunjan Kumar, and Kuldeep S. Meel. Approximate Model Counting: Is SAT Oracle More Powerful Than NP Oracle? In Proceedings of the 50th International Colloquium on Automata, Languages, and Programming (ICALP), volume 261, pages 123:1–123:17, 2023.
[CDGM26] Debarshi Chanda, Buddha Dev Das, Arijit Ghosh, and Gopinath Mishra. From decision to random certificates: Exponential separation for edge estimation with independent set queries. In Proceedings of the 30th International Conference on Randomization and Computation (RANDOM 2026), 2026. To appear.
[CEV25] Keren Censor-Hillel, Tomer Even, and Virginia Vassilevska Williams. Output-Sensitive Approximate Counting via a Measure-Bounded Hyperedge Oracle, or: How Asymmetry Helps Estimate k-Clique Counts Faster. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC, pages 1985–1996, 2025.
[CFGM13] Sourav Chakraborty, Eldar Fischer, Yonatan Goldhirsh, and Arie Matsliah. On the power of conditional samples in distribution testing. In Proceedings of the 4th Conference on Innovations in Theoretical Computer Science (ITCS), pages 561–580, 2013.
[CLW20] Xi Chen, Amit Levi, and Erik Waingarten. Nearly optimal edge estimation with independent set queries. In Proceedings of the 31st Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, pages 2916–2935, 2020.
[CRS14] Clément L. Canonne, Dana Ron, and Rocco A. Servedio. Testing equivalence between distributions using conditional samples. In Proceedings of the 25th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1174–1192, 2014.
[CRS15] Clément L. Canonne, Dana Ron, and Rocco A. Servedio. Testing Probability Distributions using Conditional Samples. SIAM Journal on Computing, 44(3):540–616, 2015. An extended abstract of this work appeared in SODA 2014.
[DL21] Holger Dell and John Lapinskas. Fine-grained reductions from approximate counting to decision. ACM Trans. Comput. Theory, 13(2):8:1–8:24, 2021.
[DLM22] Holger Dell, John Lapinskas, and Kitty Meeks. Approximately Counting and Sampling Small Witnesses Using a Colorful Decision Oracle. SIAM Journal on Computing, 51(4):849–899, 2022. A preliminary version of this paper appeared as an extended abstract in the proceedings of SODA 2020.
[DLM24] Holger Dell, John Lapinskas, and Kitty Meeks. Nearly Optimal Independence Oracle Algorithms for Edge Estimation in Hypergraphs. In Proceedings of the 51st International Colloquium on Automata, Languages, and Programming, ICALP, volume 297, pages 54:1–54:17, 2024.
[Dor43] Robert Dorfman. The Detection of Defective Members of Large Populations. The Annals of Mathematical Statistics, 14(4):436 – 440, 1943.
[Fei06] Uriel Feige. On Sums of Independent Random Variables with Unbounded Variance and Estimating the Average Degree in a Graph. SIAM Journal on Computing, 35(4):964–984, 2006. An extended abstract of this paper appeared in the proceedings of STOC 2004.
[GR08] Oded Goldreich and Dana Ron. Approximating Average Parameters of Graphs. Random Structures & Algorithms, 32(4):473–493, 2008. An extended abstract of this paper appeared in the proceedings of RANDOM 2006.
[MU05] Michael Mitzenmacher and Eli Upfal. Probability and Computing: Randomized Algorithms and Probabilistic Analysis. Cambridge University Press, Cambridge, 2005.
[RT16] Dana Ron and Gilad Tsur. The Power of an Example: Hidden Set Size Approximation Using Group Queries and Conditional Sampling. ACM Transactions on Computation Theory, 8(4), 2016.
[Sto83] Larry J. Stockmeyer. The Complexity of Approximate Counting (Preliminary Version). In Proceedings of the 15th Annual ACM Symposium on Theory of Computing (STOC), pages 118–126, 1983.
[Sto85] Larry J. Stockmeyer. On Approximation Algorithms for #P. SIAM Journal on Computing, 14(4):849–861, 1985.
[Yao77] Andrew Chi-Chin Yao. Probabilistic computations: Toward a unified measure of complexity. In Proceedings of the 18th Annual Symposium on Foundations of Computer Science, SFCS '77, page 222–227, USA, 1977. IEEE Computer Society.
Appendix
A Threshold Checking
In this section, we present the algorithms IsCollision, BirthdayEstimate and the proofs of Lemma 4 and Lemma 5.
Algorithm 8 IsCollision(G, , )
Require: cISC access to the s-partite d-hypergraph G and a threshold .
Ensure: 0 or 1
1: for to do
2: Uniformly and independently sample random hyperedges from G using cISC query.
3: if there is a collision then
4:
5: else
6:
7: end if
8: end for
9: if more than half of are 1 then
10: return 1
11: else
12: return 0
13: end if
Lemma 4 (Correctness of IsCollision). For a s-partite d-hypergraph H and a threshold , the following statements hold for IsCollision with probability at least :
(i) If , then IsCollision outputs 1.
(ii) If , then IsCollision outputs 0.
The number of cISC queries made is
Proof. Fix an iteration i of IsCollision (Line 1). The probability that no collision occurs in the i-th iteration is
If , We upper bound the probability of no collision as follows:
If , we lower bound the probability of no collision:
If , . IsCollision outputs 0 when more than half of . Over parallel runs, using the upper tail estimate of the Chernoff Bound (see Lemma 36), the probability that IsCollision outputs 0 is at most . Similarly, if , the probability that IsCollision outputs 1 is at most .
Algorithm 9 BirthdayEstimate(G, , , )
Require: cISC access to the s-partite d-hypergraph G, error parameter , confidence and a threshold .
Ensure: An estimate of
1: Uniformly and independently sample random hyperedges from G using cISC query.
2: Let be the number of samples drawn and r is the number of collisions.
3: return .
Lemma 5 (Correctness of BirthdayEstimate). For a s-partite d-hypergraph , threshold and approximation error . If , then BirthdayEstimate outputs an estimate of with probability at least . The number of cISC query made is .
Proof. Let be the sampled edges. or , define the indicator random variable to be 1 if and 0 otherwise. Then,
Define the total number of collisions by . By the linearity of expectation
Since the random variables are not independent. We will bound the variance using
Let us bound the first term in (4)
Next, consider the covariance terms in (4). If and correspond to disjoint pairs, then they are independent and the covariance is zero. If they overlap in exactly one index (share exactly one index), then
So, the bound on the variance is . Using Chebyshev's Inequality (Lemma 34), we have
To complete the proof, we need to show with probability at least
From (5), with probability at least ,
This implies
For any
Since X is the number of collisions. We conclude that
which completes the proof.
B Concentration Bounds
We use the following concentration bounds [MU05].
Lemma 34 (Chebyshev's Inequality). Let X be a random variable and a > 0, Then
Lemma 35 (Hoeffding's bound). Let be independent random variables such that for all , and . Then
Lemma 36 (Multiplicative Chernoff Bound). Let be i.i.d. random variables where and for all , and . Then, we have