An algorithm for the satisfiability problem of formulas in conjunctive normal form

Similar documents
An Improved Upper Bound for SAT

On Quantum Versions of Record-Breaking Algorithms for SAT

Clause Shortening Combined with Pruning Yields a New Upper Bound for Deterministic SAT Algorithms

A Probabilistic Algorithm for -SAT Based on Limited Local Search and Restart

A Duality between Clause Width and Clause Density for SAT

Quantum Versions of k-csp Algorithms: a First Step Towards Quantum Algorithms for Interval-Related Constraint Satisfaction Problems

Solving SAT for CNF formulas with a one-sided restriction on variable occurrences

Deterministic Algorithms for k-sat Based on Covering Codes and Local Search

Algorithms for Satisfiability Using Independent Sets of Variables

On Computing k-cnf Formula Properties

The Complexity of Satisfiability of Small Depth Circuits

arxiv: v1 [cs.ds] 10 Jun 2009

Finding Satisfying Assignments by Random Walk

On Computing k-cnf Formula Properties

Comp487/587 - Boolean Formulas

A New Approach to Proving Upper Bounds for MAX-2-SAT

On the Structure and the Number of Prime Implicants of 2-CNFs

The Cook-Levin Theorem

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

Limits to Approximability: When Algorithms Won't Help You. Note: Contents of today s lecture won t be on the exam

The Complexity of Unique k-sat: An Isolation Lemma for k-cnfs

Lecture 18: PCP Theorem and Hardness of Approximation I

arxiv: v2 [cs.ds] 17 Sep 2017

Notes for Lecture 2. Statement of the PCP Theorem and Constraint Satisfaction

1 Randomized reduction: a first start

The Complexity of Optimization Problems

Faster Satisfiability Algorithms for Systems of Polynomial Equations over Finite Fields and ACC^0[p]

Local and global deadlock-detection in component-based systems are NP-hard

Improving PPSZ for 3-SAT using Critical Variables

On the Automatizability of Resolution and Related Propositional Proof Systems

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Lecture 9: The Splitting Method for SAT

A Lower Bound of 2 n Conditional Jumps for Boolean Satisfiability on A Random Access Machine

The NP-hardness of finding a directed acyclic graph for regular resolution

Essential facts about NP-completeness:

NP-Complete Reductions 1

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Correctness of Dijkstra s algorithm

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Intro to Theory of Computation

Quantum Algorithms for Evaluating Min-Max Trees

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

EXPONENTIAL LOWER BOUNDS FOR DEPTH THREE BOOLEAN CIRCUITS

Exponential Complexity of Satisfiability Testing for Linear-Size Boolean Formulas

A Note on the Karp-Lipton Collapse for the Exponential Hierarchy

NP Complete Problems. COMP 215 Lecture 20

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

New Quantum Algorithm Solving the NP Complete Problem

CSC 2429 Approaches to the P vs. NP Question and Related Complexity Questions Lecture 2: Switching Lemma, AC 0 Circuit Lower Bounds

Part V. Intractable Problems

Worst-Case Upper Bound for (1, 2)-QSAT

INAPPROX APPROX PTAS. FPTAS Knapsack P

PCP Theorem and Hardness of Approximation

Complexity of DNF and Isomorphism of Monotone Formulas

Algebraic Dynamic Programming. Solving Satisfiability with ADP

The complexity of Unique k-sat: An Isolation Lemma for k-cnfs

Lecture 24 Nov. 20, 2014

A Satisfiability Algorithm for Sparse Depth Two Threshold Circuits

Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University

Reductions to Graph Isomorphism

-bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE ATIME QSAT, GEOGRAPHY, SUCCINCT REACH.

Notes for Lecture 3... x 4

Limitations of Algorithm Power

P, NP, NP-Complete, and NPhard

Part 1: Propositional Logic

NP-Completeness Part II

Poly-logarithmic independence fools AC 0 circuits

NP and Computational Intractability

A Note on P-selective sets and on Adaptive versus Nonadaptive Queries to NP

The Quantum Query Complexity of the Determinant

Sparse Sets, Approximable Sets, and Parallel Queries to NP. Abstract

On the correlation of parity and small-depth circuits

Chapter 7 Propositional Satisfiability Techniques

A Lower Bound for Boolean Satisfiability on Turing Machines

Splitting the Computational Universe

Derandomizing from Random Strings

Critical Reading of Optimization Methods for Logical Inference [1]

Tecniche di Verifica. Introduction to Propositional Logic

Strong Computational Lower Bounds via Parameterized Complexity

Comparing Reductions to NP-Complete Sets

CSCI 1590 Intro to Computational Complexity

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

About the impossibility to prove P NP or P = NP and the pseudo-randomness in NP

On converting CNF to DNF

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

NP Completeness and Approximation Algorithms

Propositional Logic: Models and Proofs

Lecture Notes CS:5360 Randomized Algorithms Lecture 20 and 21: Nov 6th and 8th, 2018 Scribe: Qianhang Sun

CS173 Lecture B, September 10, 2015

3-SAT Faster and Simpler - Unique-SAT Bounds for PPSZ H. PPSZ Hold in General

Stanford University CS254: Computational Complexity Handout 8 Luca Trevisan 4/21/2010

NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Solution of Exercise Sheet 12

Branching. Teppo Niinimäki. Helsinki October 14, 2011 Seminar: Exact Exponential Algorithms UNIVERSITY OF HELSINKI Department of Computer Science

CS 5114: Theory of Algorithms. Tractable Problems. Tractable Problems (cont) Decision Problems. Clifford A. Shaffer. Spring 2014

SOLUTION: SOLUTION: SOLUTION:

6.841/18.405J: Advanced Complexity Wednesday, April 2, Lecture Lecture 14

Average case Complexity

Transcription:

Journal of Algorithms 54 (2005) 40 44 www.elsevier.com/locate/jalgor An algorithm for the satisfiability problem of formulas in conjunctive normal form Rainer Schuler Abt. Theoretische Informatik, Universität Ulm, D-89069 Ulm, Germany Received 26 February 2003 Available online 9 June 2004 Abstract We consider the satisfiability problem on Boolean formulas in conjunctive normal form. We show that a satisfying assignment of a formula can be found in polynomial time with a success probability of 2 n(1 1/(1+logm)),wheren and m are the number of variables and the number of clauses of the formula, respectively. If the number of clauses of the formulas is bounded by n c for some constant c, this gives an expected run time of O(p(n) 2 n(1 1/(1+c logn)) ) for a polynomial p. 2004 Elsevier Inc. All rights reserved. Keywords: Complexity theory; NP-completeness; CNF-SAT; Probabilistic algorithms 1. Introduction The satisfiability problem of Boolean formulas in conjunctive normal form (CNF-SAT) is one of the best known NP-complete problems. The problem remains NP-complete even if the formulas are restricted to a constant number k>2 of literals in each clause (k-sat). In recent years several algorithms have been proposed to solve the problem exponentially faster than the 2 n time bound, given by an exhaustive search of all possible assignments to the n variables. So far research has focused in particular on k-sat, whereas improvements for SAT in general have been derived with respect to the number m of clauses in a formula [2,7]. The best known time bound for unbounded clause size with respect to the number of variables is 2 n ε n for a constant ε>0 [6]. The result is derived from the much stronger time bound 2 n(1 1/k) known for k-sat [5]. E-mail address: schuler@informatik.uni-ulm.de. 0196-6774/$ see front matter 2004 Elsevier Inc. All rights reserved. doi:10.1016/j.jalgor.2004.04.012

R. Schuler / Journal of Algorithms 54 (2005) 40 44 41 Theorem 1 [5]. There exists a randomised algorithm such that for every formula F SAT (1) The algorithm on input F outputs a satisfying assignment with probability at least 2 n(1 1/k),wherek is a bound on the number of literals in each clause. (2) The running time of the algorithm is polynomially bounded in the size (number of literals) of the formula. The question arises whether time-bounds of the form O(2 n(1 α) ),forsomeα>0, are possible for formulas with unbounded clause size. A partial answer in this direction was given in [1]. If the number of clauses is linearly bounded, i.e., less than cn for some constant c>1, then satisfying assignments can be found in time 2 n(1 α) for some constant α>0 depending on c. (It suffices to choose α such that H(α) 1/6c, where H(α) is the entropy function.) 2. A probabilistic algorithm for CNF-SAT As usual, we use n to denote the number of variables of a formula F and m to denote the number of clauses. The size of a clause is the number of literals it contains. Let c>1 be some constant. A satisfiable formula is in SAT(n c ) if the number of clauses is bounded by n c.weuselogn to denote the smallest integer larger than the logarithm with base 2 of n. Input CNF-Formula F on variables x 1,x 2,...,x n choose uniformly at random a permutation π of 1, 2,...,n a string y {0, 1} n let F 0 = F for i = 1 to n do let x denote the π(i)th variable x π(i) if F i 1 contains x in a unit clause set the truth value of x to 1 else if F i 1 contains the negation of x in a unit clause set the truth value of x to 0 else set the truth value of x to the ith bit of y let F i denote the formula which is derived from F i 1 by deleting all literals set to 0 deleting all clauses which contain a literal set to 1 if F n contains the empty clause output fail else (F n is empty) output truth assignment of x 1,x 2,...,x n Fig. 1. Algorithm of Paturi, Pudlák and Zane (PPZ-Algorithm).

42 R. Schuler / Journal of Algorithms 54 (2005) 40 44 Theorem 2. There exists a randomised algorithm A such that for every formula F CNF- SAT (1) The algorithm A on input F outputs a satisfying assignment with probability at least 2 n(1 1/(1+logm)). (2) The running time of A is polynomially boundedin the size (number of literals) of the formula. Proof. Using a probabilistic polynomial-time algorithm of Paturi, Pudlák, and Zane [5] a satisfying assignment of a formula can be found with success probability of at least 2 n(1 1/k), if every clause of the formula contains at most k literals. In the following we use PPZ-algorithm to refer to this algorithm (see Fig. 1). Let F denote some satisfiable formula in CNF, n denote the number of variables and m 0 denote the number of clauses of F. The algorithm to find a satisfying assignment is defined as follows. Input CNF-Formula F Let C 1,...,C m denote the clauses of F for i = 1 to m do if the size of C i is larger than 1 + log m 0 let clause D i contain the first 1 + log m 0 literals of C i else let clause D i be equal to C i Run the PPZ-algorithm on input G = m i=1 D i if the PPZ-algorithm yields a (satisfying) assignment a output a else if all clauses are of size at most logm 0 output fail else uniformly at random choose a clause D i of size 1 + log m 0 set the truth value of all literals in D i to 0 let F denote the formula which is derived from F by deleting all literals set to 0 deleting all clauses which contain a literal set to 1 recursively call the algorithm with formula F First we note that any assignment satisfying G = m i=1 D i also satisfies F. The converse, however, is not true. Let a denote some (unknown) satisfying assignment of F. We distinguish two cases. Either G is satisfiable or not. If G is satisfiable, then the PPZ-algorithm will find a satisfying assignment with the required probability. Now assume G is not satisfiable, i.e., at least one clause of G of size 1+logm 0 evaluates to false under a.leti be the smallest index such that D i evaluates to false. The probability that D i is selected by the algorithm is at least 1/m 0. In this case the truth assignments given to the 1 + log m 0 variables of D i is identical to the truth assignments under a. Hence, the derived formula F is satisfiable and a restricted to the remaining variables is a satisfying assignment of F.

R. Schuler / Journal of Algorithms 54 (2005) 40 44 43 Let j denote the number of recursive calls, until all clauses in G are true under a.if we require that in each iteration the first clause of size 1 + log m 0 which is false under a is selected, then j is a fixed number for every formula F and assignment a. This follows, since in this case, the literals which are set to 0 are determined deterministically. Note that the number of clauses which evaluate to false under a in, e.g., the initial call of the algorithm might be larger or smaller than j. Let p denote the probability that after j recursive calls the formula G is satisfiable. Then p can be estimated by ( ) 1 j p 2 j log m 0. m 0 Since in each recursive call, the PPZ-algorithm is used to find a satisfying assignment of G, the probability that a satisfiable assignment will be found in the jth recursive call is at least p 2 (n j(1+logm 0))(1 1/(1+logm 0 )). The success probability of the algorithm is therefore at least 2 j logm0 2 (n j(1+logm 0))(1 1/(1+logm 0 )) = 2 j(1+logm 0)(1 1/(1+logm 0 )) 2 n(1 1/(1+logm 0))+j(1+logm 0 )(1 1/(1+logm 0 )) = 2 n(1 1/(1+logm 0)) The probability to find a satisfying assignment can be amplified by running the algorithm several times. The expected number of iterations until a satisfying assignment is found (with some constant probability) is the inverse of the success probability. Corollary 3. Satisfying assignments of formulas in CNF-SAT can be found in expected time O ( p(n + m) 2 n(1 1/(1+logm))), where p is some polynomial and n an m are the number of variables and clauses of the formula, respectively. A special case occurs when the number of clauses is polynomially bounded in the number of variables. Corollary 4. Let c>1 be some constant. Satisfying assignments of formulas in SAT(n c ) can be found in expected time O ( p(n) 2 n(1 1/(1+c logn))), where p is some polynomial. It remains an open question, whether a similar time bound can be achieved by a deterministic algorithm. Further, it would be interesting to know whether the time bound could be improved to 2 n(1 α) for some constant α>0 [3,4].

44 R. Schuler / Journal of Algorithms 54 (2005) 40 44 Acknowledgment The author thanks the anonymous referee for helpful comments. References [1] V. Arvind, R. Schuler, The quantum query complexity of 0-1 knapsack and associated claw problems, in: Proceedings of the 14th Annual International Symposium on Algorithms and Computation, in: Lecture Notes in Comput. Sci., Springer-Verlag, 2003, in press. [2] E.A. Hirsch, New worst-case upper bounds for sat, 2nd Special Issue on SAT, J. Automat. Reason. 24 (4) (2000) 397 420. [3] R. Impagliazzo, R. Paturi, Complexity of k-sat, in: Proceedings of the 14th Annual IEEE Conference on Computational Complexity, IEEE Computer Society Press, 1990, pp. 237 240. [4] P. Pudlák, R. Impagliazzo, A lower bound for dll algorithms for k-sat (preliminary version), in: Proceedings of the Eleventh Annual ACM SIAM Symposium on Discrete Algorithms, ACM Press, 2000, pp. 128 136. [5] R. Paturi, P. Pudlák, F. Zane, Satisfiability coding lemma, in: 38th Ann. IEEE Sympos. on Foundations of Comp. Sci., FOCS 97, 1997, pp. 566 574. [6] P. Pudlák, Satisfiability algorithms and logic, in: Proceedings of the 23rd Mathematical Foundations of Computer Science, vol. 1450, Springer-Verlag, 1998, pp. 129 141. [7] J.M. Robson, Algorithms for maximum independent sets, J. Algorithms 7 (1986) 425 440.