NP 完全(2):归约与优化

Last updated on April 28, 2026 pm

本文为SJTU-AI2615算法课程的知识点复习,主要复习内容为NP完全问题(进阶),包括Karp归约等。

以“顶点覆盖归约到支配集”为例

归约方法

  • 基本思路:在每条边中间插入一个顶点,覆盖边转化为了覆盖中间的顶点
  • 修复及最终方法:

顶点覆盖归约到支配集的方法

证明过程

  • 一般思路:证明 ff 是 NP 完全问题
    1. 证明 ff 是 NP 问题
    2. 对一个 NP 完全问题 gg,给出 g≤kfg \le_k f 的归约过程
    3. 证明 gg 的正确实例映射到 ff 的正确实例
    4. 证明 gg 的错误实例映射到 ff 的错误实例
      • 或证明逆否命题,即映射到 ff 的正确实例的 gg 实例都是正确的
  • 完整证明:

First of all, DominatingSet is in NP, as a dominating set SS can be served as a certificate, and it can be verified in polynomial time whether SS is a dominating set and whether ∣S∣=k|S|=k.

To show that DominatingSet is NP-complete, we present a reduction from VertexCover. Given a VertexCover instance (G=(V,E),k)(G=(V,E),k), we construct a DominatingSet instance (G′=(V′,E′),k′)(G^{\prime}=(V^{\prime},E^{\prime}),k^{\prime}) as follows.

The vertex set is V′=V∪EV^{\prime}=V\cup E, which is defined as follows. For each vertex v∈Vv\in V in the VertexCover instance, construct a vertex v‾∈V‾⊆V′\overline{v}\in\overline{V}\subseteq V^{\prime}; for each edge e∈Ee\in E in the VertexCover instance, construct a vertex we∈E‾⊆V′w_{e}\in\overline{E}\subseteq V^{\prime}.

The edge set E′E^{\prime} is defined as follows. For each edge e=(u,v)e=(u,v) in the VertexCover instance, build two edges (u‾,we),(v‾,we)∈E′(\overline{u},w_{e}),(\overline{v},w_{e})\in E^{\prime}. For any two vertices u‾,v‾\overline{u},\overline{v} in VV, build an edge (u‾,v‾)(\overline{u},\overline{v}).

Define k′=kk^{\prime}=k.

Suppose (G=(V,E),k)(G=(V,E),k) is a yes VertexCover instance. There exists a vertex cover S⊆VS\subseteq V with ∣S∣=k|S|=k. We will prove S‾\overline{S} corresponding SS is a dominating set in G′G'.

For each vertex in V‾\overline{V}, it is covered by any vertex in S‾\overline{S} as V‾\overline{V} forms a clique.

For each vertex wew_{e} in E‾\overline{E}, let e=(u,v)∈Ee=(u,v)\in E be the corresponding edge in the VertexCover instance. We have either u∈Su\in S or v∈Sv\in S (or both), as SS is a vertex cover. This implies either u‾∈S‾\overline{u}\in\overline{S} or v‾∈S‾\overline{v}\in\overline{S} (or both), which further implies wew_{e} is covered as (u‾,we),(v‾,we)∈E‾(\overline{u},w_{e}),(\overline{v},w_{e})\in\overline{E} by our construction.

Since ∣S‾∣=∣S∣=k=k′|\overline{S}|=|S|=k=k', the DominatingSet instance we constructed is a yes instance.

注:本文中所有图片均来自张宇昊老师的课程PPT。


NP 完全(2):归约与优化
https://cny123222.github.io/2025/06/12/NP-完全-2-:归约与优化/
Author
Nuoyan Chen
Posted on
June 12, 2025
Licensed under