Jump to content

3-Sat is in P

Featured Replies

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

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.