330 likes | 454 Views
An Exact Algorithm for the Boolean Connectivity Problem for k -CNF. Kazuhisa Makino (U. of Tokyo) Suguru Tamaki (Kyoto U.) Masaki Yamamoto (Tokai U.). (One of) Our Motivation. Question: Can we solve generalized k -SAT in moderately exponential time?. (One of) Our Motivation.
E N D
An Exact Algorithm for the BooleanConnectivity Problem for k-CNF Kazuhisa Makino (U. of Tokyo) Suguru Tamaki (Kyoto U.) Masaki Yamamoto (Tokai U.)
(One of) Our Motivation • Question: Can we solve generalizedk-SAT in moderately exponential time?
(One of) Our Motivation • Question: Can we solve generalized k-SAT in moderately exponential time? • Generalized: Max-SAT, #SAT, QBF-SAT, Stochastic SAT, periodic SAT, …
(One of) Our Motivation • Question: Can we solve generalized k-SAT in moderately exponential time? • Moderately exponential: (2-ck)n for some ck>0, ckdepends only on k • n: number of variables • (2-c)n for some c>0, c independent of k, seems impossible even for standard k-SAT (SETH)
Example: Max-k-SAT • Task: find an assignment that maximize the number (total weight) of satisfied clauses • Complexity: NP-hardfork≥2 • Non-trivial exact algorithm: • k=2: 1.732n [Williams, ICALP 04] • k≥3: Open • PSAPCE algorithm for k=2 is also open
Example: #k-SAT • Task: count the number of satisfying assignments • Complexity: #P-complete for k ≥ 2 • Non-trivial exact algorithm: • (2-ck)n for some ck>0, ckdepends only on k(DPLL-type algorithm) • PSPACE algorithm
Example: k-QBF • Task: decide a quantified formula is true/false • Complexity: P (k=2), PSPACE-complete (k≥3) (in PH if #alternation is bounded) • Non-trivial exact algorithm (special case): • Σ2-k-SAT: (2-ck)n for some ck>0, ckdepends only on k (by easy reduction to standard k-SAT) • Π2-3-SAT cannot be solved in (2-c)n for any c>0, unless SAT can be solved in (2-c’)n for some c’>0 [Calabro, Impagliazzo, Paturi]
(One of) Our Motivation • Question: Can we solve generalized k-SAT in moderately exponential time? • (2-ck)n for some ck>0, ckdepends only on k • Yes only for #SAT and some special cases of QBF (afawk) • Other examples? • Should be natural extension of SAT
Our Target Problem: Conn-k-SAT(The BooleanConnectivity Problem) • Input: k-CNF formula φ • Hφ:thesubgraph of n-dimensional hypercube induced by satisfying assignments of φ • Task: decide Hφ is connected or not • Empty graph (unsat case) is connected • Complexity: P (k=2), PSPACE-complete (k ≥ 3) [Gopalan et al., ICALP 06]
Example 1 (0,1,1) (1,1,1) (0,0,1) (1,0,1) (0,1,0) (1,1,0) (0,0,0) (1,0,0)
Example 1 SAT UNSAT (0,1,1) (1,1,1) (0,0,1) (1,0,1) (0,1,0) (1,1,0) (0,0,0) (1,0,0)
Example 1 SAT UNSAT Induced edge (0,1,1) (1,1,1) (0,0,1) (1,0,1) Yes, connected (0,1,0) (1,1,0) (0,0,0) (1,0,0)
Example 2 (0,1,1) (1,1,1) (0,0,1) (1,0,1) (0,1,0) (1,1,0) (0,0,0) (1,0,0)
Example 2 SAT UNSAT (0,1,1) (1,1,1) (0,0,1) (1,0,1) (0,1,0) (1,1,0) (0,0,0) (1,0,0)
Example 2 SAT UNSAT Induced edge (0,1,1) (1,1,1) (0,0,1) (1,0,1) No, two connected components (0,1,0) (1,1,0) (0,0,0) (1,0,0)
Our Results • Theorem: Conn-k-SAT can be solved in time (2-ck)nfor some ck>0, ck depends only on k • E.g., (2-c3)=1.914
Some Remarks • (First) non-trivial algorithm for PSPACE-complete version of k-SAT • Contrast to the hardness of Π2-3-SAT (2n-time) • (of course, hardness class and running time of exact algorithms do not coincide) • Exponential space algorithm • Lack of small-size (length dn for d<1) witness
Complexity of Boolean Connectivityin Schaefer’s framework • Classification w.r.t. formula type [Gopalan et al., ICALP 06], [MTY, SAT 07]: • P: affine(linear), bijunctive(2CNF) , IHSB+, IHSB- • IHSB-/IHSB+: special case of Horn/dual-Horn • coNP-complete: Horn/dual-Horn • coNP-complete: Non-Schaefer, tight • Schaefer={affine,bijunctive,Horn, dual-Horn} • PSPACE-complete: Non-tight • Open: coNP-complete for Horn but not IHSB-?
Motivation for Boolean Connectivity • Understanding the solution space of k-CNF • Solution space geometry of random k-SAT [Achlioptas, Ricci-Tersenghi, STOC 06] • Possible solution space of k-CNF → Circuit lower bound, better SAT algorithm [Hastad, STOC 86], [Paturi, Pudlak, Saks, Zane, JACM 05],…
Motivation forBoolean Connectivity • Combinatorial interests [Ekin, Hammer, Kogan, DAM 99] • Also in graph coloring problem [Bonsma, Cereceda MFCS 07] [Cereceda, van den Heuvel, Johnson, DM 08]
Technical Details • Our Task: Given k-CNF φ, deciedeGφ=(V,E) is connected or not • V :=SAT(φ)={x∈{0,1}n | φ(x)=1} • E:={e=(y,z), y,z∈ V | d(y,z)=1} • d(y,z): Hamming distance between y,z • IfGφ given, O(|V|+|E|)-time
Naïve algorithm • AssumeV=SAT(φ) is given • Construct E by: • for each y∈V, for eachzs.t. d(y,z)=1, ifφ(z)=1 thenadd (y,z) to E • Takes n|V|-steps • Check G(V,E) is connected • Running time: n|V|poly(| φ |) steps • |V| can be Ω(2n) !
Main idea • Reducing the size of V • Fact: Efficient k-SAT algorithm can enumerate all satisfying assignments in (2-c)ntime • Output may be partial assignments (1,*,0,1,*,*,…,0) *: don’t care • Change the notion of adjacent
Simple Backtracking Algorithm x ? y ? z ?
Some Properties • Recursive call stops when φ becomes SAT/UNSAT under current partial assignment → each leaf may be a partial assignment • Enumeration: • For any y∈SAT(φ), there exists a leaf (partial assignment) consistent to y • For any two leaves y,z, d(y,z)≥1 (enumerated once)
Some Properties • Running time: (2-ck)nfor some ck>0, ckdepends only on k • #(leaves of depth t) ≤ (2-ck)t
Connectivity in Reduced Graph • V’ :={satisfying partial assignments of φ} • E’ :={e=(y,z), y,z∈ V | d’(y,z)=1} • d’(y,z):= #{i | yi ≠ zi , yi ≠*, zi ≠*} • Fact:G=(V,E) is connected iff so is G’=(V’,E’)
Main idea • Construct V’ by efficient k-SAT algorithm • |V’|≤(2-ck)n for some ck • y∈V’ may be partial assignment • How to construct E’? • Checking all neighbors? → y∈V’ has exponentially large #neighbors • Checking all pairs? → |V’|2 exceeds 2n
Main idea • Decompose V’=U∪W • U :={y∈V’ | #* of y > t } shallow leaves • W :={y∈V’ | #* of y ≤ t } deep leaves • Intuition • |U| is small → checking all pairs:|U|2 << 2n • y∈W has small #neighbors → checkingall neighbors: |W|2t << 2n
Our Algorithm(Over Simplified) • Construct V’ by efficient k-SAT algorithm • Decompose V’:=U∪W • U:={y in V | #*(y) > t } shallow leaves • W:={y in V | #*(y) ≤ t } deep leaves • Construct E’ by: • Checking all pairs of U • Checking all neighbors of W • Check G’=(V’,E’) is connected
Upper bounds • Construct V’ by (2-ck)n-time k-SAT algorithm • Construct E’ by: • Checking all pairs of U • Checking all neighbors of W • |U| ≤(2-ck)n-t → |U|2 ≤(2-ck)2(n-t) ---(a) • #{neighbors of W} ≤ ∑t’>t (2-ck)n-t’2t’ ---(b) • Choosing t appropriately, (a),(b) ≤ (2-ck’)n
Conclusion • Theorem: Conn-k-SAT can be solved in time (2-ck)nfor some ck>0, ck depends only on k • c3=1.914, c4=…, • (First) non-trivial algorithm for PSPACE-complete version of k-SAT (w.r.tn)
Future Works • Better upper bounds for CONN-k-SAT? • (Maybe, but not the scope of our paper) • PSPACE algorithm? (possible for Horn-formula) • Variation: ST-CONN is faster? (PSPACE-completeness known) Thank You !