Jump to content

3-Sat is in P


fiveworlds

Recommended Posts

3-Sat is basically a Boolean expression written as an and of 3 or statements.
 

(a!bc) and (!a!bc) and (!ab!c) and (!cde) and (!bc!d) 

010****
110****
101****
**100**
*010***

(aaa) and (!a!a!a)
0*******
1*******

It can be solved in deterministic polynomial time by performing a bitwise unique match on FALSE values stored in an array.

For example (a or !b or c) is only false for (010).

We add the false values to an ordered array so a,b,c etc and simply do a bitwise check to see if the opposite already exists in the array, so for 010 that would be 101. If the opposite already exists then the Boolean expression is unsatisfiable.

This would need to iterate over O(n) values in the worst case on a Single Tape Deterministic Turing machine. The expression is also unsatisfiable if the length of the array is >= 2n/2. Therefore the worst case runtime can never reach the exponential 2n

I am unsure whether there is any exceptions to the rule that would make this not work?

Edited by fiveworlds
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.