This is an old revision of the document!
Lab 12: NP-hard and NP-complete problems
Consider the following problems:
k-Independent Set
Let $ G=(V,E)$ be an undirected graph and $ k$ be a natural number. k-Independent-Set asks if there exists a subset $ C\subseteq V$ of size $ k$ of nodes from $ G$ such that all nodes from $ C$ are independent: $ \forall u,v \in C, (u,v)\not\in E$ .
Remark: Let $ G$ be a social network where each edge $ (u,v)\in E$ models friendship between participants $ u$ and $ v$ . k-independent-set asks if there exist a group of size $ k$ such that no two members of it are friends.
Subset Sum
Let $ a_1, a_2, \ldots, a_n, b$ be natural numbers. Subset Sum asks if there exist a subset of $ a_1, a_2, \ldots, a_n$ whose sum equals $ b$ .
Remark: Imagine $ a_1, a_2, \ldots, a_n$ to be weights of various items identified as $ 1,2, \ldots, n$ and that $ b$ is the capacity of a rucksack. Subset sum asks if you can pick a combination of items such that the rucksack can be completely full.
Partition
Let $ a_1, a_2, \ldots, a_n$ be natural numbers. Partition asks if there exists a partitioning of $ {a_1, \ldots, a_n}$ into $ P_1,P_2$ such that the sum of elements from one element of the partition equals that of the other.
- how is a partition formally defined?
Remark: Imagine you have items each having a certain value $ a_1, a_2, \ldots, a_n$ . Partition asks you to split those item s between two people such that each one receives equal value.
1. Reductions
1.1. Show that SAT $ \leq_p$ Subset Sum. Group discussion on the reduction in class.
1.2. Prove that Partition is NP-hard. What are the steps to take? Build the reduction on your own.
1.3. Prove that Independent set is NP-hard.
1.4. Show that Partition $ \leq_p$ Subset Sum.
2.Properties of NP-hard and NP-complete problems
2.1. Identify a problem which is NP-hard but not NP-complete. Justify your answer.
2.2. Suppose $ f \leq_p g$ , $ f$ is NP-hard and $ g$ is in NP. Is it true that $ g \leq_p f$ ?
2.3. What is an equivalence class? Show that the set of NP-complete problems is an equivalence class.
3. P vs NP
3.1. Suppose you find an algorithm which solves $ SAT$ in $ O(n^4)$ time. Is it true that $ P = NP$ ? Justify your answer. What does this entail?
3.2. Suppose that you find an algorithm $ A$ which can solve the problem of finding if all subsets of size k of nodes from a graph are not cliques in polynomial time. Does that entail $ P = NP$ or $ P \neq NP$ ? Justify your answer.
4. Further work
4.1. How would you define the concept of a $ P$ -complete problem? How difficult (informally) would these problems be?
4.2. Give an example of a $ P$ -complete problem.