Consequences of APSP, triangle detection, and 3SUM hardness for separation between determinism and non-determinism
aa r X i v : . [ c s . CC ] N ov Consequences of APSP, triangle detection, and 3SUMhardness for separation between determinism andnon-determinism ⋆ Andrzej Lingas Department of Computer Science, Lund University, 22100 Lund, Sweden.E-mail:
Abstract.
Let
NDT IME ( f ( n ) , g ( n )) denote the class of problems solvable in O ( g ( n )) time by a multi-tape Turing machine using an f ( n ) -bit non-deterministicoracle, and let DT IME ( g ( n )) = NDT IME (0 , g ( n )) . We show that if the all-pairs shortest paths problem (APSP) for directed graphs with N vertices and inte-ger edge weights within a super-exponential range {− N k + o (1) , ..., N k + o (1) } , k ≥ , does not admit a truly subcubic algorithm then for any ǫ > ,NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n k − ǫ ) . If the APSP problem doesnot admit a truly subcubic algorithm already when the edge weights are of mod-erate size then we obtain even a stronger implication, namely that for any ǫ > ,NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n . − ǫ ) . Similarly, we show that ifthe triangle detection problem (DT) in a graph on N vertices does not admit atruly sub- N ω -time algorithm then for any ǫ > , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n ω/ − ǫ ) , where ω stands for the exponent of fast matrix multiplica-tion. For the more general problem of detecting a minimum weight ℓ -clique( MW C ℓ ) in a graph with edge weights of moderate size, we show that the non-existence of truly sub- n ℓ -time algorithm yields for any ǫ > , NDT IME (( ℓ − ⌈ log n ⌉ , n ) * DT IME ( n ℓ − − ǫ ) . Next, we show that if 3SUM for N integers in {− N k + o (1) , ..., N k + o (1) } for some k ≥ , does not admit atruly subquadratic algorithm then for any ǫ > , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n k − ǫ ) . Finally, we observe that the Exponential Time Hypothe-sis (ETH) implies
NDT IME ( ⌈ k log n ⌉ , n ) * DT IME ( n ) for some k > , while the strong ETH (SETH) yields for any ǫ > , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n − ǫ ) . For comparison, the strongest known result on separation be-tween non-deterministic and deterministic time only asserts NDT IME ( O ( n ) , n ) * DT IME ( n ) . The complexity status of the all-pairs shortest paths problem (APSP) in directedgraphs with arbitrary edge weights is a major open problem in the area of graphalgorithms. In spite of several decades of research efforts, no truly subcubicalgorithm for this problem is known. ⋆ Research supported in part by VR grant 2017-03750 (Swedish Research Council). y truly subcubic, Vassilevska Williams and Williams [20] mean O ( N − δ poly (log M )) for some δ > , where N is the number of vertices inthe input graph or the number of rows and columns in the input matrix, and theedge weights or matrix entries respectively are in the range {− M, ..., M } . Thisdefinition assumes that M is not too large. When M is very large, e.g., M =2 N φ for some φ > , then poly (log M ) can become at least polynomial in N. For this reason, we shall adopt a more strict definition of truly subcubic, namely O ( N − δ (log M ) o (1) ) for some δ > . This definition is still compatible withthe reductions presented in [20], in particular, it allows for multiplication of O (log M ) bit numbers in (log M ) o (1) time, and it works for M of N k + o (1) size, for any constant k ≥ . Vassilevska Williams and Williams presented a list of eleven problems thatthey could show to be equivalent to the APSP problem regarding the ques-tion of admitting a truly subcubic algorithm [20]. Thus, if any problem on thelist could be shown to admit a truly subcubic algorithm then all the remain-ing problems on the list, in particular APSP, would have truly subcubic algo-rithms. Besides APSP and the verification of the naturally related distance (i.e., (min , +) ) matrix product, the list includes problems of different form rangingfrom multi-functions to decision problems. Some of the problems on the listimmediately reduce to search problems. In particular, the problem of detectinga triangle of negative total edge weight (DNT) belongs to the latter ones. Forthese reasons, the problems on the list admit quite different upper time boundsin the quantum computational model (cf. Table 2 in Appendix) or in the non-deterministic Turing machine or RAM model. We utilize the presence of theproblems on the list that directly reduce to search problems in order to deriveamong other things the following implication, where N DT IM E ( f ( n ) , g ( n )) denotes the class of problems solvable in O ( g ( n )) time by a multi-tape Turingmachine using an f ( n ) -bit non-deterministic oracle, and DT IM E ( g ( n )) = N DT IM E (0 , g ( n )) . If the APSP problem for directed graphs with integeredge weights of moderate size does not admit a truly subcubic algorithm then forany ǫ > , N DT IM E ( ⌈ log n ⌉ , n ) * DT IM E ( n . − ǫ ) . By an edge weightof moderate size, we mean a weight requiring N o (1) -bit representation, where N is the number of vertices in the input graph or the number of rows and columnsin the input matrix, respectively. Observe that the best known and celebratedresult separating non-deterministic time from the deterministic one in terms ofour notation is just N DT IM E ( O ( n ) , n ) * DT IM E ( n ) [19] (cf. [5]). Fur-thermore, no result of the form N DT IM E ( O ( n q ) , n q ) * DT IM E ( n q ) for q > is known. Our more general result is as follows. Let k ≥ , and let Q stand for the set of integers {− N k + o (1) , ..., N k + o (1) } . If forany ǫ > , the APSP problem or any of the subcubic-time equivalent problems or graphs on N vertices with edge weights in Q or N × N matrices with entriesin Q does not admit an O ( N − ǫ + k + o (1) ) -time algorithm then for any ǫ ′ > ,N DT IM E ( ⌈ k log n ⌉ , n ) * DT IM E ( n k − ǫ ′ ) holds. Thus, if it is true that the APSP problem for directed graphs does not admit atruly subcubic algorithm when the edge weights are within a super-exponentialrange then showing this seems beyond the reach of presently known techniques.Simply, it would imply an enormous breakthrough not only in lower bounds onBoolean circuit size for natural problems but also in separation between deter-ministic and non-deterministic time.We also consider the much simpler problem of detecting a triangle (DT) ina (undirected) graph. It immediately reduces to a search problem and in densegraphs it can be solved in O ( n ω ) time by a well known reduction to fast ma-trix multiplication [14]. The somewhat informal concept of a truly subcubicalgorithm can be naturally generalized to include that of a truly sub- N δ -timealgorithm by replacing N − ǫ with N δ − ǫ , respectively [20]. Similarly, we ob-tain the following weaker implication: if the DT problem for a graph on N vertices does not admit a truly sub- N ω -time algorithm then for any ǫ > ,N DT IM E ( ⌈ log n ⌉ , n ) * DT IM E ( n ω/ − ǫ ) . Next, we consider the problem of detecting a triangle of minimum totalweight (MWT) in an edge weighted graph. Note that the DNT and DT prob-lems can be easily reduced to the MWT problem. It follows in particular thatif the MWT problem admits a truly subcubic algorithm then any problem onthe aforementioned list has also this property (cf. Conclusion in [20]). A naturalgeneralization of the MWT problem is that of determining a minimum weight ℓ -clique in an edge weighted graph (MWC- ℓ ) conjectured to not admit a trulysub- N ℓ -time algorithm [1]. We show that if this conjecture holds for graphs with N vertices and edge weights in {− N k + o (1) , ..., N k + o (1) } then for any positive ǫ > , N DT IM E (( ℓ − ⌈ k log n ⌉ , n ) * DT IM E ( n ℓ − k − ǫ ) The 3SUM problem, which is to decide if an input set of numbers con-tains three numbers summing to zero, is widely believed to not admit a trulysubquadratic algorithm (weakened 3SUM hypothesis). For this reason, one hasshown truly subquadratic reducibility of 3SUM to several other problems be-lieved to have almost quadratic time complexity in order to demonstrate theirrelative hardness (see, e.g., [8,16,20]). We show that if 3SUM, when the input N numbers are integers in {− N k + o (1) , ..., N k + o (1) } for some k ≥ , does notadmit a truly subquadratic algorithm then for any ǫ > ,N DT IM E ( ⌈ k log n ⌉ , n ) * DT IM E ( n k − ǫ ) holds.Finally, we observe that the Exponential Time Hypothesis (ETH) [13] im-plies N DT IM E ( ⌈ k log n ⌉ , n ) * DT IM E ( n ) for some k > , while the3 onjecture on implicationAPSP and equiv. for ǫ > , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n . − ǫ ) DT for δ < ω , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n δ/ ) DC- ℓ where ℓ | for ǫ > , NDT IME (( ℓ − ⌈ log n ⌉ , n ) * DT IME ( n ωℓ/ − ǫ ) MWC- ℓ for ǫ > , NDT IME (( ℓ − ⌈ log n ⌉ , n ) * DT IME ( n ℓ − − ǫ ) ǫ > , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n − ǫ ) ETH for some k > , NDT IME ( ⌈ k log n ⌉ , n ) * DT IME ( n ) SETH for ǫ > , NDT IME ( ⌈ log n ⌉ , n ) * DT IME ( n − ǫ ) Table 1.
Implications from the conjectures when the input edge weights or input matrix entriesor input numbers are assumed to be integers in {− N o (1) , ..., N o (1) } . For DC- ℓ , see Section 3. strong ETH (SETH) [7] yields for any ǫ > , N DT IM E ( ⌈ log n ⌉ , n ) * DT IM E ( n − ǫ ) .Our implications from the known conjectures are in a form of a negatedcontainment of a linear-time with a logarithmic non-deterministic oracle in arespective deterministic bounded-time class. For interesting or even dramaticconsequences of this kind of containment see subsection 1.1.2 in [21].Marginally, we present simple ˜ O ( N . ) time quantum algorithms for theMWT problem and the problem of verifying if an N × N matrix defines ametric (MDM), occurring on the list in [20]. Remark 1.
All our main results can be viewed as putting straightforward/obviousand/or known implications of the conjectures in a common framework. This inparticular shows subtle differences between the implications and exhibits de-pendency on the range parameter. Thus, the contribution of our paper is mostlya conceptual one formalizing a known intuition.
For a positive integer r, [ r ] will denote { , ..., r } .Among the eleven problems on the list of subcubic-time equivalent prob-lems in [20], we shall refer explicitly to: – the all-pairs shortest path problem in directed edge weighted graphs (APSP), – the problem of detecting a triangle of negative total edge weight (DNT), and – the problem of verifying if a matrix defines a metric (MDM).Note that an N × N matrix K defines a metric on [ N ] if and only if it has non-negative entries, K [ i, j ] = 0 iff i = j and K [ i, j ] = K [ j, i ] for all i, j ∈ [ N ] , K [ i, j ] ≤ K [ i, k ] + K [ k, j ] for all i, j. k ∈ [ N ] . Of course, the first threeconditions can be easily verified in quadratic time.We shall also consider the problem of finding a triangle of minimum totaledge weight in an edge weighted graph (MWT) and the simpler problem of de-tecting a triangle in a (unweighted) graph (DT), as well as their generalizationswhere a triangle is replaced by an ℓ -clique (MWC- ℓ and DC- ℓ , respectively).Note that DNT and DT trivially reduce to MWT.Furthermore, we shall consider the 3SUM problem which is to decide if agiven set of numbers contains three elements whose sum is zero, and the Expo-nential Time Hypothesis (ETH) [13] as well as its strong version (SETH) [7].The reductions proving the subcubic-time equivalences between the elevenproblems on the list in Theorem 1.1 in [20] do not introduce new very large edgeweights or matrix entries. They typically use the edge weights or matrix entitiesfrom the reduced problem. The exception is the use of + ∞ or −∞ in case ofsome problems on the list. However, the latter can be easily simulated by multi-plying the maximum or minimum of the assumed range by a polynomial in thenumber of vertices or in the number of matrix rows/columns in the consideredproblem.In Definition 3.1 in [20], one requires an O ( m − δ ) bound on the time takenby a subcubic reduction, where m = N log M in our terms. This definition asthat of truly subcubic also assumes that the edge weights or matrix entries arenot too large. We can replace the required upper time-bound by O ( N − δ (log M ) o (1) ) to extend the edge weight or matrix entry range to atleast { N k + o (1) , ..., N k + o (1) } for any fixed k ≥ . In fact, the authors showin Section 4.3 of [20] that if random bits are allowed then the polylogarithmicdependence on M can be replaced by a polylogarithmic dependence on N inthe aforementioned reductions.Thus, Theorem 1.1 in [20] holds also when the edge weights or matrix en-tries in the problems on the list are in the range {− − N k + o (1) , ..., − N k + o (1) } for some k ≥ (under the assumption of the more strict definition of “trulysubcubic” from the introduction). Hence, we have the following fact. Fact 1
Let k ≥ . If the APSP problem or the DNT problem, or the problem ofverifying if a matrix defines a metric, or any of the remaining problems on thelist in [20], does not admit a truly subcubic algorithm when the edge weightsor matrix entries are in {− N k + o (1) , ..., N k + o (1) } then none of the problemsadmits a truly subcubic algorithm when the edge weights or matrix entries arein {− N k + o (1) , ..., N k + o (1) } . Implications of APSP and DT hardness
To start, we observe that the decision version of the MWT problem, in partic-ular of the DNT problem, as well as the complement of the problem of verify-ing if a matrix defines a metric admit N k + o (1) -time algorithms with a non-deterministic ⌈ log N ⌉ -bit oracle, when the edge weights or matrix entries arein the set { N k + o (1) , ..., N k + o (1) } for some k ≥ . Recall that N stands forthe number of vertices in the input graph or the number of rows/columns in theinput matrix, respectively. Lemma 1.
Let k ≥ , let Q denote the set of integers {− N k + o (1) , ..., N k + o (1) } , and let d ∈ Q. The problem of determining if a graph with N vertices and edgeweights in Q has a triangle of weight smaller than d, as well as the problem ofverifying that an N × N matrix with entries in Q does not define a metric arein N DT IM E ( ⌈ log N ⌉ , N k + o (1) ) .Proof. In order to guess a vertex of a triangle of edge weight smaller than d ,a non-deterministic ⌈ log N ⌉ -bit oracle is sufficient. A multi-tape Turing ma-chine can easily verify if the guessed vertex belongs to a triangle of edge weightsmaller than d, and if so return such a triangle. Simply, for each pair of verticesit can examine if the pair jointly with the guessed vertex forms a triangle of totaledge weight smaller than d, and if so output the triangle in N k + o (1) total time.A deterministic multi-tape Turing machine can also easily verify if an input N × N matrix K satisfies the first three condition required by a metric, includingthe symmetry one, in N k + o (1) time. If the three conditions are satisfied itremains to check if K [ i, j ] > K [ i, k ] + K [ k, j ] for some i, j. k. Again, toguess the first index belonging to such a triple of indices a non-deterministic ⌈ log N ⌉ -bit oracle is sufficient. Similarly, to verify if the guessed first index,say i, belongs to a triple of indices violating the triangle inequality condition canbe done by checking if K [ i, j ] > K [ i, k ] + K [ k, j ] for all other possible indices j, k. Again, it can be easily done by multi-tape Turing machine in N k + o (1) time. ⊓⊔ Theorem 1.
Let k ≥ , and let Q stand for the set of integers {− N k + o (1) , ..., N k + o (1) } . If for any ǫ > , the APSP problem or any of thesubcubic-time equivalent problems for graphs on N vertices with edge weightsin Q or N × N matrices with entries in Q does not admit an O ( N − ǫ + k + o (1) ) -time algorithm then for any ǫ ′ > , N DT IM E ( ⌈ k log n ⌉ , n ) * DT IM E ( n k − ǫ ′ ) holds.Proof. By the theorem assumptions and Fact 1, we infer that for any ǫ > , theproblem of detecting a negative triangle (DNT), when the edge weights are in6he range {− N k + o (1) , ..., N k + o (1) } , does not admit an O ( N − ǫ + k + o (1) ) -timeRAM algorithm under the logarithmic cost. On the other hand, the so restrictedDNT problem is in N DT IM E ( ⌈ log N ⌉ , N k + o (1) ) by Lemma 1. Conse-quently, if we assume N k + o (1) -bit representation of the edge weights and set n = N k + o (1) then we conclude that the restricted DNT is in N DT IM E ( ⌈ k log n ⌉ , n ) . Now the proof is by contradiction. Suppose that
N DT IM E ( ⌈ k log n ⌉ , n ) ⊆ DT IM E ( n k − ǫ ′ ) holds. Then, the re-stricted DNT problem admits an O (( N k + o (1) ) k − ǫ ′ ) -time algorithm, i.e.,an O ( N k − (2+ k + o (1)) ǫ ′ + o (1) ) -time algorithm in the multi-tape (deterministic)Turing machine model. A multi-tape (deterministic) Turing machine of timecomplexity T ( n ) ≥ n can be easily simulated by a RAM with logarithmic costrunning in O ( T ( n ) log T ( n )) time (see, e.g., section 1.7 in [4]). We infer thatthe restricted DNT problem admits an O ( N k − (2+ k + o (1)) ǫ ′ + o (1) log n ) -time,i.e., an O ( N k − (2+ k + o (1)) ǫ ′ + o (1) ) -time algorithm, in the RAM model. We ob-tain a contradiction. ⊓⊔ In particular, when the edge weights or matrix entries are of moderate size,we obtain the stronger implication of the following form: for any ǫ ′ > ,N DT IM E ( ⌈ log n ⌉ , n ) * DT IM E ( n . − ǫ ′ ) . In fact, APSP is assumed tobe hard already when the weights are polynomial [3].For the simpler DT problem, we obtain similarly the following implication. Theorem 2.
If for any δ < ω, the problem of detecting a triangle in a graph on N vertices does not admit an O ( N δ + o (1) ) -time algorithm then for any positive δ ′ < ω , N DT IM E ( ⌈ log n ⌉ , n ) * DT IM E ( n δ ′ / ) holds.Proof. The proof is similar to that of Theorem 1. First, we observe that thetriangle detection problem specified in the theorem is in
N DT IM E ( ⌈ log N ⌉ , N log N ) by modifying slightly the proof of Lemma 1.The difference is that in case of the triangle detection problem we do not haveedge weights and we need to operate only on vertex indices of logarithmic size.Also, the verification if three vertices form a triangle is easier than that theyform a triangle of total edge weight smaller than d in an edge weighted graph.Next, we proceed along the lines of the proof of Theorem 1. Namely, we set n = N log N to conclude that the triangle detection problem is in N DT IM E ( ⌈ log n ⌉ , n ) . In order to obtain a contradiction suppose that
N DT IM E ( ⌈ log n ⌉ , n ) ⊆ DT IM E ( n δ ′ / ) holds for some δ ′ < ω . Then,the triangle detection problem admits an O (( N log N ) δ ′ / ) -time algorithm,i.e., an O ( N δ ′ poly (log N )) -time algorithm in the multi-tape (deterministic) Tur-ing machine model. Hence, we can infer (by the same argument as in the proofof Theorem 1 ) that the triangle detection problem admits an7 ( N δ ′ poly (log N ) log N ) -time, i.e., an O ( N δ ′ + o (1) ) -time algorithm, in the RAMmodel. We obtain a contradiction. ⊓⊔ The asymptotically fastest algorithm for the detection of an ℓ -clique in an N vertex graph (DC- ℓ ) is by a straightforward reduction to the triangle problem.In particular, if ℓ is divisible by , it runs in O ( n ωℓ/ ) time [18]. If ℓ is notdivisible by one uses also fast rectangular multiplication and the expression ismore complicated [10]. One can conjecture that the aforementioned asymptotictime cannot be substantially improved. We can easily generalize Theorem 2 toinclude the consequences of such a conjecture (the main trick is to guess ℓ − vertices of the clique), the details are left to the reader. Theorem 3.
Let ℓ ≥ be divisible by . If for any ǫ > , the problem of detect-ing an ℓ -clique in a graph on N vertices does not admit an O ( N ωℓ/ − ǫ + o (1) ) -time algorithm, then for any positive ǫ ′ > , N DT IM E (( ℓ − ⌈ log n ⌉ , n ) * DT IM E ( n ωℓ/ − ǫ ′ ) holds. The MWT problem seems harder than the DT one, it is not clear how fastarithmetic matrix multiplication could be used here. More generally, Abboudet al. conjectured in [1] that the problem of determining a minimum weight ℓ -clique in an edge weighted graph on N vertices (MWC- ℓ ) does not admit atruly sub- N ℓ -time algorithm. The derivation of consequences of this conjecturefor the separation between nondeterminism and determinism is quite analogousto the proof of Theorem 3. The differences follow from the fact that now thebound is N ℓ instead of N ωℓ/ and the size n of the input is N k + o (1) (like inTheorem 1) instead of N log N. The proof details are left to the reader.
Theorem 4.
Let k ≥ , and let Q stand for the set of integers {− N k + o (1) , ..., N k + o (1) } . Next, let ℓ ≥ . If for any ǫ > , the problem ofdetecting a minimum weight ℓ -clique in a graph with edge weights in Q and N vertices does not admit an O ( N ℓ − ǫ + k + o (1) ) -time algorithm then for any positive ǫ ′ > , N DT IM E (( ℓ − ⌈ k log n ⌉ , n ) * DT IM E ( n ℓ − k − ǫ ′ ) holds. Gajentaan and Overmars [11] exhibited a large class of geometric problems thatwere the so called 3SUM hard, i.e., if any of them admitted a substantially sub-quadratic algorithm then 3SUM would also have a substantially subquadraticalgorithm. The aforementioned class has been subsequently expanded by notnecessarily geometric problems (e.g., [8,16,20]). In this section, we show thatif 3SUM, for integers within a bounded (up to super-exponential) range, does8ot admit a truly subquadratic algorithm then a strong separation between deter-ministic and non-deterministic time holds. The proofs in this section are similarto those from Section 3. The key trick in the proof of the following lemma isanalogous to that in the footnote on 3SUM on page 2 in [21].
Lemma 2.
The 3SUM problem, when the input N numbers are integers in {− N k + o (1) , ..., N k + o (1) } for some k ≥ , is in N DT IM E ( ⌈ log N ⌉ , N k + o (1) ) .Proof. In order to guess a number q that belongs to a triple of numbers whosesum is zero, a non-deterministic ⌈ log N ⌉ -bit oracle is sufficient. A multi-tapeTuring machine can verify if the guessed number q belongs to such a triple asfollows. First, it sorts the input numbers in non-decreasing order in N k + o (1) time. Next, it places two copies of the sorted sequence on two tapes and movesits heads over the tapes in opposite directions starting from the opposite ends.When its head over the first tape advances to a number r then its head overthe second tape advances in opposite direction to check if the number − q − r occurs in the sorted sequence, using auxiliary tapes. The whole process takes N k + o (1) time. In this way, the Turing machine can verify if q belongs to atriple of numbers summing to zero in N k + o (1) time. ⊓⊔ The proof of the following theorem is analogous to that of Theorem 1 inSection 3.
Theorem 5.
If for any ǫ > , the 3SUM problem, when the input N numbersare integers in {− N k + o (1) , ..., N k + o (1) } , for some k ≥ , does not admit an O ( N − ǫ + k + o (1) ) -time algorithm then for any ǫ ′ > ,N DT IM E ( ⌈ k log n ⌉ , n ) * DT IM E ( n k − ǫ ′ ) holds.Proof. By the theorem assumptions, we infer that for any ǫ > , the 3SUMproblem, when the input numbers are in the range {− − N k + o (1) ,..., − Nk + o (1) } , does not admit an O ( N − ǫ + k + o (1) ) -time RAM algorithm under the logarithmiccost. On the other hand, the so restricted 3SUM problem is in N DT IM E ( ⌈ log N ⌉ , N k + o (1) ) by Lemma 2. Consequently, if we assume N k + o (1) -bit representation of the input numbers and set n = N k + o (1) thenwe can conclude that the restricted 3SUM is in N DT IM E ( ⌈ k log n ⌉ , n ) . Now the proof is by contradiction. Suppose that
N DT IM E ( ⌈ k log n ⌉ , n ) ⊆ DT IM E ( n k − ǫ ′ ) holds. Then, the restricted 3SUM problem admits an O (( N k + o (1) ) k − ǫ ′ ) -time algorithm, i.e., an O ( N k − (1+ k + o (1)) ǫ ′ + o (1) ) -time algorithm in the multi-tape (deterministic) Turing machine model. A multi-tape (deterministic) Turing machine of time complexity T ( n ) ≥ n can be easilysimulated by a RAM with logarithmic cost running in O ( T ( n ) log T ( n )) time94]. We conclude that the restricted 3SUM problem admits an O ( N k − (1+ k + o (1)) ǫ ′ + o (1) log N ) -time, i.e., an O ( N k − (1+ k + o (1)) ǫ ′ + o (1) ) -timealgorithm, in the RAM model. We obtain a contradiction. ⊓⊔ In fact, 3SUM is known to be hard, under randomized reductions, when k = 0 , more precisely, already when the numbers are in {− n , . . . , n } [2]. The“strong 3SUM conjecture” even states that it is hard when the numbers are in {− n , . . . , n } . We can even easily derive implications of similar form from the ExponentialTime Hypothesis (ETH), involving a logarithmic non-deterministic oracle. Let kSAT ( ℓ ) denote the kSAT problem (see [4]) for instances with ℓ variables anddistinct clauses. Roughly, ETH conjectures that SAT ( ℓ ) requires Ω ( ℓ ) (deter-ministic) time [13] while its strong version SETH [7] conjectures that when k tends to infinity than the time complexity of kSAT ( ℓ ) tends to at least ℓ Lemma 3. SAT ( ℓ ) is in N DT IM E ( ℓ, poly ( ℓ )) . Proof.
In order to guess an assignment (if any) satisfying the input SAT ( ℓ ) formula, a non-deterministic ℓ -bit oracle is enough. Now it is sufficient to ob-serve that w.l.o.g. the number of clauses in the input formula is at most (cid:0) ℓ (cid:1) . ⊓⊔ Theorem 6.
If ETH holds then there is k > such that N DT IM E ( ⌈ k log n ⌉ , n ) * DT IM E ( n ) . Proof.
By ETH, there is a constant k such that SAT ( ℓ ) does not admit any k ℓ poly ( ℓ ) -time algorithm. Let T ( ℓ ) be the time taken by the non-deterministicalgorithm for SAT ( ℓ ) from Lemma 3. We may assume w.l.o.g. that ℓ is enoughlarge so the inequality T ( ℓ ) ≤ k ℓ holds. Hence, it follows from Lemma 3 that SAT ( ℓ ) is in N DT IM E ( ℓ, k ℓ ) . Let us set n = 2 k ℓ . Then, appropriatelypadded SAT ( ℓ ) is in N DT IM E ( ⌈ k log n ⌉ , n ) for k = k and the con-tainment N DT IM E ( k log n, n ) ⊆ DT IM E ( n ) cannot hold since it wouldcontradict the non-existence of k ℓ poly ( ℓ ) -time algorithm for SAT ( ℓ ) . ⊓⊔ The Orthogonal Vectors problem in dimension d ( OV ( d ) ) is for two sets A , B of vectors in { , } d to detect a pair of vectors a ∈ A and b ∈ B such that a, b are orthogonal in Z d . Lemma 4.
For any natural number d, the OV ( d ) problem is in N DT IM E ( ⌈ log N ⌉ , N d ) . roof. To guess a vector a ∈ A which is orthogonal to some vector b ∈ B ,a ⌈ log N ⌉ -bit non-deterministic oracle is sufficient. It remains to compute theinner product of a with each vector in B. This can be easily accomplished by amulti-tape Turing machine in O ( N d ) time. ⊓⊔ The low-dimension OV conjecture asserts that the OV ( d ) problem does notadmit a truly sub- N -time algorithm when d = ω (log N ) [12]. It is implied bySETH [22]. Theorem 7.
If the low-dimension OV conjecture holds, and hence if SETHholds, then for any ǫ > , N DT IM E ( ⌈ log n ⌉ , n ) * DT IM E ( n − ǫ ) holds.Proof. Consider the OV problem, where d = ω (log N ) and on the other hand, d = N o (1) . By the theorem assumption, it does not admit a truly sub- N -time algorithm. Suppose that for some ǫ > , N DT IM E ( ⌈ log n ⌉ , n ) ⊆ DT IM E ( n − ǫ ) holds. Set n = N d.
It follows from Lemma 4 that the OV prob-lem is in
N DT IM E ( ⌈ log N ⌉ , N d ) ⊂ N DT IM E ( ⌈ log n ⌉ , n ) . Hence, itcan be solved by a Turing machine operating in O ( n − ǫ ) time, and consequentlyby a RAM with logarithmic cost in O (( N o (1) ) − ǫ ) log N ) = O ( N − ǫ + o (1) ) time. We obtain a contradiction. ⊓⊔ In this marginal section, we present simple quantum algorithms for finding atriangle of minimum total edge length in an edge weighted graph (MWT) andfor verifying if a matrix defines a metric (MDM). Our quantum algorithm forMWT is substantially faster than the fastest known quantum algorithm for APSPin the general case [17]. On the other hand, it is substantially slower than thefastest known quantum algorithm for DT [15], see Table 2 (Appendix). Notethat DT can be regarded as a special case of MWT.We shall use a specialized variant of Grover’s search due to Dürr and Høyer[6,9] for finding an entry of the minimum value in a table.
Fact 2 (Dürr and Høyer [9]) Let T [ k ] , ≤ k ≤ n, be an unsorted table whereall values are distinct. Given an oracle for T, the index k for which T [ k ] isminimum can be found by a quantum algorithm with probability at least in O ( √ n ) time. Algorithm Q
Input: an oracle W for the weighted adjacency matrix representing an edgeweighted graph on N vertices and a positive integer M such that the edgeweights are in the range {− M, ..., M } . utput: a minimum weight triangle in the graph.Set an oracle for the virtual table T [ i, j, k ] , i, j, k ∈ [ N ] , such that T [ i, j, k ] =( N + 1) ( W [ i, j ] + W [ i, k ] + W [ k, j ]) +( N + 1) i + ( N + 1) j + k if W [ i, j ] ,W [ i, k ] , W [ k, j ] are defined and T [ i, j, k ] = ( N + 1) (3 M + 1) +( N + 1) i +( N + 1) j + k otherwiseFind the indices i ′ , j ′ , k ′ minimizing T [ i, j, k ] by using the method from Fact 2 if T [ i ′ , j ′ , k ′ ] < ( n + 1) (3 M + 1) then return ( i ′ , j ′ , k ′ ) else return “No”Since the values of the entries of the table T in Algorithm Q are distinct, themethod from Fact 2can be applied to T. Hence, by Fact 2, we obtain the follow-ing theorem.
Theorem 8.
Let G be a graph on N vertices with integer edge weights. Givenan oracle for the weighted adjacency matrix of G, a minimum weight trianglein G (if any) can be detected by a quantum algorithm with high probability in ˜ O ( N . ) time. In similar fashion, we obtain a quantum algorithmic solution to the problemof verifying if a matrix defines a metric.
Theorem 9.
Given an oracle for an N × N integer matrix, the problem of veri-fying if the matrix defines a metric admits an ˜ O ( N . ) -time quantum algorithm.Proof. The algorithm is similar to that quantum for MWT, i.e., Algorithm Q.For each of the four properties that the matrix, say K, should have, we forma virtual table with distinct values. On the base of the minimum value of anentry in the table, we can decide if the property holds. For searching for theminimum, we use again Fact 2. The largest of the virtual tables is of cubic in N size and it corresponds to the triangle inequality property. For i, j, k ∈ [ N ] , thevirtual table is defined by T [ i, j, k ] = ( N + 1) ( K [ i, k ] + K [ k, j ] − K [ i, j ])+( N + 1) i + ( N + 1) j + k . Note that all values of the entries of T are distinctand that the triangle inequality is violated by K if and only if the minimumvalue of an entry of T is negative. The virtual quadratic table U correspondingto the symmetry property is given by U [ i, j ] = ( N + 1) ( U [ i, j ] − U [ j, i ]) +( N + 1) i + ( N + 1) j + k for i, j ∈ [ N ] . We leave the rest of details to thereader. The application of the quantum search from Fact 2 to the verification ofthe triangle inequality property dominates the time complexity. ⊓⊔ Final remark
Among the implications derived from the conjectures considered in this paper,the strongest seem to be those from the conjectures on 3SUM, MWC- ℓ , andSETH. The weakest seems the implication from ETH. See Table 1.12 roblem upper bound authorAPSP ˜ O ( N . ) Navebi and Vassilevska Williams [17]MWT ˜ O ( N . ) This paperMDM ˜ O ( N . ) This paperDT ˜ O ( N / x ) Lee, Magniez, and Santha [15]3SUM ˜ O ( N o (1) ) Ambainis [6]3SAT . N poly ( N ) Ambainis [6]
Table 2.
Known upper bounds on the time complexity of quantum algorithms for problems dis-cussed in this paper. In case of 3SAT N stands for the number of variables in the input formula. The author is very grateful to reviewers of an earlier version of this paper forvaluable comments and suggestions.
References
1. Abboud, A., Bringmann, K., Dell, H.,Nederlof, J.: More consequences of falsifying SETHand the orthogonal vectors conjecture. Proc. 50th STOC, pp. 253–266, 2018.2. Abboud, A., Lewi, K., Williams, R.: Losing Weight by Gaining Edges. Proc. ESA 2014, pp.1-12.3. Abboud,A., Vassilevska Williams, V., Yu, H.: Matching Triangles and Basing Hardness onan Extremely Popular Conjecture. Proc. 47th STOC, 2015.4. Aho, A. V., Hopcroft, J. E., Ullman, J.: The Design and Analysis of Computer Algorithms.Addison-Wesley Publishing Company, Reading (1974)5. Ajtai, M.: Determinism versus Nondeterminism for Linear Time RAMs with Memory Re-strictions. Journal of Computer and Systems Sciences 65, pp. 2-37 (2002).6. Ambainis, A.: Quantum search algorithms. SIGACT News, 35 (2), pp. 22–35, 2004.7. Calabro, C.; Impagliazzo R., Paturi, R.; The Complexity of Satisfiability of Small DepthCircuits. Proc. 4th IWPEC. Revised Selected Papers, pp. 75–85, 2009.8. Duraj, L., Kleiner, K.,Polak, A., and Vassilevska Williams, V.: Equivalences between triangleand range query problems. Proc. SODA 2020, pp.30-47.9. Dürr, C., and Høyer, P.: A quantum algorithm for finding the minimum. arXiv: 9607.014,1996/99.10. Eisenbrand, F., Grandoni, F.: On the complexity of fixed parameter clique and dominatingset. Theoretical Computer Science 326, pp. 57–67 (2004)11. Gajentaan, A. and Overmars, M.H.: On a class of O ( n ) problems in computational geom-etry. Computational Geometry: Theory and Applications, 5 (3), pp. 165–185, 1985.12. Gao, J.,Impagliazzo,R. Kolokolova, A., and Williams, R.: Completeness or first-order prop-erties on sparse structures with algorithmic applications. In Proc. of 28th SODA, pages2162–2181, 2017.13. Impagliazzo, R., Paturi, R.: The Complexity of k-SAT. Proc. 14th IEEE Conf. on Computa-tional Complexity, pp. 237–240, 1999.14. Itai, A., Rodeh, M..: Finding a minimum circuit in a graph. SIAM Journal of Computing,vol. 7, pp. 413–423 (1978)
5. Lee, T., Magniez, F., and Santha, M.: Improved Quantum Query Algorithms for TriangleDetection and Associativity Testing. Algorithmica 77(2): 459-486 (2017)16. Lincoln, A., Polak, A., and Vassilevska Williams, V.: Monochromatic Triangles, Intermedi-ate Matrix Products, and Convolutions. Proc. ITCS 2020, pp. 53-1 - 51-18.17. Navebi, A. and Vassilevska Williams, V.: Quantum algorithms for shortest path problems instructured instances. arXiv:1410.6220, 2014.18. Ne˘set˘ril, J., Poljak, S.: On the complexity of the subgraph problem. Commentationes Math-ematicae Universitatis Carolinae, 26(2), pp. 415–419 (1985)19. Paul, W.J., Pippenger , N., Szemeredi , E., and Trotter, W.T.; On determinism versus non-determinism and related problems. Proc. 24th FOCS, pp. 429-438, 1983.20. Vassilevska Williams, V. and Williams, R.: Subcubic Equivalences Between Path, Matrix,and Triangle Problems, J. ACM, Vol. 65(5), 2018 (preliminary version FOCS 2010).21. Williams, R.: Improving exhaustive search implies superpolynomial lower bounds. STOC2010, pp. 231-240.22. Williams, R.: A new algorithm for optimal constraint satisfactionand its implications. Theo-retical Computer Science, 348(2-3):357–365, 2005.5. Lee, T., Magniez, F., and Santha, M.: Improved Quantum Query Algorithms for TriangleDetection and Associativity Testing. Algorithmica 77(2): 459-486 (2017)16. Lincoln, A., Polak, A., and Vassilevska Williams, V.: Monochromatic Triangles, Intermedi-ate Matrix Products, and Convolutions. Proc. ITCS 2020, pp. 53-1 - 51-18.17. Navebi, A. and Vassilevska Williams, V.: Quantum algorithms for shortest path problems instructured instances. arXiv:1410.6220, 2014.18. Ne˘set˘ril, J., Poljak, S.: On the complexity of the subgraph problem. Commentationes Math-ematicae Universitatis Carolinae, 26(2), pp. 415–419 (1985)19. Paul, W.J., Pippenger , N., Szemeredi , E., and Trotter, W.T.; On determinism versus non-determinism and related problems. Proc. 24th FOCS, pp. 429-438, 1983.20. Vassilevska Williams, V. and Williams, R.: Subcubic Equivalences Between Path, Matrix,and Triangle Problems, J. ACM, Vol. 65(5), 2018 (preliminary version FOCS 2010).21. Williams, R.: Improving exhaustive search implies superpolynomial lower bounds. STOC2010, pp. 231-240.22. Williams, R.: A new algorithm for optimal constraint satisfactionand its implications. Theo-retical Computer Science, 348(2-3):357–365, 2005.