Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:quant-ph/0310107

On the Quantum Query Complexity of Detecting Triangles in Graphs

Márió Szegedy

Published Oct 16, 2003• 22 citations
arXivHTMLPDF

Abstract

We show that in the quantum query model the complexity of detecting a triangle in an undirected graph on $n$ nodes can be done using $O(n^{1+{3\over 7}}\log^{2}n)$ quantum queries. The same complexity bound applies for outputting the triangle if there is any. This improves upon the earlier bound of $O(n^{1+{1\over 2}})$.

DOI
10.48550/arxiv.quant-ph/0310107

Related papers

Quantum algorithms for the triangle problem

Frédéric Magniez, Miklós Sántha, Márió Szegedy

We present two new quantum algorithms that either find a triangle (a copy of K3) in an undirected graph G on n nodes, or reject if G is triangle free. The first algorithm uses combinatorial ideas with Grover Search and makes Õ(n10/7) queries. The second algorithm uses Õ(n13/10) queries, and it is based on a design concept of Ambainis [6] that incorporates the benefits of quantum walks into Grover search [18]. The first algorithm uses only O(log n) qubits in its quantum subroutines, whereas the second one uses O(n) qubits. The Triangle Problem was first treated in [12], where an algorithm with O(n + √ nm) query complexity was presented, where m is the number of edges of G.

Symposium on Discrete Algorithms•Jan 23, 2005•83 citations

An $O(n^{1.3})$ Quantum Algorithm for the Triangle Problem

Frédéric Magniez, Miklós Sántha, Márió Szegedy

We present a new quantum algorithm that either finds a triangle (a copy of K3) in an undirected graph G on n nodes, or it outputs “reject ” if G is triangle free. The algorithm uses O(n 1.3) queries, and it is based on a new design concept of Ambainis [Amb03] that incorporates the benefits of quantum walks into Grover search [Gro96]. The algorithm both improves on, and is simpler than a recent algorithm of Szegedy [Sze03] which has Õ(n10/7) query complexity. The Triangle Problem was first treated in [BDH + 01], where an algorithm with O ( √ n|E|) query complexity was presented (here |E | is the number of edges of G). 1

arXiv:quant-ph/0310134•Oct 21, 2003•23 citations

Quantum Lower Bound for Graph Collision Implies Lower Bound for Triangle Detection

Kaspars Balodis, Jānis Iraids

We show that an improvement to the best known quantum lower bound for GRAPH-COLLISION problem implies an improvement to the best known lower bound for TRIANGLE problem in the quantum query complexity model.In GRAPH-COLLISION we are given free access to a graph (V, E) and access to a function f : V → {0, 1} as a black box.We are asked to determine if there exist (u, v) ∈ E, such that f (u) = f (v) = 1.In TRIANGLE we have a black box access to an adjacency matrix of a graph and we have to determine if the graph contains a triangle.For both of these problems the known lower bounds are trivial (Ω( √ n) and Ω(n), respectively) and there is no known matching upper bound.

arXiv:1507.03885•Baltic Journal of Modern Computing•Dec 19, 2016•0 citations

Quantum Algorithms for the Triangle Problem

Frédéric Magniez, Miklós Sántha, Márió Szegedy

We present two new quantum algorithms that either find a triangle (a copy of $K_{3}$) in an undirected graph G on n nodes, or reject if G is triangle free. The first algorithm uses combinatorial ideas with Grover Search and makes $\tilde{O}(n^{10/7})$ queries. The second algorithm uses $\tilde{O}(n^{13/10})$ queries and is based on a design concept of Ambainis [in Proceedings of the $45$th IEEE Symposium on Foundations of Computer Science, 2004, pp. 22–31] that incorporates the benefits of quantum walks into Grover Search [L. Grover, in Proceedings of the Twenty‐Eighth ACM Symposium on Theory of Computing, 1996, pp. 212–219]. The first algorithm uses only $O(\log n)$ qubits in its quantum subroutines, whereas the second one uses $O(n)$ qubits. The Triangle Problem was first treated in [H. Buhrman et al., SIAM J. Comput., 34 (2005), pp. 1324–1330], where an algorithm with $O(n+\sqrt{nm})$ query complexity was presented, where m is the number of edges of G.

SIAM Journal on Computing•Jan 1, 2007•311 citations

Improved Quantum Query Algorithms for Triangle Finding and Associativity Testing

Troy Lee, Frédéric Magniez, Miklós Sántha

We show that the quantum query complexity of detecting if an $n$-vertex graph contains a triangle is $O(n^{9/7})$. This improves the previous best algorithm of Belovs making $O(n^{35/27})$ queries. For the problem of determining if an operation $\circ : S \times S \rightarrow S$ is associative, we give an algorithm making $O(|S|^{10/7})$ queries, the first improvement to the trivial $O(|S|^{3/2})$ application of Grover search. Our algorithms are designed using the learning graph framework of Belovs. We give a family of algorithms for detecting constant-sized subgraphs, which can possibly be directed and colored. These algorithms are designed in a simple high-level language; our main theorem shows how this high-level language can be compiled as a learning graph and gives the resulting complexity. The key idea to our improvements is to allow more freedom in the parameters of the database kept by the algorithm. As in our previous work, the edge slots maintained in the database are specified by a graph whose edges are the union of regular bipartite graphs, the overall structure of which mimics that of the graph of the certificate. By allowing these bipartite graphs to be unbalanced and of variable degree we obtain better algorithms.

arXiv:1210.1014•Oct 3, 2012•0 citations

Quantum Query Complexity of Maximum Degree and its Generalizations

Amin Shiraz Gilani, Nikhil S. Mande, Subhasree Patro +1 more

We study the quantum query complexity of several basic graph problems. 1) We prove a tight $Θ(n^{3/2})$ bound for finding a maximum-out-degree vertex in an $n$-vertex tournament, resolving a conjecture of Mande, Paraashar, and Saurabh [FSTTCS'23]. 2) Using the same proof idea, we give a direct proof that finding a maximum-degree vertex in an $n$-vertex undirected graph requires $Θ(n^{3/2})$ quantum queries, a bound implicit in the work of Apers and Lee [CCC'21]. Both lower bounds above hold even for computing only the maximum degree or maximum out-degree. 3) We also study Maximum $(k,n-k)$-Cut, which asks for the largest cut with one side of size $k$. For every constant $k\geq 1$, we give an $O(n^{2-1/(k+1)})$-query quantum algorithm. 4) We establish a reduction to Maximum $(k,n-k)$-Cut involving $k$-Graph Collision, which asks whether the marked vertices of a known graph contain a $k$-clique. For $k\geq 3$, this yields unconditional lower bounds with exponents strictly larger than $3/2$, showing that this problem is strictly harder than computing maximum degree. Additionally, under a conjecture we propose for $k$-Graph Collision, the reduction yields a lower bound matching our upper bound above.

quant-pharXiv:2610.13906•Oct 12, 2026•0 citations
We show that in the quantum query model the complexity of detecting a triangle in an undirected graph on nnn nodes can be done using O(n1+37log⁡2n)O(n^{1+{3\over 7}}\log^{2}n)O(n1+73​log2n) quantum queries. The same complexity bound applies for outputting the triangle if there is any. This improves upon the earlier bound of O(n1+12)O(n^{1+{1\over 2}})O(n1+21​).
We present two new quantum algorithms that either find a triangle (a copy of K3) in an undirected graph G on n nodes, or reject if G is triangle free. The first algorithm uses combinatorial ideas with Grover Search and makes Õ(n10/7) queries. The second algorithm uses Õ(n13/10) queries, and it is based on a design concept of Ambainis [6] that incorporates the benefits of quantum walks into Grover search [18]. The first algorithm uses only O(log n) qubits in its quantum subroutines, whereas the second one uses O(n) qubits. The Triangle Problem was first treated in [12], where an algorithm with O(n + √ nm) query complexity was presented, where m is the number of edges of G.
An O(n1.3)O(n^{1.3})O(n1.3) Quantum Algorithm for the Triangle Problem
We present a new quantum algorithm that either finds a triangle (a copy of K3) in an undirected graph G on n nodes, or it outputs “reject ” if G is triangle free. The algorithm uses O(n 1.3) queries, and it is based on a new design concept of Ambainis [Amb03] that incorporates the benefits of quantum walks into Grover search [Gro96]. The algorithm both improves on, and is simpler than a recent algorithm of Szegedy [Sze03] which has Õ(n10/7) query complexity. The Triangle Problem was first treated in [BDH + 01], where an algorithm with O ( √ n|E|) query complexity was presented (here |E | is the number of edges of G). 1
We show that an improvement to the best known quantum lower bound for GRAPH-COLLISION problem implies an improvement to the best known lower bound for TRIANGLE problem in the quantum query complexity model.In GRAPH-COLLISION we are given free access to a graph (V, E) and access to a function f : V → {0, 1} as a black box.We are asked to determine if there exist (u, v) ∈ E, such that f (u) = f (v) = 1.In TRIANGLE we have a black box access to an adjacency matrix of a graph and we have to determine if the graph contains a triangle.For both of these problems the known lower bounds are trivial (Ω( √ n) and Ω(n), respectively) and there is no known matching upper bound.
We present two new quantum algorithms that either find a triangle (a copy of K3K_{3}K3​) in an undirected graph G on n nodes, or reject if G is triangle free. The first algorithm uses combinatorial ideas with Grover Search and makes O~(n10/7)\tilde{O}(n^{10/7})O~(n10/7) queries. The second algorithm uses O~(n13/10)\tilde{O}(n^{13/10})O~(n13/10) queries and is based on a design concept of Ambainis [in Proceedings of the 454545th IEEE Symposium on Foundations of Computer Science, 2004, pp. 22–31] that incorporates the benefits of quantum walks into Grover Search [L. Grover, in Proceedings of the Twenty‐Eighth ACM Symposium on Theory of Computing, 1996, pp. 212–219]. The first algorithm uses only O(log⁡n)O(\log n)O(logn) qubits in its quantum subroutines, whereas the second one uses O(n)O(n)O(n) qubits. The Triangle Problem was first treated in [H. Buhrman et al., SIAM J. Comput., 34 (2005), pp. 1324–1330], where an algorithm with O(n+nm)O(n+\sqrt{nm})O(n+nm​) query complexity was presented, where m is the number of edges of G.
We show that the quantum query complexity of detecting if an nnn-vertex graph contains a triangle is O(n9/7)O(n^{9/7})O(n9/7). This improves the previous best algorithm of Belovs making O(n35/27)O(n^{35/27})O(n35/27) queries. For the problem of determining if an operation ∘:S×S→S\circ : S \times S \rightarrow S∘:S×S→S is associative, we give an algorithm making O(∣S∣10/7)O(|S|^{10/7})O(∣S∣10/7) queries, the first improvement to the trivial O(∣S∣3/2)O(|S|^{3/2})O(∣S∣3/2) application of Grover search. Our algorithms are designed using the learning graph framework of Belovs. We give a family of algorithms for detecting constant-sized subgraphs, which can possibly be directed and colored. These algorithms are designed in a simple high-level language; our main theorem shows how this high-level language can be compiled as a learning graph and gives the resulting complexity. The key idea to our improvements is to allow more freedom in the parameters of the database kept by the algorithm. As in our previous work, the edge slots maintained in the database are specified by a graph whose edges are the union of regular bipartite graphs, the overall structure of which mimics that of the graph of the certificate. By allowing these bipartite graphs to be unbalanced and of variable degree we obtain better algorithms.
We study the quantum query complexity of several basic graph problems. 1) We prove a tight Θ(n3/2)Θ(n^{3/2})Θ(n3/2) bound for finding a maximum-out-degree vertex in an nnn-vertex tournament, resolving a conjecture of Mande, Paraashar, and Saurabh [FSTTCS'23]. 2) Using the same proof idea, we give a direct proof that finding a maximum-degree vertex in an nnn-vertex undirected graph requires Θ(n3/2)Θ(n^{3/2})Θ(n3/2) quantum queries, a bound implicit in the work of Apers and Lee [CCC'21]. Both lower bounds above hold even for computing only the maximum degree or maximum out-degree. 3) We also study Maximum (k,n−k)(k,n-k)(k,n−k)-Cut, which asks for the largest cut with one side of size kkk. For every constant k≥1k\geq 1k≥1, we give an O(n2−1/(k+1))O(n^{2-1/(k+1)})O(n2−1/(k+1))-query quantum algorithm. 4) We establish a reduction to Maximum (k,n−k)(k,n-k)(k,n−k)-Cut involving kkk-Graph Collision, which asks whether the marked vertices of a known graph contain a kkk-clique. For k≥3k\geq 3k≥3, this yields unconditional lower bounds with exponents strictly larger than 3/23/23/2, showing that this problem is strictly harder than computing maximum degree. Additionally, under a conjecture we propose for kkk-Graph Collision, the reduction yields a lower bound matching our upper bound above.