算法分析与设计——NP习题

算法概论 8.3


题目

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

翻译:
STINGY SAT :给定一组字句(每个字句都是其中变量的析取)和整数 k,求一个最多有 k 个变量为 true 的满足赋值——如果该赋值存在。
证明 STINGY SATNP-complete(NP完全) 问题。


思路

若要证明 STINGY SAT 是NP完全问题,则

  1. 先需要证明 STINGY SAT 是NP问题。
  2. SAT 归约到 STINGY SAT

这样STINGY SAT就是NP完全问题。


解决

SAT 是一个有k个变量的实例f(f, k)STINGY SAT 的一个实例,x 为一组赋值。

1. 证明 STINGY SAT 是NP问题
由于可以在多项式时间内验证 x 是否可以使(f, k)为真,所以 STINGY SAT 是NP问题。

PS:STINGY SAT 问题是 SAT 问题的一个变种,任何一个解都可以在多项式时间内验证,因此 STINGY SAT 是NP问题。

2. 证明 STINGY SAT 是NP完全问题
目标:证明xf的解当且仅当x(f, k)的解成立。

(1) xf的解 => x(f, k)的解(充分性)
假设xf的解,则至多有k个变量为true,而此时x赋给(f, k)也为真,因此x(f, k)的解。

(2) x(f, k)的解 => xf的解(必要性)
假设x(f, k)的解,显然xf的解。

由(1)(2)可证,STINGY SAT 是NP完全问题。

猜你喜欢

转载自blog.csdn.net/joker_yy/article/details/79032759