CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

NP-Hard Nattee Niparnan.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Department of Computer Science & Engineering
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
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 
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
MCS312: NP-completeness and Approximation Algorithms
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.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
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.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
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.
P, NP, and Exponential Problems Should have had all this in CS 252 – Quick review Many problems have an exponential number of possibilities and we can.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
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.
NP-Complete Problems Algorithm : Design & Analysis [23]
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
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.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
CSC 172 P, NP, Etc.
The Theory of NP-Completeness
P & NP.
Chapter 10 NP-Complete Problems.
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.
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Lecture 23 NP-Hard Problems
Presentation transcript:

CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin

Outline Decision, Search and Optimization Class P & Class NP Reductions NP-Completeness 2

Problems in Different Forms Decision Problem, the answer is simply “YES” or “NO” Search Problem, find a solution satisfying some properties if one exists, else return it doesn’t exist Optimization Problem, each solution has an associated value, find a solution with best value (min / max) 3

Three Forms of CLIQUE Optimization Problem Given a graph G, find a largest clique in G no harder than Usually, it’s enough to consider Decision Problem in complexity theory 4

Language and Decision Problem are Equivalent Decision Problem to Language Given a Decision Problem Encode all the instances into bit strings The corresponding language contains all the strings of “YES” instances 5

Class P V.S. Class NP P stands for what? Polynomial ! Class P: Problems solvable in deterministic polynomial time What about NP?  No Problem?  Not Polynomial (i.e. polynomial time unsolvable)? Nondeterministic Polynomial ! Class NP: Problems solvable in nondeterministic polynomial time 6

Deterministic/Nondeterministic Polynomial time? Where do these terms come from? They’re based on different computation models  Deterministic Turing Machine  Nondeterministic Turing Machine We will NOT talk about Turing Machine in this course Details of these computation models, please refer to the following course  CSCI3130 (Formal Languages and Automata Theory) 7

An Equivalent Definition of Class NP Class NP: Problems checkable or verifiable in polynomial time Verification:  Given a “certificate” of a solution, we could verify that the certificate is correct, e.g.  Certificate for SAT would be an assignment  Certificate for Hamiltonian Cycle would be a sequence of n vertices, v 1, v 2, …, v n 8

Solvable V.S. Verifiable For a problem in P, we have polynomial time algorithm to solve it For a problem in NP, we have polynomial time verification algorithm to verify a certificate 9

Reductions Reduction: a transformation between instance α of Problem A and instance β of Problem B such that The transformation takes polynomial time  Polynomial in size of the input instance The answer for α is “YES” if and only if the answer for β is also “YES” 10

Reductions Polynomial Time Reduction Polynomial Time Algorithm for Problem B Polynomial Time Algorithm for Problem A αβ Yes No Yes No If problem A is reducible to problem B in polynomial time, then which problem is easier? AOrB ? Problem B is at least as hard as Problem A! 11

Two Ways to Use Reductions Suppose Problem A is reducible to Problem B Solve problem  If there exists efficient algorithm for Problem B, then we can solve Problem A efficiently Prove Hardness  If Problem A is hard, then Problem B is also hard Problem AProblem B Reduction Efficient algorithms Hardness 12

NP-Completeness Problem A is NP-complete if 1.Problem A is in NP 2.For any Problem A’ in NP, A’ is reducible to A in polynomial time Class NPC: The class of all NP-complete problems, which is a subclass of NP  The hardest problems in NP  Solve a problem in NPC, you can solve ALL problems in NP 13

NP = P ? NP P NPC ? 14

Proof of NP-Completeness Given a Problem A, prove that A is NP-complete Proof Scheme 1 Show Problem A is in NP (easier part) For all Problems in NP, reduce them to A in polynomial time  This has been done for 3SAT, the first NP-complete problem Proof Scheme 2 Show Problem A is in NP (easier part) For arbitrary problem A’ in NPC, reduce A’ to A in polynomial time  This would be much easier 15

NP-completeness of Longest Path Longest Path (Decision Version) Given a graph G and an integer k, decide whether G contains a simple path of length greater than k Part 1 (Longest Path in NP) Given any sequence of vertices, it’s easy to check the length and whether the sequence is a path, so Longest Path is in NP Part 2 (reduce special case to general form) The Longest Path contains Hamiltonian Path (k = n) as a special case, so we can reduce Hamiltonian Path (known in NPC) to Longest Path directly 16

Reduce SAT to 3SAT What about reduce general form to special case? This implies that even for the special case, the problem will NOT be easier This may also give clues where the hardness lies in Given an instance φ(x) of SAT, we transform it to an instance φ’(x,y) of 3SAT Clause in φ(x) Set of clauses in φ’(x,y) 17

Clause in φ(x) Set of clauses in φ’(x,y) True False True False True 18

Clause in φ(x) Set of clauses in φ’(x,y) 19

Thank You! Q & A ?