Introduction to Algorithms

Similar documents
P and NP (Millenium problem)

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

Introduction to Algorithms. Lecture 24. Prof. Patrick Jaillet

NP-Complete Reductions 2

NP-complete Reductions

CSE 417 Branch & Bound (pt 4) Branch & Bound

Introduction to Algorithms

NP-Complete Problems

Computational problems. Lecture 2: Combinatorial search and optimisation problems. Computational problems. Examples. Example

Steven Skiena. skiena

6.006 Introduction to Algorithms. Lecture 25: Complexity Prof. Erik Demaine

Traveling Salesperson Problem (TSP)

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

COMP 355 Advanced Algorithms Approximation Algorithms: VC and TSP Chapter 11 (KT) Section (CLRS)

Chapter 9 Graph Algorithms

Solutions for the Exam 6 January 2014

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

Chapter 9 Graph Algorithms

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Chapter 9 Graph Algorithms

Examples of P vs NP: More Problems

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang

NP-Hard (A) (B) (C) (D) 3 n 2 n TSP-Min any Instance V, E Question: Hamiltonian Cycle TSP V, n 22 n E u, v V H

P = NP; P NP. Intuition of the reduction idea:

NP-Complete Problems

Notes for Lecture 24

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Approximation Algorithms

Module 6 NP-Complete Problems and Heuristics

CS 4407 Algorithms. Lecture 8: Circumventing Intractability, using Approximation and other Techniques

CMPSCI611: The SUBSET-SUM Problem Lecture 18

Approximation Algorithms

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Module 6 NP-Complete Problems and Heuristics

Chapter 8. NP-complete problems

Practice Final Exam 1

Graphs and Algorithms 2016

Introduction to Graph Theory

Assignment No 2 (Group B)

NP-Completeness. Algorithms

Approximation Algorithms

CS 125 Section #10 Midterm 2 Review 11/5/14

1 Definition of Reduction

Lecture 21: Other Reductions Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Nondeterministic Polynomial Time

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

Module 6 NP-Complete Problems and Heuristics

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Some Hardness Proofs

8.1 Polynomial-Time Reductions

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

Complexity Classes and Polynomial-time Reductions

CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems

Problem 1. Which of the following is true of functions =100 +log and = + log? Problem 2. Which of the following is true of functions = 2 and =3?

Reductions. designing algorithms establishing lower bounds establishing intractability classifying problems. Bird s-eye view

Theorem 2.9: nearest addition algorithm

Prove, where is known to be NP-complete. The following problems are NP-Complete:

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems

6,8:15. MA/CSSE 473 Day 37. Student Questions. Kruskal data structures. Disjoint Set ADT. Complexity intro

Graphs and Algorithms 2015

Lecture 21: Other Reductions Steven Skiena

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Fixed Parameter Algorithms

Lecture 24: More Reductions (1997) Steven Skiena. skiena

1 The Traveling Salesperson Problem (TSP)

CSCE 350: Chin-Tser Huang. University of South Carolina

4.1 Review - the DPLL procedure

Lecture 7: Counting classes

Announcements. CSEP 521 Applied Algorithms. Announcements. Polynomial time efficiency. Definitions of efficiency 1/14/2013

Partha Sarathi Mandal

Computability Theory

CSE 417 Network Flows (pt 4) Min Cost Flows

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

CS 580: Algorithm Design and Analysis

3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability

Recitation 4: Elimination algorithm, reconstituted graph, triangulation

PSD1A. DESIGN AND ANALYSIS OF ALGORITHMS Unit : I-V

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d

Size of a problem instance: Bigger instances take

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

NP-Complete Chapter 8

MITOCW watch?v=zm5mw5nkzjg

Dynamic Programming II

(p 300) Theorem 7.27 SAT is in P iff P=NP

Lecture 10 October 7, 2014

Approximation Algorithms

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching

Time Complexity of an Algorithm

University of New Mexico Department of Computer Science. Final Examination. CS 362 Data Structures and Algorithms Spring, 2006

CS 361 Data Structures & Algs Lecture 15. Prof. Tom Hayes University of New Mexico

Lecture 3. Brute Force

Steiner Tree. Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij

Graphs. Carlos Moreno uwaterloo.ca EIT

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

CSE 373: Data Structures and Algorithms

Transcription:

Introduction to Algorithms 6.046J/18.401 Lecture 21 Prof. Piotr Indyk

P vs NP (interconnectedness of all things) A whole course by itself We ll do just two lectures More in 6.045, 6.840J, etc. Introduction to Algorithms May 6, 2003 L20.2

Have seen so far Algorithms for various problems Running times O(nm 2 ),O(n 2 ),O(n log n), O(n), etc. I.e., polynomial in the input size Can we solve all (or most of) interesting problems in polynomial time? Not really Introduction to Algorithms May 6, 2003 L20.3

Example difficult problem Traveling Salesperson Problem (TSP) Input: undirected graph with lengths on edges Output: shortest tour that visits each vertex exactly once Best known algorithm: O(n 2 n ) time. Introduction to Algorithms May 6, 2003 L20.4

Another difficult problem Clique: Input: undirected graph G=(V,E) Output: largest subset C of V such that every pair of vertices in C has an edge between them Best known algorithm: O(n 2 n ) time Introduction to Algorithms May 6, 2003 L20.5

What can we do? Spend more time designing algorithms for those problems People tried for a few decades, no luck Prove there is no polynomial time algorithm for those problems Would be great Seems really difficult Best lower bounds for natural problems: Ω(n 2 ) for restricted computational models 4.5n for unrestricted computational models Introduction to Algorithms May 6, 2003 L20.6

What else can we do? Show that those hard problems are essentially equivalent. I.e., if we can solve one of them in poly time, then all others can be solved in poly time as well. Works for at least 10 000 hard problems Introduction to Algorithms May 6, 2003 L20.7

The benefits of equivalence Combines research efforts If one problem has polytime solution, then all of them do P1 P2 P3 Introduction to Algorithms May 6, 2003 L20.8

A more realistic scenario Once an exponential lower bound is shown for one problem, it holds for all of them But someone is happy P1 P2 Ron Rivest P3 Introduction to Algorithms May 6, 2003 L20.9

Summing up If we show that a problem is equivalent to ten thousand other well studied problems without efficient algorithms, then we get a very strong evidence that is hard. We need to: Identify the class of problems of interest Define the notion of equivalence Prove the equivalence(s) Introduction to Algorithms May 6, 2003 L20.10

Class of problems: NP Decision problems: answer YES or NO. E.g., is there a tour of length K? Solvable in non-deterministic polynomial time: Intuitively: the solution can be verified in polynomial time E.g., if someone gives as a tour T, we can verify if T is a tour of length K. Therefore, TSP is in NP. Introduction to Algorithms May 6, 2003 L20.11

Formal definitions of P and NP A problem is solvable in poly time (or P), if there is a poly time algorithm V(.) such that for any input x: (x)=yes iff V(x)=YES A problem is solvable in non-deterministic poly time (or NP), if there is a poly time algorithm V(.,.) such that for any input x: (x)=yes iff there exists a certificate y of size poly( x ) such that V(x,y)=YES Introduction to Algorithms May 6, 2003 L20.12

Examples of problems in NP Is Does there exist a clique in G of size K in NP? Yes: V(x,y) interprets x as a graph G, y as a set C, and checks if all vertices in C are adjacent and if C K Is Sorting in NP? No, not a decision problem. Is Sortedness in NP? Yes: ignore y, and check if the input x is sorted. Is Compositeness in NP? Yes. In fact, for V as in Lecture 17, there are many certificates y. Introduction to Algorithms May 6, 2003 L20.13

Reductions: to x f(x )= x f A for YES NO YES NO A for Introduction to Algorithms May 6, 2003 L20.14

Reductions is poly time reducible to ( ) iff there is a poly time function f that maps inputs x to into inputs x of, such that for any x (x )=(f(x )) Fact: if P and then P Fact 2: if NP and then NP Fact 3: if and then Introduction to Algorithms May 6, 2003 L20.15

Recap We defined a large class of interesting problems, namely NP We have a way of saying that one problem is not harder than another ( ) Our goal: show equivalence between hard problems Introduction to Algorithms May 6, 2003 L20.16