Manuscript Offprint
arXiv:2611.05356Breaking the quantum barriers for Graph Collision
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
In the graph collision problem, the task is to decide whether a known graph on vertices contains an edge with both endpoints marked, given query access to the input bits specifying the marked vertices. We first refute the conjectured query lower bound with a bounded error quantum algorithm using queries. We then refine this approach to obtain a query algorithm. We also obtain a query bound for all (partial) Boolean output functions with positive certificate complexity at most 2 and alphabet size , contrasting a known lower bound for such problems with large alphabet sizes. We complement these algorithms with an quantum query lower bound for graph collision, exceeding the certificate complexity barrier for the positive adversary method.
*University of Cambridge. ajcornelissen@outlook.com †University of Maryland. asgilani@umd.edu ‡NVIDIA. shiva.kintali@gmail.com §Nagoya University. legall@math.nagoya-u.ac.jp ¶Eindhoven University of Technology. s.patro@tue.nl ||The University of British Columbia. zxingyu@cs.ubc.ca
Contents
1 Introduction 3
1.1 Technical overview ..... 4
1.2 Organization ..... 12
2 Preliminaries 12
3 An algorithm breaking the barrier 14
4 An improved algorithm 21
4.1 Case I: High-degree vertices ..... 22
4.2 Case II: Low-degree vertices ..... 23
4.3 Finishing the argument ..... 31
5 Functions with positive certificates of size two 31
6 A lower bound breaking the barrier 33
6.1 Construction of the adversary matrix ..... 33
6.2 The denominator and the adversary ratio ..... 37
References 43
Appendix 46
Magniez, Santha, and Szegedy introduced graph collision as a subroutine for triangle finding and gave an query quantum algorithm for arbitrary graphs [MSS07, JKLGM16]. Their algorithm uses Ambainis's quantum walk for element distinctness [Amb07]. Subsequent work improved this bound for graphs with few nonedges [JKLGM16], small independence number [Bel12], or small treewidth [ABI+13]. Other bounds depend on the degrees of vertices in independent sets [GI12, ABI+13]. Despite these improvements for particular graph families, the bound remained the best known for arbitrary graphs.
A reduction from unstructured search gives a worst case lower bound of [BCdWZ99], leaving a gap between the known upper and lower bounds. Gavinsky and Ito ask whether graph collision admits a query algorithm [GI12, Section 6], while Ambainis et al. and Balodis and Iraids leave an bound for arbitrary graphs open [ABI+13, BI16]. Determining the quantum query complexity of graph collision also appears among the open problems in Kothari's thesis [Kot14, Open Problem 4.3] and in the work of Bun, Kothari, and Thaler [BKT20, Section 7.2]. In the other direction, Cornelissen, Gilani, and Patro report that the bound is believed by some in the community to be optimal [CGP26]. Gilani, Mande, Patro, and Raja formulate a conjecture for detecting marked cliques whose case asserts that some graph families require queries for graph collision [GMPR26, Conjecture 1.5].
We refute this conjecture. We first give a relatively elementary algorithm using queries in Section 3. Its central idea is to estimate the number of marked neighbors of each vertex and use these estimates to divide the edges into parts that can be tested efficiently. In Section 4, we refine the same approach to obtain the following stronger bound.
Theorem 1.1. There is a quantum algorithm that solves the graph collision problem on any -vertex graph with high probability using queries.
Our upper bound also applies to functions whose positive inputs can be certified by fixing at most 2 input symbols. In Section 5, we reduce any such (partial) Boolean output function on input symbols from an alphabet of size to graph collision on vertices. By Theorem 1.1, this gives a query bound of . This contrasts with the lower bound for element distinctness over large alphabets [AS04, Amb05, Ros14], whose positive inputs also have certificates of size 2. More generally, our bound is for and fixed , showing the importance of the alphabet size in lower bounds based on certificate structures [BR14].
We also improve the lower bound for graph collision. For a fixed graph this is a total Boolean function with positive certificates of size 2, so the positive adversary method cannot prove a lower bound larger than [Zha05, ŠS06]. We overcome this certificate barrier using the general adversary method, which allows negative weights [HLŠ07]. Our explicit adversary matrix construction is inspired by the recent framework of Belovs [Bel26] and gives the following result.
Theorem 1.2 (Informal version of Theorem 6.1). There is a family of graphs on vertices for which the quantum query complexity of graph collision is .
This rules out an query algorithm for arbitrary graphs, while leaving open the possibility of a query algorithm.
1.1 Technical overview
We give an informal overview of the main ideas behind our two algorithms, the reduction for functions with small positive certificates, and the lower bound. Precise statements and proofs appear in Sections 3–6.
1.1.1 An algorithm breaking the barrier
We describe the ideas behind the algorithm of Section 3, which achieves query complexity . The algorithm first preprocesses the graph, then estimates neighborhood counts and uses a threshold to divide the remaining edges into two parts. We begin by explaining why such estimates suffice. The improved algorithm of Section 4 builds on the same estimation and thresholding argument.
Let be the known graph, and let be its unknown marked set. For any set , write , where is the neighborhood of in the graph . In particular, counts the marked neighbors of . Suppose for a moment that we knew all these counts. We could then restrict attention to vertices with positive counts and use Grover search to find a marked vertex among them. This would decide graph collision using additional queries.
Approximate counts and marked volume. Computing all the counts exactly would require too many queries. We instead construct a set for which the counts approximate . Our aim is to bound their total squared error
The set S need not recover the marked set. We only use its neighborhood counts. Although approximate counts need not identify which vertices have a marked neighbor, they suffice to divide the edges into two parts that can be tested efficiently.
The relevant quantity for these tests is the marked volume , the total degree of marked vertices. Given an upper bound on this quantity, variable-time search gives a collision test using queries.
Choose a threshold and let . Consider first the edges inside . The marked volume of equals . Each term in this sum is at most , which also counts marked neighbors outside . The estimated counts are at most on , and Cauchy–Schwarz bounds the sum of the absolute errors by . Consequently,
For the edges with at least one endpoint outside , the set contains an endpoint of every such edge and is therefore a vertex cover. The same test applies with a bound on , the sum of the degrees of marked vertices in this cover. On an input with no collision, every marked vertex has zero marked neighbors. A marked vertex outside must therefore contribute more than to the squared error, which gives . If the maximum degree is at most , the marked volume of this cover is at most .
Thus the same error bound controls both edge sets: the counts inside bound their marked volume, while inaccurate counts at marked vertices outside limit the marked volume of the other cover. We apply the same volume test to both parts, using as the cover inside and as the cover outside. The volume assumptions are needed for rejection on negative inputs; a test detects a collision in its edge set with high probability even if the stated volume bound fails. We can therefore analyze the estimation error on negative inputs and still detect collisions on positive inputs.
Figure 1 illustrates the two marked volume bounds.

Figure 1: Thresholding the estimated marked neighbor counts partitions the edges. Inside , small estimates and controlled error bound the marked volume of the blue graph. On a negative input, every marked vertex outside has a large estimation error, so there are few such vertices. Their degrees are at most , giving a small marked volume for the outside cover of the orange edges. Filled vertices are marked; dotted edges belong to the other part.
Estimating neighborhood counts. The main question is how to obtain the approximate counts with few queries. Take independent uniform vertices , query their input bits, and form the estimates
Each estimate is unbiased, but its sampling error may be large. The true neighborhood counts all come from the same marked set . We use this common structure by choosing a single set minimizing
The crucial observation is that the true set is an allowed choice, so the objective value at is no larger than at . We can use this inequality to compare the neighborhood counts of and , even though we do not know .
To analyze this comparison, let be the number of common neighbors of and . Define , which estimates the number of walks of length two from to marked vertices. A sampled marked vertex contributes to this sum once for each common neighbor of and , so
Counting in two ways gives . Expanding the least squares objective leaves , together with a term that is independent of . Thus it suffices to compute the common neighbor estimates and minimize . All these computations use the known graph and the sampled input bits, so they require no further queries. Algorithm 1 gives the procedure.
Comparing with now bounds the squared estimation error by
This is the useful consequence of choosing all the estimated counts from one set: their total squared error is controlled by the sum of the absolute errors in the sampled common neighbor sums. The improved algorithm uses the same comparison.
The variance of is at most . Applying Cauchy–Schwarz to the comparison above yields
For fixed , the quantity counts ordered pairs of common neighbors, or equivalently closed walks of length four. Only walks starting at marked vertices contribute, allowing us to use the reduction in marked volume obtained by sampling even if many edges remain.
Sampling and edge deletion. The squared common neighbor counts may be too large in an arbitrary graph. We therefore preprocess the graph before estimating the counts. A separate, earlier round of sampling reduces the marked volume; further edge deletions bound the degrees and the number of closed walks starting at marked vertices. Each deletion is accompanied by a search or collision test that detects a collision among the deleted edges with high probability. The algorithm returns as soon as a test finds one.
First, take uniform vertex samples and query their input bits. Search the union of the neighborhoods of the marked samples for a marked vertex. A successful search gives a collision. Otherwise, delete all edges incident to this union. Any vertex with more than marked neighbors is likely to have one of those neighbors sampled, in which case the deletion isolates it. With high probability every remaining vertex has at most marked neighbors. Summing these counts gives . Algorithm 2 gives this sampling procedure.
Next, consider the vertices of degree greater than . Each marked vertex among them contributes more than to the marked volume, so there are at most such marked vertices. The test of Lemma 2.9 uses this count bound to check all their incident edges. If the test rejects, delete those edges. The remaining graph has maximum degree at most , and its marked volume is still at most . The degree bound has two uses: it converts the bound on into a marked volume bound, and it makes the neighborhoods in the next procedure small.
Finally, whenever an edge in the current graph has at least edges between and , record and delete that edge set. Repeat until no such edge remains. There are at most recorded graphs, since their edge sets are disjoint and each contains at least edges. We use Grover search over these graphs to find one containing a collision. Each graph has at most vertices and can be tested using a standard quantum walk. Algorithm 3 gives the extraction and search procedure.
Figure 2 summarizes how extraction supports both collision testing and estimation.

Figure 2: When an edge has at least edges between and , extract those edges, shown in orange. The upper branch tests the extracted graph for a collision; it has at most vertices because the maximum degree is at most . Repeating the extraction leaves the graph in the lower branch with fewer closed walks of length four starting at marked vertices. This controls the error in the neighborhood estimates.
To see why this deletion controls the required walks, fix the first directed edge of a closed walk . The edge joins to , and choosing its orientation determines the whole walk. At termination there are fewer than choices for this edge, with at most two possible orientations. There are choices of the first directed edge with a marked initial vertex. Hence the remaining graph satisfies
A larger reduces the number of recorded graphs but allows a larger estimation error. Taking fresh samples for estimation after preprocessing, and using , gives . Markov's inequality makes a sufficiently large constant multiple of this quantity a valid error bound with high constant probability.
Algorithm 4 combines these procedures in their execution order: sample and delete edges, test the high degree vertices, extract and test the graphs between neighborhoods, take fresh samples for estimation, and apply the threshold and the two final volume tests. A collision is either detected among the deleted edges or remains in one of the final edge sets. Balancing the sampling and preprocessing costs with the two final volume bounds gives query complexity . Section 3 chooses the parameters after deriving these costs.
1.1.2 An improved algorithm
As in Algorithm 1, we estimate the common neighbor sums by and choose a set minimizing
The resulting counts approximate the actual marked neighbor counts. Thresholding these counts determines the set , as in the first algorithm. The main refinement is to use a bound on the marked volume to restrict the sets considered in the minimization. We first reduce the maximum degree, then use this stronger estimation argument to reduce the marked volume repeatedly.
Degree reduction. Choose a degree bound , and let contain all vertices whose current degree exceeds . For intuition, suppose we know . When , take uniform samples from the marked vertices in and search the union of their neighborhoods for a marked vertex. A successful search gives a collision. Otherwise, delete all edges incident to this union. This is the search and deletion used in Algorithm 2, now sampling from the marked vertices in .
A vertex with many marked neighbors in is likely to have one of them sampled, so the deletion isolates it. With high probability, every remaining vertex has at most marked neighbors in the old set . Counting in two ways bounds the sum of the remaining degrees of these marked vertices by . Hence at most marked vertices still have degree greater than . We update and repeat.
After logarithmically many repetitions, contains at most marked vertices. Although itself may be large, this bound lets us use Lemma 2.9 to test all edges with at least one endpoint in . If no collision is found, we delete all these edges. The remaining graph has maximum degree at most . Algorithm 6 gives this degree reduction procedure, with total query cost .
Repeated volume reduction. The degree bound gives marked volume at most . Let be its current upper bound. In the first algorithm, thresholding is followed by collision tests on both the edges inside and the edges outside it. Here, we test the edges outside and continue reducing the graph inside . Our target in each round is only to halve the marked volume.
For a general graph, we apply this argument to bipartite subgraphs separately. In each one, consists of vertices with small estimated marked neighbor counts. The same thresholding argument as in the first algorithm bounds the marked volume retained inside and that of the outside cover used to test the discarded edges. We choose the parameters so that, on a negative input, the total retained volume is at most . We combine the retained edges and repeat until the volume is small enough for the final collision test. Algorithm 10 gives this iteration.
Estimating neighborhood counts. To see how the current volume bound helps, suppose for a moment that every vertex has degree . Then , so we minimize subject to . The true marked set remains an allowed choice. If every common neighbor sum is estimated within error , the comparison gives total squared error at most . Only vertices in or contribute to this comparison, and both sets have size at most . A smaller volume bound therefore limits how many estimation errors can contribute.
For a general graph, we use a result of Chlamtáć, Dinitz and Robinson [CDR19] to partition its edges into a polylogarithmic number of bipartite subgraphs with approximately uniform degrees on each side. Lower bounds on the degrees now give bounds on the number of marked vertices on each side. We impose these bounds in the minimization and choose a separate threshold for each side. The partition uses only the known graph and requires no queries.
Algorithm 1 forms its estimates from uniform vertex samples. Here, we sample marked vertices on the appropriate side and average their common neighbor counts, scaled by the estimated number of marked vertices. The same samples give estimates for every vertex, since the graph is known. When the sums are small for every , a variance bound shows that few samples give accurate estimates.
To handle large common neighbor counts, we extend the extraction procedure of Algorithm 3. That procedure extracts edges between two neighborhoods. Here, we use a neighborhood and a set of vertices on the same side as . The number of edges between them is , so large common neighbor counts identify graphs that we can test separately. We select such sets , test their edges using quantum walks, and delete them. This makes the remaining sums easier to estimate while checking the discarded edges for collisions. Algorithms 7 and 8 give these procedures.
The parameter analysis in Section 4 balances the degree reduction with the repeated volume reduction. Choosing gives the query bound .
1.1.3 Functions with positive certificates of size two
Section 5 shows that graph collision also captures the task of evaluating a (partial) function when every positive input has a certificate of size (at most) two. The idea is to represent possible input assignments by vertices and positive certificates by edges.
Suppose the input has symbols from an alphabet of size . Create a vertex for each position and alphabet symbol , and mark it exactly when . There are vertices, with exactly one marked vertex for each input position. Whenever and form a positive certificate, add an edge between and . Its endpoints are both marked exactly when the input satisfies that certificate. It follows that the constructed graph has a marked edge if and only if the original input is positive.
A query at vertex only asks whether , so it can be simulated with a constant number of queries to the original input. Applying the graph collision algorithm therefore gives a query bound of . The dependence on the alphabet comes from the increase in graph size. For constant alphabets the bound is , and for it is . More generally, the complexity remains whenever for a fixed .
For binary inputs, the graph has 2n vertices and each vertex query uses one input query. Conversely, every graph collision problem has positive certificates of size at most two. Thus graph collision is as hard as any Boolean function on binary inputs with positive certificate complexity at most two, up to a constant factor in the input size (Corollary 5.4).
1.1.4 A lower bound breaking the barrier
Section 6 proves an lower bound. For a prime power , let be the bipartite graph with one vertex for each point of and one vertex for each nonvertical line. A line with slope and intercept consists of the points satisfying in . A point vertex and a line vertex are adjacent when this equality holds. There are vertices on each side, every vertex has degree , and the graph has edges. The geometric property we use is that two distinct points lie on at most one common line, and two distinct lines meet in at most one point.
We compare inputs with many marked points and lines but no collision to inputs with exactly one marked edge. In our construction, a positive input is obtained from a negative input by changing bits only at one line and its incident points.
Choosing the inputs. A negative input is sampled in two stages:
-
Mark each line independently with probability r.
-
Mark each point lying on no marked line independently with probability p. Leave every other point unmarked.
Call a point uncovered if it lies on no marked line. The sampling rule prevents every collision, since a marked line forces all its incident points to be unmarked. Each point is uncovered with probability , so its probability of being marked is .
We want many marked vertices on both sides. Marking more lines, however, leaves fewer uncovered points. We compensate by increasing , choosing . Then a point is marked with probability , almost the same as the line probability . We take of order , with a sufficiently small constant factor. Each side then has order marked vertices in expectation, while still tends to zero. This is the largest possible order of under the balancing condition: if grew asymptotically faster than , the probability of being uncovered would be too small to compensate with any .
To sample a positive input:
-
Choose a point uniformly at random, then choose a line through uniformly at random. This chooses an edge uniformly at random.
-
Sample a negative input conditioned on being marked.
-
Mark and unmark every point on other than .
All lines through were initially unmarked, so the resulting input has exactly one marked edge, namely . We call the last step planting the edge . Once the edge and negative input are fixed, this operation determines a unique positive input, although different negative inputs can produce the same positive input. Each fixed edge defines its own positive distribution. These distributions have disjoint supports because the unique marked edge identifies the chosen edge. Figure 3 illustrates the transformation.
Negative distribution

Positive distribution

Figure 3: The hard input distributions, illustrated on . On the left, lines are marked independently, and only uncovered points may be marked. Condition on being marked. On the right, marking and unmarking its other points creates the unique marked edge , shown in orange. Blue vertices are marked, gray vertices are forced to zero, and white vertices are sampled as zero. Orange rings identify exactly the input bits that change between the panels.
Adversary matrix construction. The general adversary bound allows a real matrix whose rows are positive inputs and whose columns are negative inputs, and gives
Here retains an entry only when its two inputs differ at the queried vertex . We first construct a matrix with the same row and column sets. For a positive input whose unique marked edge is , the entry is nonzero exactly when and planting in produces . Thus, each row collects the negative inputs that could have produced its positive input by planting.
Let be the probability of under the negative distribution, and let be the probability of under the positive distribution for the fixed edge . Write for the operation that marks and unmarks its other points. Define
The weights account for the probabilities of the inputs. Since a point is marked with probability and the positive distribution is obtained by conditioning on and then planting, we have
Consequently, applying to the unit vector gives, in the rows for each fixed edge , the vector . Its squared norm is , since . There are disjoint groups of rows, so their squared norms add, giving
Thus, combining the possible planted edges gives the desired numerator. The difficulty is to preserve this gain while bounding what remains of the matrix after restricting to inputs that differ at one queried vertex.
The additive correction. For a fixed planted edge , a query outside and its incident points sees the same bit before and after planting. The corresponding entries of B are therefore removed by the restriction for that query. A query to is different: planting always changes its bit from zero to one. For a fixed queried line , the restriction retains contributions from all q possible planted points on . The matrix B alone does not give the required denominator bound. We add a matrix C to cancel a contribution shared by these choices, using the signed entries allowed by the general adversary bound.
To see what should be cancelled, consider the part of the calculation involving only line bits. Before planting, every line through other than must be unmarked. This condition is expressed by . Write each factor as , where is the difference between the line bit and its mean. Expanding the product separates the constant term from terms containing one or more of these differences.
The constant term is the same for every possible planted point on . It contains no additional line that could help identify which point was chosen. In the calculation for a query to , the matrix
cancels the contribution from this constant term. The relation ensures that the two coefficients have the same magnitude.
After this cancellation, each remaining contribution in this restricted case contains a factor for some additional line through . Once and are fixed, the planted point must be their intersection. Thus each such line can account for at most one choice of . The number of possible planted points is now bounded by the number of line factors available in the term. The corresponding counting step for a point query uses the other geometric property: a queried point and a distinct planted point determine at most one possible planted line.
The multiplicative correction. The remaining difficulty is that a term can involve many points and lines, giving many choices in these counts. The full proof organizes the expressions in a basis whose elements are products associated with sets of points and lines, extending the line expansion above. We use a diagonal matrix to give smaller weights to basis elements involving more vertices. This compensates for the growth in the counting bound. A query can introduce or remove factors, so the weights decrease gradually to control the additional contribution caused by these changes.
The unit vector used for the numerator corresponds to the constant basis function, which contains no factors. We choose to map this vector to zero and to leave it unchanged. Consequently, adding and applying preserve the image used to prove the numerator bound. The additive correction removes the contribution shared by many planted edges, while the multiplicative correction limits the contributions involving many vertices.
For the resulting adversary matrix, these estimates give
The adversary bound therefore yields queries, or since .
1.2 Organization
Section 2 gives the notation and standard quantum tools. Section 3 gives the first algorithm using one round of estimation and vertex selection. Section 4 refines these steps to prove Theorem 1.1. Section 5 gives the extension to positive certificates of size two over general alphabets. Section 6 proves the lower bound. Appendix A proves the quantum procedure lemmas. Appendices B and C give the collision tests and the construction of the edge partition.
2 Preliminaries
Graph collision. All graphs are simple and undirected. For an input , let be the set of marked vertices. Write for the neighbors of and . An input is positive if it has a marked edge, and negative otherwise. On a negative input, is an independent set: no edge joins two vertices of . Edge deletions retain the vertex labels and their input bits.
We write for the quantum query complexity of with error at most on every input. Logarithms are base two, and , , and suppress factors polynomial in .
Definition 2.1 (Marked volume). For , define
This counts incidences between edges and marked vertices in . An edge contributes once for each endpoint in .
Lemma 2.2 (Counting marked volume). For every ,
If the edge sets of partition , then , retaining the same vertex labels.
Proof. Both identities count each edge once for each endpoint in .
Lemma 2.3 (Bipartite reduction). Graph collision on a known graph with vertices reduces to graph collision on a known bipartite graph with labels, with one original query per query to the copied input.
Proof. Replace each vertex by , both marked by , and each edge by and . A marked edge exists in the new graph exactly when it exists in the original graph.
We use the bipartite reduction in the improved algorithm; the first algorithm applies directly to the input graph.
Standard quantum procedures. Grover search on a known set of labels uses queries. We also use the following consequences of quantum counting, amplitude amplification, variable-time search, and quantum walks.
Lemma 2.4 (Counting and marked samples [BHMT02, YLC14]). Let a known set of labels contain marked vertices. With queries, quantum counting returns an integer that, except with the assigned error probability, is zero exactly when and otherwise satisfies
Given , a batch of independent uniform marked samples uses a fixed query limit , reporting failure if insufficient samples are obtained. On a good estimate, sampling succeeds except with the assigned error probability, and the uniform state over marked labels can be prepared to inverse polynomial precision in queries.
Lemma 2.5 (Combining tests [Amb08]). Suppose polynomially many tests have known polynomially bounded query limits . Each accepts every positive input for its own edge list and rejects negative inputs satisfying its stated bound. If all these bounds hold on a global negative input, their OR can be tested in queries, accepting every positive global input.
Lemma 2.6 (Quantum walk search [MNRS11]). Consider a reversible ergodic Markov chain with spectral gap at least . Suppose the set of accepting states has stationary probability at least whenever it is nonempty. Let , , and denote the coherent setup, update, and checking query costs, respectively. Quantum walk search decides whether an accepting state exists using
queries.
Proofs and implementation details for Lemmas 2.4 and 2.5 appear in Appendix A. Unless stated otherwise, samples are independent draws with replacement, sample sizes are rounded upward, and error probabilities are inverse polynomial in . We write for the error probability assigned to a subroutine. Each sampling call uses its stated query limit; if sampling fails or a subroutine returns YES, the calling routine returns YES.
Collision tests. The following tests have fixed query limits, and their guarantees hold with the assigned error probability. Their constructions and proofs appear in Appendix B.
Lemma 2.7 (A cover of small marked volume). Let be a known vertex cover of . The procedure cover_test() uses queries. It accepts every positive input and rejects negative inputs satisfying .
Lemma 2.8 (Bipartite collision test). Let be bipartite with sides of sizes .
The procedure bipartite_test() accepts every positive input and rejects negative inputs satisfying , with query complexity
Lemma 2.9 (Few marked vertices in a cover). Let have at most vertices and let be a known vertex cover. There is a test using queries that accepts every positive input and rejects negative inputs satisfying .
The volume test applies to the whole graph with . For edges discarded by restricting to a vertex set, the vertices outside that set form a cover.
Adversary bound. We use the general adversary bound, which allows negative matrix entries. All matrix norms below are operator norms, and denotes entrywise multiplication.
Lemma 2.10 (General adversary bound [HLŞ07]). Let , where , and let and . For , let . For every nonzero matrix with rows indexed by and columns indexed by , computing with error at most requires
queries.
Proof. Apply the general adversary bound to the Hermitian matrix , extended by zeros to the remaining inputs. Its norm is , and its disagreement matrix at has norm .
3 An algorithm breaking the barrier
Let be a known graph on vertices, with input . In this section, we give a quantum algorithm for graph collision with query complexity exponent strictly less than .
Theorem 3.1. There is a quantum algorithm that solves the graph collision problem on any -vertex graph with high probability using queries.
The algorithm uses estimates of the number of marked neighbors of each vertex. We first show how a bound on their error allows us to apply the collision tests from the preliminaries. We then construct the estimates from a random sample of input bits and describe the preprocessing needed to obtain a sufficiently small error. The algorithm first preprocesses the graph, then estimates the neighborhood counts, applies the threshold, and performs the two final collision tests. Algorithm 4 gives the complete procedure at the end of the section, followed by its query analysis.
Part 1: Thresholding the neighborhood counts. For , let . Thus is the number of marked neighbors of . If these numbers were known exactly, we could search for a marked vertex with using queries. Such a vertex exists exactly when there is a collision.
Learning every count exactly is too expensive. Instead, we will find a set whose counts approximate , with small total squared error. The set need not resemble : only their neighborhood counts matter. Choose a threshold and let .
Inside , the estimated counts are at most , so their sum is at most . The estimation error bounds the difference from the sum of the actual marked neighbor counts, giving a bound on the marked volume of . On a negative input, a marked vertex has no marked neighbors. Each marked vertex outside therefore contributes more than to the total squared error. An error bound thus limits how many such vertices there can be.
Figure 1 summarizes why thresholding makes both parts easy to test.
Lemma 3.2 (Thresholding). Let , let , and let for . Then
On a negative input, . If the input is negative and the maximum degree is at most , the edges outside have cover of marked volume at most .
Proof. We first bound the marked volume inside . Count each incidence between an edge of and a marked vertex from the other endpoint of that edge. This gives
For every , the estimated count is at most . Separating these estimates from their errors, we obtain
The last inequality follows from Cauchy–Schwarz: the sum of the absolute errors over is at most times the square root of their sum of squares, which is at most .
Now suppose the input is negative. Every marked vertex has , whereas implies . Each vertex in therefore contributes more than to , giving . Every edge outside has an endpoint in , so this set is a vertex cover of those edges. If the maximum degree is at most , each marked vertex in this cover contributes at most to its marked volume. The volume is therefore at most .
Lemma 2.7 converts these volume bounds into query bounds for testing the two edge sets. The volume bounds are needed for rejection on negative inputs; a test accepts whenever its edges contain a collision, even if the supplied bound fails.
Part 2: Estimating the neighborhood counts. Take independent uniform vertices and query their input bits. The natural estimate of the marked neighbor count at is
This estimate is unbiased: . However, the individual estimates may be noisy. The true counts have additional structure: they all arise from the same set of marked vertices. We use this structure by requiring our estimates to be the neighborhood counts of a single set . We choose to minimize , the total squared difference between its counts and the sampled values. Since is one of the allowed choices, the objective value at is no larger than at . We can therefore compare the chosen set with without knowing , and use this comparison to bound the error in the neighborhood counts.
To expand the comparison, let and define
Here, a sampled marked vertex contributes once for each common neighbor of and . Since the samples are uniform, . Thus is an unbiased estimate of the common neighbor sum at .
Counting the contributions of pairs with and in two ways gives
Expanding the square in the least squares objective therefore gives
Once the samples are fixed, the last term is the same for every choice of . Removing it does not change which sets minimize the objective. We may therefore minimize instead.
Algorithm 1 gives the procedure for estimating the neighborhood counts from the sampled input bits.
Algorithm 1 estimate_neighborhood_counts
Input: .
1: Take fresh uniform samples and query their input bits. 2: Let for every vertex . 3: return a set minimizing over all subsets of .
The improved algorithm uses the same objective. The comparison requires only , which holds whenever is among the sets over which we minimize.
Lemma 3.3 (Comparison with the marked set). Let satisfy . Then
Proof. To relate the objective inequality to the error, we count in two ways the triples with , , and both and adjacent to . Counting first by , and then by , gives
The same identity with expresses as . Substitute into the difference of the two objectives. These identities then give
The left side is nonpositive by hypothesis. Moving the error term to the other side proves (3.1). □
Since , the squared estimation error is at most . Thus we can bound the error of the estimated neighborhood counts by bounding the errors in the sampled common neighbor sums. All common neighbor counts are known from the graph, and the minimization uses no further input queries.
The accuracy needed from preprocessing. The variance of depends on . For fixed , the quantity counts pairs of common neighbors, or equivalently closed walks of length four. Summing over and marked counts just the closed walks starting at marked vertices. We will use sampling and edge deletions to ensure that this count is at most , for a parameter , and that .
Lemma 3.4 (Accuracy of the neighborhood estimates). For , suppose and
Then Algorithm 1 has expected squared estimation error .
Proof. Fix a vertex . For a uniform sample , the mean of is , and its second moment is . Thus is unbiased. Since it averages independent samples, its variance is
Summing over and using the two hypotheses gives
By Lemma 3.3, the squared error in the neighborhood counts is at most . Applying Cauchy–Schwarz first to each expectation and then to the sum over vertices bounds its expectation by
If was obtained by earlier preprocessing, condition on any history for which the two hypotheses hold. The graph is then fixed, and the fresh samples have the distribution used above, so the same bound holds conditionally.
Part 3: Reducing marked volume and maximum degree. We have analyzed estimation on a graph satisfying the volume and closed walk bounds in Lemma 3.4. We now describe the preprocessing that establishes these properties. In this part, we first reduce the marked volume by sampling, then test and delete edges incident to vertices of degree greater than . The degree bound turns the bound on the number of marked vertices outside into the volume bound in Lemma 3.2, and keeps neighborhoods small for the graphs tested in Part 4. Both preprocessing procedures precede the fresh samples used to estimate the neighborhood counts.
We begin by reducing the marked volume. Sample vertices, query their input bits, and search the union of the neighborhoods of the marked samples. A marked vertex in this union gives a collision with a sampled marked vertex. If the search finds none, delete all edges incident to this union.
The reason for this deletion is simple: a vertex with many marked neighbors is likely to have one of them sampled. Such a vertex then belongs to the searched union and is isolated. Thus the remaining vertices have few marked neighbors, and their total count bounds the marked volume. Algorithm 2 gives the procedure.
Algorithm 2 sample_neighborhoods
Input: , with .
1: Take uniform vertex samples and query their input bits.
2: Let be the marked sampled labels.
3: Search for a marked vertex; return YES if one is found.
4: Delete every edge incident to and return .
Lemma 3.5 (Neighborhood sampling). For , Algorithm 2 has cost queries. Except with probability , every remaining vertex has at most marked neighbors and the remaining marked volume is at most . If a collision exists, the algorithm either detects one or leaves one in the remaining graph, unless the Grover search fails.
Proof. Let be the number of samples. Querying their input bits costs queries. Once these bits are known, the set is known, so Grover search over it costs queries.
Fix a vertex with more than marked neighbors before deletion. It lies outside exactly when none of its marked neighbors is sampled. By independence, this event has probability
for a sufficiently large constant in the choice of . A union bound over the vertices shows that, except with probability , every vertex outside has at most marked neighbors. Deleting edges cannot increase this count, and every vertex inside becomes isolated. In the resulting graph, counting in two ways therefore gives .
Finally, if a deleted edge is a collision, one of its marked endpoints lies in . If the Grover search succeeds, it finds a marked vertex in this set, which forms a collision with a sampled marked neighbor in . If no deleted edge is a collision, any existing collision remains in the graph.
Bounding the maximum degree. On the event guaranteed by Lemma 3.5, the remaining graph has marked volume at most . Let . Each marked vertex in contributes more than to the volume, so contains at most marked vertices. Algorithm 4 tests the edges incident to using Lemma 2.9, then deletes them if the test rejects. The maximum degree is then at most , and the volume bound is preserved.
Part 4: Bounding closed walks of length four. The volume bound alone does not control the squared common neighbor counts in (3.2). This last preprocessing step supplies that bound, which controls the variance of the estimates . Fix the first directed edge of a closed walk . The edge joins to , and choosing its orientation determines the whole walk.
Whenever an edge in the current graph has at least edges between and , record and delete those edges. Repeat until no such edge remains. Each remaining directed edge then starts at most closed walks of length four: there are fewer than choices for the middle edge and at most two orientations for each. There are vol directed edges starting at marked vertices, so the total number of these walks is at most vol. This is exactly the bound needed in (3.2).
We use Grover search over the recorded graphs to find one containing a collision, using Lemma 2.9 to check a graph. Each recorded graph has at most vertices and can be checked by a quantum walk. The walks of length four above are ordinary graph walks used for counting; the quantum walk is the procedure used for collision testing. A larger threshold gives fewer recorded graphs, but allows a larger estimation error. Algorithm 3 gives the procedure.
Figure 2 illustrates how extraction separates collision testing from estimation on the remaining graph.
Algorithm 3 extract_neighborhood_edges
Input: A graph of maximum degree at most , and a threshold .
1: Initialize an empty list of recorded graphs. 2: while an edge has at least edges between and : 3: Record those edges as a graph on their endpoints. 4: Delete the recorded edges from . 5: end while 6: Search the recorded graphs using Lemma 2.9, with count bound . 7: Return YES if a test accepts; otherwise return .
Lemma 3.6 (Edge extraction and closed walks). Algorithm 3 costs queries. Its output satisfies (3.2). If any deleted edge is a collision, Algorithm 3 returns YES with high probability.
Proof. We first prove the walk bound in the remaining graph. For fixed , each ordered pair of common neighbors gives the closed walk . Conversely, such a walk determines once its initial vertex is fixed. Thus counts exactly the closed walks of length four starting at marked vertices.
Count these walks instead by their first directed edge , with marked. The edge joins to . At termination there are fewer than such edges. Each undirected edge gives at most two choices for the ordered pair , and each choice determines the whole walk. There are therefore at most walks for each first directed edge. The number of first directed edges with a marked initial vertex is , proving (3.2). This argument also counts walks with repeated vertices: neither the ordered pair of common neighbors nor the description by a first edge requires distinct vertices.
For the query bound, each recorded graph is formed from edges between two neighborhoods of size at most , so it has at most vertices. The recorded edge sets are disjoint, each has at least edges, and the original graph has at most edges. Hence at most graphs are recorded. Using all vertices of a recorded graph as its cover, Lemma 2.9 with count bound tests it in queries. Grover search over the recorded graphs then costs queries. Every deleted edge belongs to a recorded graph. If such an edge is a collision, the search over the recorded graphs returns YES with high probability.
The complete algorithm. The preprocessing steps supply exactly the two hypotheses needed to estimate the neighborhood counts: small marked volume and few closed walks of length four from marked vertices. A fresh sample then gives approximate neighborhood counts, and thresholding divides the remaining edges into two parts handled by the same volume test. Algorithm 4 combines these steps.
Choose parameters and , with an integer. Let be a sufficiently large constant multiple of , and let . Lemma 3.4 and Markov's inequality make a valid error bound with high constant probability. Lemma 3.2 then makes a valid marked volume bound for both final tests.
Return YES as soon as any search or collision test returns YES.
Algorithm 4 First algorithm
Input: , with defined above.
1: .
2: Let .
3: Test its incident edges by Lemma 2.9, with count bound .
4: Delete the edges incident to .
5: .
6: .
7: Let and .
8: Call cover_test().
9: return cover_test().
Proof of Theorem 3.1. Suppose first that the input is negative. Condition on neighborhood sampling giving marked volume at most . The set then contains at most marked vertices, so the high degree test has a valid count bound and rejects except with its assigned error probability. Deleting its incident edges leaves maximum degree at most , and further edge deletions preserve the volume bound. Lemma 3.6 establishes (3.2). The fresh samples therefore satisfy the hypotheses of Lemma 3.4. By Markov's inequality and the choice of , their squared estimation error is at most with conditional probability at least 99/100.
On this event, Lemma 3.2 bounds the marked volume of by and that of the cover for the other edges by . Both quantities are at most . Thus both final tests have valid volume bounds and reject except with their assigned error probabilities. The other tests also reject on this negative input when their stated guarantees hold.
Now suppose the input is positive and fix a collision edge. If it is deleted during preprocessing, either an endpoint was searched in the neighborhood sampling step, or the edge was included in the high degree test or a recorded graph. The corresponding search or collision test accepts except with its assigned error probability. If the edge survives preprocessing, it either lies inside or has an endpoint outside , so one of the final tests accepts. The acceptance guarantees of these tests hold on positive inputs even when the supplied count or volume bound fails. Consequently, this argument does not require the estimation error to be small on a positive input. Taking the assigned errors sufficiently small and applying a union bound gives total error at most .
It remains to choose the parameters and bound the cost. Combining the sampling, high degree, extraction, and final test costs gives
queries. The last three terms bound after substituting .
Increasing uses more sample queries but reduces both the marked volume after neighborhood sampling and the estimation error. A smaller makes the extracted graphs cheaper to test and improves the volume bound outside , but leaves more vertices for the high degree test. A larger gives fewer extracted graphs, at the cost of a weaker estimation guarantee. Finally, increasing improves the volume bound outside while weakening the bound inside . We balance these costs by choosing , , , and . Then and . Every term in the displayed query bound is . The total is , with the displayed query limits on every execution. Repeating the algorithm times and taking the majority gives the stated high probability guarantee.
Minimization over vertex sets may require exponential classical computation. The comparison proofs also hold for weights in , giving convex quadratic minimizations with the same query bounds.
4 An improved algorithm
In this section, we show the full quantum algorithm for the graph collision problem, proving Theorem 1.1. We pick a degree threshold , and we divide the graph collision problem into two parts. In Section 4.1, we look for a collision between two vertices where at least one has degree greater than . Then, in Section 4.2, we look for a collision between two low-degree vertices, i.e., for which both degrees are at most . We finally balance the choice of in Section 4.3.
Before turning to either of these algorithms, we introduce an algorithmic component that is important for both approaches.
Marked neighborhood sampling. We introduce a useful algorithmic building block. In a graph , suppose a set of size contains marked vertices. We can sample a marked vertex uniformly at random using queries. Taking independent samples, with replacement, therefore costs queries for . Let be the set of sampled vertices. We then search its neighborhood for a marked vertex using queries.
If the search finds no collision, delete every edge incident to . Any vertex with more than marked neighbors in belongs to with high probability and is therefore isolated by this deletion. A union bound shows that every remaining vertex has at most marked neighbors in . Every deleted collision has a marked endpoint in the searched neighborhood, so it would have been detected, except with the search error.
Algorithm 5 estimates and then performs this sampling and deletion.
Algorithm 5 sample_marked_neighborhoods
Input: A graph , source , and threshold .
1: Estimate by using Lemma 2.4.
2: If , return .
3: Obtain uniform marked vertices from .
4: Let be the sampled vertices.
5: Search for a marked vertex; return YES if one is found.
6: Delete every edge incident to and return .
Lemma 4.1 (Marked neighbor bound). Let be a fixed source set of size , let , and let . Conditional on a good count estimate, Algorithm 5 uses queries. Except with the assigned error, every remaining vertex has at most marked neighbors in . A collision is detected or survives, except with the search error.
Proof. For a good nonzero estimate, the true count lies between and . A vertex with more than marked source neighbors is missed by all samples with probability at most . A union bound proves the neighbor bound. Any deleted collision has a marked endpoint in and is detected by the preceding search.
Counting costs , sampling costs , and the search costs . On a good nonzero estimate, , proving the stated query bound. The sampling limit is fixed once the estimate is obtained. On a good zero estimate the source has no marked vertices, so no operation is needed.
4.1 Case I: High-degree vertices
The core idea for high-degree vertices is as follows. Let , and let be its number of marked vertices. If , we can cheaply test for a collision incident to . Otherwise, we can cheaply take uniform marked samples from and search their neighborhood. Algorithm 5 performs this sampling and search, then deletes the edges incident to the searched neighborhood.
With high probability, every vertex in the remaining graph has at most marked neighbors in the old set . Counting in two ways bounds the sum of the remaining degrees of marked vertices in by . Each vertex whose degree still exceeds contributes more than to this sum, so at most such marked vertices remain. After logarithmically many iterations, their number is at most . Algorithm 6 gives this degree reduction procedure.
Maintain an upper bound on the number of marked vertices in the current high-degree set , starting with . While , apply Algorithm 5 with threshold . Counting in two ways then bounds the number of remaining marked high-degree vertices by , so we may halve and repeat. Once , test and delete the edges incident to . Only the sampling routine estimates marked counts internally.
Algorithm 6 cap_degrees
Input: A graph and target degree bound , with . Abort the routine and output No if its total query count exceeds a sufficiently large budget .
1: Let and .
2: while :
3: Let .
4: .
5: Let .
6: end while
7: Let .
8: Test the edges incident to by Lemma 2.9, with count bound .
9: Delete those edges and return .
Lemma 4.2 (Degree reduction). For , Algorithm 6 has query cost
On a good negative execution it returns a graph of maximum degree at most d, hence marked volume at most nd. On a positive input it detects a collision or preserves one, except with the assigned error.
Proof. Initially . Suppose this invariant holds before a sampling call, and condition on its success guarantees. Let be the returned graph and . Since ,
Lemma 4.1 and counting in two ways give
Thus halving preserves the invariant. After iterations, , making the final cover test valid on a good negative execution. Deleting its tested edges leaves maximum degree at most . Every removed collision is covered by a neighborhood search or the final test.
Writing and , each sampling call costs, on a good count estimate,
Since halves, the second terms sum geometrically to . The final test costs , giving total cost
If the loop is skipped, only the final test is needed and the same bound holds. This runtime bound holds on every input whenever the internal counting and sampling guarantees hold, or a collision is detected earlier. A union bound over the calls makes their failure probability inverse polynomially small with any desired fixed exponent. Choose the global budget sufficiently large to cover every such good execution. The global cutoff then enforces the stated worst-case query bound, and returning No on timeout adds only this negligible probability to the error on positive inputs. It introduces no additional acceptance on negative inputs.
4.2 Case II: Low-degree vertices
We now turn to the more complicated setting where we look for a collision between two vertices with small degree, i.e., . In other words, we simply remove all high-degree vertices from , and look for a collision in the remaining graph.
The degree bound gives . Our goal is to test and delete edges until the marked volume is small enough for the cover test of Lemma 2.7. If is its current upper bound, that test uses queries. We therefore start with and construct a routine that halves on each iteration. Algorithm 10 gives this procedure.
We first analyze the minimization and thresholding steps, then give the graph preprocessing and estimation routines that supply their hypotheses. We combine these routines at the end of the section.
Part 1: Estimating the neighborhood counts. First consider a bipartite graph with sides and . For vertices on the same side, let . Let and be the corresponding matrices indexed by and , respectively, and let . Suppose that approximates with . The core idea is to approximately learn the set of vertices that have few connections to marked vertices, i.e., to find an approximation of all vertices that have at most marked neighbors. Then, the marked volume of is small, because we exactly remove those vertices that are adjacent to many marked vertices. On the other hand, for a negative input, the marked volume of with as a source set is small as well, since all the neighbors of marked vertices are themselves unmarked. We make this intuition precise in the following lemma.
Lemma 4.3 (Separate thresholds). Let be a bipartite graph with edges, with vertex sets and on both sides of the bipartition, sizes and , degree upper bounds and , and such that and . Suppose that . Let minimize over subsets satisfying and . Define . Then
On a negative input, the outside cover has marked volume at most .
Proof. Replacing by preserves feasibility. Minimality and the comparison (3.1) therefore bound the squared estimation error on by
where . Exchanging the sides gives error at most on .
Apply the thresholding argument of Lemma 3.2 separately on each side. Cauchy–Schwarz bounds the retained marked volume by
On a negative input, every marked vertex has no marked neighbors. A marked vertex outside thus has estimation error greater than its side's threshold. There are at most such vertices on and on . Multiplying by the respective degree bounds proves the outside-cover bound.
The two volume bounds specify the accuracy needed from estimation. The retained volume must decrease, while the outside cover must remain cheap to test. We choose the thresholds and estimation accuracy together in the final parameter analysis. We now construct estimates satisfying these requirements.
Part 2: Graph partitioning. To simplify the problem, we find an edge partition of the graph into polylogarithmically many bipartite subgraphs with roughly uniform degrees on both sides of the bipartition. If for one of the subgraphs we label the sides and , then we have degree bounds and such that for and ,
for a multiplicative factor that is polylogarithmic in n. This construction does not require any queries to the marked set, and hence does not incur any overhead in the resulting query complexity. Lemma C.2 states the partition guarantee, and Algorithm 13 in Appendix C gives the construction.
Since the marked volume is additive over edge-disjoint graphs, we observe that for any bipartite subgraph, we have the same upper bound on the marked volume. Since we simultaneously have a lower bound on the degrees, this translates into an upper bound on the number of marked vertices on either side of the bipartition. Indeed, we find that
Indeed, on later iterations where is smaller, this sparsity bound becomes more stringent, making the routines that exploit this sparsity more efficient.
Next, we run marked neighbor sampling on both sides of the bipartition individually, to obtain upper bounds and with high probability.
Lemma 4.4. Let be bipartite with sides , whose degrees lie in and , respectively. Suppose , and let . Applying Algorithm 5 with source sets and and thresholds and , respectively, uses, conditional on good count estimates,
queries. Except with the assigned error probability, the routine detects a collision or returns a graph in which every vertex in has at most marked neighbors and every vertex in has at most marked neighbors.
Proof. The degree lower bounds give and . Apply Lemma 4.1 on both sides and substitute these count bounds into its cost. Later edge deletions preserve the marked neighbor bounds.
Part 3: C-preconditioning. We now study the matrix , indexed by vertices from , where . Thus is the product of the bipartite adjacency matrix with its transpose. That is, every entry contains the number of walks of length two between and . Since the degrees of and are bounded by , we obtain that is trivially bounded by as well.
Let's consider a single row of , indexed by the vertex . Intuitively, if we consider a subset , such that for all the entries are large, then there must be many edges between and . In fact, the number of edges between and is
We refer to as a dense region if . The idea is to search for such dense regions first, and check for collisions in these regions separately.
Algorithm 7 makes this intuition precise.
Algorithm 7 prepare_estimates
Input: A bipartite graph , with vertex sets and , such that for all and , , , and the number of marked neighbors is at most and , respectively. Let and .
1: Initialize an empty list of recorded graphs.
2: for each row , in any fixed order:
3: Let , and sort it such that is decreasing.
4: Find the longest initial segment such that . If none exist, continue.
5: If , continue.
6: Record the edges between and , then delete them.
7: end for
8: Test the recorded graphs using bipartite_test and Lemma 2.5.
9: return .
Lemma 4.5 (Extraction and coefficient bounds). Let satisfy the input conditions of Algorithm 7, and let . For any and , the algorithm records at most one graph per row and uses
(4.1) queries. On a negative input, every row of the output graph has a set such that
Here denotes the common neighbor count in the output graph. On a positive input, a collision is detected or survives, except with the assigned error. Running the routine with and exchanged gives the corresponding bounds for rows in , with ; subsequent edge deletions preserve these coefficient bounds.
Proof. Put . Consider the moment when row is processed. If its longest prefix satisfying has , then every prefix of sum greater than fails this inequality. The same holds if no such prefix exists.
Otherwise the algorithm extracts . If , every edge incident to is deleted, so its row becomes zero and remains zero. If , bipartiteness implies that extraction leaves unchanged, zeros the coefficients indexed by , and leaves the other coefficients in row unchanged. No remaining prefix can satisfy : if one did, then
contradicting the maximal length of . Subsequent edge deletions cannot increase the sum of the largest coefficients for any . Thus, in the final graph, every prefix of sum greater than has squared sum-of-coefficients divided by its length less than .
Write the final large coefficients of row as . Let consist of the vertices in the longest prefix with coefficient sum at most . For each rank outside this prefix,
Summing and using bounds the squared sum of these large coefficients by . The small coefficients, including the diagonal if it is below , contribute at most
By construction, the total coefficient sum over is at most , so its marked contribution is also at most . This proves (4.2).
For each recorded graph, use the graph at the moment of extraction. Its sides are disjoint, its edge count is exactly , and its neighborhood side has at most marked vertices. The selection rule gives
Consequently,
There is at most one recorded graph per row, and the recorded edge lists are disjoint, so . The squared bipartite test costs therefore sum to
Lemma 2.5 proves (4.1). Every deleted edge belongs to a recorded graph, so a collision is detected or survives, except with the assigned test error. Exchanging the sides proves the corresponding statement for . Subsequent deletions only decrease coefficients, preserving both bounds for the same exceptional sets.
Part 4: Estimating common neighbor sums. Now that we have preconditioned the matrix , we focus on the vector . This vector intuitively represents a vector indexed by , counting the number of length-two walks to a marked vertex.
The goal is to estimate a vector that approximates in -norm. We can do this efficiently now, since Lemma 4.5 guarantees that the squared row sum over marked entries outside is small. We can sample uniformly from with queries, where . Thus, the th entry of is , where the expectation is over a uniform vertex . The corresponding variance becomes
Using concentration, we can thus show that after samples, with cost , we have with high probability
We use this general idea to estimate an approximation of , but we observe from Lemma 4.5 that we can't upper bound the entire sum of squared entries of a given row labeled by . Instead, we deal with the exceptional set separately in the proof.
Algorithm 8 makes this idea precise.
Algorithm 8 estimate_sums
Input: A bipartite graph with vertex sets and . Let be its common neighbor matrix indexed by . Let .
1: Estimate by using Lemma 2.4.
2: If , return the zero vector.
3: Let .
4: Obtain independent batches of uniform marked samples from .
5: Compute each batch average for every row .
6: Let be the median of these averages, separately for each row.
7: return .
Lemma 4.6 (Sample averages). Let be a source set of size , write , and let . Suppose and that, on a good negative execution, each row has a set such that
Then Algorithm 8 returns estimates with for every row, conditional on a good count estimate and except with the assigned error. The sets are used only in the proof. Conditional on a good count estimate, its query cost, including counting, is
Proof. First suppose . Fix a row and split one batch average into the contributions from and . The latter contribution has variance at most . Replacing by in its normalization changes its mean by at most
Chebyshev's inequality therefore bounds its error by with probability at least 7/8, for a sufficiently large batch constant.
The contribution from is nonnegative and has expectation at most , since . Markov's inequality bounds it by with probability at least 7/8. Its true contribution is at most . Thus the full batch average differs from by with probability at least 3/4.
Independent batches and a median give failure probability at most for each row. A union bound gives the claimed simultaneous two-sided accuracy. If , a good count estimate is zero and the algorithm correctly returns the zero vector.
Counting costs queries. For , the total sampling limit is . On a good estimate, and , proving (4.3). If , a good estimate returns zero and only the counting cost remains. The sampling limit is fixed once is obtained; the bound in terms of the true marked count holds except with the assigned counting error.
Total volume reduction subroutine. Algorithm 9 combines the preceding routines with arbitrary sampling, extraction, and threshold parameters. Let and .
Algorithm 6 stays within its query budget on every input when its counting and sampling calls succeed. Here the budget is guaranteed only on negative inputs satisfying the marked count bounds, so we return YES on timeout to preserve acceptance on positive inputs.
Algorithm 9 reduce_volume
Input: A bipartite graph with side sizes , degree bounds , marked fraction bound , and parameters , , with . Return YES if the total query count exceeds a sufficiently large budget from Lemma 4.7.
1: sample_marked_neighborhoods and sample_marked_neighborhoods.
2: Run prepare_estimates on with the supplied parameters, first for rows in and then with the sides exchanged.
3: Estimate each side's common neighbor sums by estimate_sums, with bounds and respectively.
4: Minimize subject to and .
5: Let .
6: Test the edges outside with cover_test, cover , and bound .
7: Return .
Lemma 4.7 (Piece reduction). Let have edges and satisfy the input conditions of Algorithm 9. Suppose and on the negative inputs under consideration. On a good negative execution the output has marked volume at most
On the same good negative execution, the edges discarded after estimating the counts have a cover of marked volume at most
for a sufficiently large absolute constant . The query complexity is , where
On a positive input, a collision is detected or survives, except with the assigned error.
Proof. Keep side labels, sizes, and degree bounds fixed during deletions. Lemma 4.1 bounds the two sampling costs by on good count estimates. It establishes the marked-neighbor bounds required by Lemma 4.5. Applying that lemma on both sides costs and supplies exceptional contributions at most and squared-sum bounds . The second application preserves the first application's bounds under edge deletions.
Lemma 4.6, using fresh samples from the graph remaining after preprocessing, gives coordinate error at cost . Lemma 4.3 now gives the retained volume bound and the outside-cover bound . Testing this cover costs by Lemma 2.7. Adding the costs proves the claimed bound on good negative executions.
Choose the global budget large enough to cover these executions. A union bound over the internal error events makes timeout negligible on allowed negative inputs, and the cutoff enforces the worst-case query bound. Every deleted edge is covered by a preceding collision test or neighborhood search. Thus a positive input is detected or retains a collision; returning YES on timeout preserves this guarantee even when the marked count bounds fail.
Parameter optimization. Fix a target query parameter and a base cutoff . At current volume bound , partition the edges into pieces. For a piece with sides of sizes and edges, use the explicit choices
(4.4)
where is a sufficiently small absolute constant. As before, put and .
Algorithm 10 Collision search with bounded maximum degree
Input: A known bipartite graph on at most labels of maximum degree at most , where .
1: Let and , for a sufficiently large absolute constant .
2: If , return cover_test().
3: Let .
4: Let .
5: while :
6: If is edgeless, return No.
7: Partition using partition_edges; let be the number of pieces.
8: Search each piece with at most edges directly; return YES on a collision, and otherwise discard it.
9: For every remaining piece, call reduce_volume with the parameters in (4.4) and retain its returned edge list.
10: Replace by the union of the retained edge lists and let .
11: end while
12: Return cover_test().
Lemma 4.8 (Iterated volume reduction). Algorithm 10 decides graph collision with bounded error for bipartite graphs on at most labels of maximum degree at most , using
queries. Its parameter choices satisfy and in every call to reduce_volume.
Proof. Initially the marked volume is at most . On a good negative execution, each partition piece has marked volume at most . By Lemma C.1, its minimum degrees imply and . The threshold terms sum to , and
Thus Lemma 4.7 retains volume at most per piece for sufficiently small . Summing the disjoint retained edge lists gives volume at most , so halving preserves the invariant. The final cover test rejects on good negative executions. On positive inputs, every deleted collision is covered by a preceding search or test, so a collision is detected or survives. The prescribed reduction cutoffs return YES and add only their assigned error on negative inputs.
We bound the costs in Lemma 4.7. Sampling costs . Since , the first extraction term on either side is at most . Since , we have . Hence , and symmetrically . Also,
using , , and . For estimation, gives
and the same holds on . Finally, the outside-cover bound is because and , , so its test costs . Direct searches and the final cover test also cost each. Summing over logarithmically many rounds and pieces proves the bound. A union bound with sufficiently small elementary errors gives bounded error overall.
It remains to verify the parameter choices. If , the direct cover test costs . This is within a logarithmic factor of the stated minimum. Otherwise . A piece with has and , so
For the variance condition, , , and imply . Hence
using . Since and , the logarithmic slack in ensures . The same argument applies to .
The cost calculation above gives
The second term equals , and the third is at most because . The fourth is at most by . The last equals and is at most by the definition of . Thus the iterative branch costs , proving the claim.
4.3 Finishing the argument
We can now combine the low- and high-degree algorithms and optimize the degree cut-off to minimize the resulting query complexity. This gives the final query complexity bound stated in the introduction.
Proof of Theorem 1.1. Choose a degree threshold . First apply Lemma 4.2, which detects a collision or returns a graph of maximum degree at most , preserving a collision if one exists, except with the assigned error. This costs queries. Apply Lemma 2.3 to the returned graph; this gives a bipartite graph on labels whose maximum degree is still at most . Apply Lemma 4.8 to this bipartite graph. Its cost is at most
Balancing the high-degree cost with the first low-degree term gives
Both balanced terms are . The remaining term is smaller:
Thus the total query complexity is . On a negative input both routines reject, and on a positive input the first detects a collision or preserves one for the second. Amplifying each routine to error at most gives total error at most . For bounded , query all input bits. Repeating the algorithm times and taking the majority gives the stated high probability guarantee.
5 Functions with positive certificates of size two
The preceding algorithm also applies to functions with positive certificates of size at most two over an arbitrary finite alphabet.
Let be an alphabet of size , and let , where . A positive certificate is a partial assignment that forces the value 1 among inputs in . Let be the least nonnegative integer such that every positive input has a positive certificate of size at most . Write for the quantum query complexity with error at most .
Lemma 5.1 (Reduction to graph collision). Let be a (partial) function, where , , , and There is a known simple graph on vertices and a
If , one query evaluates . For binary inputs, the comparison with graph collision follows by fixing one endpoint of a single edge to be marked.
bit string such that, for every ,
Each query to can be simulated with at most two queries to . Consequently, . For binary inputs, one query suffices and the factor 2 can be omitted.
Proof. Suppose first that is nonconstant on . Let and . Thus the vertex is marked exactly when .
For each positive certificate of size two, include the edge in . For each singleton positive certificate , choose a coordinate and include the edges for all , adding each edge only once throughout the construction.
An edge arising from a certificate of size two has both endpoints marked exactly when satisfies that certificate. For a singleton certificate , exactly one vertex is marked, so one of the added edges has both endpoints marked exactly when . Thus has a marked edge if and only if satisfies a positive certificate of size at most two. Since , this is equivalent to for every .
For constant value 0, use the same input bits on an edgeless graph. For constant value 1, include every edge between and . Exactly one vertex in each part is marked, so a collision always exists.
To simulate a query to , query into a work register, flip the answer bit if , and uncompute the work register. This uses two input queries and implements the oracle for y.
For binary inputs, . Query directly into the answer bit and flip that bit when a = 0. This uses one query.
Theorem 5.2 (Query bound for an arbitrary alphabet). Let be a (partial) function, where , , and . Then .
Proof. Apply Lemma 5.1 and Theorem 1.1 to the graph on vertices. Two queries to x per query to y give the stated bound.
Corollary 5.3 (Bounds for different alphabet sizes). For every function f as in Theorem 5.2:
(i) If , then .
(ii) If , then .
(iii) If for some fixed , then .
Proof. Substitute the three bounds on into Theorem 5.2. In the third case, , so the logarithmic factors do not affect the strict improvement.
Corollary 5.4 (Equivalence for binary inputs). Let
Then .
Proof. Every graph collision function has positive certificate complexity at most two, since the two marked endpoints of an edge certify a positive input. This gives the first inequality. The binary case of Lemma 5.1 gives the second.
6 A lower bound breaking the barrier
We now give a family of graphs for which graph collision requires queries. The graphs are incidence graphs of points and lines over a finite field. The proof uses the fact that two points determine at most one line and two lines meet in at most one point.
Let be a prime power. Let and be disjoint copies of , representing points and nonvertical lines, respectively. A point is incident to a line when . Let be the Levi graph associated to this incidence structure, i.e., the bipartite graph with one independent set of vertices corresponding to the set of points in and the other independent set of vertices corresponding to the set of lines in . Place an edge in if the point in corresponding to is contained in the line in corresponding to . Thus, the graph has vertices, degree , and edges.
Theorem 6.1. For all sufficiently large prime powers , we have . Consequently, for sufficiently large values of , there is an -vertex graph with .
By Lemma 2.10, it suffices to construct a matrix with rows indexed by positive inputs and columns indexed by negative inputs, such that . The matrix keeps only entries whose two inputs disagree at the queried vertex . We want the norm of the full matrix to be large compared to the norm of each such restriction.
6.1 Construction of the adversary matrix
We compare inputs with no marked edge to inputs with exactly one marked edge , where and . We first specify distributions on these inputs.
Input distributions. Let
Here is the probability of marking a line, and is the probability of marking an uncovered point. We say a point is uncovered if it is not contained in any marked line. We have . For sufficiently large ,
For an input , let . Thus is uncovered exactly when .
For the negative distribution , mark the lines independently with probability , and then mark each uncovered point independently with probability . For an edge , define by fixing , fixing the other points on and the other lines through to zero, and using the same sampling rule on the remaining vertices. The only marked edge is . In particular, the positive distributions have disjoint supports.
The negative sampling rule prevents a collision at every point: a marked line forces all its incident points to zero. The positive distribution can also be obtained by conditioning a negative sample on , marking , and setting the other points on to zero. All lines through a were already unmarked, and all other bits remain unchanged. Thus the two distributions are related by a change confined to one line and its incident points. Figure 3 illustrates the two distributions.
Choice of probabilities. The aim is to have many marked points and lines among which to hide the planted edge. The two sides compete: marking more lines leaves fewer points available to be marked. Each point lies on lines, so it has marked incident lines on average and is uncovered with probability .
We compensate for this loss by marking uncovered points with the larger probability . The relation makes the probability that a given point is marked equal to , almost the same as the line probability . Thus the two sides have nearly the same density of marked vertices. If is of order , each side has only order marked vertices on average. With , each side instead has order marked vertices on average, while the sampling rule still prevents every collision on a negative input.
Why not mark even more lines? The probability of being uncovered decreases exponentially in , so the compensating probability grows rapidly. In particular, , and taking asymptotically larger than would force . The logarithmic scale therefore allows many more marked vertices while preserving this balance. The small factor keeps the conditional point probability small as well: and .
Bases indexed by independent sets. The input bits are dependent, since a marked line forces its neighboring points to zero. Under , once the line bits are fixed, the uncovered point bits are independent with mean , and every covered point bit is zero. Thus the conditional expectation of is . Subtracting this expectation gives a function with conditional mean zero; this subtraction is called centering. Dividing by then gives conditional second moment one at uncovered points. For a line bit, we similarly subtract its mean and divide by . In each distribution space, use the inner product . Let
As usual, . Define functions
Here excludes the points incident to . The sets and index basis vectors; they are not the marked sets of an input.
Each basis vector is a function of the input . The product vanishes unless every line in is unmarked. On those inputs, the functions for are constant, so only lines outside need separate indices. This explains why the basis is indexed by independent sets. The normalizing factors account for the probability that the required lines are unmarked.
For example, is zero when a marked line covers . When is uncovered, . Adding a line to the index set multiplies this function by . A line supplies no additional factor that varies on its support: there , so is constant. The indices therefore specify which functions and occur in the product.
Lemma 6.2 (Independent set bases). The functions form an orthonormal basis for functions on the support of , and the functions form an orthonormal basis for functions on the support of , with the inner products above.
Proof. Condition on the line bits. The functions occurring in the products are independent and have mean zero, and . Distinct point sets are therefore orthogonal. For equal point sets , the second moment forces every line in to be zero. The remaining line bits are independent, so the products of their functions are orthonormal. The displayed powers of normalize the squared norms, taking account of the lines through that are already fixed in the positive distribution.
For the negative distribution, both the basis indices and the supported inputs are the independent sets of . For the positive distribution, both are the independent sets of the graph remaining after deleting the points on and the lines through . Their cardinalities agree, so the orthonormal families are complete.
Let and be the matrices taking these basis coordinates to input coordinates. Their entries are
where the latter entry is zero unless has unique marked edge . These matrices are orthogonal by Lemma 6.2 and the disjointness of the positive supports.
Write for multiplication by in the negative basis, and for multiplication by in the direct sum of the positive bases. These are orthogonal projections onto functions supported on inputs whose bit at is one.
The planting map. To obtain an input with marked edge , start with a negative input whose point is marked, mark , and unmark the other points on . Every line through is initially unmarked, so this operation creates exactly one marked edge. We construct matrix by expressing this operation in the bases above.
The condition that is marked has two contributions in the centered basis. Indeed, the definition of gives
The first term requires all lines through to be unmarked, and the second contains the point index . This explains the two terms and their coefficients in .
For a set of lines, let be the unit vector indexed by with coordinates . The binomial theorem gives its unit norm, and expanding the product gives
Thus represents the condition that all lines in are unmarked.
For a positive row , the lines in are already unmarked wherever is nonzero. Thus only the lines in need to be included in . In particular, . Every point in covers at most one line through , so
With the normalizations of our bases, the two contributions above give the planting map
for a vector in the negative basis. The first term removes a subset of lines through , and the second removes the point index . The signs come from (6.2), and is the probability of selecting exactly when each line in is selected independently with probability .
Lemma 6.3 (Planting an edge). On a negative input with , let mark and unmark every other point on . If is the block of associated with , then, for every function on positive inputs,
Consequently, for every bit preserved by this operation, and .
Proof. Expanding the subset sum using (6.2) gives
Now and . Planting changes only and its incident points. Since contains no point on and , the factors are unchanged. This proves the formula on every basis vector. Preserved bits give the projection identities, and on negative inputs gives the last assertion.
The additive correction. Planting changes the input bit at from zero to one. A query to therefore distinguishes each input from its planted image. We add a map to cancel part of this contribution. Signed entries are allowed in the general adversary bound.
Consider first and the source coordinates without the point index . On the two line coordinates , the normalized condition is represented by . The vector is a product of these unit vectors. Taking the inner product in the coordinate therefore removes that coordinate from the subset term of . Its coefficient at the empty subset of becomes . In contrast, the coordinate containing just the line index has inner product with the same condition. This suggests removing the line index with coefficient one. Define
The two empty subset coefficients now cancel. Every other subset contribution contains an additional line through . Knowing such a line restricts the possible choices of to its points. For nonempty , the same calculation leaves the coefficient . Its difference from zero comes only from the lines in , which are already forced to be unmarked. There are at most such lines, since each point of lies on at most one line through .
The multiplicative correction. We implement the multiplicative correction by weighting the columns. A source coordinate with many point and line indices offers more choices for the planted edge: a point removed by specifies , and a line removed by specifies . We give smaller weights to columns with more indices to limit their combined contribution. At the same time, we keep weight one at the coordinate indexed by , which contributes to every planted edge. Let
These weights decrease gradually as indices are added: they are at least when , and decrease in proportion to above this scale. They also have a direct interpretation. Uniformly order the indices together with auxiliary elements. The weight is the probability that the first element is auxiliary. Let be diagonal with these entries, and define
The matrix is written in the point and line bases, while is written in input coordinates. All three operations from a source coordinate receive the same weight, and point and line indices are treated equally. We have , and the source coordinate indexed by has weight one. The rows of are indexed by positive inputs and its columns by negative inputs, as in Lemma 2.10.
Both corrections are designed to control the denominator of the adversary ratio. The additive correction creates cancellations, and the multiplicative correction reduces the weights of columns with many indices. Both preserve the image of the coordinate indexed by . Let be the corresponding unit vector. We have and , so
Since and are orthogonal, this gives . Thus the corrections preserve this lower bound on the numerator.
The numerator. We evaluate to obtain the lower bound on the numerator.
Each possible planted edge contributes to a different positive coordinate. These contributions are orthogonal, so their squared magnitudes add over all edges. The choice of makes this sum of order , which explains the additional factor in the lower bound.
Lemma 6.4 (Numerator bound). The matrices in (6.4) satisfy .
Proof. We have . For each planted edge , the vector has coefficient in the positive coordinate with . These coordinates are orthogonal, and their squared coefficients sum to , proving the claim.
6.2 The denominator and the adversary ratio
The denominator measures how much of the adversary matrix connects inputs that differ at one queried vertex. A map that preserves this input bit gives the same result whether we restrict to inputs with that bit equal to one before or after applying the map. The corresponding difference between the two operators is therefore zero. We bound by calculating in the bases above. In input coordinates, the matrix with entries becomes after multiplying column by . These sign changes preserve the norm. Changing to the point and line bases therefore gives
There are two contributions to this difference. The first comes from applying the query projection before or after . The second comes from the column weights: the query projection can mix basis coordinates with different values of , and hence different weights. Let . Adding and subtracting gives
We will bound the first contribution by counting. For the second, the reciprocal form of the weights reduces the calculation to the change in the number of indices. Let be diagonal with entries . Since , expanding the right side gives the identity
Using (6.5), , and , we obtain
The factor in the second contribution has norm and disappears when we divide by this norm. Thus we only need to control how the query changes the number of indices; no separate bound on is required.
We will show that and . Together with Lemma 6.4, these estimates give the required adversary ratio. We first describe the local query projections and bound the change in the number of indices. We then bound by counting and apply the column weights.
The action of a query. A query to a free line acts on the two coordinates in which that line index is absent or present. A point query has a slightly larger block. When the point index is present, the independent set condition excludes every line through . When is absent, the free lines through can occur in any subset. Fixing all other indices groups these possibilities into one block. For one line, write . The following lemma gives the query projections on these blocks.
Lemma 6.5 (Local query projections). On the two coordinates of a free line, its query projection is
For a point , fix the line indices outside and let . The negative point projection on the coordinates , , and is
In a positive space, the same formula holds after deleting the lines in . The projections at a and are the identity; those at the other points on and the other lines through a are zero.
Proof. The line formula follows by multiplying the functions by . For a point, use (6.2) and the identities
Order the subset coordinates first and the point coordinate last. By (6.2), multiplication by free on the subset coordinates is the projection . The two identities above, with the normalizations in the basis definitions, give the blocks
The off-diagonal blocks exchange the point coordinate with the combination of subset coordinates. Since , we have , so this is a rank one orthogonal projection. The positive formulas follow from the fixed input bits.
The number of indices changed by a query. The second term of (6.6) depends only on the difference between the sizes occurring in a local query block. A point query compares a subset of free lines with a single point index.
The squared coefficients of describe independent line selections with probability . Thus the size change is controlled by the second moment of the number of selected lines. The coefficient in the point query vector supplies the additional small factor in the bound.
Lemma 6.6 (Change in the number of indices). For every vertex ,
Proof. Consider a point query block from (6.7), with base point set and external line set . Subtract from , which leaves its commutator with the query projection unchanged. The shifted diagonal entries are on subset coordinates and zero on the point coordinate. Hence
Counting selected lines and ordered pairs gives . Expanding the difference with the rank one projection as two rank one maps bounds its norm by twice the displayed vector norm.
A free line query changes the total size by one. On its two coordinates, the commutator block is
whose norm is . A line fixed to zero gives no contribution. The local blocks are orthogonal, so their largest norm proves the claim.
Counting the contributions. We now turn to the first term of (6.6) and bound by counting compatible planted edges. For each type of contribution, we bound the norm of a local map and then count how many such maps can use a fixed source coordinate. Orthogonal target spaces allow us to add squared norms. Thus a source used by at most t maps of norm at most receives a squared bound of at most pt. The following observation makes this calculation valid for arbitrary vectors, even when different maps use some of the same source coordinates.
Lemma 6.7 (Weighted counting). Suppose maps have orthogonal target spaces, each reads only source coordinates in , and . Then
Proof. Let project onto . Since , we have . Orthogonality of the target spaces gives
Interchanging the two sums gives the claimed bound. Each source coordinate is counted once for every local map that can use it.
For a fixed planted edge, fixing the point indices and the line indices outside the queried neighborhoods gives the local blocks to which this lemma applies. A point query groups together the coordinates with its point index absent and present. Distinct planted edges have orthogonal target spaces. We split the matrix into a constant number of types of contributions; combining their bounds costs only a constant factor.
We next explain the cancellation supplied by . For a query to the planted line , the positive bit is fixed to one, so the difference on this block is . In the subset and line removal terms, is a free line coordinate. On these coordinates, , so we first multiply the corresponding part of the row by . Suppose . Among the terms with no other line through , the subset term of contributes , and the line removal term contributes . These are equal in magnitude by our choice of , so they cancel.
The terms left after this cancellation contain another line through , whose presence will restrict the possible planted edges. For nonempty , the lines in must already be unmarked wherever is nonzero. This changes the empty subset coefficient, but each point in can account for at most one such line. The next lemma separates the nonempty subsets from this remaining coefficient. It also gives the corresponding formula for a query to another point on the planted line.
Lemma 6.8 (Queries on the planted line). Fix a positive row , and let . Let be the part of this row of on source coordinates without the point index . Then
The first term has norm at most and is supported on nonempty subsets of . For a query to , we have . For a query to , let . Grouping the output line indices in gives
Thus this point query multiplies the norm of each term in (6.8) by .
Proof. The subset term of and the line removal term give
Multiplying in the coordinate and using and gives
The empty subset coordinate of is . Separating this coordinate gives exactly (6.8), since . Deleting one coordinate from the unit vector leaves a vector of norm at most one, so the nonempty part has norm at most . The line query formula follows from .
For a point , the positive bit is fixed to zero, so the corresponding difference uses the negative point projection. The only line through both and is . The free lines in the negative point query are therefore . Its part without the point index is . Multiplying its coordinate by gives the same vector , now with the additional factor , and proves (6.9). The two remaining vectors have norm one, and the query leaves the indices in unchanged.
The remaining estimates count how the source indices restrict the planted edge. For example, a line in the source line set and the queried line meet in at most one point, which fixes the planted point if it exists. The incidence structure therefore limits how many output blocks can use a given source coordinate. Lemma 6.7 converts these counts into a bound valid for arbitrary vectors.
Lemma 6.9 (A bound for ). For every vertex v and vector f in the negative basis,
Proof. Fix a source , and write and . We first bound the endpoint terms by partial matchings. For the remaining terms, we identify a point or line in the source that restricts the planted edge, count the possible edges, and multiply this count by the squared local norm. The empty subset contribution has no line to use in this way; its small coefficient is instead controlled by the points in .
Contributions at the planted endpoints. For a queried point , let be the restriction of to edges with planted point . A target has no line index through , and removes only the planted line. Thus every contributing source contains exactly one line through . That line determines the planted edge and the target label. Conversely, each target reads one source with coefficient one. The map therefore copies distinct source coordinates into distinct target coordinates, so it is a partial matching matrix and . Planting preserves , so its contribution is zero. Since the positive bit at is one, the remaining contribution to is , of norm at most one.
For a queried line , a target has no point index on . The point removal map therefore uses a source with exactly one point in on . This point determines the planted edge and the target label. As above, distinct contributing sources have distinct targets. The map is a partial matching multiplied by , so its norm is at most one. Since contains a point on , its basis function vanishes whenever . The negative line projection is consequently zero on this source, and the contribution to is the map itself.
Contributions from point indices. For a query to , consider the point removal term. Every source it uses contains the planted point . Choosing leaves at most one possible planted line, namely the line through and . There are therefore at most compatible planted edges. For each edge, group the free line indices through . Point removal has coefficient , while the part of the point query vector without the index has norm . The squared local norm is at most . Lemma 6.7 therefore assigns each source squared weight at most .
The empty part of (6.8) is also controlled by point indices. For a local block, let be the number of lines through covered by its row's point set. This set is contained in every source read by the term, so (6.3) gives . Using ,
The bound follows from and the union bound . In particular, when c = 0.
For a queried line , the planted point can be any of its points. The squared coefficient is at most , so the total squared weight is at most . For a queried point , choose one of the lines through and one of its other points as . Equation (6.9) supplies an extra squared factor , giving total squared weight at most . Within each edge, the local blocks have orthogonal targets and disjoint source supports; distinct edges also have orthogonal targets. Since , Lemma 6.7 bounds both totals by
where we used .
Contributions from line indices. For the nonempty part of a query to , the source line set contains a line . This line differs from and passes through the planted point . For each choice of , its intersection with the queried line fixes , if an intersection exists. Thus at most planted edges can use this source. The local norm in (6.8) is at most , so each edge contributes at most to the squared bound. Lemma 6.7 gives total squared weight at most .
For the nonempty part of a query to , the source still contains a line in : none of these lines passes through , so the point query leaves their indices unchanged. Choose such a line from , then choose among its points. The pair determines at most one line , giving at most compatible planted edges. Equation (6.9) gives local norm at most , whose square is . The total squared weight is therefore at most .
For a queried line , planting preserves , so its contribution to is zero. The positive bit is fixed to zero. In the line removal term, the coordinate is absent, and . Every source used by this term still contains , since the query only changes the coordinate. Choosing fixes as the intersection of and , if it exists. There are at most compatible edges, each with squared local norm at most , giving total squared weight at most .
For a point query , planting preserves the queried bit. It remains to consider . When is added to , the newly covered lines through form . This set contains at most one line, since and two distinct points lie on at most one line. If no new line is covered, the local query formulas agree before and after line removal, so the contribution to is zero. Otherwise, let be that new line. It is fixed to zero in the positive space but is free in the part of the negative block without the point index .
The correction removes only . Since the target cannot contain the index , the source must already omit . On the subset coordinates this is the functional , which selects the coordinate without . On the point coordinate, is already excluded by the presence of , so the map is the identity. After omitting unaffected coordinates, the local map is
For comparison, represents the normalized function by (6.2). Taking its inner product with a line function gives times that function's value at . Thus accounts for fixing the line bit to zero, using both line coordinates. We compare the actual map with , which satisfies the following identity for the point projections:
Indeed, it sends to , and its adjoint sends the latter vector back. Here consists of the other free lines through . The difference between the two maps is zero on the part with the point index. On the part without that index it has norm , and either point projection restricted to this part has norm . Subtracting the displayed identity expresses the contribution as two terms, each bounded by the product of these norms. Its local norm is therefore . Every source still contains , since and the query at leaves that line index unchanged. There are at most choices of and choices of . Multiplying these possibilities by the squared local bound gives .
These cases cover every possible queried vertex. For a point query, the point is , another point on , or a point outside , all treated above. For a line query, the line is , another line through , or a line outside . In the last case planting preserves the bit, and removing the index leaves the queried line's local projection unchanged. Both contributions are therefore zero. The same reasoning accounts for the zero contributions already omitted in the other cases, by Lemma 6.3 and the local query formulas.
A compatible planted edge may be counted more than once if several source lines determine it; this only increases the upper bound. The endpoint contractions contribute at most . Combining this with the counts assigns each source coordinate total squared weight
Here (6.1) gives . Lemma 6.7 now gives the claimed bound.
Applying the column weight. The squared counting bound grows quadratically with the number of indices, while the squared column weight decreases at the matching rate. Their product is uniformly bounded, which gives the required bound on . Since , we have . Applying Lemma 6.9 to therefore gives , and hence .
Proof of Theorem 6.1. By (6.6) and Lemmas 6.4, 6.9, and 6.6,
The last bound uses and . Applying the standard adversary bound of Lemma 2.10 proves .
For arbitrary sufficiently large , choose a power of two with and add isolated vertices to . Restricting their input bits to zero recovers the original problem, so the lower bound is .
Acknowledgments
AC is supported by ERC Starting Grant 101163189. ASG received support from the National Science Foundation (grant 26-17356). SP acknowledges support from the Dutch Ministry of Education, Culture, and Science through Gravitation project “Challenges in Cyber Security - 024.006.037” for this work. XZ is supported by NSERC Grant RGPIN-2024-06493.
Use of generative AI. OpenAI’s GPT-6 Astra proposed the core proof ideas of this paper and was used extensively in developing the results and preparing the manuscript. For the upper bounds, it first produced an algorithm and analysis with query exponent 13/20. By studying the ideas in that algorithm, we obtained, with further assistance from GPT-6 Astra, the simpler algorithm with exponent 92/139 presented here. In parallel, continued work with GPT-6 Astra led to the improved exponent 11/17.
For the lower bound, we built on Belovs’s approach [Bel26], with substantial assistance from GPT-6 Astra in developing the additional constructions and estimates yielding the bound.
The authors retain full responsibility for all mathematical claims and the final text.
References
[ABI+13] A. Ambainis, K. Balodis, J. Iraids, R. Ozols, and J. Smotrovs. Parameterized quantum query complexity of graph collision, 2013. URL: https://arxiv.org/abs/1305.1021.
[Amb05] Andris Ambainis. Polynomial degree and lower bounds in quantum complexity: Collision and element distinctness with small range. Theory of Computing, 1(3):37–46, 2005. URL: https://theoryofcomputing.org/articles/v001a003, doi:10.4086/toc.2005.v001a003. [Amb07] Andris Ambainis. Quantum walk algorithm for element distinctness. SIAM Journal on Computing, 37(1):210–239, 2007. URL: https://arxiv.org/abs/quant-ph/0311001. [Amb08] A. Ambainis. Quantum search with variable times. In STACS 2008, pages 49–60, 2008. doi:10.4230/LIPIcs.STACS.2008.1333. [AS04] S. Aaronson and Y. Shi. Quantum lower bounds for the collision and the element distinctness problems. Journal of the ACM, 51(4):595–605, 2004. doi:10.1145/1008731.1008735. [BCdWZ99] Harry Buhrman, Richard Cleve, Ronald de Wolf, and Christof Zalka. Bounds for small-error and zero-error quantum algorithms. In Proceedings of the 40th Annual Symposium on Foundations of Computer Science, pages 358–368, 1999. URL: https://arxiv.org/abs/cs/9904019, doi:10.1109/SFFCS.1999.814607. [Bel12] Aleksandrs Belovs. Learning-graph-based quantum algorithm for k-distinctness. In Proceedings of the 53rd Annual Symposium on Foundations of Computer Science, pages 207–216, 2012. URL: https://arxiv.org/abs/1205.1534, doi:10.1109/FOCS.2012.18. [Bel26] Aleksandrs Belovs. Tight quantum lower bound for k-distinctness. arXiv preprint arXiv:2604.05133, 2026. [BHMT02] G. Brassard, P. Høyer, M. Mosca, and A. Tapp. Quantum amplitude amplification and estimation, 2002. URL: https://arxiv.org/abs/quant-ph/0005055. [BI16] Kaspars Balodis and Jānis Iraids. Quantum lower bound for graph collision implies lower bound for triangle detection. Baltic Journal of Modern Computing, 4(4):731–735, 2016. URL: https://arxiv.org/abs/1507.03885, doi:10.22364/bjmc.2016.4.4.10. [BKT20] Mark Bun, Robin Kothari, and Justin Thaler. The polynomial method strikes back: Tight quantum query bounds via dual polynomials. Theory of Computing, 16(10):1–71, 2020. URL: https://theoryofcomputing.org/articles/v016a010/, doi:10.4086/toc.2020.v016a010. [BR14] Aleksandrs Belovs and Ansis Rosmanis. On the power of non-adaptive learning graphs. Computational Complexity, 23(2):323–354, 2014. URL: https://arxiv.org/abs/1210.3279, doi:10.1007/s00037-014-0084-1. [CDR19] E. Chlamtáč, M. Dinitz, and T. Robinson. Approximating the norms of graph spanners. In APPROX/RANDOM 2019, volume 145 of Leibniz International Proceedings in Informatics, pages 11:1–11:22, 2019. doi:10.4230/LIPIcs.APPROX-RANDOM.2019.11. [CGP26] A. Cornelissen, A. S. Gilani, and S. Patro. Quantum algorithms for path and cycle containment problems, 2026. URL: https://arxiv.org/abs/2605.09017. [GI12] D. Gavinsky and T. Ito. A quantum query algorithm for the graph collision problem, 2012. URL: https://arxiv.org/abs/1204.1527. [GMPR26] A. S. Gilani, N. S. Mande, S. Patro, and N. Raja. Quantum query complexity of maximum degree and its generalizations, 2026. URL: https://arxiv.org/abs/2610.13906. [HLŠ07] Peter Høyer, Troy Lee, and Robert Špalek. Negative weights make adversaries stronger. In Proceedings of the 39th Annual ACM Symposium on Theory of Computing, pages 526–535, 2007. URL: https://arxiv.org/abs/quant-ph/0611054. [JKLGM16] Stacey Jeffery, Robin Kothari, François Le Gall, and Frédéric Magniez. Improving quantum query complexity of Boolean matrix multiplication using graph collision. Algorithmica, 76(1):1–16, 2016. URL: https://www.irif.fr/~magniez/PAPIERS/jklm-algorithmica16.pdf, doi:10.1007/s00453-015-9985-x. [Kot14] Robin Kothari. Efficient algorithms in quantum query complexity. PhD thesis, University of Waterloo, 2014. URL: https://dspacemainprd01.lib.uwaterloo.ca/server/api/core/bitstreams/879813de-8294-43a8-a21a-f5718e0deaa8/content.
[MNRS11] F. Magniez, A. Nayak, J. Roland, and M. Santha. Search via quantum walk. SIAM Journal on Computing, 40(1):142–164, 2011. URL: https://arxiv.org/abs/quant-ph/0608026, doi:10.1137/090745854.
[MSS07] F. Magniez, M. Santha, and M. Szegedy. Quantum algorithms for the triangle problem. SIAM Journal on Computing, 37(2):413–424, 2007. URL: https://arxiv.org/abs/quant-ph/0310134.
[Ros14] Ansis Rosmanis. Quantum adversary lower bound for element distinctness with small range. Chicago Journal of Theoretical Computer Science, 2014(4), July 2014.
[ŠS06] Robert Špalek and Mario Szegedy. All quantum adversary methods are equivalent. Theory of Computing, 2(1):1–18, 2006. doi:10.4086/toc.2006.v002a001.
[YLC14] T. J. Yoder, G. H. Low, and I. L. Chuang. Fixed-point quantum search with an optimal number of queries. Physical Review Letters, 113:210501, 2014. URL: https://arxiv.org/abs/1409.3305, doi:10.1103/PhysRevLett.113.210501.
[Zha05] Shengyu Zhang. On the power of Ambainis lower bounds. Theoretical Computer Science, 339(2-3):241–256, 2005.
A Standard quantum procedures
Lemma 2.4 (restated). Let a known set of a labels contain marked vertices. With queries, quantum counting returns an integer that, except with the assigned error probability, is zero exactly when and otherwise satisfies
Given , a batch of independent uniform marked samples uses a fixed query limit , reporting failure if insufficient samples are obtained. On a good estimate, sampling succeeds except with the assigned error probability, and the uniform state over marked labels can be prepared to inverse polynomial precision in queries.
Proof. The claims follow from quantum counting and amplitude amplification [BHMT02]. Count to additive and round. For sampling, use verified randomized Grover trials of length , allowing trials. On a good estimate each trial succeeds with constant probability and, conditional on success, returns a uniform marked label. Independent trials give the stated samples and failure bound. For coherent preparation, use amplitude amplification with the lower bound on the marked fraction [YLC14]. Its query limit is fixed by the estimate and precision.
Lemma 2.5 (restated). Suppose polynomially many tests have known polynomially bounded query limits . Each accepts every positive input for its own edge list and rejects negative inputs satisfying its stated bound. If all these bounds hold on a global negative input, their OR can be tested in queries, accepting every positive global input.
Proof. Apply standard variable-time search with known costs [Amb08], with error reduction. The restriction to negative inputs causes no difficulty: in a group of comparable costs, a uniform coherent choice of child accepts with probability at least if any child is positive, regardless of the other children. On an allowed negative input its acceptance probability is at most . Reducing each child's error to costs an factor and separates the two cases by a constant factor. Standard amplification distinguishes these cases; grouping costs between consecutive powers of two gives the stated bound.
B Collision tests
The tests below have fixed query limits. Their bounds are required on negative inputs; a collision is accepted except with the assigned error probability whether or not those bounds hold.
Algorithm 11 cover_test
Input: , where is a known vertex cover.
1: Group the positive degree vertices of by .
2: for each nonempty group, with a power of two:
3: Estimate its marked count by .
4: If , return YES; if , skip this group.
5: Amplify the following trial times:
6: Prepare a uniform marked group vertex and search its neighborhood.
7: Return YES if a verified marked edge is found.
8: end for
9: return No.
Lemma 2.7 (restated). Let be a known vertex cover of . The procedure cover_test() uses queries. It accepts every positive input and rejects negative inputs satisfying .
Proof. Failed preparations in the amplified trial are nonaccepting; the trial accepts only a verified marked edge. For a group of size with marked vertices, a good estimate satisfies . On an allowed negative input, , so the count check cannot accept. If a collision has a marked endpoint in the group, a trial finds a verified edge with probability . Every collision has an endpoint in , proving acceptance on positive inputs.
Counting costs . Each trial before amplification costs , so the total for a group is . Summing over the logarithmically many groups proves the bound. For , any nonzero estimate accepts immediately; an empty cover needs no queries.
Algorithm 12 bipartite_test
Input: , with and .
1: If a side is empty, return NO; otherwise let .
2: Estimate the number of marked vertices in by .
3: If , return NO; if , return YES.
4: Let .
5: Run quantum walk search on ordered lists of marked vertices from .
6: Setup: prepare the uniform superposition over lists, allowing repetition.
7: Update: replace a random entry by a fresh uniform marked vertex.
8: Check: search for a marked neighbor of some list entry.
9: Use gap bound and accepting fraction bound .
10: return the outcome of the walk search.
Lemma 2.8 (restated). Let be bipartite with sides of sizes .
The procedure bipartite_test() accepts every positive input and rejects negative inputs satisfying , with query complexity
Proof. Condition first on a good count estimate. If , no collision exists. If , returning YES is safe because this cannot occur on a negative input satisfying . Otherwise and .
The walk has uniform stationary distribution on ordered lists from . Refreshing one of independent coordinates gives spectral gap when ; when , there is only one list and its check suffices. If a collision has endpoint , a list containing is accepting. Its stationary probability is at least
On a negative input no list is accepting. Since the graph is known, adjacency to the stored list is computed without queries. An update prepares a uniform index and a uniform marked vertex , and writes the list obtained by replacing with . If , then and are determined by and and can be uncomputed. If , then can be uncomputed, and the index register, which is uniform, is returned to its initial state. Lemma 2.4 supplies coherent preparation and updates, giving
Lemma 2.6 therefore bounds the cost, including counting, by
When lies between 1 and , the first and last terms balance at , up to a constant from rounding. If it is below 1, these terms are ; if it exceeds , they are . Since every estimate reaching the walk satisfies , the fixed query limits give (2.1) on every execution. Good estimates and the walk guarantee acceptance on every positive input, and rejection on every negative input satisfying the count bound. Counting errors are included in the assigned error probability.
For the implementation errors, preparing a state within Euclidean distance of its target gives, by preparation, phase reversal, and uncomputation, a reflection within operator norm of the exact reflection. The same estimate holds for preparations controlled by a stored list. Reducing the checking error probability to gives a coherent check with operator norm error on the subspace where its work registers are initialized. There are only polynomially many such operations, so choosing sufficiently small and inverse polynomial in makes the sum of these errors at most . A telescoping expansion of the products of operations then bounds the change in the final state by . The additional precision costs only logarithmic factors.
Lemma 2.9 (restated). Let have at most vertices and let be a known vertex cover. There is a test using queries that accepts every positive input and rejects negative inputs satisfying .
Proof. Make a bipartite graph whose first side is a copy of all vertices and whose second side is a copy of , joined by the original incidences. Apply the bipartite test of Lemma 2.8. Each query to a copied input bit costs one original query, and a marked edge exists in the copy exactly when it exists in the original graph.
C Constructing the edge partition
Lemma C.1 (Marked counts in a piece). Let a piece have sides , sizes , and edges. Its degrees on lie between and , and similarly on . If its marked volume is at most , let . Then and . These marked count bounds remain valid after edge deletions when the side labels are fixed.
Proof. On either side the maximum and minimum degrees differ by at most . Comparing them with the average degree gives the stated degree bounds for pieces from Lemma C.2. Each marked vertex on contributes at least to marked volume. There are therefore at most such vertices, and at most trivially. The argument on is identical. Edge deletions do not change the input bits of the fixed labels, so the marked count bounds remain valid.
The improved algorithm from Section 4 needs pieces with comparable degrees on each side and disjoint edge lists. The following construction (adapted from [CDR19, Lemma 11]) uses only the known graph. It supplies the degree bounds used in Lemma C.1; its query cost is zero. Algorithm 13 gives the construction.
Algorithm 13 partition_edges
Input: A bipartite graph .
1: Initialize an empty list of pieces.
2: while edges remain:
3: Group side by degrees in , for powers of two .
4: Choose a pair of groups containing the most edges; copy those edges to .
5: Repeatedly remove from a vertex on side of degree below .
6: Record and its maximum degree on each side.
7: Delete exactly from .
8: end while
9: return the recorded pieces.
Lemma C.2 (Exact partition). Algorithm 13 partitions a known bipartite graph into nonempty pieces, without input queries. It returns triples , where is an exact edge list on its incident labels and every vertex on side has degree in , for . Marked volume is additive over the pieces.
Proof. Edges removed from during trimming remain in for subsequent iterations.
If the current graph has edges, some pair contains at least edges. Each selected side has at most vertices. Charging a trimmed edge to its first removed endpoint gives total charge at most
At least edges are recorded. Repeated removal of this fraction gives . Each piece has the claimed degree bounds. Recording the actual maximum degree on each side preserves the degree ratio and ensures that the recorded bounds do not exceed the maximum degree of the input graph. Its edge list is disjoint from all others, proving both exactness and additivity.