0% found this document useful (0 votes)
23 views3 pages

Exercices - Chapter6

This document discusses complexity classes P, NP, and NP-complete. It begins by proving or disproving whether certain problems are in P or NP. It then discusses reductions between problems to show relationships between complexity classes. It defines NP-completeness and proves various properties about NP-complete problems, including that any NP-complete problem A can be reduced to any other NP-complete problem B, showing their equivalence. It concludes by giving examples of unsatisfiable Boolean formulas.

Uploaded by

Myummie e
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Exercices - Chapter6

This document discusses complexity classes P, NP, and NP-complete. It begins by proving or disproving whether certain problems are in P or NP. It then discusses reductions between problems to show relationships between complexity classes. It defines NP-completeness and proves various properties about NP-complete problems, including that any NP-complete problem A can be reduced to any other NP-complete problem B, showing their equivalence. It concludes by giving examples of unsatisfiable Boolean formulas.

Uploaded by

Myummie e
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Chapter 6

—–P vs NP—–

1. Prove or disprove: the following problem is in P .


Input: an array A[1..n] of numbers and a number x
Question: is x an element of A?

2. Prove or disprove: the following problem is in P .


Input: an array A[1..n] of numbers
Question: what is the maximum element in A?

3. Prove or disprove: the following problem is in P .


Input: a connected and directed graph G = (V, E) and an integer k
Question: is it true that for all pairs of vertices u, v ∈ V , there is a path from u to v
whose length is at most k?

4. Prove or disprove: the following problem is in N P .


Input: an array A[1..n] of numbers and a number x
Question: is x an element of A?

5. Prove or disprove: the following problem is in N P .


Input: an array A[1..n] of numbers and two indices 1 ≤ i ≤ n and 1 ≤ j ≤ n
Question: is it true that A[j] > A[i] and A[j] − A[i] is minimum?

6. Prove or disprove: the following problem is in N P .


Input: a connected and directed graph G = (V, E)
Question: what is the vertex with smallest degree in G?

7. Prove or disprove: if a language L is in P , then it is in N P .

8. Prove or disprove: if a language L is not in N P , then it is in P .

9. Prove that VERTEX-COVER is in N P .

10. Prove that CLIQUE is in N P .

11. Define 2SAT and show that 2SAT is in P .


—–Reductions—–

12. Prove that CLIQU E ≤P IN DEP − SET

13. In class, we showed that CLIQU E ≤P V ERT EX − COV ER by providing a function


f which transforms any input (G, k) to CLIQU E into an input (G0 , k 0 ) to V ERT EX −
COV ER. We showed that the function f satisfies the famous condition 2. Show that
the function f satisfies conditions 1 and 3.

14. Prove that V ERT EX − COV ER ≤P CLIQU E.

15. Consider the problem MIN, where


Input: an array A[1..n] of numbers together with a number x.
Question: Is x the minimum element in A?
Consider also the problem MAX, where
Input: an array A[1..n] of numbers together with a number x.
Question: Is x the maximum element in A?

(a) Show that M IN ≤P M AX.


(b) Show that M AX ≤P M IN .

—–Design & analysis of algorithms—–

16. Suppose you have a polynomial-time algorithm to solve CLIQUE. Explain how to solve
the following problem in polynomial time.
Input: A graph G = (V, E).
Question: What is the size of a largest clique in G (we want as many vertices as
possible)?

17. Suppose you have a polynomial-time algorithm to solve VERTEX-COVER. Explain


how to solve the following problem in polynomial time.
Input: A graph G = (V, E).
Question: What is the size of a smallest vertex cover in G (we want as few vertices as
possible)?
—–N P -Complete—–

18. Prove that for any L and L0 that are N P -Complete, we have L ≤P L0 and L0 ≤P L.

19. Let L0 be an N P -Complete problem. Prove that for all L ∈ P we have L ≤P L0 .

20. In this problem, we want to answer the following question: is there a problem in N P
that is not in N P -Complete? Consider the problem W EIRD, where
Input: an array A[1..n] of numbers
Question: is 1 = 1?

(a) Show that W EIRD is in P .


(b) Conclude that W EIRD is in N P .
(c) Show that W EIRD is not in N P -Complete.
(d) Can you think of another problem that is in N P but not in N P -Complete?
Hint: it is a problem very similar to WEIRD

21. Prove that HAM CY CLE ≤P T SP .

22. (a) Find an example of a 3-SAT Boolean formula, with exactly 2 clauses, that is not
satisfiable.
(b) Find an example of a 3-SAT Boolean formula, with exactly 3 variables, that is
not satisfiable.

You might also like