《Algorithms》NP-complete 部分证明习题解答

《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就好了。

8.10

Proving NP-completeness by generalization. For each of the problems below, prove that it is NP-complete 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).

我们可以把团(Clique)问题规约到这个子图同构问题(Subgraph Isomorphism)。

我们需要证明,给定G和一个完全图K~g~ ,(K~g~, G)问题实例的解(也就是说K~g~是不是G的子图)为正确当且仅当G有一个g个顶点的团(Clique)。

  • 必要性:给定(K~g~, G)的肯定解(前者确是后者的子图),G也有一个g个顶点的团。
  • 充分性:给定G的一个g个顶点的团,g个顶点的完全图当然也是G的子图。

(b)

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

可以建立一个有(g+1)个顶点的G的子图的哈密顿路,和在G中找长度为g的简单路的对应关系。

(c)

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

令g为给定合取范式的从句数量,那么显然SAT和这个MAX SAT是对应的。

(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.

可以从Clique规约到Dense Subgraph问题。

给定G、g,令a = g,b = g(g-1)/2,那么可以看到(K~b~, a, b)是Dense Subgraph一个实例,当且仅当G有一个g个顶点的clique。因为g个顶点的完全图有g(g-1)/2条边。

(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.

可以从独立集开始规约。

给定独立集问题(G, k),可以令a = k,b = 0,这样就可以把独立集问题规约到Sparse Subgraph上了。

(f)

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

可以从点覆盖(Vertex Cover)规约到集合覆盖(Set Cover)问题。

给定点覆盖问题(V, E),令集合覆盖问题中的k,即最多可选集合数,为点覆盖问题中的最多可选边数;令所有集合元素的并集为点覆盖问题中的边集;令集合S~v~ 为和顶点v相邻的边构成的集合。

那么,寻找(V, E)的点覆盖,就是寻找集合{S~i~}的集合覆盖。

(g)

RELIABLE NETWORK: We are given two n × n matrices, a distance matrix dij and a connectivity requirement matrix rij , 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?)

根据提示,显然可以由哈密顿回路问题规约。令所有的路的长度都是1,每个r~ij~都是2,那么求任意图的哈密顿回路显然可以规约到这个问题上。

你可能感兴趣的:(《Algorithms》NP-complete 部分证明习题解答)