1 Joe Meehean.  Log: binary search in sorted array  Linear: traverse a tree  Log-Linear: insert into a heap  Quadratic (N 2 ): your sort from P1 

Slides:



Advertisements
Similar presentations
P, NP, NP-Complete Problems
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.
Problems and Their Classes
Complexity Classes: P and NP
Limitation of Computation Power – P, NP, and NP-complete
Lower Bounds for Sorting, Searching and Selection
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
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,
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
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
Design and Analysis of Algorithms NP-Completeness Haidong Xue Summer 2012, at GSU.
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
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.
Computability and Complexity 19-1 Computability and Complexity Andrei Bulatov Non-Deterministic Space.
Tractable and intractable problems for parallel computers
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Circuits CSE 373 Data Structures Lecture 22. 3/12/03Circuits - Lecture 222 Readings Reading ›Sections and 9.7.
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
EXAMPLE 3 Write an equation for a function
Themes of Presentations Rule-based systems/expert systems (Catie) Software Engineering (Khansiri) Fuzzy Logic (Mark) Configuration Systems (Sudhan) *
1 CSC 421: Algorithm Design & Analysis Spring 2013 Complexity & Computability  lower bounds on problems brute force, decision trees, adversary arguments,
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
CSCE350 Algorithms and Data Structure
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 11 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
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.
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.
Matt Schierholtz. Method for solving problems with finite steps Algorithm example: Error Check for problem Solve problem Must terminate.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
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.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
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.
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.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Cliff Shaffer Computer Science Computational Complexity.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
ATM, Halting Problem, P vs. NP Chapter 4, 5 & 7. Russel’s Paradox An Index is a book that lists other books in.
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
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.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
LIMITATIONS OF ALGORITHM POWER
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
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.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
P, NP, and NP-Complete Problems Section 10.3 The class P consists of all problems that can be solved in polynomial time, O(N k ), by deterministic computers.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
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.
CSC 172 P, NP, Etc.
Limitation of Computation Power – P, NP, and NP-complete
NP-Complete Problems.
Chapter 12: Theory of Computation
Data Structures Lab Algorithm Animation.
CSCI 2670 Introduction to Theory of Computing
Intro to NP Completeness
CLASSES P AND NP.
Halting Problem.
Chapter 11 Limitations of Algorithm Power
CSC 380: Design and Analysis of Algorithms
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Presentation transcript:

1 Joe Meehean

 Log: binary search in sorted array  Linear: traverse a tree  Log-Linear: insert into a heap  Quadratic (N 2 ): your sort from P1  Exponential (N N ): brute force map coloring 2

 Upper bound is N k for N inputs e.g., O(logN), O(N), O(NlogN), O(N 2 ), …  Problems in class P have known polynomial time solutions 3

 Slipping into computational theory  Deterministic programs like the ones we write in C++ must search or construct the correct answer if there are many possible solutions must check them all OR carefully construct the answer piece-wise 4

 Non-deterministic programs currently exist only in theory program guided by all knowing oracle oracle can create a possible solution to the problem for free solution is often the correct one  if a solution exists 5

 Think about reducing problem to yes/no  Given a potential solution to problem is it possible to determine whether it is correct in polynomial time  Problems like this are in the NP class if in NP, but not P then there is no known polynomial time solution for these problems but we can check answers in polynomial time 6

 e.g., graph coloring given a potential coloring of vertices for each vertex compare its colors to its neighbors O(E + V) = polynomial time only need one correct k coloring to prove graph can be colored with k colors 7

8 NP P

 Hardest problems in NP  Any problem in NP can be polynomially reduced to all NP complete problems NP problem A can be translated into NP complete problem B in polynomial time e.g. calculator  numbers entered in decimal  converted to binary and solved in binary  converted back to decimal  Min color graph coloring is NP complete 9

10 NP P NP Complete maybe

 If we can solve an NP complete problem A in polynomial time we can use it as a method (sub routine) to solve other NP problem B just translate the B into A in polynomial time solve A translate solution back into B polynomial time + polynomial time = polynomial time 11

 If we can solve an NP complete problem A in polynomial time we can solve ALL NP problems in polynomial time P = NP 12

13 NP P NP Complete

 P = NP?  No one has solved an NP complete problem in polynomial time  …Yet 14

 Problems that are impossible to solve using a Turing machine-based computer impossible to solve with modern computers  E.g., halting problem does a program have an infinite loop? proof is simple to explain proof is hard to understand  involves recursion and impossible outcomes 15

16