• Non ci sono risultati.

More Reductions for NP Problems

N/A
N/A
Protected

Academic year: 2021

Condividi "More Reductions for NP Problems"

Copied!
177
0
0

Testo completo

(1)

More Reductions for NP Problems

Nabil Mustafa

Computational Complexity

(2)

Reductions From Last Time

So far, we have shown the following problems NP complete:

SAT , 3-CNF SAT, INDSET , CLIQUE , VERTEX-COVER , HITTING-SET , INTEGER-PROGRAMMING

IS SAT

3-SAT

IP HS

VC

CL

2 / 177

(3)

HAMILTONIAN

Claim

HAMILTONIAN : Given a directed graph G = (V, E), does G have a Hamiltonian path?

The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths

Note that HAMILTONIAN is in NP We reduce 3-CNF SAT to HAMILTONIAN

I For a fixed 3-CNF SAT formula, show that it can be transformed into a graph whose Hamiltonian path will give us the assignments for SAT.

(4)

HAMILTONIAN

Claim

HAMILTONIAN : Given a directed graph G = (V, E), does G have a Hamiltonian path?

The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

Review: Hamiltonian path visits each vertex in G exactly once

Computationally very different from Eulerian paths Note that HAMILTONIAN is in NP

We reduce 3-CNF SAT to HAMILTONIAN

I For a fixed 3-CNF SAT formula, show that it can be transformed into a graph whose Hamiltonian path will give us the assignments for SAT.

4 / 177

(5)

HAMILTONIAN

Claim

HAMILTONIAN : Given a directed graph G = (V, E), does G have a Hamiltonian path?

The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths

Note that HAMILTONIAN is in NP We reduce 3-CNF SAT to HAMILTONIAN

I For a fixed 3-CNF SAT formula, show that it can be transformed into a graph whose Hamiltonian path will give us the assignments for SAT.

(6)

HAMILTONIAN

Claim

HAMILTONIAN : Given a directed graph G = (V, E), does G have a Hamiltonian path?

The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths

Note that HAMILTONIAN is in NP

We reduce 3-CNF SAT to HAMILTONIAN

I For a fixed 3-CNF SAT formula, show that it can be transformed into a graph whose Hamiltonian path will give us the assignments for SAT.

6 / 177

(7)

HAMILTONIAN

Claim

HAMILTONIAN : Given a directed graph G = (V, E), does G have a Hamiltonian path?

The Hamiltonian path problem (HAMILTONIAN ) is NP complete.

Review: Hamiltonian path visits each vertex in G exactly once Computationally very different from Eulerian paths

Note that HAMILTONIAN is in NP We reduce 3-CNF SAT to HAMILTONIAN

(8)

Reduction Sketch

φ = C1∧ C2∧ . . . ∧ Cm, n variables, Ci = (x1i ∨ x2i ∨ x3i)

Givenφ, have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

We first define the mapping of variables, and then the clauses. Each xi will correspond to a path (chain) of 6m vertices If we are at the first (or end) vertex, only one path to follow

x

i

8 / 177

(9)

Reduction Sketch

φ = C1∧ C2∧ . . . ∧ Cm, n variables, Ci = (x1i ∨ x2i ∨ x3i)

Givenφ, have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

We first define the mapping of variables, and then the clauses. Each xi will correspond to a path (chain) of 6m vertices If we are at the first (or end) vertex, only one path to follow

x

i

(10)

Reduction Sketch

φ = C1∧ C2∧ . . . ∧ Cm, n variables, Ci = (x1i ∨ x2i ∨ x3i)

Givenφ, have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

We first define the mapping of variables, and then the clauses.

Each xi will correspond to a path (chain) of 6m vertices If we are at the first (or end) vertex, only one path to follow

x

i

10 / 177

(11)

Reduction Sketch

φ = C1∧ C2∧ . . . ∧ Cm, n variables, Ci = (x1i ∨ x2i ∨ x3i)

Givenφ, have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

We first define the mapping of variables, and then the clauses.

Each xi will correspond to a path (chain) of 6m vertices

If we are at the first (or end) vertex, only one path to follow

x

i

(12)

Reduction Sketch

φ = C1∧ C2∧ . . . ∧ Cm, n variables, Ci = (x1i ∨ x2i ∨ x3i)

Givenφ, have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

We first define the mapping of variables, and then the clauses.

Each xi will correspond to a path (chain) of 6m vertices

If we are at the first (or end) vertex, only one path to follow

x

i

12 / 177

(13)

Reduction Sketch

φ = C1∧ C2∧ . . . ∧ Cm, n variables, Ci = (x1i ∨ x2i ∨ x3i)

Givenφ, have to construct a graph G such that G has a Hamiltonian path iff φ is satisfiable.

We first define the mapping of variables, and then the clauses.

Each xi will correspond to a path (chain) of 6m vertices If we are at the first (or end) vertex, only one path to follow

x

i

(14)

Add a start vertex vstart which has

I no incoming edges.

I an outgoing edge to the first vertex of x1chain.

I an outgoing edge to the last vertex of x1 chain.

x1

x2

vstart

xn−1

xn

14 / 177

(15)

Add a start vertex vstart which has

I no incoming edges.

I an outgoing edge to the first vertex of x1chain.

I an outgoing edge to the last vertex of x1 chain.

x1

x2

vstart

xn−1

xn

(16)

Add a start vertex vstart which has

I no incoming edges.

I an outgoing edge to the first vertex of x1chain.

I an outgoing edge to the last vertex of x1 chain.

x1

x2

vstart

xn−1

xn

16 / 177

(17)

Add a start vertex vstart which has

I no incoming edges.

I an outgoing edge to the first vertex of x1chain.

I an outgoing edge to the last vertex of x1 chain.

x1

x2

vstart

xn−1

xn

(18)

Add a start vertex vstart which has

I no incoming edges.

I an outgoing edge to the first vertex of x1chain.

I an outgoing edge to the last vertex of x1 chain.

x1

x2

vstart

xn−1

xn

18 / 177

(19)

Add an end vertex vend which has

I no outgoing edges.

I an incoming edge from the first vertex of xnchain.

I an incoming edge from the last vertex of xn chain.

x1

x2

vend

xn−1

xn

vstart

(20)

Add an end vertex vend which has

I no outgoing edges.

I an incoming edge from the first vertex of xnchain.

I an incoming edge from the last vertex of xn chain.

x1

x2

vend

xn−1

xn

vstart

20 / 177

(21)

Add an end vertex vend which has

I no outgoing edges.

I an incoming edge from the first vertex of xnchain.

I an incoming edge from the last vertex of xn chain.

x1

x2

vend

xn−1

xn

vstart

(22)

Add an end vertex vend which has

I no outgoing edges.

I an incoming edge from the first vertex of xnchain.

I an incoming edge from the last vertex of xn chain.

x1

x2

vend

xn−1

xn

vstart

22 / 177

(23)

Add an end vertex vend which has

I no outgoing edges.

I an incoming edge from the first vertex of xnchain.

I an incoming edge from the last vertex of xn chain.

x1

x2

xn−1

xn

vstart

(24)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1 I an outgoing edge to the last vertex of chain xi +1

24 / 177

(25)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1

I an outgoing edge to the last vertex of chain xi +1

(26)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1 I an outgoing edge to the last vertex of chain xi +1

26 / 177

(27)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1 I an outgoing edge to the last vertex of chain xi +1

x1

x2

xn−1

xn

vstart

(28)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1 I an outgoing edge to the last vertex of chain xi +1

x1

x2

vend

xn−1

xn

vstart

28 / 177

(29)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1 I an outgoing edge to the last vertex of chain xi +1

x1

x2

xn−1

xn

vstart

(30)

From the first and last vertex of each chain xi, add

I an outgoing edge to the first vertex of chain xi +1 I an outgoing edge to the last vertex of chain xi +1

x1

x2

vend

xn−1

xn

vstart

30 / 177

(31)

Construction Properties

x1

x2

xn−1

xn

vstart

(32)

Construction Properties

Any Hamiltonian path has to start at vstart

x1

x2

vend

xn−1

xn

vstart

32 / 177

(33)

Construction Properties

Any Hamiltonian path has to end at vend

x1

x2

xn−1

xn

vstart

(34)

Construction Properties

Any Hamiltonian path first traverses chain x1, then x2 etc.

x1

x2

vend

xn−1

xn

vstart

34 / 177

(35)

Construction Properties

For each chain, only two ways of traversing it.

I Left-to-right means xi = 1, right-to-left means xi = 0

x1

x2

xn−1

xn

vstart

(36)

Construction Properties

Each assignment of variables corresponds to a unique Hamiltonian path.

x1

x2

vend

xn−1

xn

vstart

36 / 177

(37)

Construction Properties

Each Hamiltonian path corresponds to a unique variable assignment.

x1

x2

xn−1

xn

vstart

(38)

Construction Properties

So far, no constraints – they will come from the clauses now.

x1

x2

vend

xn−1

xn

vstart

38 / 177

(39)

Clause Constraints

Each clause Cj corresponds to a new vertex uj.

If Cj contains a non-negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk+1 in the xi chain

x

i

u

j

(40)

Clause Constraints

Each clause Cj corresponds to a new vertex uj.

If Cj contains a non-negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk+1 in the xi chain

x

i

u

j

40 / 177

(41)

Clause Constraints

Each clause Cj corresponds to a new vertex uj.

If Cj contains a non-negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk+1 in the xi chain

x

i

u

j

(42)

Clause Constraints

Each clause Cj corresponds to a new vertex uj.

If Cj contains a non-negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk+1 in the xi chain

x

i

u

j

42 / 177

(43)

Clause Constraints

Each clause Cj corresponds to a new vertex uj.

If Cj contains a non-negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk+1 in the xi chain

x

i

u

j

(44)

Clause Constraints

If Cj contains a negated literal, reverse the edge directions

If Cj contains a negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk−1 in the xi chain

x

i

u

j

44 / 177

(45)

Clause Constraints

If Cj contains a negated literal, reverse the edge directions If Cj contains a negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk−1 in the xi chain

x

i

u

j

(46)

Clause Constraints

If Cj contains a negated literal, reverse the edge directions If Cj contains a negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk−1in the xi chain

x

i

u

j

46 / 177

(47)

Clause Constraints

If Cj contains a negated literal, reverse the edge directions If Cj contains a negated literal xi, add edges to uj:

I Add an incoming edge from a vertex, say vk, in the xi chain

I Add an outgoing edge to vk−1in the xi chain

x

i

u

j

(48)

An Example

Construction of Hamiltonian path for

(a∨ b) ∧ (a ∨ b) Here:

C1= (a∨ b) C2= (a∨ b)

48 / 177

(49)

The Graph Construction

a

b

vstart

vend

a ∨ b

a ∨ b

Claim

Hamiltonian path exists ONLYif you go from left to right ina and chose any one of the two directions for b.

(50)

The Graph Construction

a

b

vstart

vend

a ∨ b

a ∨ b

Claim

Hamiltonian path exists ONLYif you go from left to right ina and chose any one of the two directions for b.

50 / 177

(51)

Path Corresponding to Assignment 1

a = 1; b = 1

a

b

vstart

a ∨ b

a ∨ b

(52)

Path Corresponding to Assignment 2

a = 1; b = 0

a

b

vstart

vend

a ∨ b

a ∨ b

52 / 177

(53)

Path Corresponding to Assignment 3

a = 0; b = 1

a

b

vstart

vend

a ∨ b

a ∨ b

(54)

Path Corresponding to Assignment 4

a = 0; b = 0

a

b

vstart

vend

a ∨ b

a ∨ b

Error in finding HAMILTONIAN

No HAMILTONIAN PATH as (a∨ b) is not accessible

54 / 177

(55)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction: Any Hamiltonian path has to start at vstart

Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc. For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

(56)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart

Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc. For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

56 / 177

(57)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart

Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc. For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

(58)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc. For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

58 / 177

(59)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it. Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

(60)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path. Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

60 / 177

(61)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path.

Each path corresponds to a unique variable assignment. If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

(62)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path.

Each path corresponds to a unique variable assignment.

If xi ∈ Cj and xi = 1, can visit uj along the way. If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

62 / 177

(63)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path.

Each path corresponds to a unique variable assignment.

If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

(64)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path.

Each path corresponds to a unique variable assignment.

If xi ∈ Cj and xi = 1, can visit uj along the way.

If xi ∈ Cj and xi = 0, can visit uj along the way.

The above two only ways to visit uj without getting stuck.

64 / 177

(65)

Construction Claim

Claim

The constructed graph G has a Hamiltonian path iff φ satisfiable.

Things to note about the final construction:

Any Hamiltonian path has to start at vstart Any Hamiltonian path has to end at vend

Any Hamiltonian path first traverses chain x1, then x2 etc.

For each chain, only two ways of traversing it.

Each assignment of variables corresponds to a path.

Each path corresponds to a unique variable assignment.

If xi ∈ Cj and xi = 1, can visit uj along the way.

(66)

SET-COVER

Claim

SET-COVER : A collectionC = {S1, . . . , Sm} of subsets of a base set X ,

|X | = n, and parameter k, find a set cover C0⊆ C of size k The set cover problem (SET-COVER ) is NP complete.

C0={Si1, . . . , Sik} is a set-cover iff SjSij = X .

Note that SET-COVER is in NP How to prove NP hardness? Reduce from VERTEX-COVER

66 / 177

(67)

SET-COVER

Claim

SET-COVER : A collectionC = {S1, . . . , Sm} of subsets of a base set X ,

|X | = n, and parameter k, find a set cover C0⊆ C of size k The set cover problem (SET-COVER ) is NP complete.

C0={Si1, . . . , Sik} is a set-cover iff SjSij = X .

Note that SET-COVER is in NP How to prove NP hardness? Reduce from VERTEX-COVER

(68)

SET-COVER

Claim

SET-COVER : A collectionC = {S1, . . . , Sm} of subsets of a base set X ,

|X | = n, and parameter k, find a set cover C0⊆ C of size k The set cover problem (SET-COVER ) is NP complete.

C0={Si1, . . . , Sik} is a set-cover iff SjSij = X . Note that SET-COVER is in NP

How to prove NP hardness? Reduce from VERTEX-COVER

68 / 177

(69)

SET-COVER

Claim

SET-COVER : A collectionC = {S1, . . . , Sm} of subsets of a base set X ,

|X | = n, and parameter k, find a set cover C0⊆ C of size k The set cover problem (SET-COVER ) is NP complete.

C0={Si1, . . . , Sik} is a set-cover iff SjSij = X .

Note that SET-COVER is in NP How to prove NP hardness?

Reduce from VERTEX-COVER

(70)

SET-COVER

Claim

SET-COVER : A collectionC = {S1, . . . , Sm} of subsets of a base set X ,

|X | = n, and parameter k, find a set cover C0⊆ C of size k The set cover problem (SET-COVER ) is NP complete.

C0={Si1, . . . , Sik} is a set-cover iff SjSij = X .

Note that SET-COVER is in NP How to prove NP hardness?

Reduce from VERTEX-COVER

70 / 177

(71)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover. The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover. Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

(72)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover. The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover. Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

72 / 177

(73)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover. Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

(74)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover. Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

74 / 177

(75)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover. Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

(76)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci ={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover. Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

76 / 177

(77)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci ={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover.

Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

(78)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci ={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover.

Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

78 / 177

(79)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci ={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover.

Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements a

V0 covers all edges ⇐⇒ C0 cover all elements

(80)

Reduction from VERTEX-COVER

Given a graph G = (V, E), the idea is that:

I Each vertex vi maps to a setCi

I {vi1, . . . , vik} is a vertex-cover iff {Ci1, . . . , Cik} is a set-cover.

The exact construction is as follows:

I Each edge ej ∈ E maps to an element aj ∈ X .

I Each vertex vi∈ V maps to set Ci ={aj s.t. ej incident to vi}

Claim

V0 ={vi1, . . . , vik} is a vertex-cover iff {Cii, . . . , Cik} is a set cover.

Proof.

If ej incident to vi, then set Ci contains aj

Picking vi covers all edges incident to vi ⇐⇒ picking Ci covers all corresponding elements aj

V0 covers all edges ⇐⇒ C0 cover all elements

80 / 177

(81)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING

Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k: Integer program variables: xj = 1 iff Sj picked in set-cover

At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

(82)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program

GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k: Integer program variables: xj = 1 iff Sj picked in set-cover

At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

82 / 177

(83)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

(84)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover

At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

84 / 177

(85)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets:

X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

(86)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

86 / 177

(87)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: X

j

xj ≤ k All elements covered:

X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

(88)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i

Variable 0 or 1: xi ∈ {0, 1}

88 / 177

(89)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i

xi ∈ {0, 1}

(90)

Another Hardness Proof for INTEGER-PROGRAMMING

Another reduction for INTEGER-PROGRAMMING SET-COVER can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the set-cover problem as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff Sj picked in set-cover At most k sets: X

j

xj ≤ k

All elements covered: X

j |ai∈Sj

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

90 / 177

(91)

Yet Another Hardness Proof for INTEGER-PROGRAMMING

Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING

Proof.

Formulate the hitting-set as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k: Integer program variables: xj = 1 iff xj picked in hitting-set

At most k elements: X

j

xj ≤ k

All sets covered: X

j |aj∈Si

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

(92)

Yet Another Hardness Proof for INTEGER-PROGRAMMING

Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the hitting-set as an integer program

GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k: Integer program variables: xj = 1 iff xj picked in hitting-set

At most k elements: X

j

xj ≤ k

All sets covered: X

j |aj∈Si

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

92 / 177

(93)

Yet Another Hardness Proof for INTEGER-PROGRAMMING

Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the hitting-set as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements: X

j

xj ≤ k

All sets covered: X

j |aj∈Si

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

(94)

Yet Another Hardness Proof for INTEGER-PROGRAMMING

Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the hitting-set as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff xj picked in hitting-set

At most k elements: X

j

xj ≤ k

All sets covered: X

j |aj∈Si

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

94 / 177

(95)

Yet Another Hardness Proof for INTEGER-PROGRAMMING

Yet another reduction for INTEGER-PROGRAMMING HITTING-SET can be reduced to INTEGER-PROGRAMMING Proof.

Formulate the hitting-set as an integer program GivenC = {S1, . . . , Sm} over X = {a1, . . . , an} and k:

Integer program variables: xj = 1 iff xj picked in hitting-set At most k elements:

X

j

xj ≤ k

All sets covered: X

j |aj∈Si

xj ≥ 1 ∀i Variable 0 or 1: xi ∈ {0, 1}

Riferimenti

Documenti correlati

congiuntiva, il problema della soddisfacibilità richiede di verificare se esiste una assegnazione di valori alle variabili che rende l'espressione vera. ● Il problema

In the time interval [0, t] no measure has been performed on the

Possiamo risolvere i problemi precedenti e altri che si risolvono facendo la ricerca esaustiva senza

Altri problemi sono in una situazione intermedia perch´e o non ne `e stata ancora dimostrata l’appartenenza a NPC, o la loro appartenenza a tale classe implicherebbe che P = NP ed

P!NP Alcuni dei problemi che vogliamo risolvere sono difficili.. Verrà

•  Un espressione Booleana su V si dice in forma normale congiuntiva (FNC) se è espressa come congiunzione di clausole (AND di

Anzitutto ogni ente di cui trattiamo dovr`a essere rappresentato in modo efficiente nel senso tecnico del termine (capitolo 2); cio`e i dati, gli algoritmi, e ogni struttura che

costruisce una espressione Booleana in forma normale congiuntiva che descrive il calcolo di un algoritmo per risolvere P su x. • L’espressione è vera se e solo se l’algoritmo