NP-completeness. Chapter 34. Sergey Bereg

Size: px
Start display at page:

Download "NP-completeness. Chapter 34. Sergey Bereg"

Transcription

1 NP-completeness Chapter 34 Sergey Bereg Oct 2017

2 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 which will be defined later. No polynomial time algorithm is known for any NP-complete problem. Shortest vs. longest simple paths. Given a directed graph G = (V, E) with non-negative edge weights, the shortest path from between two vertices can be found in O(V E) time. Finding the longest simple path is a NPcomplete problem. What if we modify Bellman-Ford algorithm by changing > to < in the relaxation condition? Relax(u, v, w) // relax edge (u, v) using weight w(u, v) 1 if d[v] > d[u] + w(u, v) then 2 d[v] = d[u] + w(u, v) 3 π[v] = u Oct

3 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 which will be defined later. No polynomial time algorithm is known for any NP-complete problem. Shortest vs. longest simple paths. Given a directed graph G = (V, E) with non-negative edge weights, the shortest path from between two vertices can be found in O(V E) time. Finding the longest simple path is a NPcomplete problem. There is a graph G and a vertex s G such that a modified Bellman-Ford algorithm does not find the longest simple paths. Oct

4 Definitions An abstract problem Q is a binary relation on a set I of problem instances and a set S of problem solutions. Example. An instance for Shortest-Path is a graph G = (V, E) and two vertices. A solution is an ordered sequence of vertices (can be empty sequence if no path exists). A given instance may have more than one solution. A decision problem is a problem having yes/no solution. So S = {0, 1}. Many problems are optimization problems where some value must be minimized or maximized. Usually it is easy to cast an optimization problem as a decision problem. Example. Decision problem for Shortest-Path is the problem Path: Given a graph G = (V, E), vertices u and v, and an integer k, is there a path of from u to v consisting at most k edges? Oct

5 Encodings Encoding of a set S is a mapping e : S {0, 1} from S to the set of binary strings. Example: S = N, then binary code e : N {0, 1}. A problem whose instance set is {0, 1} is called a concrete problem. We say that an algorithm solves a concrete problem in time O(T (n)) if it takes O(T (n)) time for a problem instance i of length n = i. If T (n) = O(n k ) then we say that the problem is polynomially solvable. Complexity class P is a class of concrete decision problems that are polynomially solvable. Oct

6 Formal language framework An alphabet Σ is a finite set of symbols. A language L over Σ is any set of strings made up of symbols from Σ. Example: if Σ = {0, 1}, the set L = {10, 11, 101, 111,... } is the language of binary representations of prime numbers. We denote the empty string by ε and the empty language by. So, L Σ where Σ is the language of all strings on Σ. Operations on languages: union L 1 L 2, intersection L 1 L 2, complement of L is Σ L, concatenation of L 1 and L 2 is {x 1 x 2 : x 1 L 1, x 2 L 2 }, closure or Kleene star L = {ε} L L 2 L 3... where L k is the language obtained by concatenating L to itself k times. Oct

7 Formal language framework An algorithm A accepts a string x {0, 1} algorithm s output is 1, i.e. A(x) = 1. A rejects x if A(x) = 0. if, given input x, the The language accepted by an algorithm A is the set of strings L = {x {0, 1} : A(x) = 1}. Question: Is it true that A rejects a string x / L? Oct

8 Formal language framework An algorithm A accepts a string x {0, 1} algorithm s output is 1, i.e. A(x) = 1. A rejects x if A(x) = 0. if, given input x, the The language accepted by an algorithm A is the set of strings L = {x {0, 1} : A(x) = 1}. Question: Is it true that A rejects a string x / L? No, A may not reject a string x / L (A may loop forever on x). Oct

9 Formal language framework A language L is decided by an algorithm A if A accepts/rejects every string x in/not in L. A language L is accepted in polynomial time by an algorithm A if, for any x L, x = n, it accepts x L in O(n k ) time for some fixed k. A language L is decided in polynomial time by an algorithm A if, for any x {0, 1}, x = n, it decides whether x L in O(n k ) time for some fixed k. P = {L {0, 1} : A that decides L in polynomial time}. Theorem. P = {L {0, 1} : A that accepts L in polynomial time}. Oct

10 Formal language framework Theorem. P = {L {0, 1} : A that accepts L in polynomial time}. Proof. If a language L is decided by a polynomial-time algorithm A, then L is accepted by A. Suppose that a language L is accepted by a polynomial-time algorithm A with running time at most T (n) = cn k. We use a simulation argument and create a new algorithm A. For an input string x, the algorithm A 1. Computes the length n = x. 2. Simulates the action of A only for time T (n). If A accept/rejects x then A reports it and stops. 3. Rejects x. Oct

11 Verification algorithms Hamiltonian cycle problem HAM-CYCLE. Given an undirected graph G, is there a simple cycle that contains all the vertices of G? An algorithm: encode graph with adjacency matrix, the number of vertices m n. There are m! permutations and the running time to check them is at least Ω(m!) = Ω(( n)!) = Ω(2 n ). Not polynomial time. To verify a solution of HAM-CYCLE we need a certificate, for example, the hamiltonian cycle. A verification algorithm has two arguments - input string and certificate string. A two-argument algorithm A verifies an input string x if there is a certificate y such that A(x, y) = 1. The language verified by a verification algorithm A is L = {x {0, 1} : y {0, 1} such that A(x, y) = 1}. Oct

12 Hamiltonian Game Is there a walk along a closed path on dodecahedron such that every vertex is visited one time? Oct

13 Complexity class NP Complexity class NP is the class of languages that can be verified by a polynomial time algorithm. So, L NP if and only if there exist a two-input polynomial-time algorithm A and a constant c such that L = {x {0, 1} : y {0, 1} such that y = O( x c ) and A(x, y) = 1}. We say that algorithm A verifies L in polynomial time. Example: HAM-CYCLE NP. If L P then L NP since there is a polynomial-time algorithm to decide L (the verification algorithm ignores the second argument). Thus, P NP. Whether P = NP is the famous problem. It is not even known if NP is closed under complement. That is, does L NP imply L NP? Complexity class co-np is the set of languages L such that L NP. So, the question is NP=co-NP? Oct

14 Classes P, NP, and co-np Since P is closed under complement, we have P NP co-np. There are 4 possible relations between P, NP and co-np. P=NP=co-NP NP=co-NP P co-np P NP co-np NP P Oct

15 Reducibility A language L 1 is polynomial-time reducible to a language L 2, written L 1 P L 2, if there exists a polynomial-time computable function f : {0, 1} {0, 1} such that for all x {0, 1} x L 1 if and only if f(x) L 2. f is the reduction function and a polynomial-time algorithm F that computes f is called a reduction algorithm. Example. Equal-Numbers P Same-Points. Equal-Numbers: Given n integer numbers, are there two equal numbers? Same-Points: Given n points in the plane with integer coordinates, are there two coinciding points? Oct

16 Reducibility Lemma. If L 1, L 2 {0, 1} are languages such that L 1 P L 2 and L 2 P, then L 1 P. Oct

17 Reducibility Lemma. If L 1, L 2 {0, 1} are languages such that L 1 P L 2 and L 2 P, then L 1 P. Proof. Consider the algorithm for L 1 that is combination of the reduction algorithm and the algorithm for L 2. Oct

18 NP-completeness A language L is NP-complete if 1. L NP, and 2. L P L for every L NP. We say that a language is NP-hard if it satisfies condition 2 (1 may be satisfied or not). Any NP-complete problem is NP-hard. Example of NP-hard problem that is not NP-complete (does not satisfy the condition 1): halting problem (given a program and its input, will it run forever?). Theorem. If any NP-complete problem is solvable in polynomial time, then P = NP. Equivalently, if some problem in NP is not solvable in polynomial time, then no NP-complete problem is polynomial-time solvable. Oct

19 Classes P, NPC NP NPC P How most theoretical computer scientists view the relationships among P, NP, and NPC. Oct

20 Circuit Satisfiability A boolean combinatorial circuit is composed of AND, OR, and NOT gates connected by wires. Circuit input is a wire that is not the output of a gate. Circuit output is a wire that is not the input of a gate; it is unique. A truth assignment of a circuit is a set of boolean input values. x z x y z x y z x x x y x y x y x y A boolean combinatorial circuit is satisfiable if it has a truth assignment that causes the output to be 1. This assignment is called a satisfying assignment. Oct

21 Circuit Satisfiability Example. x 1 = 1, x 2 = 1, x 3 = 0 is a satisfying assignment and the circuit is satisfiable. x 1 = 1 x 2 = x 3 = Oct

22 Circuit Satisfiability Circuit-SAT problem. satisfiable? Given a boolean combinatorial circuit, is it Lemma. Circuit-SAT is in NP. Proof. Make a verification algorithm A(x, y) where x is an encoding of circuit and y is the certificate (satisfying assignment). A must be a polynomial-time algorithm. Idea: for each logic gate A computes its output based on inputs. At any moment, there is a gate with ready inputs. A returns the final output (of entire circuit). Oct

23 Circuit Satisfiability Lemma. Circuit-SAT is NP-hard. Oct

24 Circuit Satisfiability Lemma. Circuit-SAT is NP-hard. Proof. Let L be a language in NP and let A be a verification algorithm for A. We want to design a polynomial-time algorithm that maps every x {0, 1} to a circuit C = f(x) such that x L if and only if C Circuit-SAT. Idea: model the execution of the algorithm (code for A, program counter, machine state, and working storage) with a circuit C. There are T (n) = O(n k ) steps in the execution. We put T (n) copies of the circuit M that implements the computer hardware. We run the algorithm on the certificate y. Oct

25 Boolean formula satisfiability An instance of Circuit-SAT can be transformed into a boolean formula φ composed of 1. n boolean variables x 1,..., x n 2. m boolean connectives: any boolean function with one or two inputs and one output, such as (AND), (OR), (NOT), (implication. like ), (if and only if. like =) 3. parentheses x y x y x y Example: φ = ((x 1 x 2 ) (( x 1 x 3 ) x 4 )) x 2. Oct

26 Boolean formula satisfiability A truth assignment for a boolean function φ is a set of values of variables of φ and a satisfying assignment is a truth assignment that causes it to evaluate to 1. If a satisfying assignment exists then φ is satisfiable. SAT problem. Given a boolean formula, is it satisfiable? Theorem. SAT is NP-complete. Proof. 1. We show that SAT is in NP: certificate is the truth assignment that satisfies the formula. Can be checked in polynomial time. Oct

27 Boolean formula satisfiability 2. We show that Circuit-SAT P SAT. Assign a variable for each wire. Formula for SAT is the AND of the circuit output and the conjunction of clauses describing the operation of each gate. The formula can be produced in polynomial time. It is satisfiable if and only if the circuit is satisfiable. x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 φ = x 10 (x 4 x 3 ) (x 5 (x 1 x 2 )) (x 6 x 4 ) (x 7 (x 1 x 2 x 4 )) (x 8 (x 5 x 6 )) (x 9 (x 6 x 7 )) (x 10 (x 7 x 8 x 9 )) Oct

28 3-CNF A literal in a boolean formula is a variable or its negation. A boolean formula is in conjunctive normal form, or CNF, if it is expressed as an AND of clauses, each of which is the OR of one or more literals. A boolean formula is in 3-conjunctive normal form, or 3-CNF, if each clause has exactly 3 distinct literals. Example: (x 1 x 2 x 3 ) (x 3 x 2 x 4 ) ( x 1 x 3 x 4 ). 3-CNF-SAT, or 3-SAT, asks whether a given 3-CNF is satisfiable. Theorem. 3-SAT is NP-complete. Proof. 3-SAT NP is similar to the proof that SAT NP (every instance of 3-SAT is an instance of SAT). Oct

29 3-CNF We prove that SAT P 3-SAT. Let φ be an input formula for SAT, for example φ = ((x 1 x 2 ) (( x 1 x 3 ) x 4 )) x 2. Construct a binary parse tree. Introduce new variables y i. y 1 y 2 y 3 y 4 x 2 x 1 x 2 y 6 y 5 x 1 x 3 x 4 Oct

30 Transform the tree into a formula φ : 3-CNF y 2 y 1 y 3 y 4 x 1 x 2 y 6 y 5 x 2 x 1 x 3 x 4 φ = y 1 (y 1 (y 2 x 2 )) (y 2 (y 3 y 4 )) (y 3 (x 1 x 2 )) (y 4 y 5 ) (y 5 (y 6 x 4 )) (y 6 ( x 1 x 3 )) Oct

31 Make truth table for each clause φ i. 3-CNF Convert φ i using 0 s in the table. For example φ 1 = y 1 (y 2 x 2 ) y 1 y 2 x 2 y 1 (y 2 x 2 ) Then φ 1 = (y 1 y 2 x 2 ) (y 1 y 2 x 2 ) (y 1 y 2 x 2 ) ( y 1 y 2 x 2 ) Oct

32 3-CNF φ 1 = (y 1 y 2 x 2 ) (y 1 y 2 x 2 ) (y 1 y 2 x 2 ) ( y 1 y 2 x 2 ) Applying DeMorgan s laws φ 1 = ( y 1 y 2 x 2 ) ( y 1 y 2 x 2 ) ( y 1 y 2 x 2 ) (y 1 y 2 x 2 ) This way we create a CNF formula φ so that each clause has at most 3 literals. We change those with 1 and 2 literals. Oct

33 NP-complete problems A clique in an undirected graph G = (V, E) is a subset V V of vertices, each pair of which is connected by an edge in E. In other words, a clique is a complete subgraph of G. The size of a clique is the number of its vertices. Clique Problem is to find a clique of maximum size in G. Decision problem: CLIQUE= { G, k : G is a graph with a clique of size k}. Naive algorithm needs Ω(k 2( ) V k ) time. Theorem. The clique problem is NP-complete. Proof. CLIQUE NP if we choose the clique as the certificate. CLIQUE is NP-hard if we show 3-SAT P CLIQUE. Oct

34 Clique Problem The reduction algorithm begins with an instance of 3-SAT problem φ = C 1 C 2 C k. We construct a graph G(V, E). For each clause C r = (l1 r l2 r l3), r we place 3 vertices v1, r v2, r v3. r We put an edge between vi r and vs j if r s and literals of vr i and vs j are not contradictory. Example: φ = (x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) (x 1 x 2 x 3 ). C 1 x 1 x 2 x 3 C C 3 2 x 1 x 1 x 2 x 2 x 3 x 3 Oct

35 Clique Problem We show that the transformation of φ is a reduction. Suppose that φ has a satisfying assignment. Then each clause C r contains at least one literal li r assigned to 1. These vertices form a clique of size k in G. Conversely, suppose that G has a clique V of size k. No edges in G connect vertices in the same triple, so V contains exactly one vertex per triple. We assign 1 to each literal in the clique (we do not assign 1 to a literal and its complement). We assign any value to a variable whose literals are not in clique. All clauses are satisfied and φ is satisfied. Oct

36 Vertex-Cover Problem A vertex cover of a graph G = (V, E) is a subset V V of vertices such that, if (u, v) E, then u V or v V (or both). The vertex-cover problem is to find a vertex cover of minimum size in G. Decision problem: VERTEX-COVER= { G, k : graph G has a vertex cover of size k}. Theorem. The vertex-cover problem is NP-complete. Proof. VERTEX-COVER NP if we choose the vertex cover as the certificate. VERTEX-COVER is NP-hard if we show CLIQUE P VERTEX- COVER. Oct

37 Vertex-Cover Problem We define the complement of G as G = (V, E) where E = {(u, v) : u, v V, u v and (u, v) / E}. An instance of G, k of the clique problem reduces to an instance G, V k of the vertex-cover problem. Indeed, a set V V, V = k is the clique of G if and only if V V is a vertex cover of G. The reduction can be done in polynomial time. a b a b e f e f d c d c G, clique {a, b, c, d} G, vertex cover {e, f} Oct

38 Vertex-Cover Problem Approx-Vertex-Cover(G) 1 C = 2 E = E[G] 3 while E 4 let (u, v) be any edge of E 5 C = C {u, v} 6 remove from E every edge incident on either u or v 7 return C Theorem. Approx-Vertex-Cover computes a 2-approximation in O(V + E) time. Oct

39 Hamiltonian-cycle Problem A hamiltonian cycle in a graph G = (V, E) is a simple cycle that contains all vertices of G. G is hamiltonian if it contains a hamiltonian cycle. Hamiltonian-cycle problem is to detect if a graph G is hamiltonian. HAM-CYCLE= { G : G is a hamiltonian graph }. Theorem. The hamiltonian-cycle problem is NP-complete. Proof. HAM-CYCLE NP if we choose the hamiltonian cycle as the certificate. HAM-CYCLE is NP-hard if we show VERTEX-COVER P HAM- CYCLE. Use widgets and selector vertices to transform G to G. Polynomial time. G has a vertex cover V if and only if G has a hamiltonian cycle. Oct

40 Traveling-salesman problem Let G be a complete graph with integer cost c(i, j) to travel from city i to j. Traveling-salesman problem is to find a minimum-cost tour (hamiltonian cycle). 3 a d b 2 c traveling-salesman tour acbda of costs 7. TSP= { G, c, k : G is a complete graph and has a traveling-salesman tour of cost at most k}. Theorem. The traveling-salesman problem is NP-complete. Proof. TSP NP if we choose the tour as the certificate. Hardness: HAM-CYCLE P TSP. Oct

41 Subset-Sum Problem Given a finite set S N (natural numbers or positive integers) and a target t, the subset-sum problem is to find a subset S S whose elements sum to t. Example: S = {1, 3, 3, 9, 18}, t = 10. Then S = {1, 9} is a solution. SUBSET-SUM= { S, t : there exists a subset S S such that t = s S s}. Theorem. The subset-sum problem is NP-complete. Proof. SUBSET-SUM NP if we choose S as the certificate. Hardness: 3-SAT P SUBSET-SUM. Oct

42 Subset-Sum Problem Reduction. φ = C 1 C 2 C 3 C 4 where C 1 = (x 1 x 2 x 3 ), C 2 = ( x 1 x 2 x 3 ), C 3 = ( x 1 x 2 x 3 ), and C 4 = (x 1 x 2 x 3 ). x 1 x 2 x 3 C 1 C 2 C 3 C 4 v 1 = v 1 = v 2 = v 2 = v 3 = v 3 = s 1 = s 1 = s 2 = s 2 = s 3 = s 3 = s 4 = s 4 = t = Oct

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

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

Chapter 34: NP-Completeness

Chapter 34: NP-Completeness Graph Algorithms - Spring 2011 Set 17. Lecturer: Huilan Chang Reference: Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms, 2nd Edition, The MIT Press. Chapter 34: NP-Completeness 2. Polynomial-time

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

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

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

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

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

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

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

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

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

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

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

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

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

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

NP-Complete Problems and Approximation Algorithms

NP-Complete Problems and Approximation Algorithms NP-Complete Problems and Approximation Algorithms Efficiency of Algorithms Algorithms that have time efficiency of O(n k ), that is polynomial of the input size, are considered to be tractable or easy

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

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

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

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

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

Lecture 15 - NP Completeness 1

Lecture 15 - NP Completeness 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 29, 2018 Lecture 15 - NP Completeness 1 In the last lecture we discussed how to provide

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

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

CMPT307: Complexity Classes: P and N P Week 13-1

CMPT307: Complexity Classes: P and N P Week 13-1 CMPT307: Complexity Classes: P and N P Week 13-1 Xian Qiu Simon Fraser University xianq@sfu.ca Strings and Languages an alphabet Σ is a finite set of symbols {0, 1}, {T, F}, {a, b,..., z}, N a string x

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

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

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

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

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

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

Polynomial-time reductions. We have seen several reductions:

Polynomial-time reductions. We have seen several reductions: Polynomial-time reductions We have seen several reductions: Polynomial-time reductions Informal explanation of reductions: We have two problems, X and Y. Suppose we have a black-box solving problem X in

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

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

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

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

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

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

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

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem? Admin Two more assignments No office hours on tomorrow NP-COMPLETE PROBLEMS Run-time analysis Tractable vs. intractable problems We ve spent a lot of time in this class putting algorithms into specific

More information

CSCI3390-Lecture 17: A sampler of NP-complete problems

CSCI3390-Lecture 17: A sampler of NP-complete problems CSCI3390-Lecture 17: A sampler of NP-complete problems 1 List of Problems We now know that if L is any problem in NP, that L P SAT, and thus SAT is NP-hard. Since SAT is also in NP we find that SAT is

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

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

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

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

Chapter 2 : Time complexity

Chapter 2 : Time complexity Dr. Abhijit Das, Chapter 2 : Time complexity In this chapter we study some basic results on the time complexities of computational problems. concentrate our attention mostly on polynomial time complexities,

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

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

CSE 135: Introduction to Theory of Computation NP-completeness

CSE 135: Introduction to Theory of Computation NP-completeness CSE 135: Introduction to Theory of Computation NP-completeness Sungjin Im University of California, Merced 04-15-2014 Significance of the question if P? NP Perhaps you have heard of (some of) the following

More information

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20 NP-complete problems CSE 101: Design and Analysis of Algorithms Lecture 20 CSE 101: Design and analysis of algorithms NP-complete problems Reading: Chapter 8 Homework 7 is due today, 11:59 PM Tomorrow

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

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

3130CIT Theory of Computation

3130CIT Theory of Computation GRIFFITH UNIVERSITY School of Computing and Information Technology 3130CIT Theory of Computation Final Examination, Semester 2, 2006 Details Total marks: 120 (40% of the total marks for this subject) Perusal:

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

BBM402-Lecture 11: The Class NP

BBM402-Lecture 11: The Class NP BBM402-Lecture 11: The Class NP Lecturer: Lale Özkahya Resources for the presentation: http://ocw.mit.edu/courses/electrical-engineering-andcomputer-science/6-045j-automata-computability-andcomplexity-spring-2011/syllabus/

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation CISC 4090 Theory of Computation Complexity Professor Daniel Leeds dleeds@fordham.edu JMH 332 Computability Are we guaranteed to get an answer? Complexity How long do we have to wait for an answer? (Ch7)

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

NP-Completeness. Dr. B. S. Panda Professor, Department of Mathematics IIT Delhi, Hauz Khas, ND-16

NP-Completeness. Dr. B. S. Panda Professor, Department of Mathematics IIT Delhi, Hauz Khas, ND-16 NP-Completeness Dr. B. S. Panda Professor, Department of Mathematics IIT Delhi, Hauz Khas, ND-16 bspanda1@gmail.com 1 Decision Problem A problem whose answer is either yes or no ( 1 or 0) Examples: HC

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

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

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

i times p(p(... (p( n))...) = n ki.

i times p(p(... (p( n))...) = n ki. Chapter 7 NP Completeness Exercise 7.1 Show that an algorithm that makes at most a constant number of calls to polynomial-time subroutines runs in polynomial time, but that a polynomial number of calls

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

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

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

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

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

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

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

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

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 Fall 2011 P and NP Carola Wenk

CS Fall 2011 P and NP Carola Wenk CS3343 -- Fall 2011 P and NP Carola Wenk Slides courtesy of Piotr Indyk with small changes by Carola Wenk 11/29/11 CS 3343 Analysis of Algorithms 1 We have seen so far Algorithms for various problems Running

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

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Problem set 8: solutions 1. Fix constants a R and b > 1. For n N, let f(n) = n a and g(n) = b n. Prove that f(n) = o ( g(n) ). Solution. First we observe that g(n) 0 for all

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

COMP 382. Unit 10: NP-Completeness

COMP 382. Unit 10: NP-Completeness COMP 382 Unit 10: NP-Completeness Time complexity 1 log n n n 2 n 3 2 n n n Space complexity 1 log n n n 2 n 3 2 n n n Complexity theory Focus on decidability (yes/no) problems What is P? Deterministic,

More information

Preliminaries and Complexity Theory

Preliminaries and Complexity Theory Preliminaries and Complexity Theory Oleksandr Romanko CAS 746 - Advanced Topics in Combinatorial Optimization McMaster University, January 16, 2006 Introduction Book structure: 2 Part I Linear Algebra

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

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

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

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

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

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

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

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

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

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

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

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

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

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

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information