Prove the EXACT 4SAT is NP-complete.
2017-07-10 18:04
211 查看
题目:
8.8. In the EXACT 4SAT problem, the input is a set of clauses, each of is a disjunction of exactly four literals, and such that each variables occurs at most once in each clause. The goal is to find a satisfying assignment, if one exists. Prove the
EXACT 4SAT is NP-complete.
解答:
这道题要求我们证明精确4SAT问题是NP完全的,精确4SAT和SAT是类似的,但是多了约束条件,我们都知道SAT是由多个子句组成的,每个子句里有若干个文字,而精确4SAT要求每个子句必须包含4个文字,且这4个文字不能重复。
通过上课知道要证明一个问题是NP-完全问题,需要证明以下两点:
1. 它是一个NP问题,且
2. 其他属于NP的问题都可归约成它。
先证明精确4SAT是NP的。首先,给出一个精确4SAT可能的解,我们可以在多项式时间验证这个解是否正确,所以精确4SAT是NP的。
后证明精确4SAT是NP完全的。要证明精确4SAT是NP完全,可以通过将一个已知的NP完全问题归约成精确4SAT。
我们都知道3SAT是NP完全的,在3SAT中,每个子句最多有3个文字,而且是可以重复的。
我们可以通过以下2步将3SAT问题转换成精确4SAT问题:
1. 对于3SAT的每个子句,如果存在重复的文字,我们可以只保留其中一个;如果同时存在x和x¯这两种文字,那么这两个文字必定有一个为true,所以这一子句必定为true,这一子句不会影响最终结果,可以直接去掉。
2. 这时候在剩下的子句中,每个子句包含的文字数量可以是1、2或者3。我们需要加入无关变量来将其扩充到4个文字。
对于包含3个文字的子句,如:
(x⋁y⋁z) (式1)
我们可以加入无关变量n,得到:
(x⋁y⋁z⋁n)(x⋁y⋁z⋁n¯)
(式2)
因为n和n¯之间必定有一个为false,所以要使得式2为true,式1也必须为true。所以精确4SAT的解也满足3SAT。
而对于包含2个文字的子句,可以用类似的方法先扩充到3个文字,再扩充到4个文字;对于只有1个文字的子句也类似。
这个从3SAT到精确4SAT的问题转换过程也是多项式时间内可以完成的。
当在精确4SAT中找到合适的解之后,我们去掉无关变量剩下的解就是3SAT的解,这也是可以在多项式时间内完成的。
所以,3SAT问题可以转化成精确4SAT问题。
综上所述,3SAT问题可以归约为精确4SAT问题,由于3SAT是NP完全的,所以精确4SAT。也是NP完全的。
8.8. In the EXACT 4SAT problem, the input is a set of clauses, each of is a disjunction of exactly four literals, and such that each variables occurs at most once in each clause. The goal is to find a satisfying assignment, if one exists. Prove the
EXACT 4SAT is NP-complete.
解答:
这道题要求我们证明精确4SAT问题是NP完全的,精确4SAT和SAT是类似的,但是多了约束条件,我们都知道SAT是由多个子句组成的,每个子句里有若干个文字,而精确4SAT要求每个子句必须包含4个文字,且这4个文字不能重复。
通过上课知道要证明一个问题是NP-完全问题,需要证明以下两点:
1. 它是一个NP问题,且
2. 其他属于NP的问题都可归约成它。
先证明精确4SAT是NP的。首先,给出一个精确4SAT可能的解,我们可以在多项式时间验证这个解是否正确,所以精确4SAT是NP的。
后证明精确4SAT是NP完全的。要证明精确4SAT是NP完全,可以通过将一个已知的NP完全问题归约成精确4SAT。
我们都知道3SAT是NP完全的,在3SAT中,每个子句最多有3个文字,而且是可以重复的。
我们可以通过以下2步将3SAT问题转换成精确4SAT问题:
1. 对于3SAT的每个子句,如果存在重复的文字,我们可以只保留其中一个;如果同时存在x和x¯这两种文字,那么这两个文字必定有一个为true,所以这一子句必定为true,这一子句不会影响最终结果,可以直接去掉。
2. 这时候在剩下的子句中,每个子句包含的文字数量可以是1、2或者3。我们需要加入无关变量来将其扩充到4个文字。
对于包含3个文字的子句,如:
(x⋁y⋁z) (式1)
我们可以加入无关变量n,得到:
(x⋁y⋁z⋁n)(x⋁y⋁z⋁n¯)
(式2)
因为n和n¯之间必定有一个为false,所以要使得式2为true,式1也必须为true。所以精确4SAT的解也满足3SAT。
而对于包含2个文字的子句,可以用类似的方法先扩充到3个文字,再扩充到4个文字;对于只有1个文字的子句也类似。
这个从3SAT到精确4SAT的问题转换过程也是多项式时间内可以完成的。
当在精确4SAT中找到合适的解之后,我们去掉无关变量剩下的解就是3SAT的解,这也是可以在多项式时间内完成的。
所以,3SAT问题可以转化成精确4SAT问题。
综上所述,3SAT问题可以归约为精确4SAT问题,由于3SAT是NP完全的,所以精确4SAT。也是NP完全的。
相关文章推荐
- 证明:EXACT 4SAT is NP-complete
- 8.3 Prove that STINGY SAT is NP-complete.
- Building a Linux kernel module without the exact kernel headers
- Exact 4SAT问题是NP完全的证明
- 证明EXACT 4SAT问题为NP-complete
- Exception:All com.android.support libraries must use the exact same version specification
- 第八章8.8证明EXACT 4ST问题为NP-complete
- Prove that STINGY SAT is NP-complete
- 解决支持库版本兼容问题:all com.android.support libraries must use the exact same version specification
- How to find the exact line position which causes “undefined is not a function" error
- the exact short movie in Guilin
- all com.android.support libraries must use the exact same version specification
- Mathmatical Prove of the Effectiveness of Quick Sort
- Prove STINGY SAT is NP-complete
- Android Studio2.3 All com.android.support libraries must use the exact same version specification...
- Inprove the speed of the "Mass storage" as u disk
- NP-C EXACT 4SAT
- a trick in reading and storing file in the exact way!
- the prove of the master method From CLRS
- python中关于Np.hstack()错误的ValueError: all the input arrays must have same number of dimensions