NP-complete problems

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.

设f为SAT一个有k个变量的实例,(f,k)为STINGY SAT的一个实例,x为一组赋值。易知x是可在多项式时间内验证是否可以使(f,k)为真,所以STINGY SAT是NP问题
目标:SAT规约到STINGY SAT,即x是f的解当且仅当x是(f,k)的解;
充分性:假设x是f的解,则至多有k个变量为真,x赋给(f,k)也为真,所以x是(f,k)的解;
必要性:假设x是(f,k)的解,显然x也是f的解;
∴ STINGY SAT也是一个NPC问题。


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问题是NP-完全问题,若能将3SAT问题归约到精确的4SAT问题,则可证明精确的4SAT问题也是NP-完全问题。

以下是将3SAT问题归约到精确的4SAT问题:

给定3SAT的实例I,I=(a1∨a2∨a3)(a4∨a5∨a6)…(ak∨ak+1∨ak+2);

精确的4SAT问题要求每个变量最多在每个字句中出现一次,因此首先通过压缩字句,对于I中的字句i:

(1)若存在几个变量相等,则只保留其中一个;

(2)若存在两个变量互反,则该字句恒为true,可以将其从I中去除;

使得每个变量最多在每个字句中出现一次。

之后在I中的字句中添加变量,使得每个字句恰有4个变量。

(1)字句(ap∨aq∨aw)可以转化为(ap∨aq∨aw∨x)(ap∨aq∨aw∨~x)。若(ap∨aq∨aw)为真,(ap∨aq∨aw∨x)(ap∨aq∨aw∨~x)显然为真;若(ap∨aq∨aw∨x)(ap∨aq∨aw∨~x)为真,由于x和~x必有一个为假,故其对应的‘ap∨aq∨aw’必为真;

(2)字句(ap∨aq)可以转化为(ap∨aq∨x∨y)(ap∨aq∨~x∨y)(ap∨aq∨x∨~y)(ap∨aq∨~x∨~y)。若(ap∨aq)为真,则(ap∨aq∨x∨y)(ap∨aq∨~x∨y)(ap∨aq∨x∨~y)(ap∨aq∨~x∨~y)显然为真;若(ap∨aq∨x∨y)(ap∨aq∨~x∨y)(ap∨aq∨x∨~y)(ap∨aq∨~x∨~y)为真,由于‘x∨y’,‘~x∨y’,‘x∨~y’和‘~x∨~y’必有一个为假,故其对应的‘ap∨aq’必为真。

(3)对于字句(ap)同理。

综上,3SAT问题可以归约到精确的4SAT问题,并且归约过程可以在多项式时间内完成,故由3SAT问题是NP-完全问题可以得到精确的4SAT问题也是NP-完全问题。


8.10Proving NP-completeness by generalization. For each of the problems below, prove that it is NPcomplete by showing that it is a generalization of some NP-complete problem we have seen in this chapter.

(a) SUBGRAPH ISOMORPHISM: Given as input two undirected graphs G and H, determine whether G is a subgraph of H (that is, whether by deleting certain vertices and edges of H we obtain a graph that is, up to renaming of vertices, identical to G), and if so, return the corresponding mapping of V (G) into V (H). 

(b) LONGEST PATH: Given a graph G and an integer g, find in G a simple path of length g. 

(c) MAX SAT: Given a CNF formula and an integer g, find a truth assignment that satisfies at least g clauses. 

(d) DENSE SUBGRAPH: Given a graph and two integers a and b, find a set of a vertices of G such that there are at least b edges between them. 

(e) SPARSE SUBGRAPH: Given a graph and two integers a and b, find a set of a vertices of G such that there are at most b edges between them.

(f) SET COVER. (This problem generalizes two known NP-complete problems.) 

(g) RELIABLE NETWORK: We are given two n × n matrices, a distance matrix dij and a connectivity requirement matrix rj, as well as a budget b; we must find a graph G = ({1, 2, … , n}, E) such that (1) the total cost of all edges is b or less and (2) between any two distinct vertices i and j there are rij vertex-disjoint paths. (Hint: Suppose that all dij’s are 1 or 2, b = n, and all rij’s are 2. Which well known NP-complete problem is this?)

(a) 子图同构:
假设图G是一个环,G和H的顶点数相同。如果G是H的子图,那么H中必然存在Ruarata回路。因此子图同构问题实际上是Rudrata回路问题的推广,故而子图同构问题是NP-完全的。

(b) 最长路径:
如果图G中顶点数为|V|,令g = |V| - 1,这时此问题就可以看做是Rudrata回路问题。因此最长路径问题实际上是Rudrata回路问题的推广,故而最长路径问题是NP-完全的。

(c) 最大SAT:
假设给定的CNF公式中子句个数为n。当g = n时,最大SAT问题就是SAT问题。因此最大SAT问题实际上是SAT问题的推广,故而最大SAT问题是NP-完全的。

(d) 稠密子图:
令b = a * (a - 1) / 2,这时问题就转化成了:G中的a个顶点,使得这些顶点两两都存在相邻的边。此时问题就转化成了最大团问题。因此稠密子图T问题实际上是最大团问题的推广,故而稠密子图问题是NP-完全的。

(e) 稀疏子图:
如果b = 0,那么稀疏子图问题可看做是独立集问题,因此稀疏子图问题实际上是独立集问题的推广,故而稀疏子图问题是NP-完全的。

(f) 集合覆盖:
集合覆盖问题是指:包含一个集合U以及U内元素构成的若干各小类集合S,目标是找到S 的一个子集,该子集满足所含元素包含了所有的元素且使小类集合个数最少。
如果使U为图中边的集合E,E中元素构成的Si为与顶点i相邻的所有边。这样,集合覆盖问题就转化为了最小顶点覆盖问题。因此集合覆盖问题实际上是最小顶点覆盖问题的推广,故而集合覆盖问题是NP-完全的。

(g) 可靠网络:
根据提示,可以联系到TSP问题。dij为1时表示两个城市有边,dij为2时表示两个城市没有边;预算b为城市的数目,rij为2,说明任意两点在一个环上。这样,可靠网络问题就转化为了TSP问题。因此可靠网络问题实际上是TSP问题的推广,故而可靠网络问题是NP-完全的。


  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值