np completeness reductions
play

NP-completeness reductions Matvey Soloviev (Cornell University) CS - PowerPoint PPT Presentation

NP-completeness reductions Matvey Soloviev (Cornell University) CS 4820, Summer 2020 1 NP that is, if NP contains any problems Last time We showed that the CNF-SAT problem is NP-complete, that is, problem in NP. In particular, if P that


  1. From SAT to 3-SAT (1) The problem with general CNF-SAT is that clauses can Idea: Create a bunch of clauses to represent every problematic clause. Make sure that the new collection of clauses is satisfiable if and only if the original clause is. Is this alone sufficient? That is, will we get a correct reduction if we just ensure there is a correspondence between and clauses like that? 7 sometimes have either too few or too many literals.

  2. From SAT to 3-SAT (1) The problem with general CNF-SAT is that clauses can Idea: Create a bunch of clauses to represent every problematic clause. Make sure that the new collection of clauses is satisfiable if and only if the original clause is. Is this alone sufficient? That is, will we get a correct reduction clauses like that? 7 sometimes have either too few or too many literals. if we just ensure there is a correspondence between φ and ψ

  3. x 1 . y 6 . Fix: Make source and target clauses satisfiable by the same From SAT to 3-SAT (2) image at all. variables, make them not interact with other source clauses’ If we need extra assignment, to preserve how clauses interact. satisfiable simultaneously! is. Clauses are satisfiable in isolation is not satisfiable; but y 5 y 4 y 3 y 2 y 1 Then take x 1 For example, take clauses satisfiable simultaneously). 8 No: We want (all φ clauses satisfiable simultaneously) ⇔ (all ψ

  4. y 6 . Fix: Make source and target clauses satisfiable by the same is not satisfiable; but image at all. variables, make them not interact with other source clauses’ If we need extra assignment, to preserve how clauses interact. satisfiable simultaneously! is. Clauses are satisfiable in isolation From SAT to 3-SAT (2) y 5 y 4 y 3 y 2 y 1 Then take clauses satisfiable simultaneously). 8 No: We want (all φ clauses satisfiable simultaneously) ⇔ (all ψ For example, take φ = ( x 1 ) ∧ ( ¬ x 1 ) .

  5. Fix: Make source and target clauses satisfiable by the same From SAT to 3-SAT (2) clauses satisfiable simultaneously). assignment, to preserve how clauses interact. If we need extra variables, make them not interact with other source clauses’ image at all. 8 No: We want (all φ clauses satisfiable simultaneously) ⇔ (all ψ For example, take φ = ( x 1 ) ∧ ( ¬ x 1 ) . Then take ψ = ( y 1 ∨ y 2 ∨ y 3 ) ∧ ( y 4 ∨ y 5 ∨ y 6 ) . φ is not satisfiable; but ψ is. Clauses are satisfiable in isolation �⇔ satisfiable simultaneously!

  6. From SAT to 3-SAT (2) clauses satisfiable simultaneously). assignment, to preserve how clauses interact. If we need extra variables, make them not interact with other source clauses’ image at all. 8 No: We want (all φ clauses satisfiable simultaneously) ⇔ (all ψ For example, take φ = ( x 1 ) ∧ ( ¬ x 1 ) . Then take ψ = ( y 1 ∨ y 2 ∨ y 3 ) ∧ ( y 4 ∨ y 5 ∨ y 6 ) . φ is not satisfiable; but ψ is. Clauses are satisfiable in isolation �⇔ satisfiable simultaneously! Fix: Make source and target clauses satisfiable by the same

  7. From SAT to 3-SAT (2) clauses satisfiable simultaneously). assignment, to preserve how clauses interact. If we need extra variables, make them not interact with other source clauses’ image at all. 8 No: We want (all φ clauses satisfiable simultaneously) ⇔ (all ψ For example, take φ = ( x 1 ) ∧ ( ¬ x 1 ) . Then take ψ = ( y 1 ∨ y 2 ∨ y 3 ) ∧ ( y 4 ∨ y 5 ∨ y 6 ) . φ is not satisfiable; but ψ is. Clauses are satisfiable in isolation �⇔ satisfiable simultaneously! Fix: Make source and target clauses satisfiable by the same

  8. From SAT to 3-SAT (3) Too few literals: Just pad out with fresh variables. 1 2 y Make sure that the clause(s) can’t be satisfied by y alone! y z y z y z y z 9 ( ℓ 1 ∨ ℓ 2 ) �→ ( ℓ 1 ∨ ℓ 2 ∨ y )

  9. From SAT to 3-SAT (3) Too few literals: Just pad out with fresh variables. Make sure that the clause(s) can’t be satisfied by y alone! y z y z y z y z 9 ( ℓ 1 ∨ ℓ 2 ) �→ ( ℓ 1 ∨ ℓ 2 ∨ y ) ∧ ( ℓ 1 ∨ ℓ 2 ∨ ¬ y )

  10. From SAT to 3-SAT (3) Too few literals: Just pad out with fresh variables. Make sure that the clause(s) can’t be satisfied by y alone! 9 ( ℓ 1 ∨ ℓ 2 ) �→ ( ℓ 1 ∨ ℓ 2 ∨ y ) ∧ ( ℓ 1 ∨ ℓ 2 ∨ ¬ y ) ( ℓ ) �→ ( ℓ ∨ y ∨ z ) ∧ ( ℓ ∨ ¬ y ∨ z ) ∧ ( ℓ ∨ y ∨ ¬ z ) ∧ ( ℓ ∨ ¬ y ∨ ¬ z ) .

  11. Interpretation: z i will be true iff the clause had to be satisfied z i will be true iff it was not be satisfied with any literal with index From SAT to 3-SAT (4) k Check that this works! 1 z k k 1 k 1 z k 2 z k 2 z 3 z 4 Too many literals: Split clause. Say the input is 3 z 3 2 1 Output: i . i . Accordingly, with some literal with index 10 ( ℓ 1 ∨ . . . ∨ ℓ k ) . Introduce k − 3 fresh variables z 3 , . . . , z k − 1 .

  12. From SAT to 3-SAT (4) k Check that this works! 1 z k k 1 k 1 z k 2 z k 2 z 4 Too many literals: Split clause. Say the input is z 3 3 z 3 2 1 Output: 10 ( ℓ 1 ∨ . . . ∨ ℓ k ) . Introduce k − 3 fresh variables z 3 , . . . , z k − 1 . Interpretation: z i will be true iff the clause had to be satisfied with some literal with index ≥ i . Accordingly, ¬ z i will be true iff it was not be satisfied with any literal with index ≥ i .

  13. From SAT to 3-SAT (4) Output: Check that this works! Too many literals: Split clause. Say the input is 10 ( ℓ 1 ∨ . . . ∨ ℓ k ) . Introduce k − 3 fresh variables z 3 , . . . , z k − 1 . Interpretation: z i will be true iff the clause had to be satisfied with some literal with index ≥ i . Accordingly, ¬ z i will be true iff it was not be satisfied with any literal with index ≥ i . ( ℓ 1 ∨ ℓ 2 ∨ z 3 ) ∧ ( ℓ 3 ∨ ¬ z 3 ∨ z 4 ) ∧ . . . ∧ ( ℓ k − 2 ∨ ¬ z k − 2 ∨ z k − 1 ) ∧ ( ℓ k − 1 ∨ ℓ k ∨ ¬ z k − 1 ) .

  14. i is true. Set z j 2, then all z j are false, and so the i and the rest are satisfied by i and z i is z j for z j . Otherwise, every clause that contains z j i . the appropriate j i , and the remaining ones are satisfied by satisfied by i is satisfied by z j , the one that contains for j From SAT to 3-SAT (5) the appropriate Check: The original k -literal clause had a satisfying assignment first output clause is satisfied by i . If i F for all j i , z j j T for all ” : Let i be the first i such that “ 11 A ⇔ an extension of A works for the k − 2 clauses we generated.

  15. From SAT to 3-SAT (5) Check: The original k -literal clause had a satisfying assignment 11 A ⇔ an extension of A works for the k − 2 clauses we generated. “ ⇒ ” : Let i be the first i such that ℓ i is true. Set z j = T for all j ≤ i , z j = F for all j > i . If i ≤ 2, then all z j are false, and so the first output clause is satisfied by ℓ i and the rest are satisfied by the appropriate ¬ z j . Otherwise, every clause that contains z j for j ≤ i is satisfied by z j , the one that contains ℓ i and ¬ z i is satisfied by ℓ i , and the remaining ones are satisfied by ¬ z j for the appropriate j > i .

  16. From SAT to 3-SAT (6) false, and so the output clauses simplify to 12 “ ⇐ ” : Claim that some ℓ i is true; then the input clause is satisfied by that literal. Suppose not. Then all of the ℓ i are ( z 3 ) ∧ ( ¬ z 3 ∨ z 4 ) ∧ . . . ∧ ( ¬ z k − 2 ∨ z k − 1 ) ∧ ( ¬ z k − 1 ) . This is not satisfiable (note that ( ¬ x ∨ y ) is x → y ). ✷

  17. We call the parts we construct in the target problem gadgets. 3-SAT is NP-complete We created a polynomial number of clauses for each original clause with only straightforward computations, and can check that we have a satisfying assignment to the resulting CNF iff we have one to the original CNF. This approach of taking discrete parts of the source problem and converting them to parts of the target problem, which interact with each other in a controlled manner, is common. 13 Hence done, and 3-SAT is NP-complete. ✷

  18. 3-SAT is NP-complete We created a polynomial number of clauses for each original clause with only straightforward computations, and can check that we have a satisfying assignment to the resulting CNF iff we have one to the original CNF. This approach of taking discrete parts of the source problem and converting them to parts of the target problem, which interact with each other in a controlled manner, is common. 13 Hence done, and 3-SAT is NP-complete. ✷ We call the parts we construct in the target problem gadgets.

  19. Intermission Let’s take a short break. Exercise: Try converting to 3-SAT, and find two distinct satisfying assignments. ( ¬ x ∨¬ y ) ∧ ( ¬ x ∨ a ) ∧ ( ¬ x ∨ y ∨¬ a ∨¬ b ∨ c ) ∧ ( x ∨¬ c ) ∧ ( x ∨ c )

  20. The Independent Set problem The Independent Set decision problem asks the following: given a graph G V E and an integer k , is there an independent set of at least k vertices? 15 Given an undirected graph G = ( V , E ) , an independent set is a set of vertices I ⊆ V such that no two vertices in I share an edge: � ∃ v , v ′ ∈ I . v � = v ′ ∧ { v , v ′ } ∈ E .

  21. The Independent Set problem The Independent Set decision problem asks the following: given a graph G V E and an integer k , is there an independent set of at least k vertices? 15 Given an undirected graph G = ( V , E ) , an independent set is a set of vertices I ⊆ V such that no two vertices in I share an edge: � ∃ v , v ′ ∈ I . v � = v ′ ∧ { v , v ′ } ∈ E .

  22. The Independent Set problem The Independent Set decision problem asks the following: independent set of at least k vertices? 15 Given an undirected graph G = ( V , E ) , an independent set is a set of vertices I ⊆ V such that no two vertices in I share an edge: � ∃ v , v ′ ∈ I . v � = v ′ ∧ { v , v ′ } ∈ E . given a graph G = ( V , E ) and an integer k , is there an

  23. In general, finding a polynomial-time reduction like this is not How to proceed in general? (1) We’d like to show that Independent Set is NP-complete. straightforward. Here is a not-quite-rigorous intuitive framework that I have personally found useful. 16

  24. How to proceed in general? (1) We’d like to show that Independent Set is NP-complete. straightforward. Here is a not-quite-rigorous intuitive framework that I have personally found useful. 16 In general, finding a polynomial-time reduction like this is not

  25. How to proceed in general? (1) We’d like to show that Independent Set is NP-complete. straightforward. Here is a not-quite-rigorous intuitive framework that I have personally found useful. 16 In general, finding a polynomial-time reduction like this is not

  26. How to proceed in general? (2) Many NP-complete problems ask for the existence of a structured solution, which typically becomes the certificate. This solution consists of many smaller components. For instance, for Independent Set, the solution is an independent set, which amounts to a choice of whether we put in each vertex of the graph. We can imagine a process of picking these components one by one, as if we ran a greedy algorithm. Every time we pick something, some future choices are ruled out: e.g. including vertices adjacent to the vertex we just picked. 17

  27. How to proceed in general? (2) Many NP-complete problems ask for the existence of a structured solution, which typically becomes the certificate. This solution consists of many smaller components. For instance, for Independent Set, the solution is an independent set, which amounts to a choice of whether we put in each vertex of the graph. We can imagine a process of picking these components one by one, as if we ran a greedy algorithm. Every time we pick something, some future choices are ruled out: e.g. including vertices adjacent to the vertex we just picked. 17

  28. How to proceed in general? (2) Many NP-complete problems ask for the existence of a structured solution, which typically becomes the certificate. This solution consists of many smaller components. For instance, for Independent Set, the solution is an independent set, which amounts to a choice of whether we put in each vertex of the graph. We can imagine a process of picking these components one by one, as if we ran a greedy algorithm. Every time we pick something, some future choices are ruled out: e.g. including vertices adjacent to the vertex we just picked. 17

  29. (The search tree we get in this fashion looks a lot like an NTM How to proceed in general? (3) If at some point we run out of choices, we get stuck and have to backtrack: undo some number of choices, and try adding a different component instead. Otherwise, at some point we’ve chosen everything there is to choose, and found a certificate that we have a “yes” instance. execution cone, and is in general of exponential size.) 18

  30. How to proceed in general? (3) If at some point we run out of choices, we get stuck and have to backtrack: undo some number of choices, and try adding a different component instead. Otherwise, at some point we’ve chosen everything there is to choose, and found a certificate that we have a “yes” instance. execution cone, and is in general of exponential size.) 18 (The search tree we get in this fashion looks a lot like an NTM

  31. We could think of it as a process of picking assignments to variables one-by-one: first we say that x 1 is set to T , then we try to set x 3 to F , immediately see it won’t lead to a solution: e.g. we just made some clause unsatisfiable by picking the opposite of all of its How to proceed in general? (4) Sometimes, there isn’t a canonical way to break down the solution into components. For instance, what are the components of CNF-SAT? Then, an assignment to a variable is ruled out if we can literals. 19

  32. immediately see it won’t lead to a solution: e.g. we just made some clause unsatisfiable by picking the opposite of all of its How to proceed in general? (4) Sometimes, there isn’t a canonical way to break down the solution into components. For instance, what are the components of CNF-SAT? Then, an assignment to a variable is ruled out if we can literals. 19 We could think of it as a process of picking assignments to variables one-by-one: first we say that x 1 is set to T , then we try to set x 3 to F , . . .

  33. How to proceed in general? (4) Sometimes, there isn’t a canonical way to break down the solution into components. For instance, what are the components of CNF-SAT? Then, an assignment to a variable is ruled out if we can literals. 19 We could think of it as a process of picking assignments to variables one-by-one: first we say that x 1 is set to T , then we try to set x 3 to F , . . . immediately see it won’t lead to a solution: e.g. we just made some clause unsatisfiable by picking the opposite of all of its

  34. Then, a way of satisfying a clause is ruled out if we previously How to proceed in general? (5) Alternatively, we could think of it as a process of satisfying did something that contradicts it: e.g. we already satisfied another clause by setting a variable so that this literal is rendered false. 20 clauses one-by-one. Every clause needs to be satisfied by some literal in it. So first we say that we satisfy ( x 1 ∨ ¬ x 3 ∨ x 7 ) by setting x 3 to F , then we satisfy ( x 3 ∨ x 4 ) by setting x 4 to T , . . .

  35. How to proceed in general? (5) Alternatively, we could think of it as a process of satisfying did something that contradicts it: e.g. we already satisfied another clause by setting a variable so that this literal is rendered false. 20 clauses one-by-one. Every clause needs to be satisfied by some literal in it. So first we say that we satisfy ( x 1 ∨ ¬ x 3 ∨ x 7 ) by setting x 3 to F , then we satisfy ( x 3 ∨ x 4 ) by setting x 4 to T , . . . Then, a way of satisfying a clause is ruled out if we previously

  36. How to proceed in general? (6) Both views are valid and useful, and give rise to reductions that we will encounter. For Independent Set, we will use the second one. 21

  37. How to proceed in general? (6) Both views are valid and useful, and give rise to reductions that we will encounter. For Independent Set, we will use the second one. 21

  38. How to proceed in general? (7) Either way, once we have decided on a search tree structure for both the source and the target problem, we can build gadgets that simulate the structure of a source choice using target choices. Sometimes, we have to plug multiple of them together. For instance, imagine the source problem lets you choose between three different options: A B C 22

  39. How to proceed in general? (7) Either way, once we have decided on a search tree structure for both the source and the target problem, we can build gadgets that simulate the structure of a source choice using target choices. Sometimes, we have to plug multiple of them together. For instance, imagine the source problem lets you choose between three different options: A B C 22

  40. How to proceed in general? (8) On the other hand, the target problem has choices that lead to two options (which don’t interact with anything else), choices where your hand is forced (you only get one option), and choices that always lead to you getting stuck: A B C x 23

  41. How to proceed in general? (9) So can model the choice structure of the source problem with three choices of the target problem: A B C 1 C 2 C 3 x 24 A ′ B ′ A ′′ B ′′

  42. Towards NP-completeness of Independent Set As said earlier, we will use the clause-satisfying view of 3-SAT. x 4 x 4 x 3 x 3 . . . x 3 . . . x 2 . . . x 2 x 3 x 2 x 4 x 1 Search tree if we try to satisfy clauses left to right: Example: input formula 25 ( x 1 ∨ ¬ x 3 ∨ x 4 ) ∧ ( ¬ x 1 ∨ x 2 ∨ x 3 ) ∧ ( ¬ x 2 ∨ x 3 ∨ x 4 ) . ¬ x 3 ¬ x 1 ¬ x 1 x 4 ¬ x 2 x 4 ¬ x 2

  43. Replicating the choice structure (1) i th clause x 7 i x 3 i x 1 i x 7 We want to build a similar decision tree in Independent Set, x 3 x 1 want to create three vertices that we can pick from: As we picked one of three literals in each clause in 3-SAT, we’ll the independent set. seen as the problem of repeatedly picking vertices to add to 26

  44. Replicating the choice structure (1) i th clause x 7 i x 3 i x 1 i x 7 We want to build a similar decision tree in Independent Set, x 3 x 1 want to create three vertices that we can pick from: As we picked one of three literals in each clause in 3-SAT, we’ll the independent set. seen as the problem of repeatedly picking vertices to add to 26

  45. Replicating the choice structure (1) We want to build a similar decision tree in Independent Set, seen as the problem of repeatedly picking vertices to add to the independent set. As we picked one of three literals in each clause in 3-SAT, we’ll want to create three vertices that we can pick from: i th clause 26 i : ¬ x 3 ( x 1 ∨ ¬ x 3 ∨ x 7 ) �→ � �� � i : x 1 i : x 7

  46. Replicating the choice structure (2) i th clause x 7 i x 3 i x 1 i x 7 Once we have already chosen to satisfy the i th clause using, x 3 x 1 subsequent choice (of vertex) by introducing edges between In Independent Set, we can make a choice (of vertex) block a satisfy the same clause. say, x 1 , we no longer need or want to choose another literal to 27 them, so we add edges between all the vertices of a clause:

  47. Replicating the choice structure (2) subsequent choice (of vertex) by introducing edges between i th clause Once we have already chosen to satisfy the i th clause using, 27 In Independent Set, we can make a choice (of vertex) block a satisfy the same clause. say, x 1 , we no longer need or want to choose another literal to them, so we add edges between all the vertices of a clause: i : ¬ x 3 ( x 1 ∨ ¬ x 3 ∨ x 7 ) �→ � �� � i : x 1 i : x 7

  48. Replicating the choice structure (3) i x 3 j x 2 j x 1 j x 7 i x 3 i x 1 j th clause x 3 x 2 x 1 i th clause x 7 x 3 x 1 mutually exclusive, which we can realise using an edge. So we This is another straightforward case of two choices being 28 Also, if we choose to satisfy a clause by, say, ¬ x 3 , then we can’t satisfy any other clauses using x 3 anymore: after all, in our assignment, x 3 would be set to F . add edges between any two contradictory literals:

  49. Replicating the choice structure (3) mutually exclusive, which we can realise using an edge. So we j th clause i th clause 28 This is another straightforward case of two choices being Also, if we choose to satisfy a clause by, say, ¬ x 3 , then we can’t satisfy any other clauses using x 3 anymore: after all, in our assignment, x 3 would be set to F . add edges between any two contradictory literals: ( x 1 ∨ ¬ x 3 ∨ x 7 ) � �� � i : ¬ x 3 j : x 2 �→ i : x 1 j : ¬ x 1 ( ¬ x 1 ∨ x 2 ∨ x 3 ) � �� � i : x 7 j : x 3

  50. Finishing up Now, set the minimum independent set size k to the number of clauses, so we need to pick a literal to make every clause true. And we’re actually done! This conversion was evidently polynomial-time. Just need to check: If we had a satisfying assignment to the 3-SAT instance, then we have an independent set of size k in the graph. If we have an independent set of size k , then we have a satisfying assignment to the 3-SAT instance the graph came from. Conclude: Independent Set is NP-complete. 29

  51. Finishing up Now, set the minimum independent set size k to the number of clauses, so we need to pick a literal to make every clause true. And we’re actually done! This conversion was evidently polynomial-time. Just need to check: If we had a satisfying assignment to the 3-SAT instance, then we have an independent set of size k in the graph. If we have an independent set of size k , then we have a satisfying assignment to the 3-SAT instance the graph came from. Conclude: Independent Set is NP-complete. 29

  52. Finishing up Now, set the minimum independent set size k to the number of clauses, so we need to pick a literal to make every clause true. And we’re actually done! This conversion was evidently polynomial-time. Just need to check: If we had a satisfying assignment to the 3-SAT instance, then we have an independent set of size k in the graph. If we have an independent set of size k , then we have a satisfying assignment to the 3-SAT instance the graph came from. Conclude: Independent Set is NP-complete. 29

  53. Finishing up Now, set the minimum independent set size k to the number of clauses, so we need to pick a literal to make every clause true. And we’re actually done! This conversion was evidently polynomial-time. Just need to check: If we had a satisfying assignment to the 3-SAT instance, then we have an independent set of size k in the graph. If we have an independent set of size k , then we have a satisfying assignment to the 3-SAT instance the graph came from. Conclude: Independent Set is NP-complete. 29

  54. Finishing up Now, set the minimum independent set size k to the number of clauses, so we need to pick a literal to make every clause true. And we’re actually done! This conversion was evidently polynomial-time. Just need to check: If we had a satisfying assignment to the 3-SAT instance, then we have an independent set of size k in the graph. If we have an independent set of size k , then we have a satisfying assignment to the 3-SAT instance the graph came from. 29 Conclude: Independent Set is NP-complete. ✷

  55. The Graph 3-colouring decision problem asks: given a graph, can it be vertex 3-coloured? Graph Colouring an assignment of one of k colours to each of the vertices of G Formally, a map c V k such that u v E , c u c v . For which k can we colour a given graph? 30 Given a graph G = ( V , E ) , a vertex k -colouring of this graph is such that no two adjacent vertices share a colour.

  56. The Graph 3-colouring decision problem asks: given a graph, can it be vertex 3-coloured? Graph Colouring an assignment of one of k colours to each of the vertices of G For which k can we colour a given graph? 30 Given a graph G = ( V , E ) , a vertex k -colouring of this graph is such that no two adjacent vertices share a colour. Formally, a map c : V → [ k ] such that ∀{ u , v } ∈ E , c ( u ) � = c ( v ) .

  57. The Graph 3-colouring decision problem asks: given a graph, can it be vertex 3-coloured? Graph Colouring an assignment of one of k colours to each of the vertices of G For which k can we colour a given graph? 30 Given a graph G = ( V , E ) , a vertex k -colouring of this graph is such that no two adjacent vertices share a colour. Formally, a map c : V → [ k ] such that ∀{ u , v } ∈ E , c ( u ) � = c ( v ) .

  58. Graph Colouring an assignment of one of k colours to each of the vertices of G For which k can we colour a given graph? can it be vertex 3-coloured? 30 Given a graph G = ( V , E ) , a vertex k -colouring of this graph is such that no two adjacent vertices share a colour. Formally, a map c : V → [ k ] such that ∀{ u , v } ∈ E , c ( u ) � = c ( v ) . The Graph 3-colouring decision problem asks: given a graph,

  59. Suppose our three colours are with red, green and blue. Graph Colouring: Preliminaries (1) Clearly, this problem is in NP. Let’s build some intution for it. What colours could we give the unpainted (white) vertex here? What about this? 31

  60. Graph Colouring: Preliminaries (1) Clearly, this problem is in NP. Let’s build some intution for it. What colours could we give the unpainted (white) vertex here? What about this? 31 Suppose our three colours are with red, green and blue.

  61. Graph Colouring: Preliminaries (1) Clearly, this problem is in NP. Let’s build some intution for it. What colours could we give the unpainted (white) vertex here? What about this? 31 Suppose our three colours are with red, green and blue.

  62. Graph Colouring: Preliminaries (1) Clearly, this problem is in NP. Let’s build some intution for it. What colours could we give the unpainted (white) vertex here? What about this? 31 Suppose our three colours are with red, green and blue.

  63. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  64. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  65. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  66. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  67. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  68. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  69. Graph Colouring: Preliminaries (2) What colours could we assign to the two blank vertices here? What about this chain? 32

  70. Graph Colouring: Preliminaries (3) What about this? x There is no 3-colouring! Doesn’t have to be a complete graph: 33

  71. Graph Colouring: Preliminaries (3) What about this? x There is no 3-colouring! Doesn’t have to be a complete graph: 33

  72. Graph Colouring: Preliminaries (3) What about this? x There is no 3-colouring! Doesn’t have to be a complete graph: 33

  73. Graph Colouring: Preliminaries (3) What about this? x There is no 3-colouring! Doesn’t have to be a complete graph: 33

  74. consisting of a series of choices of assignments to variables, repeatedly pick a colour for some vertex, getting stuck when a Towards NP-completeness Goal: Show that Graph 3-colouring is NP-complete by reducing from 3-SAT. As before, we want to use the search tree structure to drive our gadget design. However, this time, we’ll analyse 3-SAT as which gets stuck whenever we make some clause unsatisfiable. How do we build up a solution to 3-colouring? Natural framing of what we did while building intuition: vertex can’t be consistently coloured. 34

  75. repeatedly pick a colour for some vertex, getting stuck when a Towards NP-completeness Goal: Show that Graph 3-colouring is NP-complete by reducing from 3-SAT. As before, we want to use the search tree structure to drive our gadget design. However, this time, we’ll analyse 3-SAT as which gets stuck whenever we make some clause unsatisfiable. How do we build up a solution to 3-colouring? Natural framing of what we did while building intuition: vertex can’t be consistently coloured. 34 consisting of a series of choices of assignments to variables,

  76. repeatedly pick a colour for some vertex, getting stuck when a Towards NP-completeness Goal: Show that Graph 3-colouring is NP-complete by reducing from 3-SAT. As before, we want to use the search tree structure to drive our gadget design. However, this time, we’ll analyse 3-SAT as which gets stuck whenever we make some clause unsatisfiable. How do we build up a solution to 3-colouring? Natural framing of what we did while building intuition: vertex can’t be consistently coloured. 34 consisting of a series of choices of assignments to variables,

  77. Towards NP-completeness Goal: Show that Graph 3-colouring is NP-complete by reducing from 3-SAT. As before, we want to use the search tree structure to drive our gadget design. However, this time, we’ll analyse 3-SAT as which gets stuck whenever we make some clause unsatisfiable. How do we build up a solution to 3-colouring? Natural framing of what we did while building intuition: vertex can’t be consistently coloured. 34 consisting of a series of choices of assignments to variables, repeatedly pick a colour for some vertex, getting stuck when a

  78. variables, and say that, for instance, colouring it green means we make the variable T , and red means we make the variable F . No: 3-colouring is invariant under permuting colours. That is, x 3 with all true.) Choice structure of 3-colouring First idea: In our view of 3-SAT, we pick either T or F for each variable. So, in our view of 3-colouring, identify some vertices with Could something like this work? if we take a valid colouring and globally swap green and red, we still have a valid colouring. But this is not true for T and F in 3-SAT assignments! (Consider x 1 x 2 35

  79. No: 3-colouring is invariant under permuting colours. That is, x 3 with all true.) Choice structure of 3-colouring First idea: In our view of 3-SAT, we pick either T or F for each variable. So, in our view of 3-colouring, identify some vertices with we make the variable T , and red means we make the variable F . Could something like this work? if we take a valid colouring and globally swap green and red, we still have a valid colouring. But this is not true for T and F in 3-SAT assignments! (Consider x 1 x 2 35 variables, and say that, for instance, colouring it green means

  80. No: 3-colouring is invariant under permuting colours. That is, x 3 with all true.) Choice structure of 3-colouring First idea: In our view of 3-SAT, we pick either T or F for each variable. So, in our view of 3-colouring, identify some vertices with we make the variable T , and red means we make the variable F . Could something like this work? if we take a valid colouring and globally swap green and red, we still have a valid colouring. But this is not true for T and F in 3-SAT assignments! (Consider x 1 x 2 35 variables, and say that, for instance, colouring it green means

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