np hardness
play

NP-Hardness Textbook Reading Chapter 34 Overview Computational - PowerPoint PPT Presentation

NP-Hardness Textbook Reading Chapter 34 Overview Computational (in)tractability Decision problems and optimization problems Decision problems and formal languages The class P Decision and verification The class NP NP


  1. Verification Consider an algorithm V that decides a language L ′ ⊆ Σ ∗ × Σ ∗ , that is, its input is a pair (x, y) such that x, y ∈ Σ ∗ . Algorithm V is said to verify a language L if • for every x ∈ L, there exists a y ∈ Σ ∗ such that (x, y) ∈ L ′ and ∈ L, there is no y ∈ Σ ∗ such that (x, y) ∈ L ′ . • for every x / Thus, given an input (x, y) consisting of an element x ∈ L and an appropriate “proof” y ∈ Σ ∗ that shows that x ∈ L, V answers yes. For a string x / ∈ L, we can provide whatever “proof” y of its membership in L we want; V will reject every such pair (x, y). Thus, we can think of V as a “proof checker” that verifies whether any given proof of x’s membership in L is in fact correct. V does not decide whether x ∈ L. V may answer no even if x ∈ L if the provided proof of its membership in L is incorrect.

  2. Verifying is Easier Than Deciding Verifying a language may be easier than deciding it.

  3. Verifying is Easier Than Deciding Verifying a language may be easier than deciding it. Given a sequence S = � x 1 , x 2 , . . . , x n � of numbers, the element uniqueness problem asks us to decide whether there exist indices i � = j such that x i = x j .

  4. Verifying is Easier Than Deciding Verifying a language may be easier than deciding it. Given a sequence S = � x 1 , x 2 , . . . , x n � of numbers, the element uniqueness problem asks us to decide whether there exist indices i � = j such that x i = x j . Let L be the language of all sequences where two such indices exist.

  5. Verifying is Easier Than Deciding Verifying a language may be easier than deciding it. Given a sequence S = � x 1 , x 2 , . . . , x n � of numbers, the element uniqueness problem asks us to decide whether there exist indices i � = j such that x i = x j . Let L be the language of all sequences where two such indices exist. It can be shown that, using comparisons only, it takes Ω (n lg n) time in the worst case to decide whether a given sequence S belongs to L.

  6. Verifying is Easier Than Deciding Verifying a language may be easier than deciding it. Given a sequence S = � x 1 , x 2 , . . . , x n � of numbers, the element uniqueness problem asks us to decide whether there exist indices i � = j such that x i = x j . Let L be the language of all sequences where two such indices exist. It can be shown that, using comparisons only, it takes Ω (n lg n) time in the worst case to decide whether a given sequence S belongs to L. Verifying L can be done in constant time! • Let L ′ = {(S, (i, j)) | x i = x j , i � = j} • Given some pair (S, (i, j)), we can decide in constant time whether (S, (i, j)) ∈ L ′ by comparing x i and x j . • This algorithm verifies L because x ∈ L if and only if there exists a pair (i, j) such that (S, (i, j)) ∈ L ′ .

  7. The Complexity Class NP The complexity class NP is the set of all languages that can be verified in polynomial time. Formally, a language L belongs to NP if and only if there exists a language L ′ ∈ P and a constant c such that x ∈ L if and only if (x, y) ∈ L ′ for some y ∈ Σ ∗ , |y| ≤ |x| c .

  8. P versus NP Lemma: P ⊆ NP. (Every language that can be decided in polynomial time can be verified in polynomial time.)

  9. P versus NP Lemma: P ⊆ NP. (Every language that can be decided in polynomial time can be verified in polynomial time.) D x yes/no (Is x ∈ L?)

  10. P versus NP Lemma: P ⊆ NP. (Every language that can be decided in polynomial time can be verified in polynomial time.) D x yes/no (Is x ∈ L?) y /dev/null

  11. P versus NP Lemma: P ⊆ NP. (Every language that can be decided in polynomial time can be verified in polynomial time.) D x yes/no (Is x ∈ L?) y /dev/null Is P = NP or is P ⊂ NP?

  12. P versus NP Lemma: P ⊆ NP. (Every language that can be decided in polynomial time can be verified in polynomial time.) D x yes/no (Is x ∈ L?) y /dev/null Is P = NP or is P ⊂ NP? Nobody knows the answer, but . . . Given that we know verifying some languages is easier than deciding them, it is likely that P ⊂ NP.

  13. P versus NP Lemma: P ⊆ NP. (Every language that can be decided in polynomial time can be verified in polynomial time.) D x yes/no (Is x ∈ L?) y /dev/null Is P = NP or is P ⊂ NP? Nobody knows the answer, but . . . Given that we know verifying some languages is easier than deciding them, it is likely that P ⊂ NP. We will show that there exist languages that cannot be decided (decision problems that cannot be solved) in polynomial time unless P = NP!

  14. NP-Hardness and NP-Completeness A language L is NP-hard if L ∈ P implies that P = NP.

  15. NP-Hardness and NP-Completeness A language L is NP-hard if L ∈ P implies that P = NP. A language L is NP-complete if • L ∈ NP and • L is NP-hard. Intuitively, NP-complete languages are the hardest languages in NP.

  16. NP-Hardness and NP-Completeness A language L is NP-hard if L ∈ P implies that P = NP. A language L is NP-complete if • L ∈ NP and • L is NP-hard. Intuitively, NP-complete languages are the hardest languages in NP. Assume P � = NP. P NP

  17. NP-Hardness and NP-Completeness A language L is NP-hard if L ∈ P implies that P = NP. A language L is NP-complete if • L ∈ NP and • L is NP-hard. Intuitively, NP-complete languages are the hardest languages in NP. Assume P � = NP. NP-complete if NP-hard P NP

  18. NP-Hardness and NP-Completeness A language L is NP-hard if L ∈ P implies that P = NP. A language L is NP-complete if • L ∈ NP and • L is NP-hard. Intuitively, NP-complete languages are the hardest languages in NP. Assume P � = NP. Maybe NP-hard but never NP-complete NP-complete if NP-hard P NP

  19. NP-Hardness and NP-Completeness A language L is NP-hard if L ∈ P implies that P = NP. A language L is NP-complete if • L ∈ NP and • L is NP-hard. Intuitively, NP-complete languages are the hardest languages in NP. Assume P � = NP. Maybe NP-hard but never NP-complete NP-complete if NP-hard P NP Neither NP-hard nor NP-complete

  20. Polynomial-Time Reductions An algorithm R reduces a language L 1 ⊆ Σ ∗ to a language L 2 ⊆ Σ ∗ if, for all x ∈ Σ ∗ , x ∈ L 1 ⇔ R(x) ∈ L 2 . x R(x) R R is a polynomial-time reduction if its running time is polynomial in |x|.

  21. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P.

  22. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. x R(x) R

  23. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D y x yes/no R(x) R (Is y ∈ L 2 ?)

  24. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D

  25. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2

  26. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2 R(x) ∈ L 2 ⇔ D(R(x)) = yes

  27. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2 R(x) ∈ L 2 ⇔ D(R(x)) = yes x ∈ L 1 ⇔ D ′ (x) = yes

  28. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2 R(x) ∈ L 2 ⇔ D(R(x)) = yes x ∈ L 1 ⇔ D ′ (x) = yes T R (|x|) ≤ c|x| a , for some a, c.

  29. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2 R(x) ∈ L 2 ⇔ D(R(x)) = yes x ∈ L 1 ⇔ D ′ (x) = yes T R (|x|) ≤ c|x| a , for some a, c. ⇒ |R(x)| ≤ c|x| a , for some a, c.

  30. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2 R(x) ∈ L 2 ⇔ D(R(x)) = yes x ∈ L 1 ⇔ D ′ (x) = yes T R (|x|) ≤ c|x| a , for some a, c. ⇒ |R(x)| ≤ c|x| a , for some a, c. ⇒ T D (|R(x)|) ≤ c ′ |R(x)| a ′ ≤ c ′ (c|x| a ) a ′ , for some a ′ , c ′ .

  31. Proving NP-Hardness Using Polynomial-Time Reductions Lemma: If there exists a polynomial-time reduction R from a language L 1 to a language L 2 ∈ P, then L 1 ∈ P. D ′ x yes/no R(x) R D x ∈ L 1 ⇔ R(x) ∈ L 2 R(x) ∈ L 2 ⇔ D(R(x)) = yes x ∈ L 1 ⇔ D ′ (x) = yes T R (|x|) ≤ c|x| a , for some a, c. ⇒ |R(x)| ≤ c|x| a , for some a, c. ⇒ T D (|R(x)|) ≤ c ′ |R(x)| a ′ ≤ c ′ (c|x| a ) a ′ , for some a ′ , c ′ . ⇒ T D ′ (|x|) = T R (|x|) + T D (|R(x)|) ≤ c|x| a + c ′ (c|x| a ) a ′ ∈ O(|x| aa ′ ).

  32. Proving NP-Hardness Using Polynomial-Time Reductions Corollary: If there exists a polynomial-time reduction from an NP-hard language L 1 to a language L 2 , then L 2 is also NP-hard.

  33. Proving NP-Hardness Using Polynomial-Time Reductions Corollary: If there exists a polynomial-time reduction from an NP-hard language L 1 to a language L 2 , then L 2 is also NP-hard. Polynomial-time reduction L 2 ∈ P L 1 ∈ P

  34. Proving NP-Hardness Using Polynomial-Time Reductions Corollary: If there exists a polynomial-time reduction from an NP-hard language L 1 to a language L 2 , then L 2 is also NP-hard. Polynomial-time reduction NP-hardness of L 1 L 2 ∈ P L 1 ∈ P P = NP

  35. Proving NP-Hardness Using Polynomial-Time Reductions Corollary: If there exists a polynomial-time reduction from an NP-hard language L 1 to a language L 2 , then L 2 is also NP-hard. Polynomial-time reduction NP-hardness of L 1 L 2 ∈ P L 1 ∈ P P = NP L 2 is NP-hard.

  36. Where Do We Get Our First NP-Hard Problem From? To prove that a language L is NP-hard, we need an NP-hard language L ′ that we can reduce to L in polynomial time. How do we prove a language L is NP-hard when we haven’t shown any other language to be NP-hard yet? Enter Satisfiability, the mother of all NP-hard problems . . .

  37. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 )

  38. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 ) • x 1 , x 2 , x 3 , x 4 are Boolean variables, which can be true or false.

  39. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 ) • x 1 , x 2 , x 3 , x 4 are Boolean variables, which can be true or false. • x 1 , ¯ x 1 , x 2 , ¯ x 3 , x 4 are literals (a Boolean variable or its negation).

  40. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 ) • x 1 , x 2 , x 3 , x 4 are Boolean variables, which can be true or false. • x 1 , ¯ x 1 , x 2 , ¯ x 3 , x 4 are literals (a Boolean variable or its negation). • A truth assignment assigns a value true or false to each variable in F.

  41. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 ) • x 1 , x 2 , x 3 , x 4 are Boolean variables, which can be true or false. • x 1 , ¯ x 1 , x 2 , ¯ x 3 , x 4 are literals (a Boolean variable or its negation). • A truth assignment assigns a value true or false to each variable in F. • A truth assigment satisfies F if it makes F true. Example: • x 1 = x 2 = x 3 = x 4 = true satisfies F. • x 1 = x 2 = x 3 = x 4 = false does not.

  42. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 ) • x 1 , x 2 , x 3 , x 4 are Boolean variables, which can be true or false. • x 1 , ¯ x 1 , x 2 , ¯ x 3 , x 4 are literals (a Boolean variable or its negation). • A truth assignment assigns a value true or false to each variable in F. • A truth assigment satisfies F if it makes F true. Example: • x 1 = x 2 = x 3 = x 4 = true satisfies F. • x 1 = x 2 = x 3 = x 4 = false does not. • F is satisfiable if it has a satisfying truth assignment.

  43. Satisfiability (SAT) A Boolean formula: F = (x 1 ∨ (x 2 ∧ ¯ x 3 )) ∧ ( ¯ x 1 ∨ x 4 ) • x 1 , x 2 , x 3 , x 4 are Boolean variables, which can be true or false. • x 1 , ¯ x 1 , x 2 , ¯ x 3 , x 4 are literals (a Boolean variable or its negation). • A truth assignment assigns a value true or false to each variable in F. • A truth assigment satisfies F if it makes F true. Example: • x 1 = x 2 = x 3 = x 4 = true satisfies F. • x 1 = x 2 = x 3 = x 4 = false does not. • F is satisfiable if it has a satisfying truth assignment. The satisfiability problem (SAT): Given a Boolean formula F, decide whether F is satisfiable.

  44. 3-SAT A formula is in conjunctive normal form (CNF) if it is a conjunction of disjuctions. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 2 ∨ x 3 ) ∧ ( ¯ x 1 ∨ ¯ x 2 ∨ ¯ x 3 ) The disjunctions are also called clauses. A formula is in 3-CNF if each of its clauses consists of three literals. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 2 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 1 ∨ ¯ x 2 ∨ ¯ x 3 ) 3-SAT: Decide whether a given formula in 3-CNF is satisfiable.

  45. Things We Don’t Have Time To Prove Any polynomial-time verification algorithm for a language L can be turned into a polynomial-time reduction from L to SAT.

  46. Things We Don’t Have Time To Prove Any polynomial-time verification algorithm for a language L can be turned into a polynomial-time reduction from L to SAT. Thus, SAT ∈ P ⇒ L ∈ P for all L ∈ NP, that is, P = NP.

  47. Things We Don’t Have Time To Prove Any polynomial-time verification algorithm for a language L can be turned into a polynomial-time reduction from L to SAT. Thus, SAT ∈ P ⇒ L ∈ P for all L ∈ NP, that is, P = NP. In other words, SAT is NP-hard.

  48. Things We Don’t Have Time To Prove Any polynomial-time verification algorithm for a language L can be turned into a polynomial-time reduction from L to SAT. Thus, SAT ∈ P ⇒ L ∈ P for all L ∈ NP, that is, P = NP. In other words, SAT is NP-hard. Any Boolean formula F can be turned, in polynomial time, into a Boolean formula F ′ in 3-CNF, of size |F ′ | ∈ O(|F|), and such that F is satisfiable if and only if F ′ is.

  49. Things We Don’t Have Time To Prove Any polynomial-time verification algorithm for a language L can be turned into a polynomial-time reduction from L to SAT. Thus, SAT ∈ P ⇒ L ∈ P for all L ∈ NP, that is, P = NP. In other words, SAT is NP-hard. Any Boolean formula F can be turned, in polynomial time, into a Boolean formula F ′ in 3-CNF, of size |F ′ | ∈ O(|F|), and such that F is satisfiable if and only if F ′ is. Thus, 3-SAT is NP-hard.

  50. Examples of Polynomial-Time Reductions 3-SAT Vertex cover Subset sum Hamiltonian cycle

  51. Vertex Cover A vertex cover of a graph G = (V, E) is a subset S ⊆ V such that every edge in E has at least one endpoint in S.

  52. Vertex Cover A vertex cover of a graph G = (V, E) is a subset S ⊆ V such that every edge in E has at least one endpoint in S. Optimization problem: Given a graph G, find the smallest possible vertex cover of G.

  53. Vertex Cover A vertex cover of a graph G = (V, E) is a subset S ⊆ V such that every edge in E has at least one endpoint in S. Optimization problem: Given a graph G, find the smallest possible vertex cover of G. Decision problem: Given a graph G and an integer k, decide whether G has a vertex cover of size k.

  54. Vertex Cover is NP-Hard Reduction from 3-SAT: • Given any formula F, we build a graph G F that has a small vertex cover if and only if F is satisfiable. • G F will be built from subgraphs, called widgets, that guarantee certain properties of G F . • It will be obvious that this construction can be carried out in polynomial time.

  55. Vertex Cover is NP-Hard Reduction from 3-SAT: • Given any formula F, we build a graph G F that has a small vertex cover if and only if F is satisfiable. • G F will be built from subgraphs, called widgets, that guarantee certain properties of G F . • It will be obvious that this construction can be carried out in polynomial time. Variable widget for variable x i : • Two vertices x i and ¯ x i x i x i ¯ • One edge (x i , ¯ x i )

  56. Vertex Cover is NP-Hard Reduction from 3-SAT: • Given any formula F, we build a graph G F that has a small vertex cover if and only if F is satisfiable. • G F will be built from subgraphs, called widgets, that guarantee certain properties of G F . • It will be obvious that this construction can be carried out in polynomial time. Variable widget for variable x i : • Two vertices x i and ¯ x i x i x i ¯ • One edge (x i , ¯ x i ) Clause widget for clause C j : • Three literal vertices λ j,1 , λ j,2 , and λ j,3 • Three edges ( λ j,1 , λ j,2 ), ( λ j,2 , λ j,3 ), and ( λ j,3 , λ j,1 ) λ j,1 λ j,2 λ j,3

  57. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 )

  58. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F :

  59. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  60. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  61. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  62. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  63. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  64. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  65. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  66. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  67. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  68. Vertex Cover is NP-Hard F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) G F : • One variable widget per variable • One clause widget per clause • Connect every literal node λ i,j to its corresponding node x k or ¯ x k x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  69. Vertex Cover is NP-Hard n = number of variables m = number of clauses

  70. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  71. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯

  72. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

  73. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) x 1 = x 2 = x 3 = x 4 = true Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

  74. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) x 1 = x 2 = x 3 = x 4 = true Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

  75. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) x 1 = x 2 = x 3 = x 4 = true Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

  76. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) x 1 = x 2 = x 3 = x 4 = true Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

  77. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) x 1 = x 2 = x 3 = x 4 = true Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

  78. Vertex Cover is NP-Hard n = number of variables m = number of clauses Observation: Any vertex cover of G F of size n + 2m contains one vertex per variable widget and two vertices per clause widget. Lemma: F is satisfiable if and only if G F has a vertex cover of size n + 2m. F = (x 1 ∨ x 2 ∨ ¯ x 3 ) ∧ ( ¯ x 1 ∨ x 3 ∨ x 4 ) ∧ ( ¯ x 2 ∨ x 3 ∨ ¯ x 4 ) ∧ (x 1 ∨ ¯ x 3 ∨ x 4 ) Truth assignment x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 ¯ ¯ ¯ ¯ Vertex cover

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend