|
| 1 | + |
| 2 | + \chapter{P/NP 基本概念} |
| 3 | + |
| 4 | + \begin{introduction} |
| 5 | + \item $P$,$NP$,$NPC$,$NP-Hard$问题定义 |
| 6 | + \item 多项式时间归约 |
| 7 | + \item NPC问题概述 |
| 8 | + \item P与NP的讨论 |
| 9 | + \end{introduction} |
| 10 | + |
| 11 | + \section{引入} |
| 12 | + \begin{table}[!htbp] |
| 13 | + \centering |
| 14 | + \caption{不同算法的复杂度} |
| 15 | + \begin{tabular}{cc} |
| 16 | + \toprule[0.5mm] |
| 17 | + Easy Problem & Hard Problem\\ |
| 18 | + (存在多项式复杂度的确定性算法)&(不知道是否存在多项式复杂度的确定性算法)\\ |
| 19 | + \midrule[0.4mm] |
| 20 | + 最短路问题&最长路径问题\\ \\ |
| 21 | + 2SAT问题&3SAT问题\\ \\ |
| 22 | + 2色问题&3色问题\\ |
| 23 | + \bottomrule |
| 24 | + \end{tabular} |
| 25 | + \end{table} |
| 26 | + |
| 27 | + \section{概念辨析} |
| 28 | + \begin{definition}{$P$类问题}{def1} |
| 29 | + $P$代表\textit{Polynomial},指存在多项式复杂度的算法的问题。 |
| 30 | + \end{definition} |
| 31 | + |
| 32 | + \begin{definition}{$NP$类问题}{def1} |
| 33 | + $NP$代表\textit{Non-deterministic Polynomial},指可以在多项式时间内验证一个解,或有一个多项式时间的非确定性算法的问题。 |
| 34 | + \end{definition} |
| 35 | + |
| 36 | + \begin{definition}{$NPC$类问题}{def3} |
| 37 | + $NPC$代表\textit{Non-deterministic Polynomial Complete},指满足以下两个条件的问题: |
| 38 | + |
| 39 | + (1)它是一个$NP$问题。 |
| 40 | + |
| 41 | + (2)所有的$NP$问题都可以在多项式时间归约到它。 |
| 42 | + \end{definition} |
| 43 | + |
| 44 | + \begin{definition}{$NP-Hard$类问题}{def4} |
| 45 | + 指满足$NPC$问题的第二条,但不一定要满足第一条的问题。 |
| 46 | + \end{definition} |
| 47 | + |
| 48 | + 为了更好的阐述这种关系,我们采用它们之间的关系图来对此进行描述,见\autoref{fig:relation-of-three-questions}: |
| 49 | + |
| 50 | + \begin{figure}[ht] |
| 51 | + \begin{minipage}[t]{1\linewidth} |
| 52 | + \centering |
| 53 | + \includegraphics[width=10cm,height=5cm]{image/P_NP1.png} |
| 54 | + \caption{$P$,$NP$,$NPC$,$NPhard$关系图}\label{fig:relation-of-three-questions} |
| 55 | + \end{minipage} |
| 56 | + \end{figure} |
| 57 | + |
| 58 | + \section{多项式时间归约} |
| 59 | + \subsection{多项式时间归约的定义与性质} |
| 60 | + 在讨论$NPC$问题时我们谈到了多项式时间规约,这里给出了多项式时间规约的定义: |
| 61 | + \begin{definition}{多项式时间规约}{def5} |
| 62 | + 多项式时间归约:如果问题$X$和问题$Y$满足以下两条性质,那么问题$X$可以在多项式时间归约到问题$Y$,记作$X\leq_pY$: |
| 63 | + |
| 64 | + (1)问题$X$可以通过多项式时间的基本运算步骤转换为问题。 |
| 65 | + |
| 66 | + (2)问题$X$多项式次调用求解问题Y的算法。 |
| 67 | + \end{definition} |
| 68 | + 有关多项式时间规约,有以下四条性质: |
| 69 | + \begin{theorem}{多项式规约的四条性质}{} |
| 70 | + \begin{enumerate} |
| 71 | + \item 如果$X\leq_pY$且$Y$能在多项式时间内求解,则$X$也能在多项式时间内求解。 |
| 72 | + \item 如果 $X\leq_pY$,且$Y$不能在多项式时间内求解,则$X$也不能在多项式内求解。 |
| 73 | + \item 如果$X\leq_pY$且$Y\leq_pX$,则$X$,$Y$多项式等价,记为$X\equiv_pY$。若$X$,$Y$中一方能在多项式时间内求解则另一方也能在多项式时间内求解。 |
| 74 | + \item 归约的传递性:若$Z\leq_pY$且$Y\leq_pX$,则$Z\leq_pX$。 |
| 75 | + \end{enumerate} |
| 76 | + |
| 77 | + \end{theorem} |
| 78 | + |
| 79 | +\paragraph*{以下有三点提醒:} |
| 80 | + |
| 81 | +\begin{itemize} |
| 82 | + \item 注意体会上述两个定理中$X$与$Y$的表达顺序; |
| 83 | + \item 第二条定理的证明可以采用反证法,假设$X$可以在多项式时间内求解,因为$Y$能够在多项式时间内归约到$X$问题求解,所以$Y$也能在多项式时间内求解,矛盾; |
| 84 | + \item $X$的问题比$Y$更“难”。 |
| 85 | +\end{itemize} |
| 86 | + |
| 87 | + \subsection{规约问题的举例——染色问题(Graph Coloring)} |
| 88 | + |
| 89 | +\begin{itemize} |
| 90 | +\item $P_1$ (decision version):可用$K$种颜色完成染色 |
| 91 | +\item $P_2$ (optimal version):最少用$K$种颜色完成染色 |
| 92 | +\end{itemize} |
| 93 | + |
| 94 | +以下有两种情况: |
| 95 | + |
| 96 | + |
| 97 | + \begin{enumerate} |
| 98 | + \item $P_1\leq_pP_2$ |
| 99 | + |
| 100 | +将$K$值依次从2依次递增,直到$P_1$判定第一个满足的数记为$K_0$,则$K_0$为$P_2$的解,即满足$P_1$的最小的$K$(也就是$K_0$)为$P_2$的解。 |
| 101 | + |
| 102 | +过程见\autoref{fig:P1-leq-P2}: |
| 103 | + |
| 104 | + |
| 105 | + \begin{figure}[ht] |
| 106 | + \begin{minipage}[t]{1\linewidth} |
| 107 | + \centering |
| 108 | + \includegraphics[width=15cm,height=7.5cm]{image/P_NP2.png} |
| 109 | + \caption{$P_1\leq_pP_2$时过程图}\label{fig:P1-leq-P2} |
| 110 | + \end{minipage} |
| 111 | + \end{figure} |
| 112 | + |
| 113 | + |
| 114 | + \item $P_2\leq_pP_1$ |
| 115 | + |
| 116 | + 直接利用$P_2$解出$K_0$,判断$K$与$K_0$的关系,若$K\geq K_0$则成立,即可以使用$K_0$种颜色完成染色。 |
| 117 | + |
| 118 | +过程见\autoref{fig:P2-leq-P1}: |
| 119 | + \end{enumerate} |
| 120 | + |
| 121 | + |
| 122 | + \begin{figure}[ht] |
| 123 | + \begin{minipage}[t]{1\linewidth} |
| 124 | + \centering |
| 125 | + \includegraphics[width=15cm,height=7.5cm]{image/P_NP3.png} |
| 126 | + \caption{$P_2\leq_pP_1$时过程图}\label{fig:P2-leq-P1} |
| 127 | + \end{minipage} |
| 128 | + \end{figure} |
| 129 | + |
| 130 | +\newpage |
| 131 | + \section{NPC问题} |
| 132 | + \subsection{NPC概述} |
| 133 | + |
| 134 | +\paragraph*{$NPC$问题的证明思路} |
| 135 | + |
| 136 | + |
| 137 | +要证明一个问题是$NPC$问题,先证明它是一个$NP$问题,然后再证明一个已知的$NPC$问题能在多项式时间归约到它。 |
| 138 | + |
| 139 | +\paragraph*{$NPC$问题与$NP$问题之间的关系} |
| 140 | + |
| 141 | + |
| 142 | +$NPC$问题是比普通的$NP$问题更复杂一点的问题,如果找到一个$NPC$的多项式复杂度算法,也就能够通过降阶的方式将这个算法改造成解决任意一个确定的$NP$问题的多项式复杂度算法。意味着存在一个通用的万能算法,能够解决所有$NP$问题,这样只要找到一个$NPC$的多项式算法也就证明了$P=NP$。 |
| 143 | + |
| 144 | +\paragraph*{$NPC$问题举例} |
| 145 | + \subparagraph*{} |
| 146 | + |
| 147 | + \begin{table}[ht] |
| 148 | + \centering |
| 149 | + \caption{NPC问题举例} |
| 150 | + \begin{tabular}{p{100pt}p{200pt}} |
| 151 | + \toprule[0.5mm] |
| 152 | + 问题 & 描述\\ |
| 153 | + \midrule[0.4mm] |
| 154 | + 布尔可满足性问题&给定一个布尔方程,判断是否存在一组布尔变量的真值指派使整个方程为真的问题\\ \\ |
| 155 | + 最小顶点覆盖问题&给定图$G=(V,E)$和数$k$,判定是否存在包含大小至多为$k$的顶点覆盖。\\ \\ |
| 156 | + 集合覆盖问题&给定全集$U$,以及一个包含$n$个集合且这$n$集合的并集为全集的集合$S$。集合覆盖问题要找到的一个最小的子集$S$,使得他们的并集等于全集\\ \\ |
| 157 | + 哈密尔顿回路&给定图$G$,判定其是否经过图中每个顶点且仅一次的回路。\\ |
| 158 | + \bottomrule |
| 159 | + \end{tabular} |
| 160 | + \end{table} |
| 161 | +\section{关于P与NP的讨论 (P=NP?)} |
| 162 | + |
| 163 | +\begin{itemize} |
| 164 | + \item$P\subseteq NP$ |
| 165 | + |
| 166 | +如果一个问题能够在多项式时间求解,那么这个问题则一定可以在多项式时间内被验证 |
| 167 | + |
| 168 | + \item $P$是否能够等于$NP$,即等价于一个问题的结果如果能够用多项式复杂度的算法来验证,那么是否存在多项式算法来得出这个结果。现在没人能够证明这一点。 |
| 169 | + \item 证明的关键点在于能否找到一个$NPC$的多项式算法。但$NPC$问题目前没有多项式算法,只能用穷举法逐个检验得到答案。所以现在科学家们普遍认为$P\neq NP$ |
| 170 | + \item 假设证明了$P= NP$,目前的加密技术就会没有前途,因为目前的加密技术是将一个整数分解为几个因数的乘积,正是因数分解过程烦琐,才保证了信息的安全。 |
| 171 | +\end{itemize} |
| 172 | + |
| 173 | +以下列出了$P= NP$与$P\neq NP$两种情况的情况见\autoref{fig:P-eq-NP}和\autoref{fig:P-neq-NP}: |
| 174 | + |
| 175 | + \begin{figure}[!htbp] |
| 176 | + \begin{minipage}[t]{1\linewidth} |
| 177 | + \centering |
| 178 | + \includegraphics[width=4cm,height=6cm]{image/P_NP4.png} |
| 179 | + \caption{$P= NP$时关系图图}\label{fig:P-eq-NP} |
| 180 | + \end{minipage} |
| 181 | + \end{figure} |
| 182 | + |
| 183 | + \begin{figure}[!htbp] |
| 184 | + \begin{minipage}[t]{1\linewidth} |
| 185 | + \centering |
| 186 | + \includegraphics[width=4cm,height=6cm]{image/P_NP5.png} |
| 187 | + \caption{$P\neq NP$时关系图} \label{fig:P-neq-NP} |
| 188 | + \end{minipage} |
| 189 | + \end{figure} |
| 190 | + |
0 commit comments