Comparison of several polynomial and exponential time complexity functions. Size n

Size: px
Start display at page:

Download "Comparison of several polynomial and exponential time complexity functions. Size n"

Transcription

1 Comparison of several polynomial and exponential time complexity functions Time complexity function n n 2 n 3 n 5 2 n 3 n Size n second second second second second second second second second second second second second second second second second second second second second minutes minutes minutes second second minutes days years centuries * *10 13 second minutes years centuries centuries centuries

2 Size of Largest Problem Instance Solvable in 1 Hour Time complexity function With present computer With computer 100 times faster With computer 1000 times faster n N 1 100N N 1 n 2 N 2 10N N 2 n 3 N N 3 10N 3 n 5 N 4 2.5N N 4 2 n N 5 N N n N 6 N N

3 Intractable problems rec sets decidable r.e. sets non r.e. sets undecidable note procedure yes not always halts Algorithm yes no always halts

4 Definition : A problem is said to be intractable if it is so hard that no polynomial time algorithms can possibly solve it. Certain decidable problems may be intractable!!! What are polynomial time algorithms? Why possibly? In what? In which computer?

5 problem Given I and P, find S satisfying P. problem Generic instance Question A generic instance is specified in terms of various components(parameters) such as sets,graphs,functions,numbers,. A question is asked in terms of the generic instance. Decision problems yes or no answers Optimization problems

6 Traveling Salesman Instance: A finite set C = {c 1, c 2,., c m } of cities, a distance d(c i, c j ) Z + for each pair of cities c i, c j C, and a bound B Z + (where Z + denote the positive integers ) Question: Is there a tour of all cities in C having total length no more than B. < c π(1), c π(2),., c π(m) > such that m i= 1 1 d yes or no ( i), cπ ( i+ 1) ) + d( cπ ( m), cπ (1 ) B. ( cπ )

7 Algorithm yes no a TM that always halts An algorithm is a step - by - step porcedure( consisting of a finite sequence of instructions) for solving a problem. Polynomial time algorithms exponential time algorithms

8 Time Complexity T(n) T(n) time requirements of an algorithm for solving a problem of size n # of steps rather than absolute time Why? Problem length Input Length T(n) = max{ t t is time required by the algorithm to solve a problem instance of size n } Related to an encoding scheme Need two underlying assumptions: (i) The model of computation TM (ii) a reasonable encoding scheme?

9 How to encode a problem Reasonable encoding schemes What is this? A generally accepted meaning of reasonable includes : (i) Conciseness No unnatural padding (ii) Decodability Existence of a polynomial time algorithm capable of extracting a description of all components of a problem instance from encoded data. Unfortunately, no definite way for satisfying this!!! (even though the existence of a reasonable encoding scheme is intuitively obvious )

10 v 1 v 2 v 3 v 4 Descriptions of the graph G=(V,E) where V= {V 1, V 2, V 3, V 4 } and E= { {V 1, V 2 },{V 2, V 3 }}, under three different encoding schemes. Encoding Scheme String Length Vertex list, Edge list Neighbor list Adjacency matrix rows V[1]V[2]V[3]V[4](V[1]V[2])(V[2]V[3]) (V[2])(V[1]V[3])(V[2])() 0100/1010/0100/ Encoding Scheme Vertex list, Edge list Neighbor list Adjacency matrix rows Lower Bound 4v + 10e 2v + 8e (= 4 2e) v 2 +v - 1 Upper Bound 4v + 10e + (v + 2e)*[log 10 v] 2v + 8e + 2e*[log 10 v] v 2 +v - 1

11 However, most people would agree on whether or not a particular encoding scheme is reasonable. ( although the absence of a formal way is somewhat uncomfortable ) How can you resolve this difficulty? Setting up a standard encoding scheme

12 Standard encoding scheme Flexible enough to accommodate any problem with minor modifications. Basic assumption Generic instances of problems consist of basic types of set theoretic objects. Standard encoding scheme f e : D π S, D π = {problem instances } S = { structured strings } Σ* Σ = { 0, 1, -, [, ], (, ), },

13 structured strings, = { 0, 1, -, [, ], (, ), } (1) The binary representation of an integer k is a structured string representing k. ( put - if k is negative. ) (2) If x is the structured string representing an integer k, then [x] is a structured string that can be used as a name (3) If x 1, x 2,.., x m are structured strings representing the objects X 1, X 2,., X m, then (x 1, x 2,.., x m ) is a structured string representing < X 1, X 2,.., X m >.

14 Example integers 0, -1, 11, 100, -101, unstructured elements [0],[1],. (vertices, elements, cities,. ) sequences set ( [0],[1],. ) graphs ( x, y ) finite functions ( (x 1,y 1 ), (x 2,y 2 ),.., (x i,y i ),. ) f : X Y X={x 1, x 2,, x n }, Y={y 1, y 2,, y n } rational numbers (p,q) p/q O.k., now, we are comfortable!!! The length of input can be determined.

15 Input Length Length : Z + D π encoding - independent polynomially related to the input length that we would obtain from a reasonable encoding scheme. String lengths, x 1 and x 2 are polynomially related if there exist two polynomials p 1 and p 2 such that x 1 p 1 [ x 2 ], and x 2 p 2 [ x 1 ]. The function Length is not unrealistic!!! Why?

16 An encoding scheme e for π is said to be reasonable if Length(I) and x are polynomially related for all x, where x is the string encoding for I under e. D π

17 Observation The intractability of a problem turns out to be essentially independent of : (1) particular encoding scheme (2) the computer model used for determining time complexity Why?

18 Independence of computer model Simulated machine B 1-Tape Turing Machine (1TM) Simulating machine A 1TM ktm RAM - O(T(n)) O(T(n)logT(n)) k-tape Turing Machine (KTM) O(T 2 (n)) - O(T(n)logT(n)) Random Access Machine (RAM) O(T 3 (n)) O(T 2 (n)) - Hopcroft, Ullman (1969) Aho,Hopcroft, Ullman (1974)

19 π D π : a problem : The set of instances of a decision problem D π Y π Y π = { p p D π and the solution of p is yes }

20 An instance I of a problem π belongs to D π I can be obtained from the generic instance by substituting particular objects of specified types for all the generic components

21 π : a problem π O : Optimization version π D : Decision version A solution to π O A solution to π D A decision problem is no harder than its corresponding optimization problem!!! If a decision problem is NP-complete, then its corresponding optimization problem is at least as hard!!! Even though the theory of NP-completeness restricts attention to only decision problems, we can extend the implications of the theory to optimization problems as well.

22 Why restricting attention to only decision problems? These problems have a very natural, formal counterpart which is a suitable object to study a mathematically precise theory of computation!!! What is this counterpart? Language!!!

23 Language : L Σ a finite set of symbols Σ* the set of all finite strings of symbols from (including empty string ε ) L * L is a language over Decision problem Encoding scheme Language

24 An encoding scheme e for a problem π provides a way of describing each instance I D π by an appropriate string of symbols over some alphabet!!! e: D π Σ * I D π, e(i) Σ *

25 The problem π and its encoding scheme e partition Σ* into three class of strings D π * N π Y π π L(π,e)

26 L(π,e) ={ x Σ* Σ is the alphabet used by e, and x is the encoding under e of an instance I Y π } L(π,e) * L(π,e) is a language!!! Formal theory of language can be applied to decision problem

27 Observation Decision problem Language Does the language derived from a decision problem depend on encoding schemes? Why? no!!! encoding scheme Reasonable encoding scheme!!! We may assume a reasonable encoding scheme e for a problem π However, if requested, we could specify a particular encoding scheme e

28 Deterministic Turing machines and the class P Deterministic one-tape Turing machine Finite state control Tape Read-write head A program for a DTM specifies the following information : (1) A finite set Γ of tape symbols including a subset Γof input symbols and a distinguished bank symbol b. (2) a finite set Q of states, including a distinguished start-state q 0 and two distinguished halt-states q Y and q N ; (3) a transition function δ :(Q - {q Y, q N }) Γ Q Γ {-1, +1 }. note M={ Q,, Γ, δ, q 0,b,F} {q Y, q N }

29 x * initially x -1 x x +1. b b b b x x -1 x x +1. b b b b q j = q N : no q j = q Y : yes read-write header initial state q 0 δ (q i, x i ) (q j, x k, m) ±1

30 L M { x * A DTM program M accepts x } The DTM program M halts in state q Y when applied to x iff x L M. L M is the language recognized by the DTM program M.

31 Definition: A DTM program M solves a decision problem π (under encoding scheme e) if : (i) M halts for all x *. (ii) L M = L(π,e) Definition: The time used in the computation of a DTM program M on input x is the number of steps occurring up until a halt state is entered. q N or q Y

32 Definition: ( time complexity ) Let a DTM program M halt for all x *. Its time complexity function is : T M : Z + Z + such that T M (n) = max{ m M takes m steps on x for x = n. } Why max?

33 Definition: A DTM program M is said to be a polynomial time DTM program if there exists a polynomial P such that T M (n) p(n) for all n Z + Definition:The class P of languages is defined : P={ L there is a polynomial time DTM program M for which L = L M }

34 A decision problem π belongs to P ( under encoding scheme e ) if L(π,e) P, i.e., there is a polynomial time DTM program M that solves π ( under encoding scheme e )

35 Non-deterministic Computation and the class NP Instance: A finite set of cites, C={c 1, c 2,, c n }, a distance d(c i, c j ) Z + for c i, c j C, and B Z +, where Z + is the positive integers. Question: Is there a tour of all cities in C having total length no more than B? No known polynomial time algorithm!!! Suppose that someone claims, for a particular instance of problem, its answer is yes. Can you verify his/her claim? Yes, if he/she provides us a tour having the required properties. Polynomial Verifiability

36 Polynomial time Solvability Polynomial time verifiability Checking a given S yes if and only if S satisfies P Characterization of an NP class problem

37 Nondeterministic Program - guessing stage Given I D π,, this stage guesses some structure S - checking stage Given I and S, does S lead this stage to respond yes for I and S?

38 Observation (i) S does not nec. depend on I D π. S Γ* ( can possibly be ε ) (ii) The checking stage behaves in a normal deterministic manner. (iii) * Y π N π π Y π : halt with yes N π : halt with no π : go forever

39 An NDTM(program) M can solve a decision program π if the following two properties hold true for I D π : (i) I Y π (ii) I Y π some S that, when guessed for I, will lead the checking stage to respond yes for I and S any S that, when guessed for I, will lead the checking stage to respond yes for I and S.

40 Nondeterministic One-tape Turing Machine( NDTM ) Guessing module Finite state control Write-only Tape Guessing head Read-write head δ :(Q - {q r, q N }) Γ Q Γ { -1, +1 }. M ={ Q,, Γ, δ, q 0,b,F}

41 NDTM program (1) initially, x (2) guessing, b (3) checking, b b b b... b... w r/w w inactive GM GM b In the same fashion as DTM program!!! Γ,,b, Q, q 0, q Y, q N FSC FSC δ :(Q - {q Y, q N }) Γ Q Γ { -1, +1 }. 0 q 0 inactive b b b...

42 An NDTM program ceases computation for x * when the finite state control enters one of two halt states, q Y and q N. note For each x *, one set of computations Definition : A computation for x * is said to be an accepting computation if it halts in q Y. All the others, halting or not, are classed together as non-accepting computations.

43 Definition: An NDTM program M accepts x, if one of the computations for x is an accepting computation. L M the language recognized by M L M {x * M accepts x}

44 Definition: The time required by an NDTM program M to accept the string x L M is defined to be the minimum(over all accepting computations of M for x) number of steps occurring in the guessing and checking stages up until the halt state q y is entered. Informally, assume the right guessing!!! Why?

45 Definition: The time complexity function T M : Z+ Z+ for an NDTM program M is : T M (n) = max { {1} { m there is an x L M with x =n such that the time to accept x by M is m } } No input of length n are accepted

46 Definition : An NDTM program M is said to be a polynomial time NDTM program if there exist a polynomial p such that T M (n) P(n), n 1. The class NP is defined : NP = { L there is a polynomial time NDTM program M for which L M = L }

47 Definition: A decision program π is said to belong to NP( under encoding scheme e ) if L(π,e) NP.

48 Relationship between P and NP P NP P NP Why? A deterministic algorithm can be used as the checking stage of a non-deterministic algorithm!!! No general methods converting a polynomial time NDTM algorithm to a polynomial time DTM algorithm

49 Theorem π NP a polynomial P such that π can be solved by a deterministic algorithm having time complexity O(2 p(n) ). The best known result!!! [proof] Take any π in NP. Suppose that A is a polynomial time NDTM program for solving π. q(n) = a polynomial time bound on the time complexity of A. c2 (WLOG, let q(n) c n,c 1, c 2 > 0. ) 1 x L(π,e), there must exist some guessed string s Γ*, s q(n), where x = n. # of possible guesses = k q(n), where Γ = k. Why? q(n) k q(n) K q(n)+ε c 2 p(n)

50 Is NP = P? Well, P NP why? Is NP P? If yes then P = NP!!! But no hope!!! Most people believe P NP!!! NP NPI P? NP - complete!!!

51 Polynomial Transformability and NP-Completeness P NP However, nobody knows if NP P. In addition, no hope for proving P = NP. If P NP, then π NP - P This is our main focus!!!

52 Definition:( polynomial transformation ) A polynomial transformation from a language L 1 1 * to a language L 2 2 * is a function f: 1 * 2 * that satisfies the following conditions Notation (i) There is a polynomial DTM program that computes f. (ii) For all x 1 *, x L 1 f(x) L 2. L 1 L 2

53 Lemma: If L 1 L 2, then L 2 P L 1 P, and equivalently L 1 P L 2 P. [proof] Suppose that L 1 L 2 and L 2 P. Let 1 and 2 be alphabets of L 1 and L 2, respectively, and let f : 1 * 2 * be a polynomial transform from L 1 to L 2. Such a transform f exists!!! Why? M f = a polynomial time DTM program that computes f. M 2 = a polynomial time DTM program that recognizes L 2. x 1 f(x M 1 ) f M 2 yes no yes no A polynomial DTM program for recognizing L 1 can be constructed by composing M f with M 2!!! Why? (continue)

54 P f a polynomial function bounding the running time of M f P 2 a polynomial function bounding the running time of M 2 Then, x 1 1 *, f(x 1 ) P f ( x 1 ) O( P f ( x 1 ) + P 2 ( P f ( x 1 ) ) ) M f M 2 x 1 (P M f x 1 ) f M 2 yes no yes no

55 note L(π 1, e 1 ) L(π 2, e 2 ) π 1 π 2!!! π 1 π 2 if there exists a polynomial transformation f from a decision problem π 1 to a decision problem π 2 f : D π Dπ 1 2 that satisfies the following two conditions: (i) f is computable by a polynomial time algorithm (ii) For all I D, I Y f ( I Y π 1 π ) 1 π 2

56 A Hamiltonian circuit in G=(V,E) is a simple circuit that includes all vertices of V. HC( Hamiltonian Circuit ) Instance : A Graph G = ( V,E ) Question : Does G contain a Hamiltonian circuit? TS( Traveling Salesman ) Instance : A finite set C = {c 1, c 2,, c π } of cities. A distance d(c i, c j ) Z + for each pair of cities c i, c j C, and a bound B Z +. Question : Is there a tour of all cities in C having total length no more than B? Is HC TS? Yes!!! Why?

57 C := V (c i := v i ) d(c i, c j ) := 1 if {v i, v j } E 2 otherwise B := V f : D HC D TS (i) f can be computable by a polynomial time algorithm why? (ii) For all I D HC, I Y HC f(i) Y TS why? HC TS

58 Lemma : If L 1 L 2 and L 2 L 3, then L 1 L 3 [proof] Let 1, 2, and 3 be the alphabets of languages L 1, L 2, and L 3, respectively. f 1 : 1 * 2 * a polynomial transformation from L 1 to L 2. f 2 : 2 * 3 * a polynomial transformation from L 2 to L 3. Then, f 3 : 1 * 3 * is f 2 (f 1 (x)) for all x 1 *. x 1 x P 1 ( x 1 ) P 2 (P 1 ( x 1 ) ) f 1 (x) f 1 f 2 f 2 (f 1 (x)) (f 2 * f 1 )(x) = f 2 (f 1 (x)) f 2 * f 1 = f 3 x 1 *, x L 1 f 1 (x) L 2 f 2 ( f 1 (x) ) L 3 x L 1 f 2 ( f 1 (x) ) L 3 L 1 L 3

59 Definition: Two language L 1 and L 2 (two decision problems π 1 and π 2 ) are said to be polynomially equivalent if L 1 L 2 and L 2 L 1 ( π 1 π 2 and π 2 π 1 ). NP P NP-complete P and NP-complete give equivalent classes!!!

60 Definition: A language L is defined to be NP-complete if (i) L NP (ii) L L for all L NP.

61 Lemma : If L 1 and L 2 belong to NP, L 1 is NP-complete, and L 1 L 2 then L 2 is NP-complete [proof] Exercise. Given an NP-complete problem π and a new problem π, (i) π NP π NP-complete (ii) π π

62 P : Given I, is X true for I? Co-P : Given I, is X false for I? Given a DTM algorithm A for solving P, A can be used for solving Co-P!!! Co-P P h(x) x h A A' yes no yes no Is the same true for an NDTM algorithm? Well,.

63 Polynomial verifiability ( for π) Γ* However, to answer π c we need to examine all possible solutions!!!

64 TSP ( Traveling Salesman ) TSP : Given a set of cities, the intercity distance and a bound B, is it true that there is a tour of all cities having total length no more than B? Co-TSP : , Is it true that every tour of all cities has total length more than B? P NP NP P Co-NP

65 Observation P Co-P Co-P P P = Co-P Suppose that P = NP. Then, NP = Co-NP What if P NP?

66 Theorem : If there exists an NP-complete problem π such that π c NP, then NP = Co-NP. Why? AA x π' c ( π NP ) hπ' h ( x) f h ( x)) π' π' f π π ( π' π c h π h c polynomial verifiability π ( fπ ( hπ ' ( x))) c π A Yes The NDTM program AA accepts π c π NP NP = Co-NP

67 SAT( satisfiability ) Instance : A set U of Boolean variables and a collection of clauses C over U. Question : Is there a satisfying truth assignment for C? (u 1 u 2 u 5 ) (u 2 u 3 u 7 u 9 ) (u 4 u 6 ) (u 1 u 7 u 8 u 9 ). wff in CNF U = {u 1, u 2, u 3,.., u 9 } C = {{u 1, u 2, u 5 },{u 2, u 3, u 7, u 9 },{u 4, u 6 },{u 1, u 7, u 8, u 9 } }

68 Cook s Theorem Theorem: ( Cook s Theorem ) SAT(satisfiability) is NP-complete. [proof] (i) SAT NP Why? L SAT (ii) π NP, π SAT How? Well,.. = L(SAT,e) L NP, L L SAT There are infinitely many problems in NP!!! How to get around this problem?

69 π NP, π SAT. How? π NP An polynomial time NDTM program M accepting π,i.e., L M =L(π,e) SAT * N π Yπ π (in polynomial time) Describe M s moves using the generic instance of SAT!!! L(π,e) Why? π NP an NDTM program M accepting π in p(n) time, i.e., L M = L(π, e)

70 f L : * 1 * L(π,e) * L(SAT,e 1 ) 1 * x *, x L(π,e) f L (x) L(SAT,e 1 ) Let L M = L(π,e) for some NDTM M. Since M = (Q,, Γ, δ, q 0,b,F), f L will be derived in terms of P, Q,, Γ, δ, q 0, q N, q Y,!!!

71 Basic idea U and C are constructed so that an NDTM program M accepts x in * iff f L (x) has a satisfying truth assignment. - A generic instance of SAT consists of U and C -f L (x)? How?

72 Suppose that x * is accepted by M. There is an accepting computation for M on x such that (i) The number of steps in the checking stage is bounded by some polynomial P(n), n = x. (ii) The number of steps in the guessing stage is bounded by P(n), n = x. (ii) implies that the number of symbols in the guessing string is bounded by P(n), n = x GS FSC -P(n) b... b.. Only the tape squares within this range can be involved in the computation q i P(n) b

73 The status of checking computation at any one time can be specified completely by giving (i) The content of tape squares (ii) The current state (iii) The position of W/R head ID There are at most P(n) + 1 times to be considered!!! Why? Such a computation can be described completely using only (i) a limited number of Boolean variables (ii) a truth assignment to them

74 Variable Range Intended meaning Q[i,k] 0 i p(n) At time i (upon completion of 0 k r the ith step),m is in state q k. H[i,j] 0 i p(n) At time i,the read-write head is -p(n) j p(n)+1 scanning tape square j. S[i,j,k] 0 i p(n) At time i, the contents of tape -p(n) j p(n)+1 square j is symbol s k. 0 k v U = O(P(n) 2 ) q 0, q 1 = q N, q 2 = q Y, q 3,.., q r r = Q - 1 s 0 = b, s 1, s 2, s 3,.., s v v = Γ - 1

75 note Initially n..... What if the program M halts before time P(n)? x

76 x L M there is an accepting computation of M on x with p(n) or fewer steps in its checking stage and with a guessed string w of length at most p(n) there is a satisfying truth assignment for the collection of clauses in f L (x). Now, using previous Boolean variables construct clauses for f L (x). Restricting the behavior of the polynomial NDTM program M!!!

77 { Q[i,0], Q[i,1],..., Q[i,r] }, 0 i p(n) (P(n)+1) r { Q[i,j], Q[i,j ] }, 0 i p(n), 0 j <j r (P(n)+1)(r+1)(r/2) at least one state no more than one state Q = r + 1

78 Clause groups Restriction imposed G 1 At each time i, M is in exactly one state. G 2 At each time i, the read-write head is scanning exactly one tape square. G 3 At each time i, each tape square contains exactly one symbol from Γ. G 4 At each time 0, the computation is in the initial configuration of its checking stage of input x. G 5 By time p(n), M has entered state q Y and hence has accepted x. G 6 For each time i, 0 i < p(n), the configuration of M at time i + 1 follows by a single application of the transition function δ from the configuration at time i. Now, can you see what we are going to do? δ : (Q - {Q N, Q Y }) Γ Q Γ { -1, +1 }

79 Clause group Clauses in group G 1 { Q[i,0],Q[i,1],.....,Q[i,r] }, 0 i p(n) { Q[i,j],Q[i,j ], 0 i p(n), 0 j <j r G 2 { H[i,-p(n)],H[i,-p(n)+1],...,H[i,p(n)+1] }, 0 i p(n) { H[i,j],H[i,j ]}, 0 i p(n), -p(n) j <j p(n)+1 G 3 { S[i,j,0],S[i,j,1],...,S[i,j,v] }, 0 i p(n), -p(n) j p(n)+1 { S[i,j,k],S[i,j,k ] }, 0 i p(n), p(n) j p(n)+1, 0 k <k v G 4 {Q[0,0]}, {H[0,1]},{S[0,0,0]}, {S[0,1, k 1 ]},{S[0,2, k 2 ]},,{S[0,n, k n ] }, { S[0,n+1,0]}, {S[0,n+2,0]},...,{S[0,p(n)+1,0]}. Where x = S S LS G 5 { Q[p(n),2] } k 1 k 2 k n

80 G 6 : {S[i,j,l], H(i,j), S[ i+1, j, l] }, 2(p(n)+1) 2 (v+1) 0 i p(n) -p(n) j p(n)+1 0 l v {H[i,j], Q[i,k],S[i,j,l],H[i+1,j+ ] } {H[i,j], Q[i,k],S[i,j,l],Q[i+1,k ] } {H[i,j], Q[i,k],S[i,j,l],S[i+1,j,l ] } 0 i < P(n) -P(n) j P(n)+1 0 k r 0 l v 6(p(n)+1) 2 (r+1)(v+1) q k Q - {q N, q Y } δ(q k, s l ) (q k, s l, )

81 x L M There is an accepting computation of M on x of steps p(n) or less, and this computation, given the interpretation of variables, imposes the behavior of M so that there exist a truth assignment satisfying all the clauses in C = G l G 2 G G L Polynomial time for constructing f L (x)!!! Why? U C = O(p(n) 4 ) Check it!!! NP - Hard Exercise

Introduction to Complexity Theory

Introduction to Complexity Theory Introduction to Complexity Theory Read K & S Chapter 6. Most computational problems you will face your life are solvable (decidable). We have yet to address whether a problem is easy or hard. Complexity

More information

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

Lecture 25: Cook s Theorem (1997) Steven Skiena.   skiena Lecture 25: Cook s Theorem (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Prove that Hamiltonian Path is NP

More information

Automata Theory CS S-18 Complexity Theory II: Class NP

Automata Theory CS S-18 Complexity Theory II: Class NP Automata Theory CS411-2015S-18 Complexity Theory II: Class NP David Galles Department of Computer Science University of San Francisco 18-0: Language Class P A language L is polynomially decidable if there

More information

Turing Machines and Time Complexity

Turing Machines and Time Complexity Turing Machines and Time Complexity Turing Machines Turing Machines (Infinitely long) Tape of 1 s and 0 s Turing Machines (Infinitely long) Tape of 1 s and 0 s Able to read and write the tape, and move

More information

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k. Complexity Theory Problems are divided into complexity classes. Informally: So far in this course, almost all algorithms had polynomial running time, i.e., on inputs of size n, worst-case running time

More information

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem. 1 More on NP In this set of lecture notes, we examine the class NP in more detail. We give a characterization of NP which justifies the guess and verify paradigm, and study the complexity of solving search

More information

Intractable Problems [HMU06,Chp.10a]

Intractable Problems [HMU06,Chp.10a] Intractable Problems [HMU06,Chp.10a] Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions A 10 Minute Motivation https://www.youtube.com/watch?v=yx40hbahx3s 1 Time-Bounded TM s A Turing

More information

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g. NP-Completeness ch34 Hewett Problem Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g., O(2 n ) computationally feasible poly-time alg. sol. E.g., O(n k ) No

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 25 NP Completeness Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 NP-Completeness Some

More information

NP-Complete problems

NP-Complete problems NP-Complete problems NP-complete problems (NPC): A subset of NP. If any NP-complete problem can be solved in polynomial time, then every problem in NP has a polynomial time solution. NP-complete languages

More information

Review of unsolvability

Review of unsolvability Review of unsolvability L L H To prove unsolvability: show a reduction. To prove solvability: show an algorithm. Unsolvable problems (main insight) Turing machine (algorithm) properties Pattern matching

More information

NP-Completeness. Until now we have been designing algorithms for specific problems

NP-Completeness. Until now we have been designing algorithms for specific problems NP-Completeness 1 Introduction Until now we have been designing algorithms for specific problems We have seen running times O(log n), O(n), O(n log n), O(n 2 ), O(n 3 )... We have also discussed lower

More information

6.5.3 An NP-complete domino game

6.5.3 An NP-complete domino game 26 Chapter 6. Complexity Theory 3SAT NP. We know from Theorem 6.5.7 that this is true. A P 3SAT, for every language A NP. Hence, we have to show this for languages A such as kcolor, HC, SOS, NPrim, KS,

More information

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65 Undecidable Problems Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, 2018 1/ 65 Algorithmically Solvable Problems Let us assume we have a problem P. If there is an algorithm solving

More information

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9 1 Computational Complexity and Intractability: An Introduction to the Theory of NP Chapter 9 2 Objectives Classify problems as tractable or intractable Define decision problems Define the class P Define

More information

Tractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?

Tractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Tractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?» Standard working definition: polynomial time» On an input

More information

Computability and Complexity Theory

Computability and Complexity Theory Discrete Math for Bioinformatics WS 09/10:, by A Bockmayr/K Reinert, January 27, 2010, 18:39 9001 Computability and Complexity Theory Computability and complexity Computability theory What problems can

More information

CS151 Complexity Theory. Lecture 1 April 3, 2017

CS151 Complexity Theory. Lecture 1 April 3, 2017 CS151 Complexity Theory Lecture 1 April 3, 2017 Complexity Theory Classify problems according to the computational resources required running time storage space parallelism randomness rounds of interaction,

More information

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory

More information

Limitations of Algorithm Power

Limitations of Algorithm Power Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying

More information

NP-completeness. Chapter 34. Sergey Bereg

NP-completeness. Chapter 34. Sergey Bereg NP-completeness Chapter 34 Sergey Bereg Oct 2017 Examples Some problems admit polynomial time algorithms, i.e. O(n k ) running time where n is the input size. We will study a class of NP-complete problems

More information

In complexity theory, algorithms and problems are classified by the growth order of computation time as a function of instance size.

In complexity theory, algorithms and problems are classified by the growth order of computation time as a function of instance size. 10 2.2. CLASSES OF COMPUTATIONAL COMPLEXITY An optimization problem is defined as a class of similar problems with different input parameters. Each individual case with fixed parameter values is called

More information

Computability and Complexity Theory: An Introduction

Computability and Complexity Theory: An Introduction Computability and Complexity Theory: An Introduction meena@imsc.res.in http://www.imsc.res.in/ meena IMI-IISc, 20 July 2006 p. 1 Understanding Computation Kinds of questions we seek answers to: Is a given

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 25 Last time Class NP Today Polynomial-time reductions Adam Smith; Sofya Raskhodnikova 4/18/2016 L25.1 The classes P and NP P is the class of languages decidable

More information

CMSC 441: Algorithms. NP Completeness

CMSC 441: Algorithms. NP Completeness CMSC 441: Algorithms NP Completeness Intractable & Tractable Problems Intractable problems: As they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard

More information

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2) Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set

More information

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1 NP CS 320, Fall 2017 Dr. Geri Georg, Instructor georg@colostate.edu 320 NP 1 NP Complete A class of problems where: No polynomial time algorithm has been discovered No proof that one doesn t exist 320

More information

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

More information

NP-Complete Problems. More reductions

NP-Complete Problems. More reductions NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM

More information

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK Artificial Intelligence 3 Problem Complexity Prof. Dr. Jana Koehler Fall 2016 Agenda Computability and Turing Machines Tractable and Intractable Problems P vs. NP Decision Problems Optimization problems

More information

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) 1 Deterministic Turing Machine (DTM).. B B 0 1 1 0 0 B B.. Finite Control Two-way, infinite tape, broken into

More information

CSCI3390-Lecture 16: NP-completeness

CSCI3390-Lecture 16: NP-completeness CSCI3390-Lecture 16: NP-completeness 1 Summary We recall the notion of polynomial-time reducibility. This is just like the reducibility we studied earlier, except that we require that the function mapping

More information

NP Complete Problems. COMP 215 Lecture 20

NP Complete Problems. COMP 215 Lecture 20 NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst

More information

Spring Lecture 21 NP-Complete Problems

Spring Lecture 21 NP-Complete Problems CISC 320 Introduction to Algorithms Spring 2014 Lecture 21 NP-Complete Problems 1 We discuss some hard problems: how hard? (computational complexity) what makes them hard? any solutions? Definitions Decision

More information

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1 U.C. Berkeley CS278: Computational Complexity Handout N1 Professor Luca Trevisan August 30, 2004 Notes for Lecture 1 This course assumes CS170, or equivalent, as a prerequisite. We will assume that the

More information

CS154, Lecture 17: conp, Oracles again, Space Complexity

CS154, Lecture 17: conp, Oracles again, Space Complexity CS154, Lecture 17: conp, Oracles again, Space Complexity Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string

More information

Automata Theory CS Complexity Theory I: Polynomial Time

Automata Theory CS Complexity Theory I: Polynomial Time Automata Theory CS411-2015-17 Complexity Theory I: Polynomial Time David Galles Department of Computer Science University of San Francisco 17-0: Tractable vs. Intractable If a problem is recursive, then

More information

NP-Completeness and Boolean Satisfiability

NP-Completeness and Boolean Satisfiability NP-Completeness and Boolean Satisfiability Mridul Aanjaneya Stanford University August 14, 2012 Mridul Aanjaneya Automata Theory 1/ 49 Time-Bounded Turing Machines A Turing Machine that, given an input

More information

CSCI3390-Lecture 14: The class NP

CSCI3390-Lecture 14: The class NP CSCI3390-Lecture 14: The class NP 1 Problems and Witnesses All of the decision problems described below have the form: Is there a solution to X? where X is the given problem instance. If the instance is

More information

Non-Approximability Results (2 nd part) 1/19

Non-Approximability Results (2 nd part) 1/19 Non-Approximability Results (2 nd part) 1/19 Summary - The PCP theorem - Application: Non-approximability of MAXIMUM 3-SAT 2/19 Non deterministic TM - A TM where it is possible to associate more than one

More information

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch] NP-Completeness Andreas Klappenecker [based on slides by Prof. Welch] 1 Prelude: Informal Discussion (Incidentally, we will never get very formal in this course) 2 Polynomial Time Algorithms Most of the

More information

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005 Complexity Theory Knowledge Representation and Reasoning November 2, 2005 (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 1 / 22 Outline Motivation Reminder: Basic Notions Algorithms

More information

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction Algorithms and Theory of Computation Lecture 19: Class P and NP, Reduction Xiaohui Bei MAS 714 October 29, 2018 Nanyang Technological University MAS 714 October 29, 2018 1 / 26 Decision Problems Revisited

More information

Exam Computability and Complexity

Exam Computability and Complexity Total number of points:... Number of extra sheets of paper:... Exam Computability and Complexity by Jiri Srba, January 2009 Student s full name CPR number Study number Before you start, fill in the three

More information

The Cook-Levin Theorem

The Cook-Levin Theorem An Exposition Sandip Sinha Anamay Chaturvedi Indian Institute of Science, Bangalore 14th November 14 Introduction Deciding a Language Let L {0, 1} be a language, and let M be a Turing machine. We say M

More information

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA. Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA NP Completeness Susmita Sur-Kolay Advanced Computing and Microelectronics Unit

More information

Lecture 20: conp and Friends, Oracles in Complexity Theory

Lecture 20: conp and Friends, Oracles in Complexity Theory 6.045 Lecture 20: conp and Friends, Oracles in Complexity Theory 1 Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode:

More information

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013 Chapter 2 Reductions and NP CS 573: Algorithms, Fall 2013 August 29, 2013 2.1 Reductions Continued 2.1.1 The Satisfiability Problem SAT 2.1.1.1 Propositional Formulas Definition 2.1.1. Consider a set of

More information

Computational Complexity

Computational Complexity p. 1/24 Computational Complexity The most sharp distinction in the theory of computation is between computable and noncomputable functions; that is, between possible and impossible. From the example of

More information

Correctness of Dijkstra s algorithm

Correctness of Dijkstra s algorithm Correctness of Dijkstra s algorithm Invariant: When vertex u is deleted from the priority queue, d[u] is the correct length of the shortest path from the source s to vertex u. Additionally, the value d[u]

More information

CS 583: Algorithms. NP Completeness Ch 34. Intractability

CS 583: Algorithms. NP Completeness Ch 34. Intractability CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working

More information

Notes for Lecture 3... x 4

Notes for Lecture 3... x 4 Stanford University CS254: Computational Complexity Notes 3 Luca Trevisan January 14, 2014 Notes for Lecture 3 In this lecture we introduce the computational model of boolean circuits and prove that polynomial

More information

Intractable Problems. Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions

Intractable Problems. Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions Intractable Problems Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions 1 Time-Bounded TM s A Turing machine that, given an input of length n, always halts within T(n) moves is said

More information

34.1 Polynomial time. Abstract problems

34.1 Polynomial time. Abstract problems < Day Day Up > 34.1 Polynomial time We begin our study of NP-completeness by formalizing our notion of polynomial-time solvable problems. These problems are generally regarded as tractable, but for philosophical,

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

NP Completeness and Approximation Algorithms

NP Completeness and Approximation Algorithms Winter School on Optimization Techniques December 15-20, 2016 Organized by ACMU, ISI and IEEE CEDA NP Completeness and Approximation Algorithms Susmita Sur-Kolay Advanced Computing and Microelectronic

More information

NP-Completeness. NP-Completeness 1

NP-Completeness. NP-Completeness 1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and

More information

SAT, NP, NP-Completeness

SAT, NP, NP-Completeness CS 473: Algorithms, Spring 2018 SAT, NP, NP-Completeness Lecture 22 April 13, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 57 Part I Reductions Continued Ruta (UIUC)

More information

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P Easy Problems vs. Hard Problems CSE 421 Introduction to Algorithms Winter 2000 NP-Completeness (Chapter 11) Easy - problems whose worst case running time is bounded by some polynomial in the size of the

More information

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar.. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar.. Complexity Class P NP-Complete Problems Abstract Problems. An abstract problem Q is a binary relation on sets I of input instances

More information

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

COSE215: Theory of Computation. Lecture 21 P, NP, and NP-Complete Problems

COSE215: Theory of Computation. Lecture 21 P, NP, and NP-Complete Problems COSE215: Theory of Computation Lecture 21 P, NP, and NP-Complete Problems Hakjoo Oh 2017 Spring Hakjoo Oh COSE215 2017 Spring, Lecture 21 June 11, 2017 1 / 11 Contents 1 The classes P and N P Reductions

More information

On the Computational Hardness of Graph Coloring

On the Computational Hardness of Graph Coloring On the Computational Hardness of Graph Coloring Steven Rutherford June 3, 2011 Contents 1 Introduction 2 2 Turing Machine 2 3 Complexity Classes 3 4 Polynomial Time (P) 4 4.1 COLORED-GRAPH...........................

More information

DESIGN AND ANALYSIS OF ALGORITHMS. Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

DESIGN AND ANALYSIS OF ALGORITHMS. Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS DESIGN AND ANALYSIS OF ALGORITHMS Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS http://milanvachhani.blogspot.in COMPLEXITY FOR THE IMPATIENT You are a senior software engineer in a large software

More information

Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS DESIGN AND ANALYSIS OF ALGORITHMS Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS http://milanvachhani.blogspot.in COMPLEXITY FOR THE IMPATIENT You are a senior software engineer in a large software

More information

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011 The P-vs-NP problem Andrés E. Caicedo September 10, 2011 This note is based on lecture notes for the Caltech course Math 6c, prepared with A. Kechris and M. Shulman. 1 Decision problems Consider a finite

More information

1 Non-deterministic Turing Machine

1 Non-deterministic Turing Machine 1 Non-deterministic Turing Machine A nondeterministic Turing machine is a generalization of the standard TM for which every configuration may yield none, or one or more than one next configurations. In

More information

Computational Intractability 2010/4/15. Lecture 2

Computational Intractability 2010/4/15. Lecture 2 Computational Intractability 2010/4/15 Professor: David Avis Lecture 2 Scribe:Naoki Hatta 1 P and NP 1.1 Definition of P and NP Decision problem it requires yes/no answer. Example: X is a set of strings.

More information

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds

More information

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

Lecture 17: Cook-Levin Theorem, NP-Complete Problems 6.045 Lecture 17: Cook-Levin Theorem, NP-Complete Problems 1 Is SAT solvable in O(n) time on a multitape TM? Logic circuits of 6n gates for SAT? If yes, then not only is P=NP, but there would be a dream

More information

Polynomial-Time Reductions

Polynomial-Time Reductions Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel

More information

Chapter 7: Time Complexity

Chapter 7: Time Complexity Chapter 7: Time Complexity 1 Time complexity Let M be a deterministic Turing machine that halts on all inputs. The running time or time complexity of M is the function f: N N, where f(n) is the maximum

More information

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch 6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch Today: More Complexity Theory Polynomial-time reducibility, NP-completeness, and the Satisfiability (SAT) problem Topics: Introduction

More information

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak; Topics in Theoretical Computer Science February 29, 2016 Lecturer: Ola Svensson Lecture 2 (Notes) Scribes: Ola Svensson Disclaimer: These notes were written for the lecturer only and may contain inconsistent

More information

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity CS 350 Algorithms and Complexity Winter 2019 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower

More information

Data Structures in Java

Data Structures in Java Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways

More information

Computational complexity theory

Computational complexity theory Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,

More information

Advanced Topics in Theoretical Computer Science

Advanced Topics in Theoretical Computer Science Advanced Topics in Theoretical Computer Science Part 5: Complexity (Part II) 30.01.2014 Viorica Sofronie-Stokkermans Universität Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1 Contents Recall: Turing

More information

Theory of Computation

Theory of Computation Theory of Computation Unit 4-6: Turing Machines and Computability Decidability and Encoding Turing Machines Complexity and NP Completeness Syedur Rahman syedurrahman@gmail.com Turing Machines Q The set

More information

Notes for Lecture 21

Notes for Lecture 21 U.C. Berkeley CS170: Intro to CS Theory Handout N21 Professor Luca Trevisan November 20, 2001 Notes for Lecture 21 1 Tractable and Intractable Problems So far, almost all of the problems that we have studied

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.

More information

Polynomial-time Reductions

Polynomial-time Reductions Polynomial-time Reductions Disclaimer: Many denitions in these slides should be taken as the intuitive meaning, as the precise meaning of some of the terms are hard to pin down without introducing the

More information

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

More information

Lecture Notes 4. Issued 8 March 2018

Lecture Notes 4. Issued 8 March 2018 CM30073 Advanced Algorithms and Complexity 1. Structure of the class NP Lecture Notes 4 Issued 8 March 2018 Recall that it is not known whether or not P = NP, the widely accepted hypothesis being that

More information

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010 CS311 Computational Structures NP-completeness Lecture 18 Andrew P. Black Andrew Tolmach 1 Some complexity classes P = Decidable in polynomial time on deterministic TM ( tractable ) NP = Decidable in polynomial

More information

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems COSE215: Theory of Computation Lecture 20 P, NP, and NP-Complete Problems Hakjoo Oh 2018 Spring Hakjoo Oh COSE215 2018 Spring, Lecture 20 June 6, 2018 1 / 14 Contents 1 P and N P Polynomial-time reductions

More information

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015 CS 374: Algorithms & Models of Computation, Spring 2015 NP Completeness Lecture 23 November 19, 2015 Chandra & Lenny (UIUC) CS374 1 Spring 2015 1 / 37 Part I NP-Completeness Chandra & Lenny (UIUC) CS374

More information

Lecture 4: NP and computational intractability

Lecture 4: NP and computational intractability Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples

More information

Notes for Lecture Notes 2

Notes for Lecture Notes 2 Stanford University CS254: Computational Complexity Notes 2 Luca Trevisan January 11, 2012 Notes for Lecture Notes 2 In this lecture we define NP, we state the P versus NP problem, we prove that its formulation

More information

NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.

NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35. NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and

More information

CS6901: review of Theory of Computation and Algorithms

CS6901: review of Theory of Computation and Algorithms CS6901: review of Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational

More information

CS3719 Theory of Computation and Algorithms

CS3719 Theory of Computation and Algorithms CS3719 Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational tool - analysis

More information

Computers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness

Computers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory Background: Find a good method for determining whether or not any given set of specifications for a

More information

NP and NP Completeness

NP and NP Completeness CS 374: Algorithms & Models of Computation, Spring 2017 NP and NP Completeness Lecture 23 April 20, 2017 Chandra Chekuri (UIUC) CS374 1 Spring 2017 1 / 44 Part I NP Chandra Chekuri (UIUC) CS374 2 Spring

More information

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition. Lecture #14: 0.0.1 NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition. 0.0.2 Preliminaries: Definition 1 n abstract problem Q is a binary relations on a set I of

More information

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany Applied Computer Science II Chapter 7: Time Complexity Prof. Dr. Luc De Raedt Institut für Informati Albert-Ludwigs Universität Freiburg Germany Overview Measuring complexity The class P The class NP NP-completeness

More information

Computers and Intractability

Computers and Intractability Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory M. R. Garey and D. S. Johnson W. H. Freeman and Company, 1979 The Bandersnatch problem Background: Find

More information

NP-problems continued

NP-problems continued NP-problems continued Page 1 Since SAT and INDEPENDENT SET can be reduced to each other we might think that there would be some similarities between the two problems. In fact, there is one such similarity.

More information

1 Computational problems

1 Computational problems 80240233: Computational Complexity Lecture 1 ITCS, Tsinghua Univesity, Fall 2007 9 October 2007 Instructor: Andrej Bogdanov Notes by: Andrej Bogdanov The aim of computational complexity theory is to study

More information