NP-Completeness : Proofs

Similar documents
Problem Set 9 Solutions

Calculation of time complexity (3%)

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

Maximizing the number of nonnegative subsets

Statistical Mechanics and Combinatorics : Lecture III

Solutions to exam in SF1811 Optimization, Jan 14, 2015

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Finding Dense Subgraphs in G(n, 1/2)

MATH 5707 HOMEWORK 4 SOLUTIONS 2. 2 i 2p i E(X i ) + E(Xi 2 ) ä i=1. i=1

Xiangwen Li. March 8th and March 13th, 2001

APPENDIX A Some Linear Algebra

A Simple Research of Divisor Graphs

5 The Rational Canonical Form

= z 20 z n. (k 20) + 4 z k = 4

(k,?)-sandwich Problems: why not ask for special kinds of bread?

THE CHINESE REMAINDER THEOREM. We should thank the Chinese for their wonderful remainder theorem. Glenn Stevens

Volume 18 Figure 1. Notation 1. Notation 2. Observation 1. Remark 1. Remark 2. Remark 3. Remark 4. Remark 5. Remark 6. Theorem A [2]. Theorem B [2].

A new construction of 3-separable matrices via an improved decoding of Macula s construction

First day August 1, Problems and Solutions

HMMT February 2016 February 20, 2016

arxiv: v2 [cs.ds] 1 Feb 2017

Anti-van der Waerden numbers of 3-term arithmetic progressions.

2 More examples with details

The Minimum Universal Cost Flow in an Infeasible Flow Network

Lecture 12: Discrete Laplacian

Edge Isoperimetric Inequalities

Theoretical Computer Science

ISSN: ISO 9001:2008 Certified International Journal of Engineering and Innovative Technology (IJEIT) Volume 3, Issue 1, July 2013

Low-Connectivity Network Design on Series-Parallel Graphs

Distance Three Labelings of Trees

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

Real-Time Systems. Multiprocessor scheduling. Multiprocessor scheduling. Multiprocessor scheduling

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

More metrics on cartesian products

2.3 Nilpotent endomorphisms

Lecture 3. Ax x i a i. i i

On the Multicriteria Integer Network Flow Problem

Lecture 20: Lift and Project, SDP Duality. Today we will study the Lift and Project method. Then we will prove the SDP duality theorem.

arxiv: v1 [cs.gt] 14 Mar 2019

Complete subgraphs in multipartite graphs

CHAPTER III Neural Networks as Associative Memory

n ). This is tight for all admissible values of t, k and n. k t + + n t

arxiv: v3 [cs.dm] 7 Jul 2012

THE WEIGHTED WEAK TYPE INEQUALITY FOR THE STRONG MAXIMAL FUNCTION

Combining Constraint Programming and Integer Programming

Caps and Colouring Steiner Triple Systems

Min Cut, Fast Cut, Polynomial Identities

Changing Topology and Communication Delays

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

COMPLEX NUMBERS AND QUADRATIC EQUATIONS

Mixed-integer vertex covers on bipartite graphs

ECE559VV Project Report

Outline and Reading. Dynamic Programming. Dynamic Programming revealed. Computing Fibonacci. The General Dynamic Programming Technique

Every planar graph is 4-colourable a proof without computer

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Lecture 10: May 6, 2013

Simultaneous Optimization of Berth Allocation, Quay Crane Assignment and Quay Crane Scheduling Problems in Container Terminals

NUMERICAL DIFFERENTIATION

Report on Image warping

Minimum Activation Cost Edge-Disjoint Paths in Graphs with Bounded Tree-Width

The Multiple Classical Linear Regression Model (CLRM): Specification and Assumptions. 1. Introduction

Graph Reconstruction by Permutations

A New View on Rural Postman Based on Eulerian Extension and Matching

The Order Relation and Trace Inequalities for. Hermitian Operators

Stanford University CS254: Computational Complexity Notes 7 Luca Trevisan January 29, Notes for Lecture 7

arxiv: v1 [math.co] 1 Mar 2014

Week 2. This week, we covered operations on sets and cardinality.

arxiv: v1 [math.co] 7 Apr 2015

SL n (F ) Equals its Own Derived Group

ANSWERS. Problem 1. and the moment generating function (mgf) by. defined for any real t. Use this to show that E( U) var( U)

Spectral Graph Theory and its Applications September 16, Lecture 5

THE CHVÁTAL-ERDŐS CONDITION AND 2-FACTORS WITH A SPECIFIED NUMBER OF COMPONENTS

Clustering Affine Subspaces: Algorithms and Hardness

princeton univ. F 13 cos 521: Advanced Algorithm Design Lecture 3: Large deviations bounds and applications Lecturer: Sanjeev Arora

Module 9. Lecture 6. Duality in Assignment Problems

Affine transformations and convexity

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

Module 14: THE INTEGRAL Exploring Calculus

Single-Facility Scheduling over Long Time Horizons by Logic-based Benders Decomposition

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

Section 8.3 Polar Form of Complex Numbers

find (x): given element x, return the canonical element of the set containing x;

CSCE 790S Background Results

Modelli Clamfim Integrali Multipli 7 ottobre 2015

Economics 101. Lecture 4 - Equilibrium and Efficiency

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Operations Research Letters. Simpler analysis of LP extreme points for traveling salesman and survivable network design problems

Asymmetric Traveling Salesman Path and Directed Latency Problems

On Generalized Gossiping and Broadcasting

The computational complexity of the parallel knock-out problem

Problem Do any of the following determine homomorphisms from GL n (C) to GL n (C)?

The computational complexity of the parallel knock-out problem

Unique perfect phylogeny is intractable

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

Structure and Drive Paul A. Jensen Copyright July 20, 2003

Discussion 11 Summary 11/20/2018

Documents de Travail du Centre d Economie de la Sorbonne

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 12 10/21/2013. Martingale Concentration Inequalities and Applications

Formulas for the Determinant

Outline. Bayesian Networks: Maximum Likelihood Estimation and Tree Structure Learning. Our Model and Data. Outline

Transcription:

NP-Completeness : Proofs Proof Methods A method to show a decson problem Π NP-complete s as follows. (1) Show Π NP. (2) Choose an NP-complete problem Π. (3) Show Π Π. A method to show an optmzaton problem Ψ NP-hard s as follows. (1) Choose an NP-hard problem Ψ (Ψ may be NP-complete). (2) Show Ψ Ψ. An alternatve method to show Ψ NP-hard s to show the decson verson of Ψ NP-complete. 1

Two Smple Examples Ex. Sum of Subsets Instance : A fnte set A of postve ntegers and a postve nteger c. Queston : Is there a subset A of A whose elements sum to c? For example, f A = {7, 5, 19, 1, 12, 8, 14} and c = 21, then the answer s yes (A = {7, 14}). NP-completeness of Sum of Subsets s shown below. Sum of Subsets NP. A chosen NP-complete problem : Exact Cover. 2

Exact Cover Instance : A fnte set S and k subsets S 1, S 2,, S k of S. Queston : Is there a subset of {S 1, S 2,, S k } that forms a partton of S? For example, f S = {7, 5, 19, 1, 12, 8, 14}, k = 4, S 1 = {7, 19, 12, 14}, S 2 = {7, 5, 8}, S 3 = {5, 1, 8}, and S 4 = {19, 1, 8, 14}, then the answer s yes ({S 1, S 3 } forms a partton of S). 3

Exact Cover Sum of Subsets. Let S = {u 1, u 2,, u m } and S 1, S 2,, S k be an arbtrary nstance of Exact Cover. An nstance of Sum of Subsets can be obtaned n polynomal tme as follows. m 1 A = {a 1, a 2,, a k } and c = ( k + 1 ), where for 1 j k, = 0 a j = m = 1 e, ( k + 1 ) 1, j wth e j, = 1 f u S j and e j, = 0 f u S j. Sum of Subsets has the answer yes f and only f Exact Cover has the answer yes. 4

For example, gven the followng nstance of Exact Cover : S = {7, 5, 19, 1, 12, 8, 14}, k = 4, S 1 = {7, 19, 12, 14}, S 2 = {7, 5, 8}, S 3 = {5, 1, 8}, and S 4 = {19, 1, 8, 4}, a matrx e s defned as follows. S S S S 1 2 3 4 7 5 19 1 12 8 14 1 0 1 0 1 0 1 1 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 1 0 1 1 An nstance of Sum of Subsets s constructed as follows. 5

A = {a 1, a 2, a 3, a 4 } and c = 5 0 + 5 1 + 5 2 + + 5 6, where a 1 = 5 0 + 5 2 + 5 4 + 5 6 (1 st row of e); a 2 = 5 0 + 5 1 + 5 5 (2 nd row of e); a 3 = 5 1 + 5 3 + 5 5 (3 rd row of e); a 4 = 5 2 + 5 3 + 5 5 + 5 6 (4 th row of e). The constructon relates a wth S and c wth S. It s not dffcult to see a 1 + a 3 = c S 1 S 3 = S and S 1 S 3 =. 6

Ex. Partton Instance : A multset B = {b 1, b 2,, b n } of postve ntegers. Queston : Is there a subset B B such that b B' b = b B B' j b j? For example, when B = {17, 53, 9, 35, 41, 32, 35}, then the answer s yes (B = {17, 53, 41}). NP-completeness of Partton s shown below. Partton NP. A chosen NP-complete problem : Sum of Subsets. 7

Sum of Subsets Partton Let A = {a 1, a 2,, a m } and c be an arbtrary nstance of Sum of Subsets. An nstance of Partton can be obtaned n polynomal tme as follows: B = A {a m+1, a m+2 }, where a m+1 = c + 1 and a m+2 = 1 c + a A a. Snce a m+1 + a m+2 = a A a + 2, we have {a m+1, a m+2 } B and {a m+1, a m+2 } B B. We show below that a Α' a = c f and only f a m+2 + a Α' a = a m+1 + a Α Α' a (.e., B = A + {a m+2 }). 8

( ) Suppose a Α' a = c. a m+2 + a Α' a = (1 c + a A a ) + a Α' a = 1 + a Α a. a m+1 + a Α Α' a = (c + 1) + a Α Α' a = 1 + a Α a. ( ) Suppose a m+2 + a Α' a = a m+1 + a Α Α' a,.e., B = A + {a m+2 }. Then, (1 c + a Α Α' a A a, a ) + a Α' a = (c + 1) + from whch a Α' a = c can be derved. 9

Exercse 5. Read Example 8-14 on page 367 of the textbook. (1) Gve a reducton from Partton to the bn packng problem. (2) Illustrate the reducton by an example. (3) Verfy the reducton. Exercse 6. Read Theorem 11.2 on page 518 of Ref. (2). (1) Gve a reducton from Satsfablty to Clque. (2) Illustrate the reducton by an example. (3) Verfy the reducton. 10

Three Proof Technques Restrcton Local Replacement Component Desgn 11

Restrcton If a problem Π contans an NP-hard problem Π as a specal case (.e., Π s a restrcted subproblem of Π), then Π s NP-hard. Ex. Exact Cover Instance : A fnte set S and k subsets S 1, S 2,, S k of S. Queston : Is there a subset of {S 1, S 2,, S k } that forms a partton of S? Exact Cover by 3-Sets Instance : A fnte set S wth S = 3p and k 3- element subsets S 1, S 2,, S k of S. Queston : Is there a subset of {S 1, S 2,, S k } that forms a partton of S? 12

Exact Cover by 3-Sets s a specal case of Exact Cover. 3-Dmensonal Matchng Instance : A set M W X Y, where W, X and Y are three dsjont q-element subsets. Queston : Does M contan a matchng,.e., a subset M M such that M = q and no two elements of M agree n any coordnate? For example, f W = {0, 1}, X = {a, b}, Y = {+, }, and M = {(0, a, +), (1, b, +), (1, b, )}, then the answer s yes (M = {(0, a, +), (1, b, )}). 3-Dmensonal Matchng s a specal case of Exact Cover by 3-Sets. 13

For example, the followng nstance of 3-Dmensonal Matchng : W = {0, 1}, X = {a, b}, Y = {+, }, and M = {(0, a, +), (1, b, +), (1, b, )} can be transformed nto an nstance of Exact Cover by 3-Sets as follows : S 1 = {0 W, a X, + Y }, S 2 = {1 W, b X, + Y }, S 3 = {1 W, b X, Y }, and S = W X Y = {0 W, 1 W, a X, b X, + Y, Y }. Therefore, 3-Dmensonal Matchng s NP-complete. Exact Cover by 3-Sets s NP-complete. Exact Cover s NP-complete. 14

Ex. Hamltonan Cycle Instance : An undrected graph G = (V, E). Queston : Does G contan a Hamltonan Cycle,.e., an orderng (v 1, v 2,, v V ) of the vertces of G such that (v 1, v V ) E and (v, v +1 ) E for all 1 < V? Drected Hamltonan Cycle Instance : A drected graph G = (V, A), where A s a set of arcs (.e., ordered pars of vertces). Queston : Does G contan a drected Hamltonan cycle,.e., an orderng (v 1, v 2,, v V ) of the vertces of G such that (v 1, v V ) A and (v, v +1 ) A for all 1 < V? 15

Hamltonan Cycle s a specal case of Drected Hamltonan Cycle (or Hamltonan Cycle Drected Hamltonan Cycle, where each (u, v) E corresponds to two arcs (u, v), (v, u) A). Therefore, Hamltonan Cycle s NP-complete. Drected Hamltonan Cycle s NP-complete. 16

Hamltonan Path between Two Vertces Instance : An undrected graph G = (V, E) and two dstnct vertces u, v V. Queston : Does G contan a Hamltonan path startng at u and endng at v,.e., an orderng (v 1, v 2,, v V ) of the vertces of G such that u = v 1, v = v V, and (v, v +1 ) E for all 1 < V? Hamltonan Cycle Hamltonan Path between Two Vertces : f the latter s polynomal tme solvable, then the former s also polynomal tme solvable (consderng all edges (u, v) V for the latter). Hamltonan Path between Two Vertces s NP-complete. 17

Hamltonan Path Instance : An undrected graph G = (V, E). Queston : Does G contan a Hamltonan path? Hamltonan Cycle Hamltonan Path : For each (u, v) E, construct an nstance of Hamltonan Path by addng x, y to V and (x, u), (y, v) to E (thus G s nduced). x y u v u v G G G has a Hamltonan cycle f and only f G has a Hamltonan x-y path. If Hamltonan Path s polynomal tme solvable, then Hamltonan Cycle s also polynomal tme solvable. Hamltonan Path s NP-complete. 18

Exercse 7. Show the followng two problems NP- complete by restrcton to Hamltonan Path and Partton, respectvely. Bounded Degree Spannng Tree Instance : An undrected graph G = (V, E) and a postve nteger k V 1. Queston : Does G contans a spannng tree n whch each node has degree at most k? 0/1 Knapsack Instance : A fnte set U, a sze s(u) Z + and a value v(u) Z + for each u U, a sze constrant b Z +, and a value goal k Z +. Queston : Is there a subset U U such that s( u) u U' b and v( u) u U' k? 19

Local Replacement In order to show Π Π, local replacement specfes the basc unts for Π and replaces them wth others, whle constructng a correspondng nstance of Π. Usually, local replacement has one knd of basc unts that each are replaced wth the same structure. Ex. Partton nto Trangles Instance : An undrected graph G = (V, E) wth V = 3p for some nteger p > 0. Queston : Is there a partton of V nto 3-vertex subsets V 1, V 2,, V p, such that each subgraph nduced by some V (1 p) forms a trangle? 20

For example, the answer for the followng nstance s yes, because V can be parttoned nto {1, 2, 3}, {4, 5, 6}, {7, 8, 9} or {1, 4, 7}, {2, 5, 6}, {3, 8, 9}. 1 2 3 4 7 5 6 8 9 Exact Cover by 3-Sets Partton nto Trangles s shown below. Let a set S, where S = 3p, and a collecton C of 3-element subsets of S denote an arbtrary nstance of Exact Cover by 3-Sets. Construct an nstance of Partton nto Trangles as follows. 21

Consder each subset {x, y, z } C a basc unt, and replace t wth the followng structure. a [3] a [6] a [9] a [1] a [2] a [4] a [5] a [7] a [8] x y z For example, f S = {1, 2, 3, 4, 5, 6} and C = {{1, 4, 6}, {2, 4, 6}, {2, 3, 5}}, then an nstance of Partton nto Trangles s obtaned as follows. 5 3 1 4 6 2 22

It s not dffcult to check that f Exact Cover by 3-Sets has an answer yes (e.g., {{1, 4, 6}, {2, 3, 5}} s a partton of S), then Partton nto Trangles has an answer yes (the trangles are shown wth bold edges). Also, f Partton nto Trangles has an answer yes, then Exact Cover by 3-Sets has an answer yes. Exercse 8. Read Example 8-9 on page 353 of the textbook. (1) Gve a reducton from Satsfablty to 3-Satsfablty. (2) Illustrate the reducton by an example. (3) Verfy the reducton. 23

Sometmes, addtonal structures are requred, whle usng the technque of local replacement. Ex. Sequencng wthn Intervals Instance : A fnte set T of tasks and for each t T, a release tme r(t) Z + {0}, a deadlne d(t) Z +, and a length l(t) Z +. Queston : Does there exst a feasble schedule for T,.e., a functon 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, whch s executed from tme f(t) to f(t) + l(t), cannot start executon untl tme r(t), must be completed by tme d(t), and ts executon cannot overlap the executon of any other task t.) 24

Partton Sequencng wthn Intervals s shown below. An arbtrary nstance of Partton : a multset B = {b 1, b 2,, b n } of postve ntegers. Consder each b (1 n) a basc unt, and let m = 1 n b. Construct an nstance of Sequencng wthn Intervals as follow : each b corresponds to a task t wth r(t ) = 0, d(t ) = m + 1, and l(t ) = b. An addtonal structure : a task t% wth r( t% ) = m/2, d( t% ) = (m+1)/2, and l( t% ) = 1. m should be even (for otherwse, r( t% ) = d( t% ),.e., t s mpossble to schedule t% ) 25

r( t% ) = m/2, d( t% ) = (m/2) + 1 f ( t% ) must be m/2. m 2 m 2 t% 0 m m + 1 2 2 m + 1 Tme Partton has the answer yes f and only f Sequencng wthn Intervals has the answer yes. 26

Component Desgn Whle showng Π Π, component desgn s smlar to local replacement n replacng the structures (.e., basc unts) of Π wth other structures, n order to obtan an nstance of Π. Usually, component desgn adopts multple knds of basc unts, and dfferent basc unts are replaced wth dfferent structures. Ex. Vertex Cover Instance : An undrected graph G = (V, E) and a postve nteger k V. Queston : Does G contan a vertex cover of sze at most k,.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? 27

For example, {1, 3}, {1, 2, 3} and {1, 2, 4, 5} are three vertex covers of the followng graph. If k 2, the answer s yes. If k = 1, the answer s no. We show below 3-Satsfablty Vertex Cover. 3-Satsfablty Instance : A set U of varables and a collecton C = {c 1, c 2,, c m } of clauses over U, where each clause of C contans three lterals. Queston : Is there a satsfyng truth assgnment for C? 28

For example, when U = {x 1, x 2, x 3 } and C = {x 1 x 2 x 3, x 1 x 2 x 3, x 1 x 2 x 3 }, the answer s yes, because the assgnment of U : x 1 F, x 2 F, and x 3 T, can satsfy C (.e., (x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) (x 1 x 2 x 3 ) = T). Let U = {u 1, u 2,, u n } and C = {c 1, c 2,, c m } be an arbtrary nstance of 3-Satsfablty. For each u U, construct a component T = (V, E ), where V = {u, u } and E = {(u, For each c j C, construct a component S j = u )}. (V j, E j ), where V j = {a 1 [j], a 2 [j], a 3 [j]} and E j = {(a 1 [j], a 2 [j]), (a 1 [j], a 3 [j]), (a 2 [j], a 3 [j])}. For each c j C, construct an edge set E j = {(a 1 [j], x j ), (a 2 [j], y j ), (a 3 [j], z j )}, where x j, y j and z j are the three lterals n c j. 29

An nstance of Vertex Cover can be constructed as G = (V, E) and k = n + 2m, where V = ( U n ) ( U m V' ) and =1 V j=1 j E = ( U n ) ( U m =1 E j=1 E' j ) ( U m E'' ). j=1 j For example, f U = {u 1, u 2, u 3, u 4 } and C = {u 1 u 3 u 4, u 1 u 2 u 4 }, then the followng nstance of Vertex Cover s constructed, where k = 8. 30

Each edge n E j represents a satsfyng truth assgnment for c j. For example, (u 1, a 1 [1]) E 1 mples that u 1 T can satsfy c 1. Any vertex cover V V of G contans at least one from {u, from {a 1 [j], a 2 [j], a 3 [j]}. u } and at least two V n + 2m = k As explaned below, C s satsfable f and only f G has a vertex cover V V wth V k. 31

C s satsfable V V wth V k exsts Consder the example above, where u 1 T, u 2 T, u 3 T, and u 4 T can satsfy C. nclude u 1, u 2, u 3, u 4 n V In order to make V a vertex cover, V must be augmented wth two vertces from each set {a 1 [j], a 2 [j], a 3 [j]}, whle coverng all edges n E j. augment V wth any two from {a 1 [1], a 2 [1], a 3 [1]} and a 1 [2], a 2 [2] (or a 1 [2], a 3 [2]) from {a 1 [2], a 2 [2], a 3 [2]} (a 1 [2] must be ncluded n V, n order to cover the edge (u 1, a 1 [2])) 32

V V wth V k exsts C s satsfable V contans exactly k = n + 2m vertces : one for each {u, u } and two for each {a 1 [j], a 2 [j], a 3 [j]}. Consder the example above, where k = 8 and V = {u 1, u 2, u 3, u 4, a 1 [1], a 3 [1], a 1 [2], a 3 [2]} s a vertex cover. u 1 T, u 2 T, u 3 T and u 4 T can satsfy C (u 1, u 2, u 3, u 4 V ) Snce two (e.g., a 1 [1] and a 3 [1]) from {a 1 [j], a 2 [j], a 3 [j]} are ncluded n V, the other (e.g., a 2 [1]) must be connected to u or ncluded n V. u (e.g., u 3 ) that s each c j s satsfable. 33

Ex. Mnmum Tardness Sequencng Instance : A fnte set T of tasks, where each t T has length 1 and deadlne d(t) Z +, a partal order p on T, and a non-negatve nteger r T. Queston : Is there a schedule f : T {0, 1,, T 1} such that f(t) f(t ) f t t, f(t) < f(t ) f t p t, and {t T : f(t) + 1 > d(t)} r? A task t T s tardy, f f(t) + 1 > d(t). The schedule f s requred not to cause more than r tasks tardy. We show below Clque Mnmum Tardness Sequencng. 34

Clque Instance : An undrected graph G = (V, E) and a postve nteger k V. Queston : Does there exst a subset V V such that V k and every two vertces of V are adjacent n G? Let G = (V, E) and k V be an arbtrary nstance of Clque. An nstance of Mnmum Tardness Sequencng can be constructed as follows. T = V E; r = E k(k 1) / 2; v p e v V, e E, and v s an endpont of e; d(v) = V + E for v V, and d(e) = k(k + 1) / 2 for e E. 35

a clque of sze k for G a feasble schedule for T Suppose that G = (V, E ) s a k-vertex complete subgraph of G ( V = k and E = k(k 1)/2). A feasble schedule s shown below. Tasks n V and n E are not tardy. There are at most E E = E k(k 1)/2 tardy tasks. a feasble schedule for T a clque of sze k for G Suppose that f s a feasble schedule, and there are x tasks from V and y tasks from E scheduled n {0, 1,, (k(k + 1) / 2) 1} under f. 36

Then, x + y = k(k + 1) / 2. (1) Snce only tasks n E may be tardy, we have E y E k(k 1) / 2 (= r). y k(k 1) / 2 (2) Wth (1) and (2), we have x (k(k + 1) / 2) (k(k 1) / 2) = k. (3) The only stuaton that both (2) and (3) hold wth the restrcton of p s when x = k, y = k(k 1) / 2, and the k vertces together wth the k(k 1) / 2 edges form a complete subgraph of G. 37

Exercse 9. Read Example 8-10 on page 359 of the textbook. (1) Gve a reducton from a satsfablty problem where each clause has at most three lterals to the chromatc number problem. (2) Illustrate the reducton by an example. (3) Verfy the reducton. Exercse 10. Read Theorem 3.5 on page 60 of Ref. (1). (1) Gve a reducton from 3-Dmensonal Matchng to Partton. (2) Illustrate the reducton by an example. (3) Verfy the reducton. 38

A Proof Technque for NP- Completeness of Subproblems Suppose that Π s an NP-complete problem and Π s a restrcted subproblem of Π. A proof technque, whch s based on local replacement, for the NP-completeness of Π s ntroduced. Ex. Graph 3-Colorablty Instance : An undrected graph G = (V, E). Queston : Is G 3-colorable,.e., does there exst a functon f : V {1, 2, 3} such that f(u) f(v) for all edges (u, v) E? Graph 3-Colorablty wth Degrees at Most Four s a restrcted subproblem of Graph 3-Colorablty where each vertex degree of G s at most four. 39

For example, the followng graph, denoted by H 3, s 3-colorable, and n each 3-colorng, the three endponts of the largest trangle are assgned wth the same color. Let H k be the concatenaton of k 2 H 3 s, where k 3. For example, H 5 s depcted as follows. 40

H k has k outlets (.e., the vertces of degree 2). H k s 3-colorable and n each 3-colorng, the k outlets are assgned wth the same color. Next we show Graph 3-Colorablty Graph 3-Colorablty wth Degrees at Most Four. Suppose that G = (V, E) s an arbtrary nstance of Graph 3-Colorablty. An nstance G = (V, E ) of Graph 3-Colorablty wth Degrees at Most Four can be obtaned by sequentally replacng each vertex of G whose degree s k > 4 wth H k. 41

For example, It s easy to see that G s 3-colorable f and only f G s 3-colorable. 42

Planar Graph 3-Colorablty s a restrcted subproblem of Graph 3-Colorablty where G s planar. We show Graph 3-Colorablty Planar Graph 3-Colorablty below. Let H denote the followng graph. Notce that H s 3-colorable, and any 3-colorng f of H has f(x) = f(x ) and f(y) = f(y ). Besdes, there exst 3-colorngs f 1 and f 2 of H wth f 1 (x) = f 1 (x ) = f 1 (y) = f 1 (y ) and f 2 (x) = f 2 (x ) f 2 (y) = f 2 (y ). 43

Suppose that G = (V, E) s an arbtrary nstance of Graph 3-Colorablty. An nstance G = (V, E ) of Planar Graph 3-Colorablty can be obtaned by performng the followng replacement on the edge crossngs of each edge (u, v) E. It s not dffcult to check that G s 3-colorable f and only f G s 3-colorable. 44

More Examples Ex. VLSI Dscrete Layout Instance : A set R = {r 1, r 2,, r n } of rectangles, where each r s of sze h w, and an nteger A > 0. Queston : Is there a placement of R on the plane satsfyng the followng condtons: (1) each vertex of r has an ntegral (x, y)-coordnate; (2) each lne of r s parallel to the x-axs or y-axs; (3) no two rectangles overlap; (4) every two neghborng rectangles are one dstant from each other; (5) R can be covered by a rectangle of area at most A? 45

For example, f n = 5, r 1 : 3 5, r 2 : 5 12, r 3 : 5 6, r 4 : 3 6, r 5 : 4 7, and A = 210, then the answer s affrmatve, because the fve rectangles can be covered by a rectangle of sze 16 13. We show below Bn Packng VLSI Dscrete Layout. 46

Bn Packng Instance : A set U = {u 1, u 2,, u n } of tems, where each u has sze s > 0, and a set B = {b 1, b 2,, b m } of bns, where each b j has capacty c > 0. Queston : Is there a dstrbuton of U over B such that the tems wthn the same bn has total sze at most c? For example, f n = 10, (c 1, c 2,, c 10 ) = (2, 7, 5, 8, 6, 8, 5, 4, 8, 6), m = 3, and c = 20, then the answer s affrmatve. 47

Let U = {u 1, u 2,, u n } and B = {b 1, b 2,, b m } be an arbtrary nstance of Bn Packng. An nstance of VLSI Dscrete Layout can be constructed as follows. For each u (1 n), construct r of sze 1 ((2m + 1)s 1). Construct r n+1 of sze h w, where h = 2mw + 1 and w = (2m + 1)c 1. Set A = (h + 2m)w. Bn Packng yes VLSI Dscrete Layout yes Suppose that there are n tems stored n b whose szes are d, 1, d, 2, n where 1 m and d, r= 1, r c. d,, n 48

The placement of the correspondng rectangles wth respect to b s as follows. (placement wth respect to b ) The placement of all n + 1 rectangles s as follows. 49

The wdth of the placement wth respect to b s computed as follows. n (( ( n 1) + 2 m + 1 d 1) r= 1 ), r n = ( n 1) n + (2 m +1 ) d, r r= 1 (2m + 1)c 1 = w. The area of the rectangle coverng all n + 1 rectangles s at most (2m + h)w = A. VLSI Dscrete Layout yes Bn Packng yes Suppose that r 1, r 2,, r n+1 can be covered by a rectangle r% of area at most A. There are the followng three facts. 50

Fact 1. The wdth of r% s w, whch s the wdth of r n+1. Proof. Suppose to the contrary that the wdth of r% s at least w + 1. Snce the heght of r n+1 s h, the area of r% s at least h(w + 1) = hw + h = hw + (2mw + 1) = (h + 2m)w + 1 = A + 1, a contradcton! Fact 2. Each r (1 n) s placed wth heght 1, not of heght (2m + 1)s 1. Proof. If some r s placed wth heght (2m + 1)s 1, then the heght of r% s at least h + ((2m + 1)s 1) + 1 = h + (2m + 1)s. 51

So, the area of r% s at least (h + (2m + 1)s )w = hw + 2mws + ws = (2ms + h)w + ws > A + ws a contradcton! Fact 3. The total number of rows occuped by r 1, r 2,, r n s at most m. Proof. If t s not true, then the area of r% s larger than (2m + h)w = A, a contradcton. Accordng to the three facts, the placement of r 1, r 2,, r n+1 s lke the one shown on page 49. Then, put the tems correspondng to the rectangles of row nto b. 52

Suppose that there are n tems stored n b whose szes are d, 1, d, 2,, d., n Snce the wdth of row (1 m) s at most w, we have w (= (2m + 1)c 1) n (( ( n 2 m + d, r r= 1 1) + 1 1) n = ( (2 ), r r= 1 n 1) + m +1 d n n = (2 m ) d, r r= 1 +1 1. ) n d, r r= 1 c 53