solving the logic satisfiability problem solving the logic satisfiability problem jesus de loera

12
Solving the Solving the Logic Logic Satisfiability Satisfiability problem problem Jesus De Loera Jesus De Loera

Upload: gerard-randall

Post on 18-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

CNF-SAT Problem CNF – Acronym for Conjunctive Normal Form which is a boolean expression given as a product of sums CNF – Acronym for Conjunctive Normal Form which is a boolean expression given as a product of sums Let us consider the example: Let us consider the example: (A  B)  (B  ¬C)  (A  ¬B) (A  B)  (B  ¬C)  (A  ¬B) Could easily use an exhaustive search in the form of a truth table to solve this problem Could easily use an exhaustive search in the form of a truth table to solve this problem

TRANSCRIPT

Page 1: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Solving the Logic Solving the Logic Satisfiability problem Satisfiability problem

Jesus De LoeraJesus De Loera

Page 2: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

OverviewOverview The Satisfiability Problem in its most general The Satisfiability Problem in its most general

form is determining whether it is possible to form is determining whether it is possible to satisfy a given set of logical constraintssatisfy a given set of logical constraints

Could take many forms:Could take many forms: Boolean expressions & logic circuitsBoolean expressions & logic circuits Many other applications as well (e.g. Artificial Many other applications as well (e.g. Artificial

Intelligence)Intelligence) Was the original NP-Complete ProblemWas the original NP-Complete Problem

Shown in 1970 by Stephen CookShown in 1970 by Stephen Cook

Page 3: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

CNF-SAT ProblemCNF-SAT Problem CNF – Acronym for Conjunctive Normal Form CNF – Acronym for Conjunctive Normal Form

which is a boolean expression given as a which is a boolean expression given as a product of sumsproduct of sums

Let us consider the example:Let us consider the example: (A (A B) B) (B (B ¬¬C) C) (A (A ¬¬B)B)

Could easily use an Could easily use an exhaustive searchexhaustive search in the in the form of a truth table to solve this problemform of a truth table to solve this problem

Page 4: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Davis-Putnam AlgorithmDavis-Putnam Algorithm Recursive Algorithm that creates a search tree by Recursive Algorithm that creates a search tree by

making assignments to the remaining variables at making assignments to the remaining variables at each stage of the algorithmeach stage of the algorithm

Performs better on average than an exhaustive searchPerforms better on average than an exhaustive search Effectively prunes failed branches from the search treeEffectively prunes failed branches from the search tree

Page 5: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Davis-Putnam Algorithm Davis-Putnam Algorithm ContinuedContinued

LetLet’’s apply the Davis-Putnam Algorithm to our s apply the Davis-Putnam Algorithm to our example:example:

(A (A B) B) (B (B ¬¬C) C) (A (A ¬¬B)B)

procedure split(E) {procedure split(E) {if E has an empty clause, then returnif E has an empty clause, then returnif E has no clauses, then exit with current partial if E has no clauses, then exit with current partial

assignmentassignmentselect next unassigned variable, xselect next unassigned variable, xii in E in E

split(E(xsplit(E(xii=0))=0))

split(E(xsplit(E(xii=1))=1))

}}

Davis-Putnam Algorithm:Davis-Putnam Algorithm:

Page 6: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Davis-Putnam Algorithm Davis-Putnam Algorithm ContinuedContinued

(A (A B) B) (B (B ¬¬C) C) (A (A ¬¬B)B)

B B (B (B ¬¬C) C) ¬¬BB B B ¬¬CC

(()) (()) ¬¬CC

(())

A=0A=0 A=1A=1

B=0B=0 B=1B=1 B=0B=0 B=1B=1

C=0C=0 C=1C=1

Application to: (A Application to: (A B) B) (B (B ¬¬C) C) (A (A ¬¬B)B)

() = Failed Partial Assignment = Successful Partial Assignment

Page 7: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Davis-Putnam Algorithm Davis-Putnam Algorithm ContinuedContinued

Unfortunately in the worse case the Davis-Putnam Unfortunately in the worse case the Davis-Putnam Algorithm is still exponentialAlgorithm is still exponential

Currently there is no known solution that provides Currently there is no known solution that provides a worse case performance better than exponentiala worse case performance better than exponential

Page 8: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Other Applications?Other Applications?

So far we have seen instances of the So far we have seen instances of the Satisfiability problem to pure logic applicationsSatisfiability problem to pure logic applications

However it is possible to apply to many other However it is possible to apply to many other types of problems as welltypes of problems as well

In fact the problem of Satisfiability is a In fact the problem of Satisfiability is a ““centracentrall”” problem and has limitless applications problem and has limitless applications

Page 9: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Complexity ClassesComplexity Classes ReviewReview

P – Problems which can be solved in polynomial timeP – Problems which can be solved in polynomial time NP – Problems which can be solved in non-NP – Problems which can be solved in non-

deterministic polynomial timedeterministic polynomial time All problems in the NP class can be reduced (in All problems in the NP class can be reduced (in

polynomial time) to problems which are said to polynomial time) to problems which are said to be NP-Completebe NP-Complete

P = NP??? – Could be shown if one could find a P = NP??? – Could be shown if one could find a polynomial time solution for a NP-Complete polynomial time solution for a NP-Complete problem such as the Satisfiability problem.problem such as the Satisfiability problem.

Page 10: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Complexity Classes Complexity Classes Continued…Continued…

Class P

Class NP

NP-Complete NP-Complete Problems exist at Problems exist at very edge of Class NPvery edge of Class NP

Intractable Problems

Increa

sing

Hardne

ss

Can be visualized in Can be visualized in the form of a set the form of a set chart with problem chart with problem hardness increasing hardness increasing radiallyradially

Page 11: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

Transformation Of Other Transformation Of Other NP Problems Into SAT NP Problems Into SAT ProblemsProblems

Instance of the Satisfiability

Problem

Some Examples Include: Hamiltonian cycle traveling salesperson, 3-graph coloring, partition problem, etc…

Any Problem In Complexity Class

NPTransformation

Transform the problem to be solved from an optimization to a decision. This can be done in polynomial time

Provides a method to transform any problem in NP Provides a method to transform any problem in NP class into an instance of the Satisfiability problem. class into an instance of the Satisfiability problem. Therefore, we can say that the Satisfiability problem Therefore, we can say that the Satisfiability problem is NP-Complete.is NP-Complete.

Output is a series of “true” or “false”

Page 12: Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera

ImplicationsImplications Since the Satisfiability problem is NP-Since the Satisfiability problem is NP-

Complete, if a polynomial time solution for the Complete, if a polynomial time solution for the Satisfiability problem was known then we Satisfiability problem was known then we could solve all the problems in the NP could solve all the problems in the NP complexity class in polynomial time.complexity class in polynomial time.

This would essentially collapse the complexity This would essentially collapse the complexity class NP into Pclass NP into P