算法设计期末作业01-8.3

来源:互联网 发布:身份证代码检测软件 编辑:程序博客网 时间:2024/06/10 16:32

题目

STINGY SAT is the following problem: given a set of clauses(each a disjunction of literals) ans an integer k, find a satisfying assignment in which at most k variables are true, if such an assignment exists. Prove that STINGY SAT is NP-complete.

解答过程

首先,显然,STINGY SAT 的解在多项式时间内是可以验证的。接下来只需要证明NP-complete SAT是归约到STINGY SAT的即可,即x是f的解当且仅当x是(f,k)的解。
对于充分性方向,
因为x是f的解,所以最多有k个变量为true,则x对于(f,k)也为真,所以充分性得证。
对于必要性方向,
因为x是(f,k)的解,x也是f的解。故必要性得证。
综上所述,STINGY SAT是NP-complete问题

原创粉丝点击