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

5 minute read

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

์ด๋ฒˆ์— ์‚ดํŽด๋ณผ <Independent Set>, <Vertex Cover>, ๊ทธ๋ฆฌ๊ณ  <Clique> ๋ชจ๋‘ ๊ทธ๋ž˜ํ”„ ์œ„์—์„œ ์ •์˜๋˜๋Š” Search Problem์ด๋‹ค. ๊ทธ๋ฆฌ๊ณ  3๊ฐ€์ง€ ๋ฌธ์ œ ๋ชจ๋‘ ์„œ๋กœ ๋™์น˜๋‹ค!

Independent Set Problem

Problem. Independent Set Problem

Given a graph and a goal $g$, find $g$ vertices that are independent, that is, no two of which have an edge btw them.

์ด ๋ฌธ์ œ๋Š” ์˜ˆ์ „์— DP ์ฑ•ํ„ฐ์—์„œ ํŠธ๋ฆฌ(Tree) ๋ฒ„์ „์—์„œ ์‚ดํŽด๋ณธ ์ ์ด ์žˆ๋‹ค: Independent Sets in Tree ์ด ๊ฒฝ์šฐ๋Š” DP ํ…Œํฌ๋‹‰์„ ํ†ตํ•ด ์„ ํ˜• ์‹œ๊ฐ„ ๋งŒ์— ๋‹ต์„ ๊ตฌํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ด๋ฒˆ์—๋Š” ๊ทธ๋ž˜ํ”„(Graph) ์œ„์—์„œ์˜ Independent Set Problem์ด๋‹ค. ๊ทธ๋ž˜ํ”„ ์œ„์—์„œ๋Š” polynomial time algorithm์ด ์กด์žฌํ•˜์ง€ ์•Š๋Š”๋‹ค.

Vertex Cover Problem

Problem. Vertex Cover Problem

Given a graph and a budget $b$, find $b$ vertices that cover every edge.

<Vertex Cover> ๋ฌธ์ œ์˜ ๊ฒฝ์šฐ, <Set Cover> ๋ฌธ์ œ์˜ ํŠน์ˆ˜ํ•œ ๊ฒฝ์šฐ๋ผ๊ณ  ํ•œ๋‹ค. ๊ทธ์ „์— <Set Cover> ๋ฌธ์ œ๋ž€ ๋ญ˜๊นŒ?

Problem. Set Cover Problem

Given a set $B$ and its subsets $S_1, โ€ฆ, S_m \subseteq B$, find a selection of the $S_i$ whose union is $B$. The number of sets picked should be minimized.

<Vertex Cover> ๋ฌธ์ œ๋Š” ์ปค๋ฒ„ํ•ด์•ผ ํ•  ์ง‘ํ•ฉ์„ edge set $E$๋กœ ๋‘๊ณ , ๊ฐ ๋…ธ๋“œ $v_i$์— ์—ฐ๊ฒฐ๋œ edge subset์„ $S_i$๋กœ ์ œ์‹œ๋œ <Set Cover> ๋ฌธ์ œ์˜ ์ผ์ข…์ด๋‹ค. <Set Cover> ๋ฌธ์ œ์˜ ๊ฒฝ์šฐ, polynomial time algorithm์€ ์กด์žฌํ•˜์ง€ ์•Š๊ณ , Greedy Algorithm์„ ํ†ตํ•œ ๊ทผ์‚ฌ(approximation) ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ์กด์žฌํ•œ๋‹ค. ์ถ”ํ›„์— ๋ณ„๋„์˜ ํฌ์ŠคํŠธ๋ฅผ ํ†ตํ•ด <Set Cover> ๋ฌธ์ œ์— ๋Œ€ํ•ด ๋” ์‚ดํŽด๋ณด๊ฒ ๋‹ค.

Clique Problem

<Clique>๋Š” โ€œcomplete subgraphโ€๋กœ ๋ถ€๋ถ„ ๊ทธ๋ž˜ํ”„ ์ค‘ complete graph์ธ ๋…€์„์„ ๋งํ•œ๋‹ค. ๊ทธ๋ž˜์„œ ๊ทธ๋ž˜ํ”„ ์œ„์—์„œ ์ •์˜๋œ <Clique Problem>์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

Problem. Clique Problem

Given a graph with $n$ vertices and a budget $b$, find a set of $b$ vertices such that all possible edges tw tem are present.


Reduction

Independent Set and Vertex Cover

<Independent Set> ๋ฌธ์ œ์™€ <Vertex Cover> ๋ฌธ์ œ๋Š” ์„œ๋กœ ๋™์น˜์ด๋‹ค! ์œ„์˜ ๊ฒฐ๊ณผ๋ฅผ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋“ฏ, <Independent Set> ๋ฌธ์ œ์—์„œ ์„ ํƒ๋œ ์ •์ ์„ ์ œ์™ธํ•œ ์ •์ ๋“ค์ด <Vertex Cover> ๋ฌธ์ œ์˜ solution์ž„์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

Claim.

\[\text{Vertex Cover} \equiv_P \text{Independent Set}\]

$\equiv_P$๋Š” โ€œpolynomial-time equivalentโ€๋ผ๋Š” ์˜๋ฏธ์ด๋‹ค. ์ด๊ฒƒ์— ๋Œ€ํ•ด์„  ํ™˜์›(reduction) ํŒŒํŠธ์—์„œ ์ž์„ธํžˆ ์‚ดํŽด๋ณด๊ฒ ๋‹ค.

Proof.

We will show $S$ is an independent set iff $V \setminus S$ is a vertex cover.


($\implies$)

Let $S$ be any independent set. Consider an arbitrary edge $(u, v)$. Since $S$ is an independent set, any edge $(u, v)$ in $G$ donโ€™t have the ends on $S$. This means it cannot be $u \in S$ and $v \in S$, so $u \notin S$ or $v \notin S$. This implies that $u \in V \setminus S$ or $v \in V \setminus S$. It is enough to cover an edge $(u, v)$ that one of end belongs to $V \setminus S$. Thus, $V \setminus S$ covers $(u, v)$.


($\impliedby$)

Let $V \setminus S$ be any vertex cover. Consider two nodes $u \in S$ and $v \in S$. This means two vertices $u$, $v$ is not in $V \setminus S$. Since $V \setminus S$ is a vertex cover, this non-existence means the graph does not have edge $(u, v)$. (If two nodes have an edge, one of two should be in a vertex cover $V \setminus S$) Thus, no two nodes in $S$ are joined by an edge, which implies that $S$ is an independent set.

Independent Set and Clique

์ด๋ฒˆ์—๋Š” <Independent Set> ๋ฌธ์ œ์™€ <Clique> ๋ฌธ์ œ๋ฅผ ์‚ดํŽด๋ณด์ž. ๋‘ ๋ฌธ์ œ ์—ญ์‹œ ๋™์น˜์ธ๋ฐ, ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

For a graph $G = (V, E)$, define the complement graph $\bar{G} = (V, \bar{E})$. Then, an independent set $S$ of $G$ is a clique of $\bar{G}$.

์ฆ‰, <Clique> ๋ฌธ์ œ๋ฅผ ํ’€๊ณ  ์‹ถ๋‹ค๋ฉด, ์ฃผ์–ด์ง„ ๊ทธ๋ž˜ํ”„์˜ complement๋ฅผ ์ทจํ•ด <Independent Set> ๋ฌธ์ œ๋ฅผ ํ’€๋ฉด ๋˜๋Š” ๊ฒƒ์ด๋‹ค!

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