《Algorithms》NP-complete 部分证明习题解答
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 an assignment exists. Prove that STINGY SAT is NP-complete.
我们可以把SAT问题规约到Stingy SAT问题。
给定一个SAT的问题实例I,令(I, k)为有k个变量的STINGY SAT问题实例。我们可以证明,一组赋值S是I的解当且仅当S也是(I, k)的解。
- 必要性:假设S为I的解,那么因为一共只有k个变量,所以S中也有不超过k个变量可为真。所以S也是(I, k)的解。
- 充分性:假设S是(I, k)的解,那么显然它也是对应I的解。
8.8
In the EXACT 4SAT problem, the input is a set of clauses, each of which is a disjunction of exactly four literals, and such that each variable occurs at most once in each clause. The goal is to find a satisfying assignment, if one exists. Prove that EXACT 4SAT is NP-complete.
可以直接由3SAT规约到4SAT:直接在3SAT每个子句中插入一个哑变量m就好了。