[算法作业] Chapter 8 NP-complete problems 课后习题部分证明

【预备知识】

证明一个问题是NPC问题,首先这个问题要是一个NP问题。

将A问题规约到B问题:A -> B,即A可以转化为B的一个实例。

如果B在多项式时间内有解,那么A在多项式时间内也有解。

如果A是NPC问题,那么B也是NPC问题。

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.

证明:
首先,stingy SAT问题是一个NP问题。
考虑将SAT问题规约到 STINGY SAT问题:
    对于SAT问题,给定一个合取范式S,设 k = S的变量数,则(S, k)则为stingy SAT问题的一个实例。 
设X是满足S的一组解,因为一共只有k个变量,所以解X中的true的变量数 ≤ k,因此所有满足S的解同时也是(S, k)的解; 
若X为(S, k)的解,则X也是S的解。
因为SAT是一个NPC问题,因此stingy SATY也是NP-complete问题

8.8
In t he 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.
证明:
首先,exact 4SAT问题是一个NP问题。
考虑将3SAT问题规约到exact 4SAT 问题
给定一个3SAT问题,假设其表达式为 ,为了使其成为一个EXACT 4SAT的实例,我们在每个子句中,添加一系列新变量ai,
        若该3SAT问题有解,则这些新添加的变量并不对结果产生影响,我们称其为哑元变量,即3SAT问题的解也满足对应的EXACT 4SAT问题。
EXACT 4SAT子句中新加入的哑元变量都取值为0,则EXACT 4SAT问题则转换回到了3SAT问题。
因为3SAT问题是一个NPC问题,所以 EXACT 4SAT问题也是一个NP-complete问题。

8.9
In the HITTING SET problem, we are given a family of sets{S1, S2, ..., Sn} and a budget b, and we wish to find a set H of size ≤ b which intersects every Si, if
such an H exists. In other words, we want H ∩ Si ≠ ∅ for all i.
Show that HITTING SET is NP- complete.
证明:
(1)证明HITTING SET是一个NP问题
为了验证答案我们需要:对S中的每个Si, H ∩ Si ≠ ∅ ,时间复杂度为O(|H| * |S|),因此HITTING SET 是一个NP问题
(2)规约:顶点覆盖vertex cover -> hitting set
    给定一个图G = (V, E), 若有一个大小为b的顶点覆盖集合 H = {A1, A2, ..., An},定义所覆盖的边集为S = {{u, v} | (u, v) ∈ E}, 则对于S中的每一个集合{u, v},至少有一个顶点在 H 中。(S, H, b)正式hitting set的一个实例
如果X是(S, H, b)的一个hitting set, 那么对于H ∩ Si ≠ ∅ , 也就是说Si中至少有一个元素出现在顶点集合H中,则X是图G的一个顶点覆盖。
综上, hitting set 是一个NP-complete问题。

8.12
the k-SPANNING TREE problem is the following:
input: an undirected graph G = (V, E)
output: a spanning tree of G in which each node has degree ≤ k, if such a tree exists
show that for any k ≥ 2
(a) k-SPANNING TREE is a search problem
(b) k-SPANNING TREE is NP-complete(Hint: Start with k = 2 and consider the relation between this problem and RUDRATA PATH.)
证明:
(a)证明k-SPANNING TREE是一个搜索问题也就是要证明其能够在多项式时间内有解,需要验证的问题有:
对G中的每个顶点v,判断其是否有环(即是否为树)
树中每个顶点的度数 ≤ k
  上述问题能够在多项式时间内进行验证, 因此k-spanning tree是一个搜索问题

(b)考虑规约:Rudrata path - > k-spanning tree
令G是一个不带权重的无向图,确定G上是否存在Rudrata path.
令每条边的权重都为1,然后在图G上寻找k-spanning tree,  每个顶点的度数 ≤ 2的树就是路径之一
         当k = 2时,2-spanning tree实际上就是一条Rudrata 路径。如果图G中不存在这样的一颗树,那就不存在Rudrata路径
所以我们将Rudrata path问题规约到了k-spanning tree问题,又因为在(a)证明了k-spanning tree是一个NP问题,因此, k-spanning tree是NP-complete的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值