theory of computer science
play

Theory of Computer Science E4. Some NP-Complete Problems, Part I - PowerPoint PPT Presentation

Theory of Computer Science E4. Some NP-Complete Problems, Part I Gabriele R oger University of Basel May 18, 2020 Graph Problems Routing Problems Summary Course Overview Background Nondeterminism Logic P, NP Automata Theory Theory


  1. Theory of Computer Science E4. Some NP-Complete Problems, Part I Gabriele R¨ oger University of Basel May 18, 2020

  2. Graph Problems Routing Problems Summary Course Overview Background Nondeterminism Logic P, NP Automata Theory Theory Polynomial Reductions Turing Computability Cook-Levin Theorem Complexity NP-complete Problems More Computability

  3. Graph Problems Routing Problems Summary Overview of the Reductions SAT 3SAT Clique DirHamiltonCycle SubsetSum IndSet HamiltonCycle Partition VertexCover TSP BinPacking

  4. Graph Problems Routing Problems Summary Graph Problems

  5. Graph Problems Routing Problems Summary 3SAT ≤ p Clique SAT 3SAT Clique DirHamiltonCycle SubsetSum IndSet HamiltonCycle Partition VertexCover TSP BinPacking

  6. Graph Problems Routing Problems Summary Clique Definition ( Clique ) The problem Clique is defined as follows: Given: undirected graph G = � V , E � , number K ∈ N 0 Question: Does G have a clique of size at least K , i. e., a set of vertices C ⊆ V with | C | ≥ K and { u , v } ∈ E for all u , v ∈ C with u � = v ? German: Clique

  7. Graph Problems Routing Problems Summary Clique is NP-Complete (1) Theorem ( Clique is NP-Complete) Clique is NP-complete.

  8. Graph Problems Routing Problems Summary Clique is NP-Complete (2) Proof. Clique ∈ NP: guess and check. Clique is NP-hard: We show 3SAT ≤ p Clique . We are given a 3-CNF formula ϕ , and we may assume that each clause has exactly three literals. In polynomial time, we must construct a graph G = � V , E � and a number K such that: G has a clique of size at least K iff ϕ is satisfiable. � construction of V , E , K on the following slides. . . .

  9. Graph Problems Routing Problems Summary Clique is NP-Complete (2) Proof. Clique ∈ NP: guess and check. Clique is NP-hard: We show 3SAT ≤ p Clique . We are given a 3-CNF formula ϕ , and we may assume that each clause has exactly three literals. In polynomial time, we must construct a graph G = � V , E � and a number K such that: G has a clique of size at least K iff ϕ is satisfiable. � construction of V , E , K on the following slides. . . .

  10. Graph Problems Routing Problems Summary Clique is NP-Complete (2) Proof. Clique ∈ NP: guess and check. Clique is NP-hard: We show 3SAT ≤ p Clique . We are given a 3-CNF formula ϕ , and we may assume that each clause has exactly three literals. In polynomial time, we must construct a graph G = � V , E � and a number K such that: G has a clique of size at least K iff ϕ is satisfiable. � construction of V , E , K on the following slides. . . .

  11. Graph Problems Routing Problems Summary Clique is NP-Complete (2) Proof. Clique ∈ NP: guess and check. Clique is NP-hard: We show 3SAT ≤ p Clique . We are given a 3-CNF formula ϕ , and we may assume that each clause has exactly three literals. In polynomial time, we must construct a graph G = � V , E � and a number K such that: G has a clique of size at least K iff ϕ is satisfiable. � construction of V , E , K on the following slides. . . .

  12. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  13. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  14. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  15. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  16. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  17. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  18. Graph Problems Routing Problems Summary Clique is NP-Complete (3) Proof (continued). Let m be the number of clauses in ϕ . Let ℓ ij the j -th literal in clause i . Define V , E , K as follows: V = {� i , j � | 1 ≤ i ≤ m , 1 ≤ j ≤ 3 } � a vertex for every literal of every clause E contains edge between � i , j � and � i ′ , j ′ � if and only if i � = i ′ � belong to different clauses, and ℓ ij and ℓ i ′ j ′ are not complementary literals K = m � obviously polynomially computable to show: reduction property . . .

  19. Graph Problems Routing Problems Summary Clique is NP-Complete (4) Proof (continued). ( ⇒ ): If ϕ is satisfiable, then � V , E � has clique of size at least K : Given a satisfying variable assignment choose a vertex corresponding to a satisfied literal in each clause. The chosen K vertices are all connected with each other and hence form a clique of size K . . . .

  20. Graph Problems Routing Problems Summary Clique is NP-Complete (4) Proof (continued). ( ⇒ ): If ϕ is satisfiable, then � V , E � has clique of size at least K : Given a satisfying variable assignment choose a vertex corresponding to a satisfied literal in each clause. The chosen K vertices are all connected with each other and hence form a clique of size K . . . .

  21. Graph Problems Routing Problems Summary Clique is NP-Complete (5) Proof (continued). ( ⇐ ): If � V , E � has a clique of size at least K , then ϕ is satisfiable: Consider a given clique C of size at least K . The vertices in C must all correspond to different clauses (vertices in the same clause are not connected by edges). � exactly one vertex per clause is included in C Two vertices in C never correspond to complementary literals X and ¬ X (due to the way we defined the edges). If a vertex corresp. to X was chosen, map X to 1 (true). If a vertex corresp. to ¬ X was chosen, map X to 0 (false). If neither was chosen, arbitrarily map X to 0 or 1. � satisfying assignment

  22. Graph Problems Routing Problems Summary Clique is NP-Complete (5) Proof (continued). ( ⇐ ): If � V , E � has a clique of size at least K , then ϕ is satisfiable: Consider a given clique C of size at least K . The vertices in C must all correspond to different clauses (vertices in the same clause are not connected by edges). � exactly one vertex per clause is included in C Two vertices in C never correspond to complementary literals X and ¬ X (due to the way we defined the edges). If a vertex corresp. to X was chosen, map X to 1 (true). If a vertex corresp. to ¬ X was chosen, map X to 0 (false). If neither was chosen, arbitrarily map X to 0 or 1. � satisfying assignment

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