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

Similar documents
NP Complete Problems. COMP 215 Lecture 20

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

NP Completeness and Approximation Algorithms

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

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

Correctness of Dijkstra s algorithm

NP-Complete Problems. More reductions

1. Introduction Recap

Spring Lecture 21 NP-Complete Problems

Essential facts about NP-completeness:

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

CS 5114: Theory of Algorithms

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

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

INTRO TO COMPUTATIONAL COMPLEXITY

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

Design and Analysis of Algorithms

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

Turing Machines and Time Complexity

CSE 135: Introduction to Theory of Computation NP-completeness

Intro to Theory of Computation

Lecture 4: NP and computational intractability

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

Complexity, P and NP

Instructor N.Sadagopan Scribe: P.Renjith

3130CIT Theory of Computation

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-Complete Reductions 2

NP-Hardness reductions

NP and Computational Intractability

SAT, NP, NP-Completeness

Introduction. Pvs.NPExample

Polynomial-time Reductions

Nondeterministic Turing Machines

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

CS21 Decidability and Tractability

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

NP-Complete Reductions 1

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Polynomial-Time Reductions

Lecture 3: Nondeterminism, NP, and NP-completeness

Algorithm Design and Analysis

Introduction to Complexity Theory

NP and NP Completeness

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

P, NP, NP-Complete, and NPhard

More on NP and Reductions

CS154, Lecture 13: P vs NP

NP-Completeness and Boolean Satisfiability

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

DAA 8 TH UNIT DETAILS

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

BBM402-Lecture 11: The Class NP

Lecture 18: PCP Theorem and Hardness of Approximation I

Graduate Algorithms CS F-21 NP & Approximation Algorithms

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

CSCI 1590 Intro to Computational Complexity

NP-Completeness. NP-Completeness 1

CS Fall 2011 P and NP Carola Wenk

CS154, Lecture 13: P vs NP

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

There are two types of problems:

Computational Intractability 2010/4/15. Lecture 2

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

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

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

Show that the following problems are NP-complete

Algorithms Design & Analysis. Approximation Algorithm

Lecture 19: Finish NP-Completeness, conp and Friends

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

ECS122A Handout on NP-Completeness March 12, 2018

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

Non-Deterministic Time

Theory of Computation Time Complexity

Comp487/587 - Boolean Formulas

Advanced Topics in Theoretical Computer Science

Lecture Notes CS:5360 Randomized Algorithms Lecture 20 and 21: Nov 6th and 8th, 2018 Scribe: Qianhang Sun

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

Chapter 7: Time Complexity

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

Limitations of Algorithm Power

Lecture 18: More NP-Complete Problems

NP and Computational Intractability

Lecture 23: More PSPACE-Complete, Randomized Complexity

Geometric Steiner Trees

Notes for Lecture 2. Statement of the PCP Theorem and Constraint Satisfaction

Provable intractability. NP-completeness. Decision problems. P problems. Algorithms. Two causes of intractability:

More NP-Complete Problems

Complexity Classes V. More PCPs. Eric Rachlin

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

The Cook-Levin Theorem

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

NP-Completeness Part II

Theory of Computation Chapter 9

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness

SAT, Coloring, Hamiltonian Cycle, TSP

Polynomial-time reductions. We have seen several reductions:

Lecture 7: Polynomial time hierarchy

Transcription:

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 of the input parameters). No one has been able to prove that these problems are difficult and need this much time. Thus there is a gap in our understanding of these problems. We refer to these problems as intractable problems. Two examples are: Satisfiability (SAT) and Clique. In the last lecture we showed that SAT can be solved in O(2 n F ) time on any CNF Boolean forumla F on n variables. We also proved that we can solve the clique problem in O( ( n k) k 2 ) time on a graph with n nodes, k being the target clique size. These intractable problems have some properties in common. We ll identify them next. Nondeterminstic Algorithms A decision problem is one that has only two possible answers, namely, yes and no. For any problem, we can think of a decision version and an optimization version of it. For example, for the clique problem a decision version will have a graph G(V, E) and an integer k (1 k V ) as input. The problem is to check if G has a clique of size k. An optimization version will have a graph G(V, E) as the input and the problem is to identify the largest integer k (1 k V ) such that G has a clique of size k. If we have an efficient algorithm for the decision version of a problem, we might also be able to get an efficient algorithm for the optimization version. In our discussion of intractable problems, we consider only decision problems. A nondeterministic algorithm uses the same set of basic operations as a deterministic algorithm except that it has access to another operation called Choice. Choice takes as input a set S and returns an element of S. There is no rule that specifies how this choice has to be made. Whenever there is a set of choices that leads to a successful completion of the algorithm, then one such set of choices is always made. There are two phases in any nondeterministic algorithm. In the first phase Choice is used (possibly multiple times) to guess a solution to the problem at hand. The second phase is deterministic and is used to check the correctness of the guesses made in the first phase. Here is a nondeterministic algorithm for SAT: (Let F be the input Boolean CNF formula on n variables x 1, x 2,..., x n ). 1

Phase 1 for i = 1 to n do x i =Choice{T, F }; Phase 2 Check if the assignment guessed in Phase 1 satisfies F ; Run time analysis: Phase 2 takes O( F ) time. In Phase 1, n calls are made to Choice and each such call takes one unit of time. Thus the total run time of the algorithm is O(n + F ). This is indeed a linear time algorithm! Here is a nondeterministic algorithm for solving the clique problem. Let the input be the graph G(V, E) and the integer k: Phase 1 S = ; for i = 1 to k do x =Choice(V ); S = S {x}; Phase 2 Check if the k nodes in S form a clique; Run time analysis: If we assume that the graph is in adjacency matrix form, then Phase 2 can be completed in O(k 2 ) time. Phase 1 takes k steps. Thus the total run time is O(k 2 ). The complexity classes P and N P By a polynomial time we mean a run time of O(n c ) where c is any constant. The complexity class P is the collection of all the problems that can be solved in deterministic polynomial time. Example problems in P: sorting, MST, matrix multiplication, etc. The complexity class N P is the collection of all the problems that can be solved in nondterministic polynomial time. Example problems in N P: SAT, Clique, traveling salesperson problem, etc. One of the long-time unanswered questions is: Is P = N P? If a problem is in P, then, trivially, it is also in N P. Thus we infer: P N P. 2

Polynomial Time Reductions We say that a problem π 1 reduces to another problem π 2 if we can solve the problem π 1 using an algorithm known for solving π 2. For example, if π 1 is selection and π 2 is sorting, then π 1 reduces to π 2. If the problem π 1 reduces to the problem π 2, then it should be possible to convert any input x 1 for π 1 into a corresponding input x 2 for π 2. We can then solve π 2 on x 2 to get the answer y 2 (for π 2 ). y 2 is then converted into a relevant output y 1 for π 1. The steps involved in reducing π 1 to π 2 are summarized in the following figure: We say that a problem π 1 polynomially reduces to the problem π 2 if π 1 reduces to π 2 and Converter 1 and Converter 2 take a (deterministic) polynomial time each. We use the following notation: π 1 π 2. N P-hard and N P-complete Problems A problem π is said to be N P-hard if the problem π polynomially reduces to π for every π N P. The problem π is said to be N P-complete is π is N P-hard and π N P. Cook s Theorem: Cook showed that SAT is N P-complete. He showed that a Boolean formula in CNF can be constructed in polynomial time such that it simulates each and every step of a non-deterministic machine that runs for a polynomial amount of time. If the machine solves a problem π, then the Boolean formula will have a satisfying assignment if and only if the machine terminates with the answer yes. An equivalent definition for N P-complete problems: A problem π is N P-comlete if π N P and π π, for some problem π that is known to be N P-complete. This is the definition that is typically used to show N P-completeness of problems. 3

Lemma: If the problem π is N P-complete and if π P, then P = N P. Proof: Let π be any problem in N P. If π is N P-complete and π P, then we will show that π P that will imply that P = N P. Since π is N P-complete, it follows that π π for any π N P. Let x be any input for π. It follows that we can convert x into a corresponding input x for π in deterministic polynomial time. Let this polynomial be q(.). Let y be the answer of π on x. It also follows that y can be converted into a corresponding output y for π in deterministic polynomial time. Let this polynomial be r(.) Since π P, we can solve π on x in a determinstic polynomial time. Let this polynomial be p(.). Let the size of the input x be n. Then we realize that the size of x cannot be more than q(n) and that the size of y cannot be more than p(q(n)). As a result, it follows that π can be solved deterministically in time q(n) + p(q(n)) + r(p(q(n))) which is a constant degree polynomial in n. Specifically, if the degrees of the polynomials q(.), p(.), and r(.) are d 1, d 2, and d 3, respectively, then the above run time is a polynomial of degree d 1 d 2 d 3. Along the same lines we can also prove the following Lemma. Lemma: If π 1 π 2 and π 2 π 3, then, π 1 π 3. N P-completeness Proofs There are two steps involved in proving that a problem π is N P-complete: 1) show that π N P this is often easy; and 2) Show that π π for some known N P-complete problem π. To show that π 1 π 2 there are three steps: 1) Present an algorithm for Converter 1; 2) Show that this algorithm takes (deterministic) polynomial time; and 3) Prove that this reduction is correct. This involves two substeps: a) Prove that if the answer of π 1 on x 1 is yes then the answer of π 2 on x 2 is also yes and b) Show that if the answer of π 1 on x 1 is no then the answer of π 2 on x 2 is also no. Clique is N P-complete Now we will show that Clique is N P-complete. We have already shown that Clique is a member of N P. We will show that SAT Clique. Let F = C 1 C 2 C k be any Boolean formula in CNF. Here C 1, C 2,..., C k are clauses, where each clause if a disjunction of literals. (A literal is either a variable or its negation). The input for the Clique problem will be a graph and an integer. 4

We generate the following input for Clique: G(V, E); k, where there is a node in G for every literal in every clause of F. If x q is a literal in C i, then the node corresponding to this literal is denoted as (x q, i). Two nodes (x q, i) and (x r, j) will be connected by an edge if and only if i j and x q x r. An Example: Let F = (x 1 x 2 ) (x 2 x 3 x 1 ). In this case the input for the Clique will be G(V, E); 2, where V = {(x 1, 1), ( x 2, 1), (x 2, 2), (x 3, 2), ( x 1, 2)} and E = {((x 1, 1), (x 2, 2)), ((x 1, 1), (x 3, 2)), (( x 2, 1), (x 3, 2)), (( x 2, 1), ( x 1, 2))}. The proof will be completed in the next lecture. 5