Download presentation
1
SATISFIABILITY Eric L. Frederich
2
Overview Definitions K-Satisfiability 3-Satisfiability
Three Colorable Problem Transformation Davis – Putnam Algorithm 2-Satisfiability Algorithm Summary References
3
Definitions Satisfiability Product of Sums n m K
An instance of the problem is defined by a Boolean expression written using only AND, OR, NOT, variables, and parentheses. The question is: given the expression, is there some assignment of TRUE and FALSE values to the variables that will make the entire expression true?* Product of Sums A way of arranging a boolean expression such that the final output is a result of ‘AND’ing some ‘OR’ clauses where each term within an ‘OR’ clause may or may not be ‘NOT’ed. n The number of boolean variables found in the expression (with or without a NOT) m The number of ‘OR’ clauses ‘AND’ed together in the boolean expression K The maximum number of variables found within each OR clause * Definition from
4
K-Satisfiability K is the maximum number of terms allowed per ‘OR’ clause. For any K > 2, the problem lies in NP-Complete Solution of order 2n Special K’s 3SAT 3 Colorable Graph problem Still NP-Complete 2SAT Polynomial time solution K = 5 (A + B’ + C)(B + C’ + E’)(A’ + B + C’+ D’ + E)(B + D) K = 3 (3SAT) (X’ + Y)(X + Y’ + Z)(X’ + Z’)(Y + Z’) K = 2 (2SAT) (X1 + X2)(X2’ + X3)(X1’ + X2’)(X3 + X4)(X3’ + X5)(X4’ + X5’)(X3’ + X4)
5
3 – Colorable Transformation
Procedure Transform(G) for each vertex vi in G output(ri + yi + bi) for each edge (vi,vj) in G output(ri’ + rj ’)(yi’ + yj’)(bi’ + bj’) output : boolean expression with K = 3
6
2(21) = 2,097,152 (R2 + Y2 + B2) (R4’ + R5’)(Y4’ + Y5’)(B4’ + B5’)
( Y1 )( B2)(R )( B4)(R ) ( Y6 )( Y7 ) (R1' + R2’)( + Y2’)(B1’ + )(R1’ + )( + Y3’)(B1’ + B3’) (R1' + R4’)( + Y4’)(B1’ + )(R1’ + )( + Y5’)(B1’ + B5’) (R2' + )(Y2’ + Y5’)( + B5’)(R2’ + R6’)(Y2’ + )( + B6’) ( + R4’)(Y3’ + Y4’)(B3’ + )(R4’ + )(Y4’ + Y5’)( + B5’) ( + R6’)(Y5’ + )(B5’ + B6’)(R7’ + R4’)( + Y4’)(B7’ + ) (R7' + )( + Y5’)(B7’ + B5’) (R1 + Y1 + B1) (R6 + Y6 + B6) (R2’ + R6’)(Y2’ + Y6’)(B2’ + B6’) (R5’ + R6’)(Y5’ + Y6’)(B5’ + B6’) (R5 + Y5 + B5) (R2’ + R5’)(Y2’ + Y5’)(B2’ + B5’) (R3 + Y3 + B3) (R7 + Y7 + B7) (R1’ + R2’)(Y1’ + Y2’)(B1’ + B2’) (R1’ + R4’)(Y1’ + Y4’)(B1’ + B4’) (R4 + Y4 + B4) (R1’ + R3’)(Y1’ + Y3’)(B1’ + B3’) (R1’ + R5’)(Y1’ + Y5’)(B1’ + B5’) 1 2 6 3 4 5 7 2(21) = 2,097,152 (R1 + Y1 + B1)(R2 + Y2 + B2)(R3 + Y3 + B3)(R4 + Y4 + B4)(R5 + Y5 + B5) (R6 + Y6 + B6)(R7 + Y7 + B7) (R1' + R2’)(Y1’ + Y2’)(B1’ + B2’)(R1’ + R3’)(Y1’ + Y3’)(B1’ + B3’) (R1' + R4’)(Y1’ + Y4’)(B1’ + B4’)(R1’ + R5’)(Y1’ + Y5’)(B1’ + B5’) (R2' + R5’)(Y2’ + Y5’)(B2’ + B5’)(R2’ + R6’)(Y2’ + Y6’)(B2’ + B6’) (R3’ + R4’)(Y3’ + Y4’)(B3’ + B4’)(R4’ + R5’)(Y4’ + Y5’)(B4’ + B5’) (R5’ + R6’)(Y5’ + Y6’)(B5’ + B6’)(R7’ + R4’)(Y7’ + Y4’)(B7’ + B4’) (R7' + R5’)(Y7’ + Y5’)(B7’ + B5’)
7
R1 R2 R3 R4 R5 R6 R7 Y1 Y2 Y3 Y4 Y5 Y6 Y7 B1 B2 B3 B4 B5 B6 B7
3-Colorable R1' R2' R3' R4' R5' R6' R7' Y1' Y2' Y3' Y4' Y5' Y6' Y7' B1' B2' B3' B4' B5' B6' B7' (R1 + Y1 + B1)(R2 + Y2 + B2)(R3 + Y3 + B3)(R4 + Y4 + B4)(R5 + Y5 + B5) (R6 + Y6 + B6)(R7 + Y7 + B7) (R1' + R2’)(Y1’ + Y2’)(B1’ + B2’)(R1’ + R3’)(Y1’ + Y3’)(B1’ + B3’) (R1' + R4’)(Y1’ + Y4’)(B1’ + B4’)(R1’ + R5’)(Y1’ + Y5’)(B1’ + B5’) (R2' + R5’)(Y2’ + Y5’)(B2’ + B5’)(R2’ + R6’)(Y2’ + Y6’)(B2’ + B6’) (R3’ + R4’)(Y3’ + Y4’)(B3’ + B4’)(R4’ + R5’)(Y4’ + Y5’)(B4’ + B5’) (R5’ + R6’)(Y5’ + Y6’)(B5’ + B6’)(R7’ + R4’)(Y7’ + Y4’)(B7’ + B4’) (R7' + R5’)(Y7’ + Y5’)(B7’ + B5’)
8
Davis - Putnam Recursive but still 2n
Prunes off branches which will not yield a result. Does not examine the entire expression at each guess Procedure split (E) 1. if E has an empty clause, then return 2. if E has no clauses, then exit with current partial assignment 3. select next unassigned variable, xi, in E 4. split ( E ( xi = 0 ) ) 5. split ( E ( xi = 1 ) )
9
(X1 + X3’ + X4)(X1’ + X2’ + X4’)(X2’ + X3)(X1’ + X2 + X4)
Davis - Putnam (X1 + X3’ + X4)(X1’ + X2’ + X4’)(X2’ + X3)(X1’ + X2 + X4) X1 = 0 X1 = 1 (X2’ + X4’)(X2’ + X3)(X2 + X4) (X3’ + X4)(X2’ + X3) X2 = 0 X2 = 0 X2 = 1 X2 = 1 (X3’ + X4) (X3’ + X4)(X3) (X4) (X4’)(X3) X3 = 0 X3 = 1 X3 = 0 X3 = 1 X3 = 0 X3 = 1 X3 = 1 X3 = 0 (X4’) (X4) (X4) (X4) (X4) X4 = 0 X4 = 0 X4 = 0 X4 = 0 X4 = 0 X4 = 0 X4 = 0 X4 = 1 X4 = 0 X4 = 0
10
(X1 + X2)(X2’ + X3)(X1’ + X2’)(X3 + X4)(X3’ + X5)(X4’ + X5’)(X3’ + X4)
2- Satisfiability (X1 + X2)(X2’ + X3)(X1’ + X2’)(X3 + X4)(X3’ + X5)(X4’ + X5’)(X3’ + X4) Pick an assignment Drop terms that become true Make assignments based on initial assignment. Repeat….
11
Summary For K-Satisfiability where K > 2 it is an NP-Complete Problem 2-Satisfiability is solvable in polynomial time Davis-Putnam improves efficiency but does not decrease order of complexity 3-Colorable problem is synonymous to 3-Satisfiability
12
References http://condor.stcloudstate.edu/~pkjha/CSCI504/2SAT.pdf
"The New Turing Omnibus", by A.K. Dewdney A.W.H. Freeman/Owl Book, 2001 New York
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.