NP completeness(NP完整性)(Introduction to Algorithms, 算法导论,CLRS)学习笔记

本文是《算法导论》中关于NP完全性的学习笔记,详细探讨了P类问题和NP类问题的定义,以及如何验证解决方案。重点介绍了HAM-CYCLE问题、CIRCUIT-SAT的NP完全性和多项式时间归约。通过证明CIRCUIT-SAT的NP完全性,展示了如何证明一个问题属于NPC。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

NP completeness

  • Here we use binary string in our problems;
  • Call an instance of a problem language, and x∈{ 0,1}∗x\in\{0,1\}^*x{ 0,1} means the input of the language x is encoded in binary; A(X)=1/0A(X)=1/0A(X)=1/0 means there is a verification algorithm AAA that accepts /rejects the language LLL.
  • xxx in a language is a certain instance(in binary string), remember!!!
  • yyy is one certificate for a instance. A(x,y)=1A(x,y)=1A(x,y)=1(AAA is a verification algorithm running in polynomial time) means yyy is a certificate for instance xxx.

1. Definition of PPP

The language LLL could be accept by an algorithm AAA in polynomial time.

2. Definition of NP

2.1 The HAM−CYCLEHAM-CYCLEHAMCYCLE problem and verification

  • Verification: AAA verifies ccc is a solution to xxx.

  • HAM-CYCLE: An undirected graph G is hamiltonian if it contains a simple cycle containing every vertex of G.

  • Verifying HAM-CYCLE

2.2 Verifying a language

2.3 The complexity of NP

  • Definition: L={ x∈{ 0,1}∗∣L=\{x\in\{0,1\}^*|L={ x{ 0,1} there is a y∈{ 0,1}∗y\in\{0,1\}^*y{ 0,1} with ∣y∣=O(∣x∣c)|y|=O(|x|^c)y=O(xc) such that A(x,y)=1}A(x,y)=1\}A(x,y)=1}
  • If L∈PL\in PLP then L∈NPL\in NPLNP: we can easily find a verification algorithm for a P class language which runs in polynomial time.

2.4 Polynomial-time reducibility

  • L1≤PL2∧L2∈P−−>L1∈PL_1\le_{P}L_2\land L_2\in P-->L_1\in PL1PL2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值