Connections between exponential time and polynomial time problem Lecture Notes for CS294 Lecturer: Russell Impagliazzo Scribe: Stefan Schneider November 10, 2015 We connect problems that have exponential time-complexity with much easier polynomial time problems using reductions that preserve their fine-grained complexity 1 Subset-Sum and k-sum Consider the Subset-Sum problem we have seen before Definition 1 The Subset-Sum problem is given integers a 1,, a n [ 2 l, 2 l ] and T N, find a set S {1,, n} such that a i = T (1) i S The trivial algorithm for subset sum tests all subsets of numbers and takes time O(2 n ), but we have seen in earlier lectures that we can improve this algorithm to O(2 n/2 ) In fact, we showed that Subset-Sum is in time min{2 n/2, 2 l } The k-sum problem is in some sense the polynomial time equivalent of subset sum Definition 2 The k-sum problem is given k sets of integers A 1,, A k with A 1 = = A k = n and T N, find a i A i for all i such that k a i = T (2) i=1 Using a similar idea as used for Subset-Sum, we can solve k-sum in time O(n k/2 ) The k-sum conjecture then says that this runtime is essentially optimal Conjecture 1 (k-sum conjecture) k-sum requires time O(n k/2 ε ) for all ε > 0 As we will see next lecture, the k-sum conjecture implies interesting lower bounds for geometric problems We have previously seen that Subset-Sum is hard assuming the Exponential Time Hypothesis (ETH) In particular, we have seen a reduction from 3-SAT on n variables and m clauses to Subset- Sum of size n = O(n + m) and l = O(n + m) Hence, if ETH is true, there is a c > 0 such that Subset-Sum is not in time min{2 cn, 2 cl } We want to prove a similar statement for k-sum Let c k = inf c k-sum TIME(n c ) be the best exponent in the runtime for k-sum Note that we take an infimum to avoid problems if there is an infinite sequence of better and better algorithms rather than a single optimal algorithm 1
Theorem 1 ([1]) If ETH is true, then c k = Θ(k) Proof The idea is to reduce Subset-Sum to k-sum Let A = {a 1,, a n }, T be the input to the Subset-Sum problem Divide A into k sets {(i 1) n k + 1,, i n k } of size n k each and let A i be all sums of subsets of this sets Note that N = A i = 2 n/k We then ask if the k-sum instance A 1,, A k, T has a solution Using the fact that we have an O(N ck+δ ) algorithm for k-sum for any δ > 0 we get a total time complexity of ( O k2 n/k) ( ) + O N c k+δ = O ) (2 n c k +δ k Assuming ETH the time complexity of Subset-Sum is lower bounded by 2 cn for some constant c Therefore we have c k k c and therefore c k = Ω(k) 2 Independent Set and k-independent Set In this section we consider the k-independent set problem we have seen in earlier lectures Definition 3 The k-independent set problem is given a graph G, decide whether there is a set of k vertices such that they are independent, ie there is no edge between them Note the the independent set problem on the complement graph is the k-clique problem For the purpose of this section there is no difference between the k-independent set problem and the k-clique problem As seen earlier, this problem can be solved in time n ωk/3 where ω is the matrix multiplication exponent by reduction to the problem of finding a triangle in a graph Triangle detection of a graph G with adjacency matrix M can be solved in time O(n ω ) by checking if M 3 contains a positive entry in the diagonal We have also seen that the maximum independent set problem requires time 2 cn for some constant c assuming ETH Definition 4 The maximum independent set problem is given a graph G and t N, decide if there is an independent set of size at least t Let c k be the best exponent for k-independent set We want to show that c k = Θ(k) with a reduction from independent set to k-independent set Consider an input G = (V, E), t for the independent set problem Partition V into k sets V 1,, V k with V i = n k arbitrarily Consider a tuple t 1,, t k with t 1 + +t k = t Note that there are O(n k ) such tuples We build a graph G consisiting of k cliques U 1,, U k where the vertex set of U i consists of all independents sets of V i of size exactly t i For two vertices S U i and T U j we further add an edge (S, T ) if S T is not and independent set In G any k-independent set must be exactly one vertex per clique Furthermore, since a k- independent set cannot contain any edges, such a set must necessarily correspond to an independent set of size t in the original graph G To execute this reduction and then solve the k-independent set problem we need to construct this graph and solf the k-independent set problem n k times The time complexity is therefore given by ( n k k2 2n/k + (2 n/k) c k ) Assuming ETH this has to be lower bounded by 2 cn for some constant c We can conclude c max{ 2 k, c k k } and therefore c k = Θ(k) 2
3 Tight Lower Bounds for Orthogonal Vectors So far we used ETH to argue about the asymptotic growth of the the exponent To get a result on a more specific exponent we need to use a strong hypothesis Definition 5 The Strong Exponential Time Hypothesis (SETH) is that for all ε > 0 there is a k such that k-sat requires time Ω(2 n εn ) We want to apply SETH to the 2-Orthogonal Vectors problem Definition 6 The 2-Orthogonal Vectors problem is given two sets of boolean vectors S and T with S = T = n and every A S and B T are d-dimensional boolean vectors, ie A = A 1 A 2 A d with A i {0, 1} and B = B 1 B d with B i {0, 1} The question is if there is A S and B T such that A and B are orthogonal, ie A 1 B 1 + + A d B d = 0 We will consider the problem where d = polylogn The obvious algorithm for 2-orthogonal vectors tests all pairs of vectors and runs in time O(n 2 d) The Orthogonal Vectors Conjecture (OVC) is that this is essentially optimal Specifically, if d = ω(log n), then there is no O(n 2 ε ) algorithm for any ε > 0 Theorem 2 ([2]) SETH implies OVC Proof We use the split and list technique which we already used in the previous examples Consider a k-cnf with variable set x 1,, x n and let C 1,, C m be its clauses By the Sparsification Lemma we can assume m = O(n) We will construct two sets of d-dimensional boolean vectors S and T with N = S = T = 2 n/2 and d = m = cn = c log S Split the variables into two sets and let α be an assigment to the first set of variables Define the vector A α as { 1 if α does not satisfy Ci (A α ) j = 0 otherwise Symmetrically, for β an assignment to the second set of variables define B β as { 1 if β does not satisfy Ci (B β ) j = 0 otherwise We define S as the set of all A α obtained that way and T as the set of all B β We have that α, β satisfies the formula if and only if for all j either α or β satisfies C j Hence either (A α ) j = 0 or (B β ) j = 0, which is the case exactly if A α and B β are orthogonal If we now have an algorithm for orthogonal vectors that runs in time O(n 2 ε ) for some ε > 0 if d = ω(log N) tk hen we have such an algorithm for d = C log N for all constants C Hence for any k we get a total time to solve k-sat of ( ( O 2 n/2 + 2 n/2) ) 2 ε = O (2 n nε/2) which contradicts the Strong Exponential Time Hypothesis 3
4 Graph Diameter In this section we show that it is hard under SETH to approximate the diameter of a graph within a factor of 3/2 Definition 7 For an unweighted, undirected graph G, the diameter of G is the maximum (shortest path) distance between any two vertices The obvious algorithm for graph diameter does a breadth first search from every starting point The total time complexity of this algorithm is O(nm) We reduce the orthogonal vectors problem to the graph diameter problem Given an instance of the orthogonal vectors problem, we construct a graph G = (V, E) with We have to following edges: (s, A) for all A S (s, i) for all i {1,, d} (t, B) for all B T (t, i) for all i {1,, d} (s, t) (A, i) if (A) i = 1 (B, i) if (B) i = 1 We can observe the following distances: dist(a 1, A 2 ) = 2 dist(b 1, B 2 ) = 2 dist(a, i) 2 dist(b, i) 2 dist(a, s) = 1 dist(a, t) = 2 dist(b, s) = 2 dist(b, t) = 1 dist(i, j) = 2 Furthermore we have dist(a, B) = V = S T {1,, d} {s, t} { 2 if they are not orthogonal 3 if they are orthogonal Hence we have a diameter of 3 if there is an orthogonal pair and a diameter of 2 otherwise Using the orthogonal vectors conjecture (or SETH) we can therefore conclude that distinguishing between graphs of diameters 2 and 3 requires time Ω(n 2 ε ) for all ɛ In particular this also implies that approximating the diameter within a factor of 3/2 also requires quadratic time 4
s t A 1 1 B 1 A 2 B 2 A i if (A i ) j = 1 j if (B i ) j = 1 B i d A N Figure 1: The reduction from orthogonal vectors to graph diameter B N 5
References [1] Mihai Patrascu and Ryan Williams On the possibility of faster sat algorithms In SODA, volume 10, pages 1065 1075 SIAM, 2010 [2] Ryan Williams A new algorithm for optimal 2-constraint satisfaction and its implications Theoretical Computer Science, 348(2):357 365, 2005 6