270 likes | 414 Views
Generating Hard Satisfiability Problems. Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin. 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.
E N D
Generating Hard Satisfiability Problems Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin Generating Hard Satisfiability Problems
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
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
K-SAT is a harder problem • K-SAT: each clause has K literals Generating Hard Satisfiability Problems
Problem Definition of K-SAT • Generate formulas of • N variables • K literals per clause (K = 3 in this paper) • M clauses • To generate a clause • Randomly choose K distinct variables • Negate each with probability 0.5 • Generate formulas with certain ratio of clauses-to-variables Generating Hard Satisfiability Problems
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
Three Common Rules for DP • The unit clause rule • If a clause contains only one literal, set it to true • The pure literal rule • If a formula contains a literal but not its complement, set it to true • The smallest clause rule • 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
DP’s Performances on K-SAT • Ratio of clauses-to-variables significantly affects the hardness of formulas Generating Hard Satisfiability Problems
Ratio of Clauses-to-variables vs. Computational Cost • Another example in [Mitchell & Levesque ‘96] Generating Hard Satisfiability Problems
50% Point • 50% point: given a certain N (# variables), the point that 50% of generated formulas are satisfiable • 50% point is stable w.r.t. ratio of clauses-to-variables Generating Hard Satisfiability Problems
50% Point – The Hardest Point (cont.) • 50% point is close to the location of peak hardness Generating Hard Satisfiability Problems
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
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
Finding All Satisfying Assignments or Contradiction (cont.) • Computational cost of DP – monotonically decreases for increasing ratios of clauses to variables Generating Hard Satisfiability Problems
Satisfiablity when ratio of clause-to-variable 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
Satisfiablity when ratio of clause-to-variable 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
Satisfiablity when ratio of clause-to-variable 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
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
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} • [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) satisfiable undetermined unsatisfiable ck ck* Generating Hard Satisfiability Problems
Satisfiability for Different K (cont.) • Lower and upper bounds for different K Generating Hard Satisfiability Problems
K-SAT with different K’s • When K is larger → Higher satisfiability, larger search space when n is large Generating Hard Satisfiability Problems
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
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
Solving SAT by Local Search (cont.) • Performance of GSAT • Drawback – cannot prove unsatisfiability Generating Hard Satisfiability Problems
Thank you! Generating Hard Satisfiability Problems
Additional Contents • Performances of other approaches for solving K-SAT are presented in [Larrabee & Tsuji ‘93], which shows similar results (easy-hard-easy pattern) Generating Hard Satisfiability Problems
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