advertisement

Generating Hard Satisfiability Problems Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin Generating Hard Satisfiability Problems 1 Can SAT be solved in polynomial time in average case? In Goldberg’s paper [Goldberg ‘79] it is claimed that SAT can be solved “on average” in polynomial time. Goldberg’s model of generating formulas m clauses, n variables, each literal has probability p to be in each clause Is SAT really easy? Generating Hard Satisfiability Problems 2 Can SAT be solved in polynomial time in average case? Goldberg’s SAT formulas are easy to solve [Franco & Paull ‘83] Theorem 1: Number of truth assignments for a formula is greater than 2n(1-ε) with probability 1 Theorem 2: By randomly guessing truth assignments w times, Pr(success)=1 – m/(2αnw) assume each clause has at least αr literals Generating Hard Satisfiability Problems 3 K-SAT is a harder problem K-SAT: each clause has K literals Generating Hard Satisfiability Problems 4 Problem Definition of K-SAT Generate formulas of To generate a clause N variables K literals per clause (K = 3 in this paper) M clauses Randomly choose K distinct variables Negate each with probability 0.5 Generate formulas with certain ratio of clauses-to-variables Generating Hard Satisfiability Problems 5 DP Procedure DP: a backtracking depth-first search in the space of all truth assignments Procedure DP Given a set of clauses Σ defined over a set of variables V Set the value of a variable v and call DP on the simplified formula If this call returns “satisfiable”, then return “satisfiable” Set v to the opposite value, return the result of calling DP on the re-simplified formula Generating Hard Satisfiability Problems 6 Three Common Rules for DP The unit clause rule The pure literal rule If a formula contains a literal but not its complement, set it to true The smallest clause rule If a clause contains only one literal, set it to true If none of the above rules applies, set a variable in a smallest clause The last two rules are not used in this paper Generating Hard Satisfiability Problems 7 DP’s Performances on K-SAT Ratio of clauses-to-variables significantly affects the hardness of formulas Generating Hard Satisfiability Problems 8 Ratio of Clauses-to-variables vs. Computational Cost Another example in [Mitchell & Levesque ‘96] Generating Hard Satisfiability Problems 9 50% Point 50% point: given a certain N (# variables), the point that 50% of generated formulas are satisfiable N 20 50 100 150 50% point 4.55 4.36 4.31 4.3 50% point is stable w.r.t. ratio of clauses-tovariables Generating Hard Satisfiability Problems 10 50% Point – The Hardest Point (cont.) 50% point is close to the location of peak hardness Generating Hard Satisfiability Problems 11 Satisfiable vs. Unsatisfiable Formulas Short formulas – under-constrained, have many satisfying assignments Long formulas – over-constrained, contradictions can often be easily found Generating Hard Satisfiability Problems 12 Finding All Satisfying Assignments or Contradiction Let DP search the full space, until finding a contradiction Given a set of variables Ratio of clauses to variables increases → Search space decreases Generating Hard Satisfiability Problems 13 Finding All Satisfying Assignments or Contradiction (cont.) Computational cost of DP – monotonically decreases for increasing ratios of clauses to variables Generating Hard Satisfiability Problems 14 Satisfiablity when ratio of clause-tovariable is small Pure literal rule: if a formula contains a literal but not its complement Set this literal to 1 Remove all clauses containing this literal For 3-CNF with up to 1.63n clauses, pure literal rule by itself finds satisfying assignments with high probability [Broder, Frieze & Upfal ‘93] Generating Hard Satisfiability Problems 15 Satisfiablity when ratio of clause-tovariable is small Smallest clause rule: Choose a (random) literal in a (random) smallest clause For 3-CNF with less than 3.003n clauses, by smallest clause rule one can find satisfying assignments with high probability [Frieze & Suen ‘92] By “high probability” we mean Pr → 1 as n → ∞ Generating Hard Satisfiability Problems 16 Satisfiablity when ratio of clause-tovariable is large When c>4.762, a random 3-SAT formula is unsatisfiable with high probability [Kamath et al ‘94]. Some intuitions of proof: Consider a certain assignment Z1, each clause is true with probability 7/8. Let #F denote number of satisfying assignments on F. E[#F] = 2n(7/8)cn. By Markov inequality, P[#F>0]≤E[#F]=(2∙(7/8)c)n This probability is exponentially small when c > 5.191 Generating Hard Satisfiability Problems 17 DP vs. Resolution DP searches for satisfying assignments as well as contradictions Resolution searches for contradictions Some result about resolution In k-SAT problems of cn clauses, when k ≥ 3 and c2–k ≥ 0.7, with probability tending to 1 as n goes to infinity, a randomly chosen formula of cn clauses is unsatisfiable, but there exists ε>0 such that every resolution proof must generate at least (1+ε)n clauses [Chvatal & Reed ‘92] c=5.6 when k=3 Generating Hard Satisfiability Problems 18 Satisfiability for Different K For a random formula Fk(n, cn) ck = sup{ c : Fk(n, cn) is satisfiable with high prob} ck*= inf{ c : Fk(n, cn) is unsatisfiable with high prob} satisfiable undetermined ck unsatisfiable ck* [Kirousis et al ‘98] ck* ≤ 2k ln2 – (1+ln2)/2 [Achlioptas and Peres ‘03] ck = ck* (1 – o(1)) ck ≥ 2k ln2 – (k+1)ln2/2 – 1 – δk (for a certain sequence δk→0) Generating Hard Satisfiability Problems 19 Satisfiability for Different K (cont.) Lower and upper bounds for different K 1000000 100000 10000 ratio Lower 1000 Upper 100 10 1 3 4 5 7 10 20 K Generating Hard Satisfiability Problems 20 K-SAT with different K’s When K is larger → Higher satisfiability, larger search space when n is large Generating Hard Satisfiability Problems 21 P-SAT with different K’s Each variable has certain probability to appear in each clause Each clause has K variables on average Generating Hard Satisfiability Problems 22 Solving SAT by Local Search [B. Selman et al ‘92] “A new method for solving hard satisfiability problems” GSAT – greedily search in the space of assignments GSAT algorithm Repeat for MAX-TRIES times randomly generate an assignment repeat for MAX-FLIPS times flip a variable to get largest increase in number of satisfied clauses Generating Hard Satisfiability Problems 23 Solving SAT by Local Search (cont.) Performance of GSAT 100000 10000 second 1000 GSAT 100 DP 10 1 0.1 50 70 100 120 140 150 200 250 300 400 500 num of var Drawback – cannot prove unsatisfiability Generating Hard Satisfiability Problems 24 Thank you! Generating Hard Satisfiability Problems 25 Additional Contents Performances of other approaches for solving K-SAT are presented in [Larrabee & Tsuji ‘93], which shows similar results (easy-hardeasy pattern) Generating Hard Satisfiability Problems 26 Solving 2-SAT in Linear Time Choose a variable x and assign a value (e.g. x=1) Remove all clauses that are true Set values to all variables whose values are decided Propagate in this way until nothing can be done If contradiction happens, return false A set of clauses are left that are independent with the removed ones If these clauses are satisfiable, return true Else return false Generating Hard Satisfiability Problems 27