zoukankan      html  css  js  c++  java
  • Proving NP-completeness

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

      (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 atmost 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 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 ?)
      

    用一般的方法证明NP完全:利用推广的方法证明NP-完全性。对以下每个问题请通过证明它是本章某个NP-完全问题的推广说明它是NP-完全
    的。
      (a)子图同构:给定两个作为输入的无向图G和H,判断G是否为H的一个子图(即删除H中的某些顶点或边后,所得的新图最多只需再修改某些顶点的名称,即可与G相同),且如果是,返回由V(G)到V(H)相关映射。
      (b)最长路径:给定图G和整数g,求G中一条长为g的简单路径。
      (c)最大SAT:给定一个CNF公式和整数g,求满足其中至少g个子句的真赋值。
      (d)稠密子图:给定一个图和两个整数a和b,求G中的a个顶点,使得它们之间最少有b条边。
      (e)稀疏子图:给定一个图和两个整数a和b,求G中的a个顶点,使得它们之间最多有b条边。
      (f)集合覆盖。(该问题衍生了两个著名的NP-完全问题。)
      (g)可靠网络:给定两个nxn的矩阵,一个距离矩阵dij,一个连接需求矩阵rij以及预算b。我们要求一个图G=({1,2,……,n},E)
        使得:
          (1)其中所有边的总代价不超过b;
          (2)在任意两个不同的顶点i和j之间,存在rij条顶点互不相交的路径。
          (提示:假设所有dij都为1和2,b=n,所有的rij=2。这属于哪个著名的NP-完全问题?)

    证明:
    (a)子图同构:
      令图G 为一个环,环上的顶点数等于图H 的顶点数。那么若G 是H 的同构子图,则说明H 存在Rudrata 回路(经过图中每个顶点有且仅有一次的回路)。所以可以判断Rudrata回路事实上是子图同构问题的一个特例。所以子图同构是Rudrata回路的推广。
    (b)最长路径:
      如果令g = V −1,即得到一条Rudrata 路径(经过图中每个顶点有且仅有一次的回路)。所以Rudrata路径可以看做是该问题的一个特例。
    (c)最大SAT:
      令g为子句的总数,即成SAT问题,所以最大SAT为SAT问题的一个推广。
    (d)稠密子图:
      令b=a(a-1)/2,此时这a 个顶点两两相连,于是即成最大团问题(图中的每个顶点间均有边相连)。
    (e)稀疏子图:
      令b = 0,即成最大独立集问题(一个顶点集合中的任意两个顶点间均没有边相连)。
    (f)集合覆盖。
      集合覆盖问题是指:包含一个集合U以及U内元素构成的若干各小类集合S,目标是找到S 的一个子集,该子集满足所含元素包含了所有的元素且使小类集合个数最少。
      如果使U为图中边的集合E,E中元素构成的Si为与顶点i相邻的所有边。这样,集合覆盖问题就转化为了最小顶点覆盖问题。因此集合覆盖问题实际上是最小顶点覆盖问题的推广,故而集合覆盖问题是NP-完全的。
    (g)可靠网络:
      根据提示,可以联系到TSP问题。dij为1时表示两个城市有边,dij为2时表示两个城市没有边;预算b为城市的数目,rij为2,说明任意两点在一个环上。这样,可靠网络问题就转化为了TSP问题。因此可靠网络问题实际上是TSP问题的推广,故而可靠网络问题是NP-完全的。

  • 相关阅读:
    CMS前世今生
    叫练手把手教你读JVM之GC信息
    原来我还有网络天赋
    最简单的JVM内存结构图
    图解CyclicBarrier运动员接力赛
    图解定时任务线程池
    并发队列:ArrayBlockingQueue实际运用场景和原理
    ReentrantReadWriteLock读写锁简单原理案例证明
    JavaScript中的Function类型浅析
    JS数组整理
  • 原文地址:https://www.cnblogs.com/yangjiannr/p/7391324.html
Copyright © 2011-2022 走看看