NP 完全(2):归约与优化
Last updated on June 13, 2025 pm
本文为SJTU-AI2615算法课程的知识点复习,主要复习内容为NP完全问题(进阶),包括Karp归约等。
以“顶点覆盖归约到支配集”为例
归约方法
- 基本思路:在每条边中间插入一个顶点,覆盖边转化为了覆盖中间的顶点
- 修复及最终方法:
证明过程
- 一般思路:证明 是 NP 完全问题
- 证明 是 NP 问题
- 对一个 NP 完全问题 ,给出 的归约过程
- 证明 的正确实例映射到 的正确实例
- 证明 的错误实例映射到 的错误实例
- 或证明逆否命题,即映射到 的正确实例的 实例都是正确的
- 完整证明:
First of all, DominatingSet is in NP, as a dominating set can be served as a certificate, and it can be verified in polynomial time whether is a dominating set and whether .
To show that DominatingSet is NP-complete, we present a reduction from VertexCover. Given a VertexCover instance , we construct a DominatingSet instance as follows.
The vertex set is , which is defined as follows. For each vertex in the VertexCover instance, construct a vertex ; for each edge in the VertexCover instance, construct a vertex .
The edge set is defined as follows. For each edge in the VertexCover instance, build two edges . For any two vertices in , build an edge .
Define .
Suppose is a yes VertexCover instance. There exists a vertex cover with . We will prove corresponding is a dominating set in .
For each vertex in , it is covered by any vertex in as forms a clique.
For each vertex in , let be the corresponding edge in the VertexCover instance. We have either or (or both), as is a vertex cover. This implies either or (or both), which further implies is covered as by our construction.
Since , the DominatingSet instance we constructed is a yes instance.
注:本文中所有图片均来自张宇昊老师的课程PPT。