Complexity Theory of Polynomial-Time Problems Lecture 2: SETH and OV Karl Bringmann
Tutorial Slot Tuesday, 16:15-18:00 works for everybody? alternative time slot: Mo Tue Wed Thu Fri 10-12 12-14 new 14-16 16-18 current
I. SETH
Satisfiability Problem (x 1 _ x 2 _ x 4 ) ^ (x 3 _ x 3 )^ ( x 1 _ x 2 _ x 3 _ x 4 ) CNF-SAT: boolean variables x ",, x % clauses C ",, C ' are an OR over literals decide whether an assignment of x ",, x % satisfies ALL clauses unbounded clause width = variable or negated variable = number of literals per clause k-sat: clause width bounded by k thus M N,
Satisfiability Hypotheses P NP: k-sat not in time poly(n) k 3 or k 3 ETH (Exponential Time Hypothesis) k-sat not in time 2 >(%) k 3 or k 3 SETH (Strong Exponential Time Hypothesis) [Impagliazzo,Paturi,Zane 01] ε > 0: k 3: k-sat not in time O(2 "@A % ) best-known algorithm for k-sat: O(2 "@F G H ) where c, = Θ(1/k) [Paturi,Pudlak,Saks,Zane 98]
Satisfiability Hypotheses P NP: k-sat not in time poly(n) k 3 or k 3 ETH (Exponential Time Hypothesis) k-sat not in time 2 >(%) k 3 or k 3 SETH (Strong Exponential Time Hypothesis) ε > 0: k 3: CNF-SETH CNF-SAT not in time O(poly M 2 "@A % ) [Impagliazzo,Paturi,Zane 01] k-sat not in time O(2 "@A % ) best-known algorithm for CNF-SAT: [Calabro,Impagliazzo,Paturi 06] O(2 "@N % ) where x = Θ(1/log (M/N))
Satisfiability Hypotheses P NP: k-sat not in time poly(n) k 3 or k 3 ETH (Exponential Time Hypothesis) k-sat not in time 2 >(%) k 3 or k 3 SETH (Strong Exponential Time Hypothesis) ε > 0: k 3: CNF-SETH OV-Hypothesis CNF-SAT not in time O(poly M 2 "@A % ) OV not in time O(poly d n R@A ) [Impagliazzo,Paturi,Zane 01] k-sat not in time O(2 "@A % )
Reminder: Definition of Reductions transfer hardness of one problem to another one by reductions problem P instance I size n reduction r(n) time problem Q instance J size s(n) I is a yes -instance () J is a yes -instance t(n) algorithm for Q implies a r n + t(s n ) algorithm for P if P has no r n + t(s n ) algorithm then Q has no t(n) algorithm
SETH-Hardness for OV CNF-SAT N variables M clauses reduction time O(M2 %/R ) OV sets A, B of size n = 2 %/R in dimension d = M O(2 "@A/R % poly(m)) algorithm O(n R@A poly(d)) algorithm Thm: SETH implies OVH [Williams 05] O(2 "@"/`(abc '/% ) % ) algorithm O(n R@"/`(abc d/abc H ) ) algorithm best-known algorithm for CNF-SAT! [Lecture 3]
SETH-Hardness for OV CNF-SAT N variables M clauses reduction time O(M2 %/R ) OV sets A, B of size n = 2 %/R in dimension d = M Proof: U = assignments of x ",, x %/R {1,, n} V = assignments of x %/Rk",, x % {1,, n} we say that partial assignment u satisfies clause C iff i: x o is set to true in u and x o appears unnegated in C or i: x o is set to false in u and x o appears negated in C in this case we write: sat(u, C) = 1 otherwise: sat(u, C) = 0 unsat u, C 1 sat(u, C) A = unsat u, C ",, unsat u, C ' u U } B = unsat v, C ",, unsat v, C ' v V }
SETH-Hardness for OV CNF-SAT N variables M clauses reduction time O(M2 %/R ) OV sets A, B of size n = 2 %/R in dimension d = M Proof: U = assignments of x ",, x %/R {1,, n} we say that partial assignment what if we usplit satisfies into clause k parts? C in this case we write: sat(u, C) = 1 V = assignments of x %/Rk",, x % {1,, n} iff i: x o is set U o to = true assignments in u and xof o appears x (o@")%/,k" unnegated,, x o%/, in C or i: x o is Aset to false in u and x o appears negated in C o = unsat u, C ",, unsat u, C ' u U o } unsat u, C 1 sat(u, C) otherwise: sat(u, C) = 0 A = unsat u, C ",, unsat u, C ' u U } B = unsat v, C ",, unsat v, C ' v V }
SETH-Hardness for k-ov CNF-SAT N variables M clauses reduction time O(M2 %/, ) k-ov sets A ",, A, of size n = 2 %/, in dimension d = M k-orthogonalvectors: Input: Task: Sets A ",, A, 0,1 d of size n Decide whether there are a (") A ",, a (,) A, such that 1 i d: wx" a w o = 0 1 i d: j: a w o = 0, Thm: k-ov has no O(n,@A ) algorithm unless SETH fails. [Williams,Patrascu 10]
II. Fréchet Distance
Curve Similarity Given two polygonal curves, how similar are they? very similar: less similar: Applications in: signature recognition, analysis of moving objects
Discrete Fréchet Distance natural measure for curve similarity rich field of research: many extensions and applications
Discrete Fréchet Distance natural measure for curve similarity rich field of research: many extensions and applications man and dog walk along two curves only allowed to go forward in every time step: advance in one or both curves to the next vertex what is the minimum possible length of the leash? d df (P 1, P 2 )= min all ways of traversing P 1 and P 2 max time step t distance at time t
Dynamic Program and Known Results 3.2 1.4 0.7 2.6 0.3 1.3 P 1 2.5 0.7 2.2 2.0 0.4 2.2 natural dynamic programming algorithm: O(n R ) 0.8 1.8 2.8 0.5 2.1 3.2 T i, j = d } (P " 1.. i, P R 1.. j ) = current distance T i, j = max { P " i P R j, min T i 1, j, T i, j 1, T[i 1, j 1] } P 2 last step in P " last step in P R last step in both logfactor improvement: O(n R abc abc H abc H ) [Agarwal,Avraham,Kaplan,Sharir 13]
OV-Hardness Result OV sets A, B 0,1 d of size n reduction time O(dn) Fréchet distance curves P ", P R O(dn) vertices O(n R@A poly(d)) algorithm O(n R@A ) algorithm Thm: Fréchet distance has no O(n R@A ) algorithm unless the OV-Hypothesis fails. [B. 14]
Proof: Vector Gadgets OV n vectors, dimension d reduction time O(dn) Fréchet distance O(dn) vertices for a A: VG(a) 1 2 d 1/2 a o = 1 a o = 0 1/(16d 2 ) 1 d df (VG(a), VG(b)) 1 iff a b for b B: VG(b) b o = 0 b o = 1 for a, a A: VG(a) and VG(a ) are on top of each other cross distances: (1 2/16d 2 ) R +(1/2d) R = 1 + (2/16d 2 ) R > 1
Proof: OR-Gadget OV n vectors, dimension d reduction time O(dn) Fréchet distance O(dn) vertices we add some control points s.t.: r 1 Fréchet distance 1 iff a, b: a b final curves: P 1 = s 1 r 1 VG(A[1]) t 1 s 1 r 1 VG(A [n]) t 1 s 1 s 2 t 1 t 2 P 2 = s 2 s R r 2 VG(B[1]) r 2 VG(B[n]) r 2 t R t 2 s R t R
Proof: Correctness OV n vectors, dimension d reduction time O(dn) Fréchet distance O(dn) vertices Fréchet distance 1 iff a, b: a b r 1 ( : let a A, b B with a b stay at s 2 and walk to the a 1 -copy of s 1 stay at s 1 and walk to the a 2 -copy of r 2 step to r 1 walk through VG(a 1 ), VG(a 2 ) in parallel step to t 1 stay at t 1 and walk to t 2 P 2 is completely traversed, now finish traversing P 1 s 1 s 2 s R r 2 t 1 t 2 t R
Proof: Correctness OV n vectors, dimension d reduction time O(dn) Fréchet distance O(dn) vertices Fréchet distance 1 iff a, b: a b r 1 ) : consider a traversal staying in distance 1 when at s R : have to be at s 1 (say at a-copy) after that, at first time we are at r 1 : s 1 s 2 t 1 t 2 could be at s 2, t 2, or r 2 s 2 : already passed t 2 : not reachable because of t R so have to be at r 2 (say at b-copy) in the following we have to traverse VG(a), VG(b) in parallel r 2 this is only possible if a b s R t R
OV-Hardness Result OV sets A, B 0,1 d of size n reduction time O(dn) Fréchet distance curves P ", P R O(dn) vertices O(n R@A poly(d)) algorithm O(n R@A ) algorithm Thm: Fréchet distance has no O(n R@A ) algorithm unless the OV-Hypothesis fails. [B. 14]
Inapproximability Thm: Fréchet distance has no 1.001-approximation in time O n R@A unless the OV-Hypothesis fails. [B. 14] different construction yields 1.399-inapproximability [B.,Mulzer 15] Q: improve constant Thm: Fréchet distance has has an α-approximation in time O n R /α + n log n [B.,Mulzer 15] Q: close this gap
Inapproximability Thm: Fréchet distance has no 1.001-approximation in time O n R@A unless the OV-Hypothesis fails. [B. 14] Proof Idea: for a A: VG(a) 1 2 d a o = 1 a o = 0 replace by: 1,3,5, 2,4, we still have to walk in parallel through vector gadgets!
Inapproximability Thm: Fréchet distance has no 1.001-approximation in time O n R@A unless the OV-Hypothesis fails. [B. 14] Proof Idea: construction has a fixed (constant) set of points minimal distance between any pair of points in distance > 1 in P 1 and P 2 is C > 1. 001 if d df (P 1, P 2 ) > 1 then d df (P 1, P 2 ) > 1.001 thus any 1.001-approximation of the Fréchet distance can decide OV
Generalizations Fréchet distance has no O(n R@A ) algorithm unless OVH fails even on one-dimensional curves [B.,Mulzer 15] A generalization to k curves has no O(n,@A ) algorithm unless OVH fails (for curves in the plane) [Buchin,Buchin,Konzack,Mulzer,Schulz 16] Q: Ω(n,@A ) lower bound for k one-dimensional curves continuous Fréchet distance: Q: Ω(n R@A ) lower bound for one-dimensional curves Q: Ω(n,@A ) lower bound for k curves
III. Longest Common Subsequence
Longest Common Subsequence (LCS) given strings x, y of length n m, compute longest string z that is a subsequence of both x and y write LCS x, y = z natural dynamic program O(n R ) y[1] y[m] x[1] x[n] T[i, j] = LCS(x[1.. i], y[1.. j]) a b b c a d a c d a a b d delete in x delete in y T[i, j] = max { T i 1, j, T[i, j 1]} if x i = y[j]: T[i, j] = max {T i, j, T i 1, j 1 + 1} logfactor improvement: O(n R / log R n) [Masek,Paterson 80] match
OV-Hardness Result OV sets A, B 0,1 d of size n reduction time O(d R n) LCS strings x, y of length O(d R n) O(n R@A poly(d)) algorithm O(n R@A ) algorithm Thm: [B.,Künnemann 15+ Longest Common Subsequence Abboud,Backurs,V-Williams 15] has no O(n R@A ) algorithm unless the OV-Hypothesis fails.
Proof: Coordinate Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 we want to simulate the coordinates {0,1} and the behavior of a o ž b o LCS = 2 0 = 001 0 œ = 011 1 = 111 LCS = 0 1 œ = 000 replace a o by a o and b o by b o œ LCS(a o,b o œ ) can be written as f(ao ž b o ), with f 0 > f 1
Proof: Vector Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 we want to simulate orthogonality of a A, b B in the picture: d = 4 concatenate a ",, a d, padded with a new symbol 2 length 4d VG a = a " 2 2 a R 2 2 a Ÿ 2 2 a œ VG b = b " 2 2 œ br 2 2 œ bÿ 2 2 b œ - no LCS matches symbols in a o with symbols in b w œ where i j
Proof: Vector Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 we want to simulate orthogonality of a A, b B concatenate a ",, a d, padded with a new symbol 2 length 4d VG a = a " 2 2 a R 2 2 a Ÿ 2 2 a VG b = b " œ 2 2 br œ 2 2 bÿ œ 2 2 b œ - no LCS matches symbols in a œ o with symbols in b w where i j assume otherwise then we could match d 2 4d symbols 2 and 3d symbols 0/1 but LCS VG a, VG b d 1 4d > d 2 4d + 3d
Proof: Vector Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 we want to simulate orthogonality of a A, b B concatenate a ",, a d, padded with a new symbol 2 VG a = a " 2 2 a R 2 2 a Ÿ 2 2 a VG b = b " œ 2 2 br œ 2 2 bÿ œ 2 2 b œ - no LCS matches symbols in a o with symbols in b w œ where i j - some LCS matches all 2 s
Proof: Vector Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 we want to simulate orthogonality of a A, b B concatenate a ",, a d, padded with a new symbol 2 VG a = a " 2 2 a R 2 2 a Ÿ 2 2 a VG b = b " œ 2 2 br œ 2 2 bÿ œ 2 2 b œ - LCS VG a, VG b = d 1 4d + d LCS(a œ ox" o, b o ) =f(a o ž b o ) #2 s LCS VG a, VG b = C + 2 LCS VG a, VG b C if a b otherwise where C = d 1 4d + 2d 2
Proof: Normalized Vectors Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 add a (d + 1)-st coordinate: a dk" 0 b dk" 1 this does not change a b still holds: C: LCS VG a, VG b = C + 2 if a b LCS VG a, VG b C otherwise define vector: s 0,, 0,1 {0,1} dk" LCS VG s, VG b = C aim for max {LCS VG a, VG b, LCS VG s, VG b } this takes only 2 values, depending on whether a b
Proof: Normalized Vectors Gadgets OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 new vector gadgets: length 10d R VG a : VG a 4 4 VG(s) VG a 4 4 VG(s) VG b : 4 4 VG b 4 4 4 4 VG b 4 4 LCS(VG a, VG b ) = 10d R + max {LCS VG a, VG b, LCS VG s, VG b } LCS(VG a, VG b ) = C + 2 C if a b otherwise write VG for VG
Proof: OR-Gadget OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 fresh symbol 3, want to construct: in the picture: n = 3 VG A 1 3 3 VG A 2 3 3 VG A 3 3 3 VG A 1 3 3 VG A 2 3 3 VG(A 3 ) 3 3 VG B 1 3 3 VG B 2 3 3 VG B 3 3 3 length 100d R length 100d R ž 2n
Proof: OR-Gadget OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 fresh symbol 3, want to construct: in the picture: n = 3 VG A 1 3 3 VG A 2 3 3 VG A 3 3 3 VG A 1 3 3 VG A 2 3 3 VG(A 3 ) 3 3 VG B 1 3 3 VG B 2 3 3 VG B 3 3 3 can align VG(B j ) with VG(A Δ + j mod n ) for any offset Δ H LCS 2n 1 100d R + max LCS(VG A Δ + j mod n, VG B j ) wx" #3 s in upper string maximize over offset need normalization! If there is an orthogonal pair, some offset Δ aligns this pair, and we get LCS 2n 1 100d R + nc + 2
Proof: OR-Gadget OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 fresh symbol 3, want to construct: in the picture: n = 3 VG A 1 3 3 VG A 2 3 3 VG A 3 3 3 VG A 1 3 3 VG A 2 3 3 VG(A 3 ) 3 3 VG B 1 3 3 VG B 2 3 3 VG B 3 3 3 if an orthogonal pair exists then LCS 2n 1 100d R + nc + 2 Claim: otherwise: LCS 2n 1 100d R + nc this finishes the proof: equivalent to OV instance length O(d R n)
OV-Hardness Result OV sets A, B 0,1 d of size n reduction time O(d R n) LCS strings x, y of length O(d R n) O(n R@A poly(d)) algorithm O(n R@A ) algorithm Thm: [B.,Künnemann 15+ Longest Common Subsequence Abboud,Backurs,V-Williams 15] has no O(n R@A ) algorithm unless the OV-Hypothesis fails.
Proof of Claim OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 Claim: if no orthogonal pair exists: LCS 2n 1 100d R + nc VG A 1 3 3 VG A 2 3 3 VG A 3 3 3 VG A 1 3 3 VG A 2 3 3 VG(A 3 ) 3 3 VG B 1 3 3 VG B 2 3 3 VG B 3 3 3 consider how an LCS matches the VG(B[j]) - no crossings
Proof of Claim OV: Given A, B {0,1} d of size n each Are there a A, b B such that i: a o ž b o = 0 Claim: if no orthogonal pair exists: LCS 2n 1 100d R + nc VG A 1 3 3 VG A 2 3 3 VG A 3 3 3 VG A 1 3 3 VG A 2 3 3 VG(A 3 ) 3 3 VG B 1 3 3 VG B 2 3 3 VG B 3 3 3 non-orthogonal LCS 2n 1 100d R H + ox" #3 s in upper string 0 C VG B j 3 3 if VG(B j ) is not matched if VG(B j ) is matched to one if VG(B j ) is matched to > 1 could match VG completely, but loose many 3 s 0
Extensions similar problems: edit distance dynamic time warping... alphabet size: longest common subsequence and edit distance are even hard on binary strings, i.e., alphabet {0,1} longest common subsequence of k strings takes time Ω(n,@A )
Summary reduction SETH OV introduced k-ov OV-hardness for Fréchet distance OV-hardness for longest common subsequence