Introduction to NP-Completeness Tahir Azim. The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also.

Slides:



Advertisements
Similar presentations
NP-Complete Problems CIT 596, Spring Problems that Cross the Line What if a problem has: o An exponential upper bound o A polynomial lower bound.
Advertisements

Lecture 19. Reduction: More Undecidable problems
Department of Computer Science & Engineering
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Computational problems, algorithms, runtime, hardness
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Computational Complexity CSC 172 SPRING 2002 LECTURE 27.
Analysis of Algorithms CS 477/677
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
P, NP, and NP-Complete Suzan Köknar-Tezel.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Hardness Results for Problems
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Hard Problems Fundamental Data Structures and Algorithms Vahe Poladian Slides courtesy of Michael Maxim April 11, 2003.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC 413/513: Intro to Algorithms NP Completeness.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Halting Problem Introduction to Computing Science and Programming I.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
CSC 413/513: Intro to Algorithms
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
CSC 172 P, NP, Etc.
The NP class. NP-completeness
P & NP.
Lecture 22 Complexity and Reductions
NP-Completeness Yin Tat Lee
NP-Completeness Yin Tat Lee
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
CSE 589 Applied Algorithms Spring 1999
Presentation transcript:

Introduction to NP-Completeness Tahir Azim

The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also problems that can’t be solved so easily… Moral: know thy problem!

P vs NP P = Problems that can be solved in polynomial time NP = Problems for which you can test the correctness of a solution in polynomial time –Example? Solutions in P are also in NP –But not necessarily vice versa Undecidable Problems: Cannot be solved by a computer. Picture Courtesy: Wikipedia

Examples of hard problems Long simple paths: Given a graph G, vertices s and t, and a number k, does there exist a path from s to t with at least k edges and no cycles? –In NP. Why? –In P? No! RSA: In NP, but not in P! Chess-Playing: In NP, but not in P! Halting Problem

Unsolvability of the halting problem Suppose P solves variant of halting problem –On input Q, assume P(Q) = Build program D –D(Q) = Does this make sense? What can D(D) do? –If D(D) halts, then D(D) runs forever. –If D(D) runs forever, then D(D) halts. –CONTRADICTION: program P must not exist. yes if Q(Q) halts no otherwise run forever if Q(Q) halts halt if Q(Q) runs forever

How to solve such problems? Heuristics Approximation Use the exponential time solution anyway Add more assumptions to simplify it

Is P=NP? If it's always easy to check a solution, should it also be easy to find the solution? Most famous open problem in theoretical CS Most expect it to be false, but there is no proof

NP-Complete Problems (NPC) The hardest of all problems in NP NP-hard: A problem that is at least as hard as any problem in NP –Does not necessarily have to be in NP, e.g. the Halting Problem A problem is said to be NP-complete if it is –(i) in NP –and (ii), it is NP-hard

How to prove if a problem Y is NP- hard By showing that an instance X of an NP-hard problem can be reduced to Y in polynomial time Informally, a problem A is reducible to B if A can be solved by using B as a sub-routine –i.e. if B returns “yes”, then A also returns yes. The idea is the following: –If Y was not NP-hard, then X could be solved “easily” by using Y –Therefore, X would no longer be a hard problem –X is NP-hard –Therefore, Y is NP-hard.

More common method (slightly different) Generally, a slightly different approach is used A problem Y is said to be NP-complete if it is –(i) in NP –and, (ii) an instance of an NP-complete problem can be reduced to Y in polynomial time Notation: X < p Y, Ǝ X Ɛ NPC Where did the first NP-complete problem come from? –Stephen Cook (1971) showed that SAT is an NP- complete problem from first principles

Examples of various NP-complete problems and their reductions Additional Problems: –Graph Coloring Karp's 21 NP- complete problems (1972) Picture Courtesy: Wikipedia

More of the good stuff… If you can prove one NP-complete problem to be solvable in polynomial time, you can prove that all others are also solvable in polynomial time One way to prove P=NP! Follow up: –Wikipedia, of course But check your sources! Don’t trust Wikipedia!