P, NP, NP-Complete Problems

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

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.
Introduction to Algorithms NP-Complete
Limitation of Computation Power – P, NP, and NP-complete
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.
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 
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 Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
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
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
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.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
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.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
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.
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.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
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.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
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.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
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.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
Limitation of Computation Power – P, NP, and NP-complete
NP-Complete Problems.
NP-completeness Ch.34.
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
NP-Completeness Yin Tat Lee
ICS 353: Design and Analysis of Algorithms
Approximation Algorithms
NP-Complete Problems.
NP-Completeness Yin Tat Lee
P, NP and NP-Complete Problems
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
P, NP and NP-Complete Problems
CSC 380: Design and Analysis of Algorithms
Our old list of problems
Presentation transcript:

P, NP, NP-Complete Problems

Polynomial Problems (P Family) The set of problems that can be solved in polynomial time These problems form the P family All problems we covered so far are in P P

Nondeterministic Polynomial (NP Family) The set of decision problems that can be verified in polynomial time Not necessarily solvable in polynomial time What does it mean: “decision problem” “verifiable” NP

Nondeterministic Polynomial (NP Family) (Cont’d) Decision Problem Problem where its outcome is either Yes or No Is there assignment of 0’s and 1’s to these Xi variables that make the expression = true? Is there a way to color the graph 3-way such that no two adjacent nodes have the same color? Is there a clique of size 5? Verifiable in Polynomial Time If I give you a candidate answer, you can verify whether it is correct or wrong in polynomial time That is different from finding the solution in polynomial time

Verifiable in Polynomial Time If I give you assignment for each Xi: >> if the expression is True If I give you color assignment: >> Check the number of colors is 3 >> Each that no two vertices are the same O(E) But the find a solution from scratch, it can be hard

P vs. NP NP family has set of problems known as “NP-Complete” NP P P is definitely subset of NP Every problem with poly-time solution is verifiable in poly-time Is it proper subset or equal? No one knows the answer NP P Most guesses are leaning towards P ≠ NP NP family has set of problems known as “NP-Complete” Hardest problems in NP No poly-time solution for NP-Complete problems yet

NP-Complete (NPC) NP P NPC A set of problems in NP So, they are decision problems Can be verified quickly (poly-time) They are hardest to solve The existing solutions are all exponential Known for 30 or 40 years, and no one managed to find poly-time solution for them Still, no one proved that no poly-time solution exist for NPC problems Property in NPC problem Problem X is NPC if any other problem in NP can be mapped (transformed) to X in polynomial time NP P NPC

NP-Complete (NPC) Cont’d Property in NPC problems Problem X is NPC if any other problem in NP can be mapped (transformed) to X in polynomial time So, Any two problems in NPC must transform to each other in poly-time X ----PolyTime-------> Y Y -----PolyTime ------> X Y NP NPC X This means if any problem in NPC is solved in poly-time  Then all NPC problems are solved in Poly-Time This will lead to P = NP

NPC Example I: Satisfiability Problem Given an expression of n variables Has m conjunctive sun-expressions Is there an assignment of 0’s and 1’s to each Xi that makes the exp = True?

NPC Example 2: Clique Problem Given a graph G(V, E) Clique: subset of vertices, where each pair of them is connected by an edge Is there a clique in G ? If there a clique of size m in G?

NPC Example 3: Graph Coloring Given a graph G (V, E) Is there coloring scheme of the vertices in G using 3-way colors such that no two adjacent vertices have the same color? BTW: 2-way graph coloring is solvable in poly-time

How to prove a new problem “Y” is NPC? Show it is in NP It is a decision problem Verifiable in poly-time Select any problem from NPC family (say X) Show that X transforms to Y in poly-time

NP-Hard Family It is a family of problems as hard as NPC problems But they are not decision problems Can be any type NP-Hard problems have exponential time solutions

NP-Hard Example: Travelling Salesman Problem Given a set of n cities and a pairwise distance function d(u, v) What is the shortest possible route that visits each city once and go back to the starting point

Full Diagram Most probable