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

theory of computer science
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Theory of Computer Science

  • E4. Some NP-Complete Problems, Part I

Gabriele R¨

  • ger

University of Basel

May 18, 2020

slide-2
SLIDE 2

Graph Problems Routing Problems Summary

Course Overview

Theory Background Logic Automata Theory Turing Computability Complexity Nondeterminism P, NP Polynomial Reductions Cook-Levin Theorem NP-complete Problems More Computability

slide-3
SLIDE 3

Graph Problems Routing Problems Summary

Overview of the Reductions

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-4
SLIDE 4

Graph Problems Routing Problems Summary

Graph Problems

slide-5
SLIDE 5

Graph Problems Routing Problems Summary

3SAT ≤p Clique

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-6
SLIDE 6

Graph Problems Routing Problems Summary

Clique

Definition (Clique) The problem Clique is defined as follows: Given: undirected graph G = V , E, number K ∈ N0 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

slide-7
SLIDE 7

Graph Problems Routing Problems Summary

Clique is NP-Complete (1)

Theorem (Clique is NP-Complete) Clique is NP-complete.

slide-8
SLIDE 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. . . .

slide-9
SLIDE 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. . . .

slide-10
SLIDE 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. . . .

slide-11
SLIDE 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. . . .

slide-12
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-13
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-14
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-15
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-16
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-17
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-18
SLIDE 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

  • bviously polynomially computable

to show: reduction property . . .

slide-19
SLIDE 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. . . .

slide-20
SLIDE 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. . . .

slide-21
SLIDE 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

slide-22
SLIDE 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

slide-23
SLIDE 23

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

slide-24
SLIDE 24

Graph Problems Routing Problems Summary

Clique ≤p IndSet

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-25
SLIDE 25

Graph Problems Routing Problems Summary

IndSet

Definition (IndSet) The problem IndSet is defined as follows: Given: undirected graph G = V , E, number K ∈ N0 Question: Does G have an independent set of size at least K,

  • i. e., a set of vertices I ⊆ V with |I| ≥ K

and {u, v} / ∈ E for all u, v ∈ I with u = v? German: unabh¨ angige Menge

slide-26
SLIDE 26

Graph Problems Routing Problems Summary

IndSet is NP-Complete (1)

Theorem (IndSet is NP-Complete) IndSet is NP-complete.

slide-27
SLIDE 27

Graph Problems Routing Problems Summary

IndSet is NP-Complete (2)

Proof. IndSet ∈ NP: guess and check. IndSet is NP-hard: We show Clique ≤p IndSet. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for Clique. Then f (G, K) is the IndSet instance G, K, where G := V , E and E := {{u, v} ⊆ V | u = v, {u, v} / ∈ E}. (This graph G is called the complement graph of G.) Clearly f can be computed in polynomial time. . . .

slide-28
SLIDE 28

Graph Problems Routing Problems Summary

IndSet is NP-Complete (2)

Proof. IndSet ∈ NP: guess and check. IndSet is NP-hard: We show Clique ≤p IndSet. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for Clique. Then f (G, K) is the IndSet instance G, K, where G := V , E and E := {{u, v} ⊆ V | u = v, {u, v} / ∈ E}. (This graph G is called the complement graph of G.) Clearly f can be computed in polynomial time. . . .

slide-29
SLIDE 29

Graph Problems Routing Problems Summary

IndSet is NP-Complete (2)

Proof. IndSet ∈ NP: guess and check. IndSet is NP-hard: We show Clique ≤p IndSet. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for Clique. Then f (G, K) is the IndSet instance G, K, where G := V , E and E := {{u, v} ⊆ V | u = v, {u, v} / ∈ E}. (This graph G is called the complement graph of G.) Clearly f can be computed in polynomial time. . . .

slide-30
SLIDE 30

Graph Problems Routing Problems Summary

IndSet is NP-Complete (2)

Proof. IndSet ∈ NP: guess and check. IndSet is NP-hard: We show Clique ≤p IndSet. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for Clique. Then f (G, K) is the IndSet instance G, K, where G := V , E and E := {{u, v} ⊆ V | u = v, {u, v} / ∈ E}. (This graph G is called the complement graph of G.) Clearly f can be computed in polynomial time. . . .

slide-31
SLIDE 31

Graph Problems Routing Problems Summary

IndSet is NP-Complete (2)

Proof. IndSet ∈ NP: guess and check. IndSet is NP-hard: We show Clique ≤p IndSet. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for Clique. Then f (G, K) is the IndSet instance G, K, where G := V , E and E := {{u, v} ⊆ V | u = v, {u, v} / ∈ E}. (This graph G is called the complement graph of G.) Clearly f can be computed in polynomial time. . . .

slide-32
SLIDE 32

Graph Problems Routing Problems Summary

IndSet is NP-Complete (3)

Proof (continued). We have: V , E, K ∈ Clique iff there exists a set V ′ ⊆ V with |V ′| ≥ K and {u, v} ∈ E for all u, v ∈ V ′ with u = v iff there exists a set V ′ ⊆ V with |V ′| ≥ K and {u, v} / ∈ E for all u, v ∈ V ′ with u = v iff V , E, K ∈ IndSet iff f (V , E, K) ∈ IndSet and hence f is a reduction.

slide-33
SLIDE 33

Graph Problems Routing Problems Summary

IndSet ≤p VertexCover

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-34
SLIDE 34

Graph Problems Routing Problems Summary

VertexCover

Definition (VertexCover) The problem VertexCover is defined as follows: Given: undirected graph G = V , E, number K ∈ N0 Question: Does G have a vertex cover of size at most K,

  • i. e., a set of vertices C ⊆ V with |C| ≤ K and {u, v} ∩ C = ∅

for all {u, v} ∈ E? German: Knoten¨ uberdeckung

slide-35
SLIDE 35

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (1)

Theorem (VertexCover is NP-Complete) VertexCover is NP-complete.

slide-36
SLIDE 36

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (2)

Proof. VertexCover ∈ NP: guess and check. VertexCover is NP-hard: We show IndSet ≤p VertexCover. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for IndSet. Then f (G, K) := G, |V | − K. This can clearly be computed in polynomial time. . . .

slide-37
SLIDE 37

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (2)

Proof. VertexCover ∈ NP: guess and check. VertexCover is NP-hard: We show IndSet ≤p VertexCover. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for IndSet. Then f (G, K) := G, |V | − K. This can clearly be computed in polynomial time. . . .

slide-38
SLIDE 38

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (2)

Proof. VertexCover ∈ NP: guess and check. VertexCover is NP-hard: We show IndSet ≤p VertexCover. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for IndSet. Then f (G, K) := G, |V | − K. This can clearly be computed in polynomial time. . . .

slide-39
SLIDE 39

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (2)

Proof. VertexCover ∈ NP: guess and check. VertexCover is NP-hard: We show IndSet ≤p VertexCover. We describe a polynomial reduction f . Let G, K with G = V , E be the given input for IndSet. Then f (G, K) := G, |V | − K. This can clearly be computed in polynomial time. . . .

slide-40
SLIDE 40

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (3)

Proof (continued). For vertex set V ′ ⊆ V , we write V ′ for its complement V \ V ′. Observation: a set of vertices is a vertex cover iff its complement is an independent set. We thus have: V , E, K ∈ IndSet iff V , E has an independent set I with |I| ≥ K iff V , E has a vertex cover C with |C| ≥ K iff V , E has a vertex cover C with |C| ≤ |V | − K iff V , E, |V | − K ∈ VertexCover iff f (V , E, K) ∈ VertexCover and hence f is a reduction.

slide-41
SLIDE 41

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (3)

Proof (continued). For vertex set V ′ ⊆ V , we write V ′ for its complement V \ V ′. Observation: a set of vertices is a vertex cover iff its complement is an independent set. We thus have: V , E, K ∈ IndSet iff V , E has an independent set I with |I| ≥ K iff V , E has a vertex cover C with |C| ≥ K iff V , E has a vertex cover C with |C| ≤ |V | − K iff V , E, |V | − K ∈ VertexCover iff f (V , E, K) ∈ VertexCover and hence f is a reduction.

slide-42
SLIDE 42

Graph Problems Routing Problems Summary

VertexCover is NP-Complete (3)

Proof (continued). For vertex set V ′ ⊆ V , we write V ′ for its complement V \ V ′. Observation: a set of vertices is a vertex cover iff its complement is an independent set. We thus have: V , E, K ∈ IndSet iff V , E has an independent set I with |I| ≥ K iff V , E has a vertex cover C with |C| ≥ K iff V , E has a vertex cover C with |C| ≤ |V | − K iff V , E, |V | − K ∈ VertexCover iff f (V , E, K) ∈ VertexCover and hence f is a reduction.

slide-43
SLIDE 43

Graph Problems Routing Problems Summary

Routing Problems

slide-44
SLIDE 44

Graph Problems Routing Problems Summary

3SAT ≤p DirHamiltonCycle

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-45
SLIDE 45

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (1)

Definition (Reminder: DirHamiltonCycle) The problem DirHamiltonCycle is defined as follows: Given: directed graph G = V , E Question: Does G contain a Hamilton cycle? Theorem DirHamiltonCycle is NP-complete.

slide-46
SLIDE 46

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (1)

Definition (Reminder: DirHamiltonCycle) The problem DirHamiltonCycle is defined as follows: Given: directed graph G = V , E Question: Does G contain a Hamilton cycle? Theorem DirHamiltonCycle is NP-complete.

slide-47
SLIDE 47

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (2)

Proof. DirHamiltonCycle ∈ NP: guess and check. DirHamiltonCycle is NP-hard: We show 3SAT ≤p DirHamiltonCycle. We are given a 3-CNF formula ϕ where each clause contains exactly three literals and no clause contains duplicated literals. We must, in polynomial time, construct a directed graph G = V , E such that: G contains a Hamilton cycle iff ϕ is satisfiable. construction of V , E on the following slides . . .

slide-48
SLIDE 48

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (2)

Proof. DirHamiltonCycle ∈ NP: guess and check. DirHamiltonCycle is NP-hard: We show 3SAT ≤p DirHamiltonCycle. We are given a 3-CNF formula ϕ where each clause contains exactly three literals and no clause contains duplicated literals. We must, in polynomial time, construct a directed graph G = V , E such that: G contains a Hamilton cycle iff ϕ is satisfiable. construction of V , E on the following slides . . .

slide-49
SLIDE 49

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (2)

Proof. DirHamiltonCycle ∈ NP: guess and check. DirHamiltonCycle is NP-hard: We show 3SAT ≤p DirHamiltonCycle. We are given a 3-CNF formula ϕ where each clause contains exactly three literals and no clause contains duplicated literals. We must, in polynomial time, construct a directed graph G = V , E such that: G contains a Hamilton cycle iff ϕ is satisfiable. construction of V , E on the following slides . . .

slide-50
SLIDE 50

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (3)

Proof (continued). Let X1, . . . , Xn be the propositional variables in ϕ. Let c1, . . . , cm be the clauses of ϕ with ci = (ℓi1 ∨ ℓi2 ∨ ℓi3). Construct a graph with 6m + n vertices (described on the following slides). . . .

slide-51
SLIDE 51

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (4)

Proof (continued). For every variable Xi, add vertex xi with 2 incoming and 2 outgoing edges:

x1 x2 . . . xn

For every clause cj, add the subgraph Cj with 6 vertices:

a b c A B C

We describe later how to connect these parts. . . .

slide-52
SLIDE 52

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (5)

Proof (continued). Let π be a Hamilton cycle of the total graph. Whenever π enters subgraph Cj from one of its “entrances”, it must leave via the corresponding “exit”: (a − → A, b − → B, c − → C). Otherwise, π cannot be a Hamilton cycle. Hamilton cycles can behave in the following ways with regard to Cj:

π passes through Cj once (from any entrance) π passes through Cj twice (from any two entrances) π passes through Cj three times (once from every entrance)

. . .

slide-53
SLIDE 53

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (6)

Proof (continued). Connect the “open ends” in the graph as follows: Identify entrances/exits of the clause subgraph Cj with the three literals in clause cj. One exit of xi is positive, the other one is negative. For the positive exit, determine the clauses in which the positive literal Xi occurs:

Connect the positive exit of xi with the Xi-entrance

  • f the first such clause graph.

Connect the Xi-exit of this clause graph with the Xi-entrance

  • f the second such clause graph, and so on.

Connect the Xi-exit of the last such clause graph with the positive entrance of xi+1 (or x1 if i = n).

analogously for the negative exit of xi and the literal ¬Xi . . .

slide-54
SLIDE 54

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (7)

Proof (continued). The construction is polynomial and is a reduction: (⇒): construct a Hamilton cycle from a satisfying assignment Given a satisfying assignment I, construct a Hamilton cycle that leaves xi through the positive exit if I(Xi) is true and by the negative exit if I(Xi) is false. Afterwards, we visit all Cj-subgraphs for clauses that are satisfied by this literal. In total, we visit each Cj-subgraph 1–3 times. . . .

slide-55
SLIDE 55

Graph Problems Routing Problems Summary

DirHamiltonCycle is NP-Complete (8)

Proof (continued). (⇐): construct a satisfying assignment from a Hamilton cycle A Hamilton cycle visits every vertex xi and leaves it by the positive or negative exit. Map Xi to true or false depending on which exit is used to leave xi. Because the cycle must traverse each Cj-subgraph at least once (otherwise it is not a Hamilton cycle), this results in a satisfying assignment. (Details omitted.)

slide-56
SLIDE 56

Graph Problems Routing Problems Summary

DirHamiltonCycle ≤p HamiltonCycle

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-57
SLIDE 57

Graph Problems Routing Problems Summary

HamiltonCycle is NP-Complete (1)

Definition (Reminder: HamiltonCycle) The problem HamiltonCycle is defined as follows: Given: undirected graph G = V , E Question: Does G contain a Hamilton cycle? Theorem HamiltonCycle is NP-complete.

slide-58
SLIDE 58

Graph Problems Routing Problems Summary

HamiltonCycle is NP-Complete (1)

Definition (Reminder: HamiltonCycle) The problem HamiltonCycle is defined as follows: Given: undirected graph G = V , E Question: Does G contain a Hamilton cycle? Theorem HamiltonCycle is NP-complete.

slide-59
SLIDE 59

Graph Problems Routing Problems Summary

HamiltonCycle is NP-Complete (2)

Proof sketch. HamiltonCycle ∈ NP: guess and check. HamiltonCycle is NP-hard: We show DirHamiltonCycle ≤p HamiltonCycle. Basic building block of the reduction:

v

= ⇒

v1 v2 v3

slide-60
SLIDE 60

Graph Problems Routing Problems Summary

HamiltonCycle is NP-Complete (2)

Proof sketch. HamiltonCycle ∈ NP: guess and check. HamiltonCycle is NP-hard: We show DirHamiltonCycle ≤p HamiltonCycle. Basic building block of the reduction:

v

= ⇒

v1 v2 v3

slide-61
SLIDE 61

Graph Problems Routing Problems Summary

HamiltonCycle is NP-Complete (2)

Proof sketch. HamiltonCycle ∈ NP: guess and check. HamiltonCycle is NP-hard: We show DirHamiltonCycle ≤p HamiltonCycle. Basic building block of the reduction:

v

= ⇒

v1 v2 v3

slide-62
SLIDE 62

Graph Problems Routing Problems Summary

HamiltonCycle ≤p TSP

SAT 3SAT Clique IndSet VertexCover DirHamiltonCycle HamiltonCycle TSP SubsetSum Partition BinPacking

slide-63
SLIDE 63

Graph Problems Routing Problems Summary

TSP is NP-Complete (1)

Definition (Reminder: TSP) TSP (traveling salesperson problem) is the following decision problem: Given: finite set S = ∅ of cities, symmetric cost function cost : S × S → N0, cost bound K ∈ N0 Question: Is there a tour with total cost at most K, i. e., a permutation s1, . . . , sn of the cities with n−1

i=1 cost(si, si+1) + cost(sn, s1) ≤ K?

German: Problem der/des Handlungsreisenden Theorem TSP is NP-complete.

slide-64
SLIDE 64

Graph Problems Routing Problems Summary

TSP is NP-Complete (2)

Proof. TSP ∈ NP: guess and check. TSP is NP-hard: We showed HamiltonCycle ≤p TSP in Chapter E2.

slide-65
SLIDE 65

Graph Problems Routing Problems Summary

Summary

slide-66
SLIDE 66

Graph Problems Routing Problems Summary

Summary

In this chapter we showed NP-completeness of

three classical graph problems: Clique, IndSet, VertexCover three classical routing problems: DirHamiltonCycle, HamiltonCycle, TSP