NP-Completeness : Proofs Proof Methods A method to show a - - PDF document

np completeness proofs
SMART_READER_LITE
LIVE PREVIEW

NP-Completeness : Proofs Proof Methods A method to show a - - PDF document

NP-Completeness : Proofs Proof Methods A method to show a decision problem NP-complete is as follows. (1) Show NP. (2) Choose an NP-complete problem . (3) Show


slide-1
SLIDE 1

1

NP-Completeness : Proofs

  • Proof Methods

A method to show a decision problem Π Π Π Π NP-complete is as follows. (1) Show Π Π Π Π ∈ ∈ ∈ ∈ NP. (2) Choose an NP-complete problem Π Π Π Π’. (3) Show Π Π Π Π’ ∝ ∝ ∝ ∝ Π Π Π Π. A method to show an optimization problem Ψ Ψ Ψ Ψ NP-hard is as follows. (1) Choose an NP-hard problem Ψ Ψ Ψ Ψ’ (Ψ Ψ Ψ Ψ’ may be NP-complete). (2) Show Ψ Ψ Ψ Ψ’ ∝ ∝ ∝ ∝ Ψ Ψ Ψ Ψ. An alternative method to show Ψ Ψ Ψ Ψ NP-hard is to show the decision version of Ψ Ψ Ψ Ψ NP-complete.

slide-2
SLIDE 2

2

  • Two Simple Examples

Ex. Sum of Subsets Instance : A finite set A of positive integers and a positive integer c. Question : Is there a subset A’ of A whose elements sum to c ? For example, if A = {7, 5, 19, 1, 12, 8, 14} and c = 21, then the answer is yes (A’ = {7, 14}). NP-completeness of Sum of Subsets is shown below.

♣ Sum of Subsets ∈

∈ ∈ ∈ NP.

♣ A chosen NP-complete problem :

Exact Cover.

slide-3
SLIDE 3

3

Exact Cover Instance : A finite set S and k subsets S1, S2, …, Sk of S. Question : Is there a subset of {S1, S2, …, Sk} that forms a partition of S ? For example, if S = {7, 5, 19, 1, 12, 8, 14}, k = 4, S1 = {7, 19, 12, 14}, S2 = {7, 5, 8}, S3 = {5, 1, 8}, and S4 = {19, 1, 8, 14}, then the answer is yes ({S1, S3} forms a partition of S).

slide-4
SLIDE 4

4

♣ Exact Cover ∝

∝ ∝ ∝ Sum of Subsets. Let S = {u1, u2, …, um} and S1, S2, …, Sk be an arbitrary instance of Exact Cover. An instance of Sum of Subsets can be obtained in polynomial time as follows. A = {a1, a2, …, ak} and c = (

)

m i

i

k

− =

+

1

1 , where for 1 ≤ ≤ ≤ ≤ j ≤ ≤ ≤ ≤ k, aj =

, (

)

m j i i

i

e k

=

+

1

1

1 , with ej,i = 1 if ui ∈ ∈ ∈ ∈ Sj and ej,i = 0 if ui ∉ ∉ ∉ ∉ Sj. ⇒ Sum of Subsets has the answer yes if and

  • nly if Exact Cover has the answer yes.
slide-5
SLIDE 5

5

For example, given the following instance of Exact Cover : S = {7, 5, 19, 1, 12, 8, 14}, k = 4, S1 = {7, 19, 12, 14}, S2 = {7, 5, 8}, S3 = {5, 1, 8}, and S4 = {19, 1, 8, 4}, a matrix e is defined as follows. 7 5 19 1 12 8 14

1 2 3 4

1 1 1 1 1 1 1 1 1 1 1 1 1 1 S S S S            

An instance of Sum of Subsets is constructed as follows.

slide-6
SLIDE 6

6

A = {a1, a2, a3, a4} and c = 50

+ 51 + 52 + … + 56,

where a1 = 50

+ 52 + 54 + 56

(1st row of e); a2 = 50

+ 51 + 55

(2nd row of e); a3 = 51

+ 53 + 55

(3rd row of e); a4 = 52

+ 53 + 55 + 56

(4th row of e). The construction relates ai with Si and c with S. It is not difficult to see a1 + a3 = c ⇔ ⇔ ⇔ ⇔ S1 ∪ ∪ ∪ ∪ S3 = S and S1 ∩ ∩ ∩ ∩ S3 = ∅ ∅ ∅ ∅.

slide-7
SLIDE 7

7

Ex. Partition Instance : A multiset B = {b1, b2, …, bn} of positive integers. Question : Is there a subset B’ ⊆ ⊆ ⊆ ⊆ B such that

i

i

b B'

b

∈ ∈ ∈ ∈

=

j

j

b B B'

b

∈ ∈ ∈ ∈

?

For example, when B = {17, 53, 9, 35, 41, 32, 35}, then the answer is yes (B’ = {17, 53, 41}). NP-completeness of Partition is shown below.

♣ Partition ∈

∈ ∈ ∈ NP.

♣ A chosen NP-complete problem :

Sum of Subsets.

slide-8
SLIDE 8

8

♣ Sum of Subsets ∝

∝ ∝ ∝ Partition Let A = {a1, a2, …, am} and c be an arbitrary instance of Sum of Subsets. An instance of Partition can be obtained in polynomial time as follows: B = A ∪ ∪ ∪ ∪ {am+1, am+2}, where am+1 = c + 1 and am+2 = 1 − − − − c +

i

i

a A

a

∈ ∈ ∈ ∈

. Since am+1 + am+2 =

i

i

a A

a

∈ ∈ ∈ ∈

+ 2, we have {am+1, am+2} ⊄ ⊄ ⊄ ⊄ B’ and {am+1, am+2} ⊄ ⊄ ⊄ ⊄ B − − − − B’. We show below that

i

i

a Α'

a

∈ ∈ ∈ ∈

= c if and only if am+2 +

i

i

a Α'

a

∈ ∈ ∈ ∈

= am+1 +

i

i

a Α Α'

a

∈ ∈ ∈ ∈

(i.e., B’ = A’ + {am+2}).

slide-9
SLIDE 9

9

(⇒ ⇒ ⇒ ⇒) Suppose

i

i

a Α'

a

∈ ∈ ∈ ∈

= c. am+2 +

i

i

a Α'

a

∈ ∈ ∈ ∈

= (1 −

− − − c +

i

i

a A

a

∈ ∈ ∈ ∈

) +

i

i

a Α'

a

∈ ∈ ∈ ∈

= 1 +

i

i

a Α

a

∈ ∈ ∈ ∈

. am+1 +

i

i

a Α Α'

a

∈ ∈ ∈ ∈

= (c + 1) +

i

i

a Α Α'

a

∈ ∈ ∈ ∈

= 1 +

i

i

a Α

a

∈ ∈ ∈ ∈

. (⇐ ⇐ ⇐ ⇐) Suppose am+2 +

i

i

a Α'

a

∈ ∈ ∈ ∈

= am+1 +

i

i

a Α Α'

a

∈ ∈ ∈ ∈

, i.e., B’ = A’ + {am+2}. Then, (1 − − − − c +

i

i

a A

a

∈ ∈ ∈ ∈

) +

i

i

a Α'

a

∈ ∈ ∈ ∈

= (c + 1) +

i

i

a Α Α'

a

∈ ∈ ∈ ∈

, from which

i

i

a Α'

a

∈ ∈ ∈ ∈

= c can be derived.

slide-10
SLIDE 10

10

Exercise 5. Read Example 8-14 on page 367 of the textbook. (1) Give a reduction from Partition to the bin packing problem. (2) Illustrate the reduction by an example. (3) Verify the reduction. Exercise 6. Read Theorem 11.2 on page 518 of Ref. (2). (1) Give a reduction from Satisfiability to Clique. (2) Illustrate the reduction by an example. (3) Verify the reduction.

slide-11
SLIDE 11

11

  • Three Proof Techniques

Restriction Local Replacement Component Design

slide-12
SLIDE 12

12

  • Restriction

If a problem Π Π Π Π contains an NP-hard problem Π Π Π Π’ as a special case (i.e., Π Π Π Π’ is a restricted subproblem

  • f Π

Π Π Π), then Π Π Π Π is NP-hard.

  • Ex. Exact Cover

Instance : A finite set S and k subsets S1, S2, …, Sk of S. Question : Is there a subset of {S1, S2, …, Sk} that forms a partition of S ? Exact Cover by 3-Sets Instance : A finite set S with |S| = 3p and k 3- element subsets S1, S2, …, Sk of S. Question : Is there a subset of {S1, S2, …, Sk} that forms a partition of S ?

slide-13
SLIDE 13

13

Exact Cover by 3-Sets is a special case of Exact Cover. 3-Dimensional Matching Instance : A set M ⊆ ⊆ ⊆ ⊆ W × × × × X × × × × Y, where W, X and Y are three disjoint q-element subsets. Question : Does M contain a matching, i.e., a subset M’ ⊆ ⊆ ⊆ ⊆ M such that |M’| = q and no two elements of M’ agree in any coordinate ? For example, if W = {0, 1}, X = {a, b}, Y = {+ + + +, − − − −}, and M = {(0, a, + + + +), (1, b, + + + +), (1, b, − − − −)}, then the answer is yes (M’ = {(0, a, + + + +), (1, b, − − − −)}). 3-Dimensional Matching is a special case of Exact Cover by 3-Sets.

slide-14
SLIDE 14

14

For example, the following instance of 3-Dimensional Matching : W = {0, 1}, X = {a, b}, Y = {+ + + +, − − − −}, and M = {(0, a, + + + +), (1, b, + + + +), (1, b, − − − −)} can be transformed into an instance of Exact Cover by 3-Sets as follows : S1 = {0W, aX, + + + +Y}, S2 = {1W, bX, + + + +Y}, S3 = {1W, bX, − − − −Y}, and S = W ∪ ∪ ∪ ∪ X ∪ ∪ ∪ ∪ Y = {0W, 1W, aX, bX, + + + +Y, − − − −Y}. Therefore, 3-Dimensional Matching is NP-complete. ⇒ ⇒ ⇒ ⇒ Exact Cover by 3-Sets is NP-complete. ⇒ ⇒ ⇒ ⇒ Exact Cover is NP-complete.

slide-15
SLIDE 15

15

  • Ex. Hamiltonian Cycle

Instance : An undirected graph G = (V, E). Question : Does G contain a Hamiltonian Cycle,

i.e., an ordering (v1, v2, …, v|V|) of

the vertices of G such that (v1, v|V|) ∈ ∈ ∈ ∈

E and (vi, vi+1) ∈

∈ ∈ ∈ E for all 1 ≤ ≤ ≤ ≤ i < |V| ? Directed Hamiltonian Cycle Instance : A directed graph G = (V, A), where A is a set of arcs (i.e., ordered pairs

  • f vertices).

Question : Does G contain a directed Hamiltonian cycle, i.e., an ordering (v1, v2, …, v|V|)

  • f the vertices of G such that (v1, v|V|) ∈

∈ ∈ ∈ A and (vi, vi+1) ∈ ∈ ∈ ∈ A for all 1 ≤ ≤ ≤ ≤ i < |V| ?

slide-16
SLIDE 16

16

Hamiltonian Cycle is a special case of Directed Hamiltonian Cycle (or Hamiltonian Cycle ∝ ∝ ∝ ∝ Directed Hamiltonian Cycle, where each (u, v) ∈ ∈ ∈ ∈ E corresponds to two arcs (u, v), (v, u) ∈ ∈ ∈ ∈ A). Therefore, Hamiltonian Cycle is NP-complete. ⇒ ⇒ ⇒ ⇒ Directed Hamiltonian Cycle is NP-complete.

slide-17
SLIDE 17

17

Hamiltonian Path between Two Vertices Instance : An undirected graph G = (V, E) and two distinct vertices u, v ∈ ∈ ∈ ∈ V. Question : Does G contain a Hamiltonian path starting at u and ending at v, i.e., an ordering (v1, v2, …, v|V|) of the vertices of G such that u = v1, v = v|V|, and (vi, vi+1) ∈ ∈ ∈ ∈ E for all 1 ≤ ≤ ≤ ≤ i < |V| ? Hamiltonian Cycle ∝ ∝ ∝ ∝ Hamiltonian Path between Two Vertices : if the latter is polynomial time solvable, then the former is also polynomial time solvable (considering all edges (u, v) ∈ ∈ ∈ ∈ V for the latter). ⇒ ⇒ ⇒ ⇒ Hamiltonian Path between Two Vertices is NP-complete.

slide-18
SLIDE 18

18

Hamiltonian Path Instance : An undirected graph G = (V, E). Question : Does G contain a Hamiltonian path ? Hamiltonian Cycle ∝ ∝ ∝ ∝ Hamiltonian Path : For each (u, v) ∈ ∈ ∈ ∈ E, construct an instance of Hamiltonian Path by adding x, y to V and (x, u), (y, v) to E (thus G’ is induced).

u v u v x y

G G’ G has a Hamiltonian cycle if and only if G’ has a Hamiltonian x-y path. ⇒ ⇒ ⇒ ⇒ If Hamiltonian Path is polynomial time solvable, then Hamiltonian Cycle is also polynomial time solvable. ⇒ Hamiltonian Path is NP-complete.

slide-19
SLIDE 19

19

Exercise 7. Show the following two problems NP- complete by restriction to Hamiltonian Path and Partition, respectively. Bounded Degree Spanning Tree Instance : An undirected graph G = (V, E) and a positive integer k ≤ ≤ ≤ ≤ |V| − − − − 1. Question : Does G contains a spanning tree in which each node has degree at most k ? 0/1 Knapsack Instance : A finite set U, a “size” s(u) ∈ ∈ ∈ ∈ Z+

and

a “value” v(u) ∈ ∈ ∈ ∈ Z+

for each u ∈

∈ ∈ ∈ U, a size constraint b ∈ ∈ ∈ ∈ Z+, and a value goal k ∈ ∈ ∈ ∈ Z+. Question : Is there a subset U’ ⊆ ⊆ ⊆ ⊆ U such that

u U'

s u

( )

∈ ∈ ∈ ∈

≤ ≤ ≤ b and

u U'

v u

( )

∈ ∈ ∈ ∈

≥ ≥ ≥ k ?

slide-20
SLIDE 20

20

  • Local Replacement

In order to show Π Π Π Π’ ∝ ∝ ∝ ∝ Π Π Π Π, local replacement specifies the “basic units” for Π Π Π Π’ and replaces them with

  • thers, while constructing a corresponding instance
  • f Π

Π Π Π. Usually, local replacement has one kind of basic units that each are replaced with the same structure. Ex. Partition into Triangles Instance : An undirected graph G = (V, E) with |V| = 3p for some integer p > 0. Question : Is there a partition of V into 3-vertex subsets V1, V2, …, Vp, such that each subgraph induced by some Vi (1 ≤ ≤ ≤ ≤ i ≤ ≤ ≤ ≤ p) forms a triangle ?

slide-21
SLIDE 21

21

For example, the answer for the following instance is yes, because V can be partitioned into {1, 2, 3}, {4, 5, 6}, {7, 8, 9} or {1, 4, 7}, {2, 5, 6}, {3, 8, 9}.

1 2 3 4 5 6 7 8 9

Exact Cover by 3-Sets ∝ ∝ ∝ ∝ Partition into Triangles is shown below. Let a set S, where |S| = 3p, and a collection C

  • f 3-element subsets of S denote an arbitrary

instance of Exact Cover by 3-Sets. Construct an instance of Partition into Triangles as follows.

slide-22
SLIDE 22

22

Consider each subset {xi, yi, zi} ∈ ∈ ∈ ∈ C a basic unit, and replace it with the following structure.

ai[3] ai[1] ai[2] ai[4] ai[5] ai[6] ai[7] ai[8] ai[9]

xi yi zi

For example, if S = {1, 2, 3, 4, 5, 6} and C = {{1, 4, 6}, {2, 4, 6}, {2, 3, 5}}, then an instance

  • f Partition into Triangles is obtained as follows.

1 4 6 2 3 5

slide-23
SLIDE 23

23

It is not difficult to check that if Exact Cover by 3-Sets has an answer yes (e.g., {{1, 4, 6}, {2, 3, 5}} is a partition of S), then Partition into Triangles has an answer yes (the triangles are shown with bold edges). Also, if Partition into Triangles has an answer yes, then Exact Cover by 3-Sets has an answer yes. Exercise 8. Read Example 8-9 on page 353 of the textbook. (1) Give a reduction from Satisfiability to 3-Satisfiability. (2) Illustrate the reduction by an example. (3) Verify the reduction.

slide-24
SLIDE 24

24

Sometimes, additional structures are required, while using the technique of local replacement.

  • Ex. Sequencing within Intervals

Instance : A finite set T of “tasks” and for each t ∈ ∈ ∈ ∈ T, a “release time” r(t) ∈ ∈ ∈ ∈ Z+ ∪ ∪ ∪ ∪ {0}, a “deadline” d(t) ∈ ∈ ∈ ∈ Z+, and a “length” l(t) ∈ ∈ ∈ ∈ Z+. Question : Does there exist a feasible schedule for T, i.e., a function f : T → → → → Z+ such that for each t ∈ ∈ ∈ ∈ T, f(t) ≥ ≥ ≥ ≥ r(t), f(t) + l(t) ≤ ≤ ≤ ≤ d(t), and f(t’) + l(t’) ≤ ≤ ≤ ≤ f(t) or f(t) + l(t) ≤ ≤ ≤ ≤ f(t’) for each t’ ∈ ∈ ∈ ∈ T − − − − {t} ? (It means that the task t, which is “executed” from time f(t) to f(t) + l(t), cannot start execution until time r(t), must be completed by time d(t), and its execution cannot overlap the execution of any other task t’.)

slide-25
SLIDE 25

25

Partition ∝ ∝ ∝ ∝ Sequencing within Intervals is shown below. An arbitrary instance of Partition : a multiset B = {b1, b2, …, bn} of positive integers. Consider each bi (1 ≤ ≤ ≤ ≤ i ≤ ≤ ≤ ≤ n) a basic unit, and let m =

i i n

b

≤ ≤

1

. Construct an instance of Sequencing within Intervals as follow : each bi corresponds to a task ti with r(ti) = 0, d(ti) = m + 1, and l(ti) = bi. An additional structure : a task t with ( ) r t =    m/2   , ( ) d t =    (m+1)/2   , and ( ) l t = 1. ⇒ ⇒ ⇒ ⇒ m should be even (for otherwise, ( ) r t = ( ) d t , i.e., it is impossible to schedule t )

slide-26
SLIDE 26

26

⇒ ⇒ ⇒ ⇒ ( ) r t = m/2, ( ) d t = (m/2) + 1 ⇒ ⇒ ⇒ ⇒ ( ) f t

  • must be m/2.

⇒ Partition has the answer yes if and only if Sequencing within Intervals has the answer yes.

2 m 1 2 m + 1 m + t

  • 2

m 2 m

Time

slide-27
SLIDE 27

27

  • Component Design

While showing Π Π Π Π’ ∝ ∝ ∝ ∝ Π Π Π Π, component design is similar to local replacement in replacing the structures (i.e., basic units) of Π Π Π Π’ with other structures, in order to obtain an instance of Π Π Π Π. Usually, component design adopts multiple kinds of basic units, and different basic units are replaced with different structures. Ex. Vertex Cover Instance : An undirected graph G = (V, E) and a positive integer k ≤ ≤ ≤ ≤ |V|. Question : Does G contain a vertex cover of size at most k, i.e., a subset V’ ⊆ ⊆ ⊆ ⊆ V such that |V’| ≤ ≤ ≤ ≤ k and for each (u, v) ∈ ∈ ∈ ∈ E, at least one of u and v belongs to V’ ?

slide-28
SLIDE 28

28

For example, {1, 3}, {1, 2, 3} and {1, 2, 4, 5} are three vertex covers of the following graph. If k ≥ ≥ ≥ ≥ 2, the answer is yes. If k = 1, the answer is no. We show below 3-Satisfiability ∝ ∝ ∝ ∝ Vertex Cover. 3-Satisfiability Instance : A set U of variables and a collection C = {c1, c2, …, cm} of clauses over U, where each clause of C contains three literals. Question : Is there a satisfying truth assignment for C ?

slide-29
SLIDE 29

29

For example, when U = {x1, x2, x3} and C = {x1 ∨ ∨ ∨ ∨ x2 ∨ ∨ ∨ ∨ x3, x1

∨ ∨ ∨ x2 ∨ ∨ ∨ ∨ x3 , x1 ∨ ∨ ∨ ∨ x2

∨ ∨ ∨ x3}, the answer is yes, because the assignment of U : x1 ← ← ← ← F, x2 ← ← ← ← F, and x3 ← ← ← ← T, can satisfy C (i.e., (x1 ∨ ∨ ∨ ∨ x2 ∨ ∨ ∨ ∨ x3) ∧ ∧ ∧ ∧ ( x1

∨ ∨ ∨ x2 ∨ ∨ ∨ ∨ x3 ) ∧ ∧ ∧ ∧ (x1 ∨ ∨ ∨ ∨ x2

∨ ∨ ∨ x3) = T). Let U = {u1, u2, …, un} and C = {c1, c2, …, cm} be an arbitrary instance of 3-Satisfiability. ♦ For each ui ∈ ∈ ∈ ∈ U, construct a component Ti = (Vi, Ei), where Vi = {ui,

i

u } and Ei = {(ui,

i

u )}. ♦ For each cj ∈ ∈ ∈ ∈ C, construct a component Sj = (V’j, E’j), where V’j = {a1[j], a2[j], a3[j]} and E’j = {(a1[j], a2[j]), (a1[j], a3[j]), (a2[j], a3[j])}. ♦ For each cj ∈ ∈ ∈ ∈ C, construct an edge set E’’j = {(a1[j], xj), (a2[j], yj), (a3[j], zj)}, where xj, yj and zj are the three literals in cj.

slide-30
SLIDE 30

30

An instance of Vertex Cover can be constructed as G = (V, E) and k = n + 2m, where V = (

n i

i

V

=1

  • ) ∪

∪ ∪ ∪ (

m j

j

V'

=1

  • ) and

E = (

n i

i

E

=1

  • ) ∪

∪ ∪ ∪ (

m j

j

E'

=1

  • ) ∪

∪ ∪ ∪ (

m j

j

E''

=1

  • ).

For example, if U = {u1, u2, u3, u4} and C = {u1 ∨ ∨ ∨ ∨ u

3

∨ ∨ ∨ u

4 , u 1

∨ ∨ ∨ u2 ∨ ∨ ∨ ∨ u

4 }, then the following

instance of Vertex Cover is constructed, where k = 8.

slide-31
SLIDE 31

31

  • Each edge in E’’j represents a satisfying truth

assignment for cj. For example, (u1, a1[1]) ∈ ∈ ∈ ∈ E’’1 implies that u1 ← ← ← ← T can satisfy c1.

  • Any vertex cover V’ ⊆

⊆ ⊆ ⊆ V of G contains at least one from {ui,

i

u } and at least two from {a1[j], a2[j], a3[j]}. ⇒ ⇒ ⇒ ⇒ |V’| ≥ ≥ ≥ ≥ n + 2m = k As explained below, C is satisfiable if and only if G has a vertex cover V’ ⊆ ⊆ ⊆ ⊆ V with |V’| ≤ ≤ ≤ ≤ k.

slide-32
SLIDE 32

32

♣ ♣ ♣ ♣ C is satisfiable ⇒ ⇒ ⇒ ⇒ V’ ⊆ ⊆ ⊆ ⊆ V with |V’| ≤ ≤ ≤ ≤ k exists Consider the example above, where u1 ← ← ← ← T, u2 ← ← ← ← T, u

3

← ← ← T, and u

4

← ← ← T can satisfy C. ⇒ include u1, u2, u

3 , u 4 in V’

In order to make V’ a vertex cover, V’ must be augmented with two vertices from each set {a1[j], a2[j], a3[j]}, while covering all edges in E’’j. ⇒ ⇒ ⇒ ⇒ augment V’ with any two from {a1[1], a2[1], a3[1]} and a1[2], a2[2] (or a1[2], a3[2]) from {a1[2], a2[2], a3[2]} (a1[2] must be included in V’, in order to cover the edge (u

1, a1[2]))

slide-33
SLIDE 33

33

♣ ♣ ♣ ♣ V’ ⊆ ⊆ ⊆ ⊆ V with |V’| ≤ ≤ ≤ ≤ k exists ⇒ ⇒ ⇒ ⇒ C is satisfiable V’ contains exactly k = n + 2m vertices : one for each {ui,

i

u } and two for each {a1[j], a2[j], a3[j]}. Consider the example above, where k = 8 and V’ = {u

1, u2, u 3 , u4, a1[1], a3[1], a1[2], a3[2]} is a

vertex cover. ⇒ ⇒ ⇒ ⇒ u

1

← ← ← T, u2 ← ← ← ← T, u

3

← ← ← T and u4 ← ← ← ← T can satisfy C (u

1, u2, u 3 , u4 ∈

∈ ∈ ∈ V’) Since two (e.g., a1[1] and a3[1]) from {a1[j], a2[j], a3[j]} are included in V’, the other (e.g., a2[1]) must be connected to ui or

i

u

(e.g., u

3 ) that is

included in V’. ⇒ ⇒ ⇒ ⇒ each cj is satisfiable.

slide-34
SLIDE 34

34

  • Ex. Minimum Tardiness Sequencing

Instance : A finite set T of “tasks”, where each t ∈ ∈ ∈ ∈ T has “length” 1 and “deadline” d(t) ∈ ∈ ∈ ∈ Z+, a partial order on T, and a non-negative integer r ≤ ≤ ≤ ≤ |T|. Question : Is there a “schedule” f : T → → → → {0, 1, …, |T| − − − − 1} such that f(t) ≠ ≠ ≠ ≠ f(t’) if t ≠ ≠ ≠ ≠ t’, f(t) < f(t’) if t t’, and |{t ∈ ∈ ∈ ∈ T : f(t) + 1 > d(t)}| ≤ ≤ ≤ ≤ r ? A task t ∈ ∈ ∈ ∈ T is tardy, if f(t) + 1 > d(t). The schedule f is required not to cause more than r tasks tardy. We show below Clique ∝ ∝ ∝ ∝ Minimum Tardiness Sequencing.

slide-35
SLIDE 35

35

Clique Instance : An undirected graph G = (V, E) and a positive integer k ≤ ≤ ≤ ≤ |V|. Question : Does there exist a subset V’ ⊆ ⊆ ⊆ ⊆ V such that |V’| ≥ ≥ ≥ ≥ k and every two vertices of V’ are adjacent in G ? Let G = (V, E) and k ≤ ≤ ≤ ≤ |V| be an arbitrary instance

  • f Clique.

An instance of Minimum Tardiness Sequencing can be constructed as follows. T = V ∪ ∪ ∪ ∪ E; r = |E| − − − − k(k − − − − 1) / 2; v e ⇔ ⇔ ⇔ ⇔ v ∈ ∈ ∈ ∈ V, e ∈ ∈ ∈ ∈ E, and v is an endpoint

  • f e;

d(v) = |V| + |E| for v ∈ ∈ ∈ ∈ V, and d(e) = k(k + 1) / 2 for e ∈ ∈ ∈ ∈ E.

slide-36
SLIDE 36

36

♣ ♣ ♣ ♣ a clique of size ≥ ≥ ≥ ≥ k for G ⇒ ⇒ ⇒ ⇒ a feasible schedule for T Suppose that G’ = (V’, E’) is a k-vertex complete subgraph of G (|V’| = k and |E’| = k(k − − − − 1)/2). A feasible schedule is shown below. Tasks in V and in E’ are not tardy. ⇒ ⇒ ⇒ ⇒ There are at most |E − − − − E’| = |E| − − − − k(k − − − − 1)/2 tardy tasks. ♣ ♣ ♣ ♣ a feasible schedule for T ⇒ ⇒ ⇒ ⇒ a clique of size ≥ ≥ ≥ ≥ k for G Suppose that f is a feasible schedule, and there are x tasks from V and y tasks from E scheduled in {0, 1, …, (k(k + 1) / 2) − − − − 1} under f.

slide-37
SLIDE 37

37

Then, x + y = k(k + 1) / 2. (1) Since only tasks in E may be tardy, we have |E| − − − − y ≤ ≤ ≤ ≤ |E| − − − − k(k − − − − 1) / 2 (= r). ⇒ ⇒ ⇒ ⇒ y ≥ ≥ ≥ ≥ k(k − − − − 1) / 2 (2) With (1) and (2), we have x ≤ ≤ ≤ ≤ (k(k + 1) / 2) − − − − (k(k − − − − 1) / 2) = k. (3) The only situation that both (2) and (3) hold with the restriction of is when x = k, y = k(k − − − − 1) / 2, and the k vertices together with the k(k − − − − 1) / 2 edges form a complete subgraph of G.

slide-38
SLIDE 38

38

Exercise 9. Read Example 8-10 on page 359 of the textbook. (1) Give a reduction from a satisfiability problem where each clause has at most three literals to the chromatic number problem. (2) Illustrate the reduction by an example. (3) Verify the reduction. Exercise 10. Read Theorem 3.5 on page 60 of Ref. (1). (1) Give a reduction from 3-Dimensional Matching to Partition. (2) Illustrate the reduction by an example. (3) Verify the reduction.

slide-39
SLIDE 39

39

  • A Proof Technique for NP-

Completeness of Subproblems

Suppose that Π Π Π Π is an NP-complete problem and Π Π Π Π’ is a restricted subproblem of Π Π Π Π. A proof technique, which is based on local replacement, for the NP-completeness of Π Π Π Π’ is introduced.

  • Ex. Graph 3-Colorability

Instance : An undirected graph G = (V, E). Question : Is G 3-colorable, i.e., does there exist a function f : V → → → → {1, 2, 3} such that f(u) ≠ ≠ ≠ ≠ f(v) for all edges (u, v) ∈ ∈ ∈ ∈ E ? Graph 3-Colorability with Degrees at Most Four is a restricted subproblem of Graph 3-Colorability where each vertex degree of G is at most four.

slide-40
SLIDE 40

40

For example, the following graph, denoted by H3, is 3-colorable, and in each 3-coloring, the three endpoints of the largest triangle are assigned with the same color. Let Hk be the concatenation of k − − − − 2 H3’s, where k ≥ ≥ ≥ ≥ 3. For example, H5 is depicted as follows.

slide-41
SLIDE 41

41

Hk has k “outlets” (i.e., the vertices of degree 2). Hk is 3-colorable and in each 3-coloring, the k “outlets” are assigned with the same color. Next we show Graph 3-Colorability ∝ ∝ ∝ ∝ Graph 3-Colorability with Degrees at Most Four. Suppose that G = (V, E) is an arbitrary instance of Graph 3-Colorability. An instance G’ = (V’, E’) of Graph 3-Colorability with Degrees at Most Four can be obtained by sequentially replacing each vertex of G whose degree is k > 4 with Hk.

slide-42
SLIDE 42

42

For example, It is easy to see that G is 3-colorable if and only if G’ is 3-colorable.

slide-43
SLIDE 43

43

Planar Graph 3-Colorability is a restricted subproblem of Graph 3-Colorability where G is planar. We show Graph 3-Colorability ∝ ∝ ∝ ∝ Planar Graph 3-Colorability below. Let H denote the following graph. Notice that H is 3-colorable, and any 3-coloring f of H has f(x) = f(x’) and f(y) = f(y’). Besides, there exist 3-colorings f1 and f2 of H with f1(x) = f1(x’) = f1(y) = f1(y’) and f2(x) = f2(x’) ≠ ≠ ≠ ≠ f2(y) = f2(y’).

slide-44
SLIDE 44

44

Suppose that G = (V, E) is an arbitrary instance of Graph 3-Colorability. An instance G’ = (V’, E’) of Planar Graph 3-Colorability can be obtained by performing the following replacement on the edge crossings

  • f each edge (u, v) ∈

∈ ∈ ∈ E. It is not difficult to check that G is 3-colorable if and only if G’ is 3-colorable.

slide-45
SLIDE 45

45

  • More Examples
  • Ex. VLSI Discrete Layout

Instance : A set R = {r1, r2, …, rn} of rectangles, where each ri is of size hi × × × × wi, and an integer A > 0. Question : Is there a placement of R on the plane satisfying the following conditions: (1) each vertex of ri has an integral (x, y)-coordinate; (2) each line of ri is parallel to the x-axis or y-axis; (3) no two rectangles overlap; (4) every two neighboring rectangles are one distant from each other; (5) R can be covered by a rectangle of area at most A ?

slide-46
SLIDE 46

46

For example, if n = 5, r1: 3 × × × × 5, r2: 5 × × × × 12, r3: 5 × × × × 6, r4: 3 × × × × 6, r5: 4 × × × × 7, and A = 210, then the answer is affirmative, because the five rectangles can be covered by a rectangle of size 16 × × × × 13. We show below Bin Packing ∝ ∝ ∝ ∝ VLSI Discrete Layout.

slide-47
SLIDE 47

47

Bin Packing Instance : A set U = {u1, u2, …, un} of items, where each ui has size si > 0, and a set B = {b1, b2, …, bm} of bins, where each bj has capacity c > 0. Question : Is there a distribution of U over B such that the items within the same bin has total size at most c ? For example, if n = 10, (c1, c2, …, c10) = (2, 7, 5, 8, 6, 8, 5, 4, 8, 6), m = 3, and c = 20, then the answer is affirmative.

slide-48
SLIDE 48

48

Let U = {u1, u2, …, un} and B = {b1, b2, …, bm} be an arbitrary instance of Bin Packing. An instance of VLSI Discrete Layout can be constructed as follows. For each ui (1 ≤ ≤ ≤ ≤ i ≤ ≤ ≤ ≤ n), construct ri of size 1 × × × × ((2m + 1)si − − − − 1). Construct rn+1 of size h × × × × w, where h = 2mw + 1 and w = (2m + 1)c − − − − 1. Set A = (h + 2m)w. ♣ ♣ ♣ ♣ Bin Packing “yes” ⇒ ⇒ ⇒ ⇒ VLSI Discrete Layout “yes” Suppose that there are ni items stored in bi whose sizes are

, i

d 1,

, i

d 2, …,

, i i n

d , where 1 ≤ ≤ ≤ ≤ i ≤ ≤ ≤ ≤ m and

,

i

n i r r=

d

1

≤ ≤ ≤ ≤ c.

slide-49
SLIDE 49

49

The placement of the corresponding rectangles with respect to bi is as follows. (placement with respect to bi) The placement of all n + 1 rectangles is as follows.

slide-50
SLIDE 50

50

The width of the placement with respect to bi is computed as follows.

,

i

n i r i r=

n m d +

1

( 2

((

−1) + 1 −1) −1) + 1 −1) −1) + 1 −1) −1) + 1 −1)

) ) ) )

=

,

i

n i r i i r=

n n m d

1

( (2 ) −1) − + +1 −1) − + +1 −1) − + +1 −1) − + +1 ≤ ≤ ≤ ≤ (2m + 1)c − − − − 1 = w. The area of the rectangle covering all n + 1 rectangles is at most (2m + h)w = A. ♣ ♣ ♣ ♣ VLSI Discrete Layout “yes” ⇒ ⇒ ⇒ ⇒ Bin Packing “yes” Suppose that r1, r2, …, rn+1 can be covered by a rectangle r

  • f area at most A.

There are the following three facts.

slide-51
SLIDE 51

51

Fact 1. The width of r is w, which is the width of rn+1.

  • Proof. Suppose to the contrary that the

width of r is at least w + 1. Since the height of rn+1 is h, the area

  • f r

is at least h(w + 1) = hw + h = hw + (2mw + 1) = (h + 2m)w + 1 = A + 1, a contradiction ! Fact 2. Each ri (1 ≤ ≤ ≤ ≤ i ≤ ≤ ≤ ≤ n) is placed with height 1, not of height (2m + 1)si − − − − 1.

  • Proof. If some ri is placed with height

(2m + 1)si − − − − 1, then the height of r

  • is at least h + ((2m + 1)si −

− − − 1) + 1 = h + (2m + 1)si.

slide-52
SLIDE 52

52

So, the area of r is at least (h + (2m + 1)si)w = hw + 2mwsi + wsi = (2msi + h)w + wsi > A + wsi a contradiction ! Fact 3. The total number of rows occupied by r1, r2, …, rn is at most m.

  • Proof. If it is not true, then the area of r
  • is larger than (2m + h)w = A,

a contradiction. According to the three facts, the placement of r1, r2, …, rn+1 is like the one shown on page 49. Then, put the items corresponding to the rectangles of row i into bi.

slide-53
SLIDE 53

53

Suppose that there are ni items stored in bi whose sizes are

, i

d 1,

, i

d 2, …,

, i i n

d . Since the width of row i (1 ≤ ≤ ≤ ≤ i ≤ ≤ ≤ ≤ m) is at most w, we have w (= (2m + 1)c − − − − 1) ≥ ≥ ≥ ≥

,

i

n i r i r=

n m d +

1

( 2

((

−1) + 1 −1) −1) + 1 −1) −1) + 1 −1) −1) + 1 −1)

) ) ) )

=

,

i

n i r i i r=

n m d n

1

( (2 ) −1) + +1 − −1) + +1 − −1) + +1 − −1) + +1 − =

,

i

n i r r=

m d

1

(2 ) +1 −1 +1 −1 +1 −1 +1 −1. ⇒ ⇒ ⇒ ⇒

,

i

n i r r=

d

1

≤ ≤ ≤ c