算法设计期末作业05-8.14

来源:互联网 发布:党卫军和国防军 知乎 编辑:程序博客网 时间:2024/06/07 19:41

题目

Prove that the following problem is NP-complete: given an undirected graph G = (V, E) and an integer k, return a clique of size k as weill as an independent set of size k, provided both exist.

问题解答

这个问题可以被最大独立集问题规约,也就是说,令G1=G(V,E),再去掉G1的所有的边,得到G2,这个时候G1和G2有大小为D的集,当且仅当G存在大小为D的独立集。所以团和独立集的问题是等价的,所以这个问题是一个NPC问题。