ShanghaiTech CS140 | Lecture Note 01
Topic: NP and NP-completeness
Keyword: P, NP, NP-completeness, reduction
说明:笔记旨在整理我校CS130课程的基本概念。由于授课及考试语言为英文,故用英文为主,中文为辅的方式整理。由于是整理,尽提供最低限度的解释,以便提供简洁快速的查阅。
1 P 和 NP
1.0 The class P(P类型问题)
Def1.0.1: P is the set of all problems that can be solved by a polytime algorithm.
Def1.0.2: A polynomial time (polytime) algorithm is one that runs in time, for some constant k, when input has size n.
Recall: What does time mean? A asymptotic analysis of real running time f(n) via some evaluation. means that .
1.1 The class NP (NP类型问题)
常见谬误:认为NP类型问题就是不能用多项式时间解出的问题,实则是一个misnormer。NP类型问题在历史上,确实未被证明有多项式时间解出的solution。但是这不代表NP问题的定义是:不能用多项式时间解出的问题。准确地讲,该类问题应被称为非P问题。下面先对一些前提定义,再给出NP问题的定义。
Remark: NP = Nondeterministic polynomial time.
Def1.1.1: An instance of a problem consists of an input for the problem.
例子:排序问题的instance 可以是一个我们想要排序的集合 {3, 1, 2, 4}。in