University of Freiburg Dept. of Computer Science Prof. Dr. F. Kuhn
S. Faour, P. Schneider
Theoretical Computer Science - Bridging Course Exercise Sheet 8
Due:Wednesday, 23rd of June 2021, 12:00 pm
Exercise 1: Questions about class N P (6 Points)
• Give two equivalent definitions of the classN P.
• Is the3-Cliqueproblem from the previous sheet in classN P ? Is it decidable? Justify.
• Is the halting problem inN P? Justify.
Exercise 2: Proving Problems in N P (9 Points)
Show that the following problems are in the classN P
• A clique in a graphG= (V, E) is a setQ⊆V such that for allu, v∈Q:{u, v} ∈E.
Given a graph Gand integer k, it is required to determine whether Gcontains a clique of size at leastk, hence consider the following problem:
Clique:={hG, ki |Ghas a clique of size at least k}.
• Given a collection S of integers x1, . . . , xk and a target t, it is required to determine whetherS contains a sub-collection that adds up tot, hence consider the following problem:
SUBSET-SUM= (
hS, ti|S ={x1, . . . , xk},and for some {y1, . . . , yl} ⊆ {x1, . . . , xk}we have X
i
yi =t )
• A hitting set H ⊆ U for a given universe U and a set S ={S1, S2, . . . , Sm} of subsets Si ⊆ U, fulfills the property H∩Si 6=∅for 1≤i≤m (H ’hits’ at least one element of everySi).
Given a universe set U, a set S of subsets of U, and a positive integer k, it is required to determine whether U contains a hitting set of size at most k, hence consider the following problem: HittingSet:= {hU, S, ki |universe U has subset of size ≤ k that hits all sets in S⊆2U}.1
Exercise 3: From N P to N PC (5 Points)
A language is called N P-complete (⇔:L∈ N PC), if 1. L∈ N P and
2. L isN P-hard.
Recall what areN P-hard problems and how to show a problem N P-hard in the following.
1The power set 2U of some ground setU is the set ofall subsets ofU. SoS⊆2U is a collection of subsets ofU.
• Language Lis called N P-hard, ifall languagesL0 ∈ N P are polynomially reducible toL, i.e.
L isN P-hard⇐⇒ ∀L0 ∈ N P :L0 ≤p L.
Recall let L1, L2 be languages (problems) over alphabets Σ1,Σ2. Then L1 ≤p L2 (L1 is polyno- mially reducible toL2), iff a functionf : Σ∗1 → Σ∗2 exists, that can be calculated in polynomial time and
∀s∈Σ∗1 :s∈L1 ⇐⇒f(s)∈L2.
• The reduction relation ’≤p’ is transitive (L1 ≤p L2 and L2 ≤p L3 ⇒ L1 ≤p L3). Therefore, in order to show that L is N P-hard, it suffices to reduce a known N P-hard problem ˜L toL, i.e.
L˜ ≤p L.
Given a graphG= (V, E), an independent set of sizekofG= (V, E) is a subsetI ⊆V of nodes, such that|I|=kand {u, v}∈/ E for all u, v∈I.
Show thatIndependentSet:={hG, ki |G is a simple graph and has an independent set of size at leastk}
is in N PC. Use that theCliqueproblem from the above exercise is∈ N PC.
Hint: For the poly. transformation (≤p) you have to describe an algorithm (with poly. run-time!) that transforms an instance hG, ki of Clique into an instance hG0, k0i of IndependentSet s.t. a clique of size at least k in G becomes a independent set ofG0 of size at least k0 and vice versa!.