Cooks Theorem Section 7 2 Mon Dec 12

  • Slides: 12
Download presentation
Cook’s Theorem Section 7. 2 Mon, Dec 12, 2005

Cook’s Theorem Section 7. 2 Mon, Dec 12, 2005

Reductions and NP-Completeness Theorem: If L 1 is NP-complete and L 2 is in

Reductions and NP-Completeness Theorem: If L 1 is NP-complete and L 2 is in NP and L 1 can be reduced to L 2 in polynomial time, then L 2 is NP-complete. p What we need is one problem that is known to be NPcomplete. p From it, through reductions, we can show that other problems are also NP-complete. p See p http: //en. wikipedia. org/wiki/List_of_NPcomplete_problems

Cook’s Theorem: SAT is NP-complete. p Cook was able to show that any problem

Cook’s Theorem: SAT is NP-complete. p Cook was able to show that any problem in NP could be reduced to SAT. p Our textbook shows that the Bounded Tiling Problem is NP-complete, and then reduces it to SAT. p

The Bounded Tiling Problem Begin with a set of tiles D = {d 1,

The Bounded Tiling Problem Begin with a set of tiles D = {d 1, …, dk} and an s s board to be tiled. p There are horizontal restrictions H and vertical restrictions V. p For example, if (1, 2) H, then it is permissible to place tile d 2 to the right of tile d 1. p If (3, 4) V, then it is permissible to place tile d 4 above tile d 3. p For example, no red tile can go to the right of a green tile and no blue tile can go above a red tile. p

The Bounded Tiling Problem Thus, H {1, …, k} and V {1, …, k}.

The Bounded Tiling Problem Thus, H {1, …, k} and V {1, …, k}. p The bounded tiling problem begins with a triple (D, H, V), a size s of the board, and a bottom row already filled in. p Describe the bottom row as a function f : {1, …, s} {1, …, k}. p If f(i) = j, then square i on the bottom row is filled with tile dj. p

The Bounded Tiling Problem p The Bounded Tiling Problem asks, is it possible to

The Bounded Tiling Problem p The Bounded Tiling Problem asks, is it possible to fill in the rest of the s s square, using tiles in D and observing the restrictions in H and V?

The Bounded Tiling Problem Theorem: The Bounded Tiling Problem is NPcomplete. p Proof: See

The Bounded Tiling Problem Theorem: The Bounded Tiling Problem is NPcomplete. p Proof: See pp. 310 – 312 in the textbook for an outline of the proof. p

SAT is NP-Complete Theorem: SAT is NP-complete. p Proof: p n n It is

SAT is NP-Complete Theorem: SAT is NP-complete. p Proof: p n n It is sufficient to show that the Bounded Tiling Problem can be reduced to SAT. Begin with a tiling system (D, H, V), a size s, and a bottom row f. Let X = {xmnt | 1 m s, 1 n s, 1 t k}. Interpretation: xmnt is true if and only if tile dt is in square (m, n).

SAT is NP-Complete p We will create a Boolean formula F that is satisfiable

SAT is NP-Complete p We will create a Boolean formula F that is satisfiable if and only if the s s board with bottom row f can be tiled with tiles from the system (D, H, V). n n n Begin with a clause for each cell in row 1: xm 1 f(m) This clause is true only if xm 1 f(m) is true, and xm 1 f(m) is true only if tile f(m) is in cell (m, 1). Thus, (so far) F is satisfiable if row 1 is filled in as prescribed.

SAT is NP-Complete For each cell (m, n), create a clause xmn 1 xmn

SAT is NP-Complete For each cell (m, n), create a clause xmn 1 xmn 2 … xmnk. p This clause will be true only if there is at least one tile in cell (m, n). p Again, for each cell (m, n), create a clause x'mni x'mnj for every i j. p This clause will be true only if cell (m, n) does not contain both of tiles di and dj. p

SAT is NP-Complete For every m s – 1, n s, create the clause

SAT is NP-Complete For every m s – 1, n s, create the clause x'mni x'm+1 nj for every pair (i, j) H. p This clause is true only if we did not use a restricted horizontal pair to fill cells (m, n) and (m + 1, n). p Similarly, create clauses x'mni x'mn+1 j for every pair (i, j) V. p This clause is true only if we did not use a restricted vertical pair to fill cells (m, n) and (m, n + 1). p

SAT is NP-Complete Let the Boolean formula F be the conjunction of all of

SAT is NP-Complete Let the Boolean formula F be the conjunction of all of these clauses, requiring that they all be true simultaneously. p It is clear the F is satisfiable if and only if the s s square can be tiled. p Therefore, the bounded tiling problem can be reduced to SAT (in polynomial time). p Therefore, SAT is NP-complete. p