Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University

Size: px
Start display at page:

Download "Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University"

Transcription

1 Algorithms NP -Complete Problems Dong Kyue Kim Hanyang University

2 The Class P Definition 13.2 Polynomially bounded An algorithm is said to be polynomially bounded if its worst-case complexity is bounded by a polynomial function of the input size. A problem is said to be polynomially bounded if there is a polynomially bounded algorithm for it. Definition 13.3 The class P P is the class of decision problems that are polynomially bounded. 2

3 The Class P Why polynomial bound as the criterion for the definition? Problems not in P are definitely hard. Polynomials have closure property. Any algorithm built from several polynomially bounded algorithms will also be polynomially bounded. No smaller class of functions has this property. Polynomial bound makes P independent of the particular formal model of computation used. A problem that requires (f(n)) steps on one model may require more than (f(n)) steps on another, but for virtually all of the realistic models, if a problem is polynomially bounded for one, then it is so for the others. 3

4 The Class NP Informal definition NP is the class of decision problems for which a given proposed solution for a given input can be checked quickly (in polynomial time) to see if it really is a solution. Many decision problems are phrased as existence question. A proposed solution (certificate) is simply an object of the appropriate kind it may or may not satisfy the criteria. 4

5 The Class NP Definition 13.4 Nondeterministic algorithm A nondeterministic algorithm has two phases and an output step: 1. Nondeterministic guessing phase: Arbitrary string of characters, s, is written. (A solution is proposed.) 2. Deterministic verifying phase: Read the decision problem s input and optionally s. Returns a value true or false, or it may get in an infinite loop. 3. Output step: If the verifying phase returned true, the algorithm outputs yes. Otherwise, there is no output. 5

6 The Class NP Example : Nondeterministic graph coloring (Figure 13.1) Input: k, n, edges of G The first phase will write s = c 1, c 2,, c q. The second phase assigns ci to vi and 1. Check if q = n. 2. Check if each c i is in the range 1,, k. 3. For each edge v i v j check if c i c j. A nondeterministic algorithm is said to be polynomially bounded if there is a polynomial p such that for each input of size n for which the answer is yes, there is some execution of the algorithm that produces yes in at most p(n) steps. 6

7 The Class NP 7

8 The Class NP Definition 13.5 The class NP NP is the class of decision problems for which there is a polynomially bounded nondeterministic algorithm. (NP : Nondeterministic Polynomially bounded.) Theorem 13.1 Previous sample problems are all in NP. Theorem 13.2 P NP. Proof. A deterministic algorithm is a special case of a nondeterministic algorithm (executing only the second phase). 8

9 The Class NP The big question: P = NP? or P NP? Is nondeterminism more powerful than determinism? The trouble is that there are exponential number of strings to check. ( character set = c c p(n) strings of length p(n) ) Can we devise an algorithm that does not have to examine all possible solutions? We do not know good enough tricks yet. There are no polynomially bounded algorithms known for many problems in NP, but no larger-than-polynomial lower bounds have been proved for these problems. 9

10 P and NP : Some Sample Problems Exponential algorithms are useless except for very small inputs. Intractable problems: No efficient algorithms have been identified. Not proved that the problem requires a lot of time. Many optimization problems are of this nature. 10

11 P and NP : Some Sample Problems Problem 13.6 Satisfiability CNF(conjunctive normal form): a sequence of clauses separated by. clause: a sequence of literals separated by. literal: a propositional variable or the negation of a propositional variable Decision problem: Is there a truth assignment for the variables in the expression so that the expression has the value true? 11

12 P and NP : Some Sample Problems Problem 13.1 Graph coloring A coloring of a graph G = (V, E) is a mapping C: V S, where S is a finite set (of colors), such that if vw E then C(v) C(w). The chromatic number of G, (G), is the smallest number of colors needed to color G. Optimization Problem: Given G, determine (G). Decision Problem: Given G and a k, is there a coloring of G using at most k colors? (k-colorable?) 12

13 P and NP : Some Sample Problems Problem 13.1 Graph coloring Example : Exam schedule (k time slots) V set of courses E pair of courses that should not be at the same time G(V, E) should be k-colorable. 13

14 P and NP : Some Sample Problems Problem 13.2 Job scheduling with penalties n jobs J 1, J 2,, J n executed one at a time execution times: t 1, t 2,, t n deadlines: d 1, d 2,, d n penalties for missing the deadlines: p 1, p 2,, p n A schedule is a permutation of {1, 2,, n}, where J (i) is the job done the ith. Total penalty for a particular schedule n is P j 1 P j where P j is the penalty for the jth job, and is defined as P j = p (j) if Job J (j) completes after the deadline d (j), otherwise P j = 0. 14

15 P and NP : Some Sample Problems Problem 13.2 Job scheduling with penalties Optimization problem: Determine the minimum possible penalty. Decision problem: Given k, is there a schedule such that P k? 15

16 P and NP : Some Sample Problems Problem 13.3 Bin packing Unlimited number of bins with capacity 1. n objects with sizes s 1, s 2,, s n, where 0 s n 1. Optimization problem: Determine the smallest number of bins for packing. Decision problem: Given k, do objects fit in k bins? Example : Filling orders for a product (e.g., fabric) to be cut from large, standard-sized pieces. 16

17 P and NP : Some Sample Problems Problem 13.4 Knapsack A knapsack of capacity C. n objects with sizes s 1, s 2,, s n. Profits: p 1, p 2,, p n. Optimization problem: Find the largest total profit of any subset of objects that fits in the knapsack. Decision problem: Given k, is there a subset of objects that fits and has a total profit k? 17

18 P and NP : Some Sample Problems Problem 13.5 Subset sum Positive integer C. n positive integer sizes: s 1, s 2,, s n. Optimization problem: Determine the largest subset sum C. Decision problem: Is there a subset whose subset sum = C? 18

19 P and NP : Some Sample Problems Problem 13.7 Hamiltonian cycles and Hamiltonian paths A Hamiltonian cycle in an undirected graph is a simple cycle that passes through every vertex exactly once. The word circuit in place of cycle is sometimes seen. A Hamiltonian path in an undirected graph is a simple path that passes through every vertex exactly once. Decision problem: Does a given undirected graph have a Hamiltonian cycle (path)? 19

20 P and NP : Some Sample Problems Problem 13.8 Traveling salesperson (Minimum tour) The salesperson wants to minimize the total traveling cost required to visit all the cities in a territory, and return to the starting point. Optimization problem: Given a complete, weighted graph, find a minimum-weight Hamiltonian cycle. Decision problem: Given a complete, weighted graph and an integer k, is there a Hamiltonian cycle with total weight k? 20

21 NP Complete Problems: Polynomial Reductions Suppose we want to solve a problem P. We have an algorithm for Q. We have a function T that takes an input x for P and produces T(x), an input for Q such that the correct answer for P on x is yes if and only if the correct answer for Q on T(x) is yes. Then, by composing T and the algorithm for Q, we have an algorithm for P. See Figure

22 NP Complete Problems: Polynomial Reductions 22

23 NP Complete Problems: Polynomial Reductions Example : A simple reduction P: Given a sequence of Boolean values, does at least one of them have the value true? Q: Given a sequence of integers, is the maximum of the integers positive? T(x 1, x 2,, x n ) = (y 1, y 2,, y n ) where y i = 1 if x i = true, and y i = 0 if x i = false. Clearly, an algorithm to solve Q, when applied to y 1, y 2,, y n, solves P for x 1, x 2,, x n. 23

24 NP Complete Problems: Polynomial Reductions Definition 13.6 Polynomial reduction and reducibility Let T be a function from the input set for a decision problem P into the input set for a decision problem Q. T is a polynomial reduction (also called a polynomial transformation) from P to Q if all of the following hold: 1. T can be computed in polynomially bounded time. 2. For every string x, if x is a yes input for P, then T(x) is a yes input for Q. 3. For every string x, if x is a no input for P, then T(x) is a no input for Q. It is usually easier to prove the contrapositive of part For every x, if T(x) is a yes input for Q, then x is a yes input for P. 24

25 NP Complete Problems: Polynomial Reductions Definition 13.6 (cont d) Problem P is polynomially reducible (also called polynomially transformable) to Q if there exists a polynomial transformation from P to Q. (We usually just say P is reducible to Q) The notation P P Q is used to indicate that P is reducible to Q. P P Q Q is at least as hard to solve as P. 25

26 NP Complete Problems: Polynomial Reductions Theorem 13.3 If P P Q and Q is in P, then P is in P. Proof. p polynomial bound on T q polynomial bound on algorithm for Q x input for P of size n The size of T(x) is at most p(n). If T(x) is given to the algorithm for Q, it does at most q(p(n)) steps. So the total for transformation T and the use of the Q algorithm is p(n) + q(p(n)) a polynomial in n. 26

27 NP Complete Problems: Polynomial Reductions Definition 13.7 NP -hard and NP -complete A problem Q is NP -hard if every problem P in NP is reducible to Q; that is, P P Q. A problem Q is NP -complete if it is in NP and is NP -hard. Being NP -hard constitutes a lower bound on the problem. Being in NP constitutes an upper bound. Theorem 13.4 If any NP -complete problem is in P, then P = NP. How valuable it would be to find a polynomially bounded algorithm for any NP -complete problem. How unlikely it is that such an algorithm exists because there are so many problems in NP for which polynomially bounded algorithms have been sought without success. 27

28 NP Complete Problems: Polynomial Reductions To show that some problem Q is NP -hard, it is necessary to show that all problems in NP are reducible to Q. How would this be possible? The first proof that a certain problem actually is NP - complete stands as one of the major accomplishments! Theorem 13.5 (Cook s theorem) The satisfiability problem is NP -complete. Theorem 13.6 (Cook s theorem) Graph coloring, Hamiltonian cycle, Hamiltonian path, job scheduling with penalties, bin packing, the subset sum problem, the knapsack problem, and the traveling salesperson problem are all NP -complete. 28

29 NP Complete Problems: Polynomial Reductions To prove that a problem Q NP is NP -complete, it suffices to prove that some other NP -complete problem is polynomially reducible to Q. the reducibility relation is transitive (Be careful about the direction of the reduction!) To show Q NP is NP -complete, Choose some known NP -complete problem P. Show P P Q. Then, all problems R NP satisfy R P Q. Therefore, Q is NP -complete. 29

30 NP Complete Problems: Polynomial Reductions Theorem 13.7 The directed Hamiltonian cycle problem is reducible to the undirected Hamiltonian cycle problem. Proof. Let G =(V, E) be a directed graph with n vertices. G is transformed into the undirected graph G =(V, E ) where V = { v i v V, i = 1, 2, 3 } E = { v 1 v 2, v 2 v 3 v V} { v 3 w 1 vw E } (See Figure 13.3) The transformation is straightforward, and G can be constructed in polynomially bounded time. If V = n and E = m, then V = 3n and E = 2n + m. 30

31 NP Complete Problems: Polynomial Reductions 31

32 NP Complete Problems: Polynomial Reductions Proof. (cont d) We have to show that G has a directed Hamiltonian cycle G has an undirected Hamiltonian cycle. ( ) Suppose G has a Hamiltonian cycle v 1, v 2,, v n. Then v 11, v 12, v 13, v 21, v 22, v 23,, v n1, v n2, v n3, is an undirected Hamiltonian cycle. ( ) Suppose G has a Hamiltonian cycle. The three vertices, say v 1, v 2, v 3, that correspond to one vertex in G must be traversed consecutively in the order v 1, v 2, v 3 or v 3, v 2, v 1 because v 2 cannot be reached from any other vertex in G. 32

33 NP Complete Problems: Polynomial Reductions Proof. (cont d) Since the other edges in G connects vertices with superscripts 1 and 3, if the order in one triple is 1, 2, 3, then the order is 1, 2, 3 for all triples. Otherwise, it is 3, 2, 1 for all triples. Since G is undirected, we may assume that its Hamiltonian cycle is v i11, v i12, v i13,, v in1, v in2, v in3. Then v i1, v i2,, v in is a directed Hamiltonian cycle for G. The vertex v 2 is introduced to force the vertices that correspond to v to appear together in any cycle in G. 33

34 Optimization Problems and Decision Problems Three kinds of problems listed in order of increasing difficulty: 1. Decision problem: Is there a solution better than some given bound? 2. Optimal value: What is the value of a best possible solution? 3. Optimal solution: Find a solution that achieves the optimal value. Optimization problems are harder than the NP -complete decision problems (NP -hard). No polynomial verification algorithm is known that can determine if a proposed solution is an optimal solution. 34

35 Optimization Problems and Decision Problems What if P = NP? If we had polynomial time algorithms for the decision problems, could we find the optimal solution value in polynomial time? (In many cases, we could.) Example : Graph coloring cancolor(g, k) = true chromaticnumber(g) for (k = 1; k n; k++) if (cancolor(g, k)) break; return k; G is k-colorable If cancolor runs in polynomial time, so does the whole program. 35

36 Optimization Problems and Decision Problems Example : Hamiltonian cycle tspbound(g, k) = true tspmin(g) for (k = 1; k ; k++) if (tspbound(g, k)) break; return k; there is a tour of cost k Let W be the maximum of the edge weights. Since there are n edges in Hamiltonian cycle, the weight of a minimum tour is at most nw nw iterations. As the discussion on input size indicates, this is not good enough to conclude that the program runs in polynomial time. 36

37 Approximation Algorithms Approximation (or heuristic) algorithms: Fast (polynomially-bounded) algorithms that give near optimal solution. Consider a particular optimization problem and an input I. FS(I): set of feasible solutions for I (objects of right type, not necessarily optimal) Example : graph coloring G = (V, E) FS(G) = {C: V {1,, V } s.t. C(v) C(w) if vw E} set of all colorings 37

38 Approximation Algorithms val(i, x): value of the optimization parameter achieved by the feasible solution x, for input instance I Example : graph coloring val(g, C) = C(V) # of colors used opt(i) = best {val(i, x) x FS(I)} An optimal solution for I is an x FS(I) such that val(i, x) = opt(i). Approximation algorithm: A polynomial-time algorithm that, when given input I, outputs an element of FS(I). 38

39 Approximation Algorithms A: approximation algorithm A(I): feasible solution A chooses for I val( I, A( I)) ra ( I) for minimizati on problems, opt( I) opt( I) ra ( I) for maximization problems. val( I, A( I)) r A (I) 1 measure for the goodness Consider the worst-case scenario R A (m) = max {r A (I) I such that opt(i) = m}, S A (n) = max {r A (I) I of size n}. 39

40 Computer Algorithms (Backtracking & Branch-and-Bound)

41 Finding Solutions to NP -complete Problems Many of the NP -complete problems arise in real-life applications NP -complete problems cannot be solved in polynomial time. We need techniques for finding solutions to such hard problems in a reasonable amount of time. 41

42 Backtracking (From of Michael T. Goodrich & Roberto Tamassia) Takes advantage of the inherent structure of the NP -complete problems: A certificate consists of a set of choices. The certificate can be checked in polynomial time by testing whether or not it demonstrates a successful configuration of a problem instance. Searches through a large (exponential-size) set of possibilities in a systematic way: Traverses through possible search paths to locate solutions or dead ends. 42

43 Backtracking The search space consists of the configurations (x, y). x: the remaining subproblem to be solved y: the set of choices that have been made to get to this subproblem from the original problem instance The backtracking strategy: Starts from (x, ). x is the original problem instance Generates new configurations by making a small set of additional choices. Backtracks at dead ends to another configuration. 43

44 Backtracking 44

45 Backtracking To turn the strategy into an actual algorithm: 1. Define a way of selecting the most promising candidate configuration from the frontier set F. 2. Specify the way of expanding a configuration (x, y) into subproblem configurations. The expansion process should, in principle, be able to generate all feasible configurations. 3. Describe how to perform a simple consistency check for a configuration (x, y) that returns solution found, dead end, or continue. The frontier F can be a stack (depth-first search), or a queue (breadth-first search), or others. 45

46 Backtracking Example : A Backtracking Algorithm for CNF-SAT S : a Boolean expression in CNF Configuration (S, y) y : an assignment S : resultant formula by applying y to S The most promising choice is the subformula S with the smallest clause. Such a formula would hit a dead end most quickly Two new subproblems are generated by picking a variable x from a smallest clause in S, and assigning x = 1 and x = 0, respectively. 46

47 Backtracking Example : CNF-SAT (Cont d) To perform a consistency check for an assignment of x in S : Reduce any clauses containing x based on the assignment. If the resultant clause contains a single literal y or y, Assign a value to y to make this clause satisfied. Propagate the assignment. Repeat this process until we have no more single-literal clauses. If we discover a contradiction, return dead end. If we reduce S to 1, return solution found. Otherwise, we derive a new formula S such that each clause has at least two literals ( continue ). 47

48 Backtracking Example : CNF-SAT (Cont d) The worst-case running time for this algorithm is still exponential, but the backtracking can often speed things up. If every clause in the formula has at most two literals, this algorithm runs in polynomial time. 48

49 Branch-and-Bound (From 9.7. of Gilles Brassard & Paul Bratley) Backtracking is not designed for optimization problems: In addition to some feasibility conditions the optimization problems have an objective function to be minimized or maximized. Branch-and-bound is an extension of backtracking: Search continues even after a solution is found until the best solution is found. The algorithm calculates a bound on the possible values of any solutions that might lie farther on in the branch. If such solutions are necessarily worse than the best solution found so far, that branch is pruned. 49

50 Branch-and-Bound Often, the calculated bound is also used to choose which open path looks the most promising. As the bound gets more accurate, the algorithm s efficiency improves. Example : The Assignment Problem Assign n tasks to n agents, each task being performed by a single agent, in such a way that the total cost of executing the n tasks is minimized. 50

51 Branch-and-Bound Example : The Assignment Problem (Cont d) The cost matrix (c ij : the cost of task j when performed by agent i) a b c d An upper bound on the answer can be obtained by considering one possible solution: a 1, b 2, c 3, d 4 cost : = 73 An optimal solution cannot cost more than this. 51

52 Branch-and-Bound A lower bound can be obtained by adding the smallest elements in each column or row: = 58 (column) = 49 (row) not so useful! The answer lies somewhere in [58..73]. Branch-and-bound search: Starts from the root (no assignment). At each level, fixes the assignment of an agent. At each node, calculates a bound on the solution obtainable by completing the current partial assignment. The bound is used to guide the search and also to prune the branches (search paths). 52

53 Branch-and-Bound lower bounds a 1 a 2 a 3 a * The node with the lowest lower bound is expanded next. Cut off because this lower bound is higher than the upper bound

54 Branch-and-Bound a 1 60 a 2, b 1 68 a 2 a 2, b 3 59 a 3 65 a 2, b 4 64 a 4 78* 54

55 Branch-and-Bound a 1 a 2 a a 2, b 1 68 a 2, b 3 a 2, b 4 64 a 2, b 3, c 1, d 4 64 a 2, b 3, c 4, d 1 65 a 4 78* Now, 64 is a new upper bound. 55

56 Branch-and-Bound a 1 a 2 a 3 a * 78* a 2, b 1 68* a 2, b 3, c 1, d 4 64 a 2, b 3 a 2, b 3, c 4, d 1 65* a 2, b 4 64* Can be eliminated if we only want one solution. 56

57 Branch-and-Bound a 1, b 2 68* a 1 a 1, b 3 a 1, b * a 2 a 3 a 4 65* 78* a 2, b 1 68* a 2, b 3, c 1, d 4 64 a 2, b 3 a 2, b 3, c 4, d 1 65* a 2, b 4 64* 57

58 Branch-and-Bound a 1 a 2 a 3 a 4 65* 78* a 1, b 2 68* a 1, b 3 a 1, b 4 a 1, b 3, c 2, d 4 69* a 1, b 3, c 4, d * a 2, b 1 68* a 2, b 3, c 1, d 4 64 a 2, b 3 a 2, b 3, c 4, d 1 65* a 2, b 4 64* Now, 61 is a new upper bound. 58

59 Branch-and-Bound a 1 a 2 a 3 a 4 65* 78* a 1, b 2 68* a 1, b 3 a 1, b 4 a 1, b 3, c 2, d 4 69* a 1, b 3, c 4, d * a 2, b 1 68* a 2, b 3, c 1, d 4 64* a 2, b 3 a 2, b 3, c 4, d 1 65* a 2, b 4 64* 61 is the optimum (minimum) value because all the other nodes are cut off. 59

ECS122A Handout on NP-Completeness March 12, 2018

ECS122A Handout on NP-Completeness March 12, 2018 ECS122A Handout on NP-Completeness March 12, 2018 Contents: I. Introduction II. P and NP III. NP-complete IV. How to prove a problem is NP-complete V. How to solve a NP-complete problem: approximate algorithms

More information

1. Introduction Recap

1. Introduction Recap 1. Introduction Recap 1. Tractable and intractable problems polynomial-boundness: O(n k ) 2. NP-complete problems informal definition 3. Examples of P vs. NP difference may appear only slightly 4. Optimization

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

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

INTRO TO COMPUTATIONAL COMPLEXITY

INTRO TO COMPUTATIONAL COMPLEXITY MA/CSSE 473 Day 38 Problems Decision Problems P and NP Polynomial time algorithms INTRO TO COMPUTATIONAL COMPLEXITY 1 The Law of the Algorithm Jungle Polynomial good, exponential bad! The latter is obvious,

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

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 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

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

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof T-79.5103 / Autumn 2006 NP-complete problems 1 NP-COMPLETE PROBLEMS Characterizing NP Variants of satisfiability Graph-theoretic problems Coloring problems Sets and numbers Pseudopolynomial algorithms

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

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 Complexity Theory. Chapter 8: Introduction to Complexity. Computer Science - Durban - September 2005

Algorithms and Complexity Theory. Chapter 8: Introduction to Complexity. Computer Science - Durban - September 2005 Algorithms and Complexity Theory Chapter 8: Introduction to Complexity Jules-R Tapamo Computer Science - Durban - September 2005 Contents 1 Introduction 2 1.1 Dynamic programming...................................

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

CS/COE

CS/COE CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ P vs NP But first, something completely different... Some computational problems are unsolvable No algorithm can be written that will always produce the correct

More information

4. How to prove a problem is NPC

4. How to prove a problem is NPC The reducibility relation T is transitive, i.e, A T B and B T C imply A T C Therefore, to prove that a problem A is NPC: (1) show that A NP (2) choose some known NPC problem B define a polynomial transformation

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

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

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

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Review Basic reduction strategies. Simple equivalence: INDEPENDENT-SET P VERTEX-COVER. Special case to general case: VERTEX-COVER P SET-COVER. Encoding with gadgets:

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

Unit 1A: Computational Complexity

Unit 1A: Computational Complexity Unit 1A: Computational Complexity Course contents: Computational complexity NP-completeness Algorithmic Paradigms Readings Chapters 3, 4, and 5 Unit 1A 1 O: Upper Bounding Function Def: f(n)= O(g(n)) if

More information

Algorithms Design & Analysis. Approximation Algorithm

Algorithms Design & Analysis. Approximation Algorithm Algorithms Design & Analysis Approximation Algorithm Recap External memory model Merge sort Distribution sort 2 Today s Topics Hard problem Approximation algorithms Metric traveling salesman problem A

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

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

8.5 Sequencing Problems

8.5 Sequencing Problems 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

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

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

CS 5114: Theory of Algorithms. Tractable Problems. Tractable Problems (cont) Decision Problems. Clifford A. Shaffer. Spring 2014

CS 5114: Theory of Algorithms. Tractable Problems. Tractable Problems (cont) Decision Problems. Clifford A. Shaffer. Spring 2014 Department of Computer Science Virginia Tech Blacksburg, Virginia Copyright c 2014 by Clifford A. Shaffer : Theory of Algorithms Title page : Theory of Algorithms Clifford A. Shaffer Spring 2014 Clifford

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

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM 8. INTRACTABILITY I poly-time reductions packing and covering problems constraint satisfaction problems sequencing problems partitioning problems graph coloring numerical problems Lecture slides by Kevin

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

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

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle Directed Hamiltonian Cycle Chapter 8 NP and Computational Intractability Claim. G has a Hamiltonian cycle iff G' does. Pf. Suppose G has a directed Hamiltonian cycle Γ. Then G' has an undirected Hamiltonian

More information

COP 4531 Complexity & Analysis of Data Structures & Algorithms

COP 4531 Complexity & Analysis of Data Structures & Algorithms COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According

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

Computational Complexity

Computational Complexity Computational Complexity Problems, instances and algorithms Running time vs. computational complexity General description of the theory of NP-completeness Problem samples 1 Computational Complexity What

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

CS 5114: Theory of Algorithms

CS 5114: Theory of Algorithms CS 5114: Theory of Algorithms Clifford A. Shaffer Department of Computer Science Virginia Tech Blacksburg, Virginia Spring 2014 Copyright c 2014 by Clifford A. Shaffer CS 5114: Theory of Algorithms Spring

More information

SAT, Coloring, Hamiltonian Cycle, TSP

SAT, Coloring, Hamiltonian Cycle, TSP 1 SAT, Coloring, Hamiltonian Cycle, TSP Slides by Carl Kingsford Apr. 28, 2014 Sects. 8.2, 8.7, 8.5 2 Boolean Formulas Boolean Formulas: Variables: x 1, x 2, x 3 (can be either true or false) Terms: t

More information

P, NP, NP-Complete, and NPhard

P, NP, NP-Complete, and NPhard P, NP, NP-Complete, and NPhard Problems Zhenjiang Li 21/09/2011 Outline Algorithm time complicity P and NP problems NP-Complete and NP-Hard problems Algorithm time complicity Outline What is this course

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

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

Graduate Algorithms CS F-21 NP & Approximation Algorithms

Graduate Algorithms CS F-21 NP & Approximation Algorithms Graduate Algorithms CS673-2016F-21 NP & Approximation Algorithms David Galles Department of Computer Science University of San Francisco 21-0: Classes of Problems Consider three problem classes: Polynomial

More information

Computational Complexity. IE 496 Lecture 6. Dr. Ted Ralphs

Computational Complexity. IE 496 Lecture 6. Dr. Ted Ralphs Computational Complexity IE 496 Lecture 6 Dr. Ted Ralphs IE496 Lecture 6 1 Reading for This Lecture N&W Sections I.5.1 and I.5.2 Wolsey Chapter 6 Kozen Lectures 21-25 IE496 Lecture 6 2 Introduction to

More information

More NP-Complete Problems

More NP-Complete Problems CS 473: Algorithms, Spring 2018 More NP-Complete Problems Lecture 23 April 17, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 57 Recap NP: languages/problems that have

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

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

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 26 Computational Intractability Polynomial Time Reductions Sofya Raskhodnikova S. Raskhodnikova; based on slides by A. Smith and K. Wayne L26.1 What algorithms are

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

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

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

NP-Complete Reductions 2

NP-Complete Reductions 2 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete

More information

1.1 P, NP, and NP-complete

1.1 P, NP, and NP-complete CSC5160: Combinatorial Optimization and Approximation Algorithms Topic: Introduction to NP-complete Problems Date: 11/01/2008 Lecturer: Lap Chi Lau Scribe: Jerry Jilin Le This lecture gives a general introduction

More information

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office? N P NP Completeness Announcements Friday Four Square! Today at 4:15PM, outside Gates. Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Explore P, NP, and their connection. Did

More information

A An Overview of Complexity Theory for the Algorithm Designer

A An Overview of Complexity Theory for the Algorithm Designer A An Overview of Complexity Theory for the Algorithm Designer A.1 Certificates and the class NP A decision problem is one whose answer is either yes or no. Two examples are: SAT: Given a Boolean formula

More information

Theory of Computer Science. Theory of Computer Science. E5.1 Routing Problems. E5.2 Packing Problems. E5.3 Conclusion.

Theory of Computer Science. Theory of Computer Science. E5.1 Routing Problems. E5.2 Packing Problems. E5.3 Conclusion. Theory of Computer Science May 31, 2017 E5. Some NP-Complete Problems, Part II Theory of Computer Science E5. Some NP-Complete Problems, Part II E5.1 Routing Problems Malte Helmert University of Basel

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

Show that the following problems are NP-complete

Show that the following problems are NP-complete Show that the following problems are NP-complete April 7, 2018 Below is a list of 30 exercises in which you are asked to prove that some problem is NP-complete. The goal is to better understand the theory

More information

VIII. NP-completeness

VIII. NP-completeness VIII. NP-completeness 1 / 15 NP-Completeness Overview 1. Introduction 2. P and NP 3. NP-complete (NPC): formal definition 4. How to prove a problem is NPC 5. How to solve a NPC problem: approximate algorithms

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

2 COLORING. Given G, nd the minimum number of colors to color G. Given graph G and positive integer k, is X(G) k?

2 COLORING. Given G, nd the minimum number of colors to color G. Given graph G and positive integer k, is X(G) k? 2 COLORING OPTIMIZATION PROBLEM Given G, nd the minimum number of colors to color G. (X(G)?) DECISION PROBLEM Given graph G and positive integer k, is X(G) k? EQUIVALENCE OF OPTIMAIZTION AND DE- CISION

More information

Theory of Computation Time Complexity

Theory of Computation Time Complexity Theory of Computation Time Complexity Bow-Yaw Wang Academia Sinica Spring 2012 Bow-Yaw Wang (Academia Sinica) Time Complexity Spring 2012 1 / 59 Time for Deciding a Language Let us consider A = {0 n 1

More information

CSE 3500 Algorithms and Complexity Fall 2016 Lecture 25: November 29, 2016

CSE 3500 Algorithms and Complexity Fall 2016 Lecture 25: November 29, 2016 CSE 3500 Algorithms and Complexity Fall 2016 Lecture 25: November 29, 2016 Intractable Problems There are many problems for which the best known algorithms take a very long time (e.g., exponential in some

More information

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1 CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY E. Amaldi Foundations of Operations Research Politecnico di Milano 1 Goal: Evaluate the computational requirements (this course s focus: time) to solve

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

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

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

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURES 30-31 NP-completeness Definition NP-completeness proof for CIRCUIT-SAT Adam Smith 11/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova,

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

More on NP and Reductions

More on NP and Reductions Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data

More information

CS Algorithms and Complexity

CS Algorithms and Complexity CS 50 - Algorithms and Complexity Linear Programming, the Simplex Method, and Hard Problems Sean Anderson 2/15/18 Portland State University Table of contents 1. The Simplex Method 2. The Graph Problem

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

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved. Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved. 1 P and NP P: The family of problems that can be solved quickly in polynomial time.

More information

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision 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

Comp487/587 - Boolean Formulas

Comp487/587 - Boolean Formulas Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested

More information

Recap from Last Time

Recap from Last Time NP-Completeness Recap from Last Time Analyzing NTMs When discussing deterministic TMs, the notion of time complexity is (reasonably) straightforward. Recall: One way of thinking about nondeterminism is

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

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

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

Instructor N.Sadagopan Scribe: P.Renjith. Lecture- Complexity Class- P and NP

Instructor N.Sadagopan Scribe: P.Renjith. Lecture- Complexity Class- P and NP Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data

More information

NP and NP-Completeness

NP and NP-Completeness 0/2/206 Algorithms NP-Completeness 7- Algorithms NP-Completeness 7-2 Efficient Certification NP and NP-Completeness By a solution of a decision problem X we understand a certificate witnessing that an

More information

NP-Completeness. Subhash Suri. May 15, 2018

NP-Completeness. Subhash Suri. May 15, 2018 NP-Completeness Subhash Suri May 15, 2018 1 Computational Intractability The classical reference for this topic is the book Computers and Intractability: A guide to the theory of NP-Completeness by Michael

More information

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170 UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, 2003 Notes 22 for CS 170 1 NP-completeness of Circuit-SAT We will prove that the circuit satisfiability

More information

Principles of Computing, Carnegie Mellon University. The Limits of Computing

Principles of Computing, Carnegie Mellon University. The Limits of Computing The Limits of Computing Intractability Limits of Computing Announcement Final Exam is on Friday 9:00am 10:20am Part 1 4:30pm 6:10pm Part 2 If you did not fill in the course evaluations please do it today.

More information

Introduction. Pvs.NPExample

Introduction. Pvs.NPExample Introduction Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 09 NP-Completeness (Chapter 34) Stephen Scott (Adapted from Vinodchandran N. Variyam) sscott@cse.unl.edu I

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

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

NP-Completeness Part II

NP-Completeness Part II NP-Completeness Part II Please evaluate this course on Axess. Your comments really do make a difference. Announcements Problem Set 8 due tomorrow at 12:50PM sharp with one late day. Problem Set 9 out,

More information

Geometric Steiner Trees

Geometric Steiner Trees Geometric Steiner Trees From the book: Optimal Interconnection Trees in the Plane By Marcus Brazil and Martin Zachariasen Part 3: Computational Complexity and the Steiner Tree Problem Marcus Brazil 2015

More information

Una descrizione della Teoria della Complessità, e più in generale delle classi NP-complete, possono essere trovate in:

Una descrizione della Teoria della Complessità, e più in generale delle classi NP-complete, possono essere trovate in: AA. 2014/2015 Bibliography Una descrizione della Teoria della Complessità, e più in generale delle classi NP-complete, possono essere trovate in: M. R. Garey and D. S. Johnson, Computers and Intractability:

More information

Reductions. Reduction. Linear Time Reduction: Examples. Linear Time Reductions

Reductions. Reduction. Linear Time Reduction: Examples. Linear Time Reductions Reduction Reductions Problem X reduces to problem Y if given a subroutine for Y, can solve X. Cost of solving X = cost of solving Y + cost of reduction. May call subroutine for Y more than once. Ex: X

More information

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine. The Class NP NP is the problems that can be solved in polynomial time by a nondeterministic machine. NP The time taken by nondeterministic TM is the length of the longest branch. The collection of all

More information

Theory of Computation Chapter 9

Theory of Computation Chapter 9 0-0 Theory of Computation Chapter 9 Guan-Shieng Huang May 12, 2003 NP-completeness Problems NP: the class of languages decided by nondeterministic Turing machine in polynomial time NP-completeness: Cook

More information

Chapter 8. NP and Computational Intractability

Chapter 8. NP and Computational Intractability Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Acknowledgement: This lecture slide is revised and authorized from Prof.

More information

NP and NP-Completeness

NP and NP-Completeness CSC 364S Notes University of Toronto, Spring, 2003 NP NP and NP-Completeness NP is a class of languages that contains all of P, but which most people think also contains many languages that aren t in P.

More information

Lecture 18: P & NP. Revised, May 1, CLRS, pp

Lecture 18: P & NP. Revised, May 1, CLRS, pp Lecture 18: P & NP Revised, May 1, 2003 CLRS, pp.966-982 The course so far: techniques for designing efficient algorithms, e.g., divide-and-conquer, dynamic-programming, greedy-algorithms. What happens

More information

Instructor N.Sadagopan Scribe: P.Renjith

Instructor N.Sadagopan Scribe: P.Renjith Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data

More information