fullscreen
timer
qrcode
plickers
selector
edit
reset

intractibility 1 (8)

packing and covering problems

independent set

\(\IndependentSet\): Given a graph \(G=(V,E)\) and an int \(k\), is there a subset of \(k\) (or more) vertices such that no two are adjacent?

Ex: Is there an independent set of size \(\geq 6\)?

Ex: Is there an independent set of size \(\geq 7\)?

vertex cover

\(\VertexCover\): Given a graph \(G=(V,E)\) and an integer \(k\), is there a subset of vertices of \(k\) (or fewer) vertices such that each edge is incident to at least one vertex in the subset?

Ex: Is there a vertex cover of size \(\leq 4\)?

Ex: Is there a vertex cover of size \(\leq 3\)?

quiz: intractibility

live view ]

Consider the following graph \(G\). Which are true?

  1. The white vertices are a vertex cover of size \(7\)
  2. The black vertices are an independent set of size \(3\)
  3. Both A and B
  4. Neither A nor B

vertcover and indset reduce to one another

Theorem: \(\VertexCover \equiv_P \IndependentSet\)

Pf: We show \(S\) is an independent set of size \(k\) iff \(V - S\) is a vertex cover of size \(n-k\)


vertcover and indset reduce to one another

Theorem: \(\VertexCover \equiv_P \IndependentSet\)

Pf: We show \(S\) is an independent set of size \(k\) iff \(V - S\) is a vertex cover of size \(n-k\)

Pf ⇒:

vertcover and indset reduce to one another

Theorem: \(\VertexCover \equiv_P \IndependentSet\)

Pf: We show \(S\) is an independent set of size \(k\) iff \(V - S\) is a vertex cover of size \(n-k\)

Pf ⇐:

Set cover

\(\SetCover\): Given a set \(U\) of elements, a collection of \(m\) subsets of \(U\) (\(S_1\), \(S_2\), ..., \(S_m\)), and an int \(k\), are there \(\leq k\) of these subsets whose union is equal to \(U\)?

Sample application

U = { 1, 2, 3, 4, 5, 6, 7 }

S1 = { 3, 7 }          S4 = { 2, 4 }
S2 = { 3, 4, 5, 6 }    S5 = { 5 }
S3 = { 1 }             S6 = { 1, 2, 6, 7 }

k = 2

quiz: Intractibility

live view ]

Given following universe \(U\) and sets, which is the minimum size of a set cover of \(U\)?

\[ U = \{1,2,3,4,5,6,7\} \]

\[\begin{array}{lll} S_1 = \{1,4,6\} & S_2 = \{1,6,7\} & S_3 = \{1,2,3,6\} \\ S_4 = \{1,3,5,7\} & S_5 = \{2,6,7\} & S_6 = \{3,4,5\} \end{array}\]

  1. 1
  2. 2
  3. 3
  4. None of the above

vertex cover reduces to set cover

Theorem: \(\VertexCover \leq_P \SetCover\)

Pf: Given a \(\VertexCover\) instance \(G=(V,E)\) and \(k\), we construct a \(\SetCover\) instance \((U,S,k)\) that has a set cover of size \(k\) iff \(G\) has a vertex cover of size \(k\).

Construction:

vertex cover reduces to set cover

Theorem: \(\VertexCover \leq_P \SetCover\)

Construction:

U = { 1, 2, 3, 4, 5, 6, 7 }

Sa = { 3, 7 }
Sb = { 2, 4 }
Sc = { 3, 4, 5, 6 }
Sd = { 5 }
Se = { 1 }
Sf = { 1, 2, 6, 7 }

k = 2

vertex cover reduces to set cover

Lemma: \(G=(V,E)\) contains a vertex cover of size \(k\) iff \((U,S,k)\) contains a set cover of size \(k\)

Pf ⇒: Let \(X \subseteq V\) be a vertex cover of size \(k\) in \(G\). Then \(Y = \{S_v : v \in X \}\) is a set cover of size \(k\) in \((U,S,k)\).

U = { 1, 2, 3, 4, 5, 6, 7 }

Sa = { 3, 7 }
Sb = { 2, 4 }
Sc = { 3, 4, 5, 6 }     <==
Sd = { 5 }
Se = { 1 }
Sf = { 1, 2, 6, 7 }     <==

k = 2

vertex cover reduces to set cover

Lemma: \(G=(V,E)\) contains a vertex cover of size \(k\) iff \((U,S,k)\) contains a set cover of size \(k\)

Pf ⇐: Let \(Y \subseteq S\) be a set cover of size \(k\) in \((U,S,k)\). Then \(X = \{v : S_v \in Y \}\) is a vertex cover of size \(k\) in \(G\). ∎

U = { 1, 2, 3, 4, 5, 6, 7 }

Sa = { 3, 7 }
Sb = { 2, 4 }
Sc = { 3, 4, 5, 6 }     <==
Sd = { 5 }
Se = { 1 }
Sf = { 1, 2, 6, 7 }     <==

k = 2
×