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

2 minute read

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


Satisfiability ๋ฌธ์ œ, ์ค„์—ฌ์„œ SAT ๋ฌธ์ œ๋Š” ์ฃผ์–ด์ง„ Boolean formula๋ฅผ ๋งŒ์กฑ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” true/false ๊ฐ’์„ Boolean ๋ณ€์ˆ˜๋“ค์— ์ ์ ˆํžˆ ํ• ๋‹นํ•˜๋Š” ๋ฌธ์ œ๋‹ค. ๊ตฌ์ฒด์ ์œผ๋กœ Boolean formula๋Š” CNF(conjunctive normal form) ํ˜•ํƒœ๋กœ ์ฃผ์–ด์ง„๋‹ค.

\[(x \lor y \lor z) (x \lor \bar{y}) (y \lor \bar{z}) (z \lor \bar{x}) (\bar{x} \lor \bar{y} \lor \bar{z})\]

โ€œGiven a Boolean formula in CNF, either find a satisfying truth assignment or report โ€˜none existsโ€™.โ€

๋‹จ์ˆœํ•˜๊ฒŒ ์™„์ „ ํƒ์ƒ‰์œผ๋กœ ์ ‘๊ทผํ•˜๋ฉด, $n$๊ฐœ์˜ boolean variable์— ๋Œ€ํ•ด $2^n$๊ฐœ์˜ ๊ฐ€๋Šฅํ•œ ๋ชจ๋“  assignment๋ฅผ ์ˆœํšŒํ•˜๋ฉฐ ์ฃผ์–ด์ง„ Boolean formula์— ํ• ๋‹นํ•ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ฉด ๋œ๋‹ค. ๊ทธ๋ž˜์„œ SAT ๋ฌธ์ œ๋Š” ์ด์ง„ ํŠธ๋ฆฌ๋ฅผ ํƒ์ƒ‰ํ•˜๋Š” ์ „ํ˜•์ ์ธ search problem์— ์†ํ•œ๋‹ค.


Variation of SAT

์•„๋ฌด ์ œ์•ฝ์กฐ๊ฑด์ด ์—†๋Š” ์ˆœ์ˆ˜ํ•œ SAT ๋ฌธ์ œ๋ฅผ ํ‘ธ๋Š” ๊ฒƒ์€ NP์ง€๋งŒ, ์•„๋ž˜์˜ ๋ณ€ํ˜•์— ๋Œ€ํ•ด์„  ํšจ๊ณผ์ ์ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ์ œ์‹œ๋˜์—ˆ๋‹ค!

Horn formula

โ€œAll clauses contain at most one positive literal. Find a satisfying truth assignment.โ€

Greedy Algorithm์„ ํ†ตํ•ด linear-time์— ํ•ด๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ๋‹ค.

2 SAT

โ€œAll clauses have only two literals. Find a satisfying truth assignment.โ€

Strongly Connected Components ๋ฌธ์ œ๋กœ ํ™˜์›(reduction)ํ•ด linear-time์— ํ•ด๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ๋‹ค.

์œ„ ๋ฌธ์ œ๋“ค์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ ๋ณ„๋„์˜ ํฌ์ŠคํŠธ์—์„œ ํƒ๊ตฌํ•ด๋ณด๋„๋ก ํ•˜๊ณ  ์ง€๊ธˆ์€ SAT ๋ฌธ์ œ๊ฐ€ ๋ฌด์—‡์ธ์ง€๋งŒ ํ™•์ธํ•˜๊ณ  ๋„˜์–ด๊ฐ€์ž.


SAT ๋ฌธ์ œ๋Š” NP ๋ฌธ์ œ ์ค‘์—์„œ ๊ธฐ๋ณธ์ด ๋˜๋Š” ๋ฌธ์ œ๋‹ค. ๊ทธ๋ž˜์„œ ๊ฑฐ์˜ ๋ชจ๋“  NP ๋ฌธ์ œ๋“ค์ด SAT ๋ฌธ์ œ์˜ ๊ผด๋กœ ํ™˜์›ํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•ด๋‹น ๋‚ด์šฉ์€ ์ถ”ํ›„์— Reduction ํฌ์ŠคํŠธ์—์„œ ๋” ์‚ดํŽด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค.

Problem Solving

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