2020-1ํ•™๊ธฐ, ๋Œ€ํ•™์—์„œ โ€˜์•Œ๊ณ ๋ฆฌ์ฆ˜โ€™ ์ˆ˜์—…์„ ๋“ฃ๊ณ  ๊ณต๋ถ€ํ•œ ๋ฐ”๋ฅผ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. ์ง€์ ์€ ์–ธ์ œ๋‚˜ ํ™˜์˜์ž…๋‹ˆ๋‹ค :)

6 minute read

2020-1ํ•™๊ธฐ, ๋Œ€ํ•™์—์„œ โ€˜์•Œ๊ณ ๋ฆฌ์ฆ˜โ€™ ์ˆ˜์—…์„ ๋“ฃ๊ณ  ๊ณต๋ถ€ํ•œ ๋ฐ”๋ฅผ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. ์ง€์ ์€ ์–ธ์ œ๋‚˜ ํ™˜์˜์ž…๋‹ˆ๋‹ค :)


(Review) P and NP

P-and-NP

์ž ๊น ์ด์ „ ๋‚ด์šฉ์„ ๋ณต์Šตํ•ด๋ณด์ž.

  • $\textbf{NP}$: the class of all search problems
  • $\textbf{P}$: the class of all search problems that can be solved in polynomial time.

๊ทธ๋ฆฌ๊ณ  $\textbf{P} = \textbf{NP}$ ์ธ์ง€ $\textbf{P} \neq \textbf{NP}$ ์ธ์ง€์— ๋Œ€ํ•œ ๋…ผ์Ÿ๋„ ์ž ๊น ๋‹ค๋ค˜๋‹ค. ๋Œ€๋ถ€๋ถ„์˜ ์—ฐ๊ตฌ์ž๋“ค์€ $\textbf{P} \neq \textbf{NP}$๋ผ๊ณ  ๋ฏฟ๊ณ  ์žˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ $\textbf{P} \neq \textbf{NP}$์ž„์„ ๋ฐํžˆ๋Š” ๋ช…ํ™•ํ•œ ์ฆ๋ช…์ด ์žˆ๋Š” ๊ฑด ์•„๋‹ˆ๋‹ค. ๊ทธ๋“ค์€ ์™œ $\textbf{P} \neq \textbf{NP}$๋ผ๊ณ  ๋ฏฟ๋Š” ๊ฑธ๊นŒ?

๊ทธ๋“ค์€ โ€˜์ฆ๊ฑฐโ€™๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค! $\textbf{NP}$์— ์†ํ•˜๋Š” ๋ช‡๋ช‡ search problem์€ ๋ช‡์‹ญ๋…„, ๋ช‡๋ฐฑ๋…„์ด ๊ฑธ๋ ค๋„ ํšจ์œจ์ ์ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ฐพ์„ ์ˆ˜ ์—†์—ˆ๋‹ค๋Š” ๊ฒฝํ—˜์ ์ธ ์ฆ๊ฑฐ๊ฐ€ ์žˆ๋‹ค. ๋˜, ํ•˜๋‚˜์˜ ์ฆ๊ฑฐ๋Š” ํ™˜์›(Reduction)์œผ๋กœ, ๊ทธ๋Ÿฐ hardest problem๋“ค์ด equivalent under reduction๋ผ๋Š” ๊ฒƒ์ด ์ฆ๋ช… ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค!

What reductions demonstrate is that the problems are all, in some sense, exactly the same problem, except that they are stated in different languages.

์ด๋ฒˆ ์ฑ•ํ„ฐ์—์„œ๋Š” $\textbf{NP}$์˜ hardest problem๋“ค์ด ์–ด๋–ป๊ฒŒ equivalent under reduction ํ•œ์ง€ ๊ฐ€๋ณ๊ฒŒ ์‚ดํŽด๋ณด๊ฒ ๋‹ค.


Reduction

Definition. Reduction (search problem)

A reduction from search problem $A$ to search problem $B$ is a polynomial-time algorithm $f$ that transforms any instance $I$ of $A$ into an instance $f(I)$ of $B$.

Together with another polynomial-time algorithm $h$ that maps any solution $S$ of $f(I)$ back into a solution $S$ of $f(I)$ back into a solution $h(S)$ of $I$.

์ฆ‰, <Reduction>์ด๋ผ ํ•จ์€

  • instance $I$๋ฅผ ๋ณ€ํ™˜(transform) ํ•˜๋Š” polynomial-time algorithm $f$
  • $f(I)$์˜ solution $S$๋ฅผ $I$์˜ solution์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” polynomial-time algorithm $h$

์ฆ‰ $f$์™€ $h$, 2๊ฐ€์ง€ ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ํ•„์š”ํ•œ ์ž‘์—…์ด๋‹ค!


๊ทธ๋Ÿฐ๋ฐ <Reduction>์„ ํ•˜๋Š” ์ด์œ ๊ฐ€ ๋ญ˜๊นŒ? ๊ฑฐ๊ธฐ์—” 2๊ฐ€์ง€ ๋ชฉ์ ์ด ์žˆ๋‹ค.

  1. We know how to solve $B$ efficiently, and want to utilize it to solve $A$
  2. We know $A$ is hard, and use the reuction to prove $B$ is hard as well.

๋ณดํ†ต์˜ ๊ฒฝ์šฐ๋“ค์—๋Š” ๋ชฉ์  1์„ ์ด๋ฃจ๊ธฐ ์œ„ํ•ด <Reduction> ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ด๋ฒˆ ๊ฒฝ์šฐ์—๋Š” Problem B๊ฐ€ Problem A๋งŒํผ โ€˜์–ด๋ ต๋‹คโ€˜๋Š” ์ฆ๋ช…ํ•˜๋Š” ๋ชฉ์  2๋ฅผ ์œ„ํ•ด์„œ <Reduction> ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•œ๋‹ค!!

๋ณธ์ธ์€ ์ฒ˜์Œ์— ์œ„์˜ ๋ฌธ์žฅ๋“ค์ด ์ž˜ ์ดํ•ด๊ฐ€ ์•ˆ ๋˜์—ˆ๋‹ค. Reduction์œผ๋กœ ์œ ๋„๋˜๋Š” Problem B์˜ Difficulty๊ฐ€ ๋ถ€์ž์—ฐ์Šค๋Ÿฌ์›Œ ๋ณด์˜€๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ๋ณธ์ธ์€ Reduction์€ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ์ˆ˜๋‹จ, ์ฆ‰ ๋ชฉ์  1์— ๋Œ€ํ•ด์„œ๋งŒ ์˜จ์ „ํžˆ ์ดํ•ดํ•˜๊ณ  ์žˆ์—ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ Wikipedia์— ๊ธฐ์ˆ ๋œ ์•„๋ž˜ ๊ตฌ์ ˆ์„ ์ฝ๊ณ  ๋ชฉ์  2๋ฅผ ์˜จ์ „ํžˆ ์ดํ•ดํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.

Intuitively, problem A is reducible to problem B if an algorithm for solving B efficiently could also be used as a subroutine to solve problem A efficiently. When this is true, solving A cannot be harder than solving B. โ€œHarderโ€ means having a higher estimate of the required computational resources in a given context.

์ฆ‰, problem A์—์„œ problem B๊ฐ€ Reduction์ด ๊ฐ€๋Šฅํ•œ ์ˆœ๊ฐ„๋ถ€ํ„ฐ Difficulty์— ๋Œ€ํ•œ bound๊ฐ€ ์ƒ๊ธฐ๋Š” ์…ˆ์ด๋‹ค. ๊ทธ๊ฒƒ์€ โ€˜solving A cannot be harder than solving Bโ€™๋ผ๋Š” ๋ฌธ์žฅ์œผ๋กœ ํ‘œํ˜„๋œ๋‹ค. ์ด๊ฒƒ์€ Difficulty of B๊ฐ€ Difficulty of A์˜ upper bound๊ฐ€ ๋œ๋‹ค๋Š” ์…ˆ์ด๋ฉฐ, ๋ฐ”๊ฟ”๋งํ•˜๋ฉด Difficulty of A๊ฐ€ B์˜ lower bound๊ฐ€ ๋œ๋‹ค๋Š” ์…ˆ์ด๋‹ค.

\[A \rightarrow B \implies \text{Dfficulty of A} \le \text{Difficulty of B}\]

Reduction๋ฅผ ์ˆ˜์‹์œผ๋กœ ํ‘œํ˜„๋ฉด $A \rightarrow B$ ๋˜๋Š” $A \le_p B$๋กœ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. โ€œ$B$ is polynomial-time reducible to $A$โ€๋ผ๊ณ  ์ฝ์œผ๋ฉด ๋œ๋‹ค. $A \le_m B$๋„ ์žˆ๋Š”๋ฐ, subscript๊ฐ€ $p$์ธ์ง€ $m$์ธ์ง€์— ๋”ฐ๋ผ mapping reduction, polynomial reduction์œผ๋กœ ๋‚˜๋‰œ๋‹ค. ์ด์— ๋Œ€ํ•ด์„œ๋Š” ๋ณ„๋„์˜ ํฌ์ŠคํŠธ์—์„œ ๋‹ค๋ฃจ๋„๋ก ํ•˜๊ฒ ๋‹ค.

NP-complete

์ด์ œ <Reduction>์ด ๋ฌด์—‡์ธ์ง€ ๋Œ€์ถฉ ์•Œ์•˜์œผ๋‹ˆ $\textbf{NP-complete}$์˜ ๊ฐœ๋…์„ ์ •์˜ํ•ด๋ณด๊ฒ ๋‹ค.

Definition. $\textbf{NP-complete}$

A search problem is $\textbf{NP-complete}$ if all other search problems reduce to it.

ํ…์ŠคํŠธ์™€ ํ•จ๊ป˜ ์•„๋ž˜ ๊ทธ๋ฆผ์„ ์‚ดํŽด๋ณด์ž.

์œ„ ๊ทธ๋ฆผ์„ ๋ณด๋ฉด, ๋ชจ๋“  Search Problem, ์ฆ‰ $\textbf{NP}$ ๋ฌธ์ œ๊ฐ€ <SAT>๋กœ reduction ๋˜๋Š” ๊ฑธ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ๋”ฐ๋ผ์„œ <SAT>๋Š” $\textbf{NP-complete}$๋‹ค. ๊ทธ์™ธ์— ์šฐ๋ฆฌ๊ฐ€ ์‚ดํŽด๋ดค๋˜ <3-SAT>, <Independent Set Problem> ๋“ฑ์ด ์ผ๋ จ์˜ Reduction์„ ๊ฑฐ์ณ์„œ ๋‹ค์‹œ <SAT>๋กœ ํ™˜์›๋œ๋‹ค. ๋”ฐ๋ผ์„œ ์œ„ ๊ทธ๋ฆผ์— ๋“ฑ์žฅํ•˜๋Š” Search Problem ๋ชจ๋‘ $\textbf{NP-complete}$๋‹ค!

์‚ฌ์‹ค ์œ„ ๊ทธ๋ฆผ์„ ์ง„์ •์œผ๋กœ ์ดํ•ดํ•˜๋ ค๋ฉด, <Reduction>์ด composition property๋ฅผ ๊ฐ–๋Š”๋‹ค๋Š” ์‚ฌ์‹ค์„ ์•Œ์•„์•ผ ํ•œ๋‹ค.

For reduction,

If $A \rightarrow B$ and $B \rightarrow C$, then $A \rightarrow C$

<Reduction>์˜ composition property๋ฅผ ํ• ์šฉํ•˜๋ฉด, โ€œAll NP โ†’ ???โ€๋ฅผ ์ฆ๋ช…ํ•˜์ง€ ์•Š๊ณ , โ€œAll NP โ†’ SATโ€๋ฅผ ๋ณด์ธ ํ›„์— โ€œSAT โ†’ ???โ€๋ฅผ ๋ณด์ด๋ฉด, โ€œAll NP โ†’ ???โ€๋ฅผ ์ฆ๋ช…ํ•˜๋Š”๋ฐ ์ถฉ๋ถ„ํ•˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค!

๋ณธ์ธ ๊ต์žฌ์—์„œ๋Š” $\textbf{NP-complete}$๋ฅผ NP problem์˜ reduction ๊ฐ€๋Šฅ์„ฑ์œผ๋กœ ์ •์˜ ๋‚ด๋ ธ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋‹ค๋ฅธ ์ž๋ฃŒ์—์„œ๋Š” $\textbf{NP-hard}$๋ฅผ ์ •์˜ํ•˜๊ณ , ์ด๋ฅผ ํ™œ์šฉํ•ด $\textbf{NP-complete}$๋ฅผ ์ •์˜ํ•œ๋‹ค. ๊ทธ๋ž˜์„œ ์•„๋ž˜์™€ ๊ฐ™์€ Complexity Space๋ฅผ ์ œ๋Œ€๋กœ ์ดํ•ดํ•˜๋ ค๋ฉด, โ€œNP-complete and NP-hardโ€ ํฌ์ŠคํŠธ๋ฅผ ์‚ดํŽด๋ณด๋„๋ก ํ•˜์ž. ๋˜๋Š” Reduction์˜ ์ผ€์ด์Šค๋“ค์„ ๋จผ์ € ์‚ดํŽด๋ณด๊ณ  $\textbf{NP-complete}$๋ฅผ ์ดํ•ดํ•ด๋„ ์ข‹๋‹ค.

P-and-NP


์ž! ์ด์ œ ๋ช‡ ํŽธ์˜ ํฌ์ŠคํŠธ์— ๊ฑธ์ณ์„œ ์ด์ œ๊ป ์‚ดํŽด๋ดค๋˜ $\textbf{NP}$ ๋ฌธ์ œ๋“ค์ด ์–ด๋–ป๊ฒŒ ์„œ๋กœ <Reduction> ๋˜๋Š”์ง€ ์‚ดํŽด๋ณผ ๊ฒƒ์ด๋‹ค.

ํ•จ๊ป˜๋ณด๊ธฐ

References