6. the most difficult np problems: the class npc

40
6. The Most Difficult NP Problems: The Class NPC Polynomial transformation: Given function such that iff . If the function is computable in time that is polynomial in the length of the encoding of , then is said to be polynomially transformable to . (notation: ( in language term)) Note that means that is no easier than in terms of polynomial time solvability. If we can solve in polynomial time (find ‘yes’, ‘no’ answer using deterministic algorithm), then we can answer whether any given instance of is ‘yes’ or ‘no’ in polynomial time. But, the converse may not hold. Integer Programming 2013 1

Upload: tacey

Post on 20-Feb-2016

22 views

Category:

Documents


0 download

DESCRIPTION

6. The Most Difficult NP Problems: The Class NPC. Polynomial transformation: Given function such that iff . If the function is computable in time that is polynomial in the length of the encoding of , then is said to be polynomially transformable to . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 6. The Most Difficult NP Problems: The Class NPC

6. The Most Difficult NP Problems: The Class NPC Polynomial transformation:

Given function such that iff . If the function is computable in time that is polynomial in the length of the encoding of , then is said to be polynomially transformable to .(notation: ( in language term))

Note that means that is no easier than in terms of polynomial time solv-ability. If we can solve in polynomial time (find ‘yes’, ‘no’ answer using deterministic algorithm), then we can answer whether any given instance of is ‘yes’ or ‘no’ in polynomial time. But, the converse may not hold.

Integer Programming 2013 1

Page 2: 6. The Most Difficult NP Problems: The Class NPC

Polynomial reduction: is polynomially reducible to if algorithm for that uses algorithm for as a subroutine and runs in polynomial time assuming each call to the subroutine takes unit time. ( recall Opt and Feas for 0-1 IP problem)( transformation is a special case of reduction)

Polynomial transformation also called Karp reduction, (GJ).Polynomial reduction called Turing reduction, (GJ).

Prop: If is polynomially transformable (reducible) to , and , then .

Def: is a special case of if and .

( Use identity transformation .)

Integer Programming 2013 2

Page 3: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 3

Def: is said to be complete if all problems in can be polynomially reduced (transformed) to .The set of complete problems is denoted by .

complete problem is the hardest problem in since the existence of a poly-nomial time algorithm for any complete problem implies that all the prob-lems in can be solved in polynomial time.

Prop 6.3: If is complete, then iff .( )

Pf) and . poly time alg. for any problem in .Hence . Also . So .

Prop 6.4: If is complete, and , then is complete.( Be careful about the direction of the transformation.)

Page 4: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 4

Is ?

First complete problem found: Satisfiability problem (Cook, 1971)

Given a set of Boolean variables and a collection of clauses over , is there a satisfying truth assignment for ?( Is there a truth assignment to ? )( : and, : or )ex) Given ,

a truth assignment is true, false, false

Thm 6.5: (Cook) The satisfiability problem (SAT) is complete.Pf) polynomial transformation of any NDTM into the satisfiability problem.

(GJ, pp.38-44)

Page 5: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 5

Prop 6.6: 0-1 IP feasibility problem is complete.Pf) clearly in .Let each clause be . Then (SAT) is satisfiable iff

is feasible.We have a function that transforms any instance of (SAT) to an in stance of 0-1 IP feasibility.

Note that we transform an arbitrary instance of (SAT) to a (specific) instance of 0-1 IP feasibilty, which depends on the given instance of (SAT). The ratio-nale is that if there exists an efficient algorithm to solve any instance of 0-1 IP feasibility, we can apply the algorithm to the transformed instance to solve any arbitrary instance of (SAT). So it is unlikely that such efficient algorithm for 0-1 IP feasibility exists since the existence of such algorithm implies that we can solve (SAT) easily and solve all problems in easily.

Page 6: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 6

Boundary between and : 0-1 matrix.

two 1’s in each column of (node-edge incidence matrix) :matching problem

Three 1’s in each column One 1 in each row Two 1’s in each row (edge-node incidence matrix) :

node packing problem

Be careful about the distinction between the feasibility problem itself and the 0-1 IP formulation.

Page 7: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 7

Unweighted node packing problem (independent set, stable set):Given a graph such that and is a node packing?

Prop 6.7: The lower bound feasibility problem for unweighted node packing is complete.Pf) in . transform from (SAT)

ex) 1 {1, 2} {3}2 {2, 3} {4}3 {4} {1, 2}4 {3}

clauses vars set

{1, 3} = ‘true’, {2, 4} = ‘false’ (4, 3)

(1, 1)

(6, 3)

(5, 3) (2, 1)

(7, 1)

(2, 2)

(3, 2)

(8, 2)

(3, 4)

Page 8: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 8

Then the given instance of (SAT) has truth assignment iff node packing of size .

Note that is set depending on the given instance of (SAT). It is not an arbi-trary number.

If we want to claim that IP feasibility formulation of node packing lower bound feasibility is complete, we need to transform the node packing to the IP formulation.

Page 9: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 9

Clique: Given is called a clique if . (complete subgraph of G) Clique problem: Given and positive integer , a clique of size

Prop: Clique problem is completePf) in . Independent set (node packing) cliqueGiven an instance of node packing construct . Set Then is an independent set for iff is a clique for .Hence has an independent set of size iff has a clique of size .

Page 10: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 10

Vertex cover: Given is called a vertex cover if all edges in are incident to at least one vertex in .

Vertex cover problem: Given a vertex cover of size (complete)Pf) in . clique vertex coverGiven an arbitrary instance of clique construct an instance of vertex cover. Construct and set .Then is a clique of size in is a vertex cover of size in .() nodes in not connected by edges in .

edges in incident to at least one node in . vertex cover in .

() every edge in is incident to at least one node in no edge in connects nodes in . clique in .

Page 11: 6. The Most Difficult NP Problems: The Class NPC

Relation between node packing (independent set), clique, vertex cover:

is a vertex cover for . is a node packing for . is a clique in .

Integer Programming 2013 11

Page 12: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 12

Six Basic NP-complete Problems (GJ) 3-Satisfiability (3SAT)

Instance: Collection of clauses on a finite set of variables such that for .Question : Is there a truth assignment for that satisfies all the clauses in

Dimensional Matching (3DM)Instance : A set where and are disjoint sets having the same number of el-ements.Question : Does contain a matching, that is, a subset such that and no two elements of agree in any coordinate ?(generalization of marriage problem.)

Page 13: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 13

Vertex Cover

Clique

Hamiltonian Circuit:Instance : A graph Question : Does contain a Hamiltonian circuit, that is, an ordering of the vertices of , where such that and for all

Partition:Instance : A finite set and a “size” for each .Question : Is there a subset such that

Page 14: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 14

Proving NP-completeness Set partitioning feasibility problem :

Given an matrix , is Prop 6. 8: Set partitioning feasibility problem is complete.

Pf) In . Lower bound feasibility problem for unweighted node packing Set partitioning feasibility problem Given an instance of node packing let be matrix defined as follows.

11000

0110000110

GGGE AAAI

A

( is edge-node incidence matrix of .)

Page 15: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 15

feasible pick distinct columns of s node packing of size . Simi-larly, for converse.Hence node packing of set partitioning feasible with columns (vari-ables)

Prop 6. 9: The set partitioning feasibility feasibility problem in which ma-trix has, at most, three 1’s per column is complete.

Page 16: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 16

Ex)

111100000111100000

110011001101010101011001101100110011001100111

𝐴=¿

𝑒1

𝑒2

𝑒3

𝑒4

𝑒5

1

2

3

4

Page 17: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 17

Subset sum problem:Given an integer , integral vector and integer , is

Prop 6.10: The subset sum problem is complete.Pf) in . Set partitioning feasibility problem subset sum.Given an 0-1 matrix , construct an instance of subset sum as follows.

1

111

101

001110011

x

1

2

)1(

)1()1(

1

mn

nn

naaa 21 b

mi n

ni

mi ij

ij

mnb

njana

11)1(1

11

)1(

,...,1for ,)1(

( j-th column of A is representation of aj using (n+1) symbols.)

Page 18: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 18

0-1 knapsack lower bound feasibility problem:Given an integer , integral vectors and and integers and , is

(complete)Pf) in . Subset sum problem can be reformulated as

.Hence it is a special case of 0-1 knapsack lower bound feasibility. Since spe-cial case is complete, more general case is complete. ( recall the definition of special case. It is identity transformation ( or any obvious one-to-one corre-spondence between the instances.)(special case also called “restriction” and one of the easiest and widely used proving techniques.)

Note that 0-1 knapsack is not a special case of integer knapsack.

Page 19: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 19

More examples of Restriction Variants of Hamiltonian Circuit :

Hamiltonian Path: Same as HC except that we drop the requirement that the first and the last vertices in the sequence be joined by an edge.

Hamiltonian Path between Two Points: same as HP except that two points are given as input and the question is whether contains a HP beginning with and end-ing with .

All three problems complete For directed graph?

transform each undirected problem to a directed problem by replacing each edge of by two parallel arcs of opposite direction. Undirected version is a special case of directed version.

Page 20: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 20

Bounded Degree Spanning Tree :Instance : A graph and a positive integer .Question : Is there a spanning tree for in which no vertex has degree exceed-ing that is, a subset such that the graph is connected, and no vertex in is in-cluded in more than edges from

Restrict to Hamiltonian Path by allowing only instances in which . HP is a special case of BDST with .

Page 21: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 21

Multiprocessor Scheduling:Instance : A finite set of ‘tasks’, a ‘length’ for each a number of ‘proces-sors’, and a ‘deadline’ .Question : Is there a partition of into disjoint sets such that

max

Restrict to partition by allowing only instances in which and .

Page 22: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 22

Longest Path:Instance : Graph positive integer Question : Does contain a simple path (that is, a path encountering no vertex more that once) with or more edges ?

Restrict to Hamiltonian Path, i.e. set

Set Packing:Instance : Collection of finite sets, positive integer Question : Does contain disjoint sets ?

Restrict to Exact Cover by Sets, i.e. restrict for all and .

Page 23: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 23

Exact Cover by Sets (X3C): (complete)Instance : A finite set with and a collection of 3-element subsets of .Question : Does contain an exact cover for that is, a subcollection of such that every element of occurs in exactly one member of

Note that 3DM is a restricted version of X3C, hence X3C is complete.

Compare to NW p115, 117 in representing the problems.

Page 24: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 24

Proving Traveling Salesman Problem is complete.Instance : Set of cities, distance for each pair of cities , a positive integer .Question : Is there a tour of having length or less, i.e., a permutation of such that

Pf) In . HC TSPGiven construct an instance of TSP as follows.Let . Let if and if . Set .Then has a HC iff TSP has a tour with length .

Page 25: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 25

If , then . ( i.e. there are problems of intermediate difficulty.) is called (Intermediate)

NoteMembers in not equivalent in terms of polynomial transformation. ( infinite

number of equivalent classes.)Only artificial examples known. Have been looking for natural problems in .Composite number, LP regarded as candidates in . Composite Number : Given positive integer are there integers such that

Page 26: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 26

Note that composite number is in and its complementary problem (Primes) is to check the primality of a given prime number. There exists a short proof to check primality. Hence Composite Number is in . So it is unlikely that com-posite number is complete by Prop 6.12.Composite number was proven to be in in 2002.

NP

P

NPC NPI

Page 27: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 27

Prop 6. 12: If then (It is unlikely that any problem in is complete)Pf) If there exists polynomial transformation such that for Since . For an instance in maintains ‘yes’ ‘no’ answer after the trans-formation.If a ‘no’ instance in is given, we can apply to it, and obtain an instance in which has ‘no’ answer. Since we can verify the ‘no’ by polynomial time NDTM.So ‘no’ instance in can be verified Similarly, for the other direction.

NP

P

CoNPNPC

Page 28: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 28

Status of Open Problems in GJ

Source : Pulleyblank, MPS 2000 tutorial 1. Graph Isomorphism open

2. Subgraph homeomorphism for a fixed graph3. Graph genus complete4. Chordal graph completion complete5. Chromatic index complete6. Spanning tree parity7. Partial Order Dimension complete8. Precedence constrained 3-processor schedu open9. Linear Programming 10. Total Unimodularity11. Composite number open ()12. Minimum length triangulation open

Page 29: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 29

NP-complete in the strong sense (strongly NP-com-plete)

Refer GJ. p90 - Recall that algorithm for 0-1 knapsack problem (also subset sum). Though

0-1 knapsack feasibility is complete, is less formidable than . If is small (polynomial of ), the algorithm runs in polynomial time for the restricted case.called pseudo-polynomial time algorithm.

Q) pseudo-polynomial time algorithms for other complete problems involv-ing numbers like ? e.g.) TSP feasibility, Multiprocessor scheduling.

Problems like clique, vertex cover do not have pseudo-polynomial time al-gorithms.

Some problems involving numbers do not have even pseudo-polynomial time algorithms.

Page 30: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 30

For each instance of decision problem , define the functionsLength[]: length of encoding of .Max]: magnitude of largest number in . (not the size of encoding)

Def: An algorithm for is called a pseudo-polynomial time algorithm for if its time complexity function is bounded above by a polynomial func-tion of Length[] and Max[].(In NW, polynomial running time in unary encoding )

Def: A problem is called a number problem if there exists no polynomial such that Max[] (Length[]) for all e.g) knapsack, partition

Page 31: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 31

Let be subproblem of restricted to instances such that Max[] (Length[]) .Then if pseudo-polynomial time algorithm for solvable in polyno-mial time.

Def: A decision problem is complete in the strong sense (strongly com-plete) if is in and there exists a polynomial function for which is com-plete.

It is the problem class for which there might not exist even pseudo-poly-nomial time algorithms.If a problem is not a number problem and complete, then it is automati-cally strongly complete.

NW: Feasibility problem is called strongly complete if the existence of a pseudo-polynomial time algorithm for it implies .

Page 32: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 32

Ex) 0-1 IP feasibility with coefficients 0, +1, -1 (transformation from satisfi-ability, size of numbers in r.h.s. also small)

TSP: HC TSP. Edge weights 1 or 2 . Hence, all instances with this transformation satisfy Max[I] (Length[]) and complete. So TSP is strongly complete (Length[]

3-Partition: Instance: A finite set of elements, a bound and a ‘size’ for each such that satisfies and such that . Question : Can be partitioned into disjoint sets such that, for

Page 33: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 33

Multiprocessor Scheduling

Sequencing within intervals:Instance: A finite set of ‘tasks’ and, for each an integer ‘release time’ a ‘deadline’ and a ‘length’ Question: Does there exist a feasible schedule for , that is, a function such that, for each and, if then either or

Page 34: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 34

Proving strong completeness by considering restricted problem may be tedious. Use pseudo-polynomial transformation from a strongly com-plete problem.

Def: A pseudo-polynomial transformation from to is a function : such that

For all if and only if can be computed in time polynomial in the two variables Max[] and

Length[], a polynomial such that, for all

(Length’[]) Length[]( size of transformed length does not shrink too much.)

a two variable polynomial such that, for all Max’[] (Max[], Length[])

( magnitude of the largest number does not blow up exponentially)

Page 35: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 35

Lemma: If is complete in the strong sense, and there exists a pseudo-polynomial transformation from to then is complete in the strong sense.

Note that the transformation from set partitioning feasibility (which is strongly complete) to subset sum is not a pseudo-polynomial transforma-tion. Max’[] ( is not bounded by any poly function of Length[] ( ).Hence the existence of pseudo-polynomial time algorithm for subset sum cannot be ruled out.Also, if is complete and and if there exists a pseudo-polynomial time al-gorithm for , it does not necessarily imply the existence of a pseudo-polynomial time algorithm for .

Page 36: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 36

NP-hard Problems GJ Chapter 5 Search problem :

Given an instance return string , such that or decide no such string ex-ists. ( : set of solutions for )( Decision problem may be regarded as a special case of search problem by defining {‘yes’} if and if )

Def: A polynomial time Turing reduction (or simply Turing reduction) from a search problem to a search problem is an algorithm that solves by using a hypothetical subroutine for solving such that, if were a poly-nomial time algorithm for , then would be a polynomial time algorithm for (the subroutine may be used many times and and need not be fea-sibility problems)

Page 37: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 37

Def: A search problem is hard if there exists an complete problem such that (Turing reducible)( is at least as hard as complete problem and is search problem (optimization problem)

Recall (0-1 IP FEAS) (0-1 IP OPT)

Def: A search problem is called easy if there exists a such that ( search problem is no harder than complete problems.Recall (0-1 IP OPT) (0-1 IP FEAS) )

Page 38: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 38

A search problem is called equivalent if both hard and easy. (has the same degree of difficulty as an complete problem in terms of polynomial time solvability.)

To show that an optimization problem is difficult to solve (hard), it is enough to show that the corresponding feasibility problem is complete and the optimization problem is Turing reducible from the feasibility problem (usually trivial).

Some people use the term complete for optimization problems too.

Page 39: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 39

Optimization and Separation Relates the complexity of a class of optimization problem over certain poly-

hedra with the separation problem for the polyhedra.

Optimization, separation trivial if is given explicitly. But if polyhedron is given as conv() where is set of feasible solutions, the story is different.ex) for node packing is nontrivial if is fractional.

Separation problem:Given is If not, find an inequality satisfied by all points in but violated by the point .

Page 40: 6. The Most Difficult NP Problems: The Class NPC

Integer Programming 2013 40

Thm: Optimization problem over a class of polyhedra is polynomially solv-able if and only if the separation problem for the polyhedra is polynomiallly solvable.