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.

Slides:



Advertisements
Similar presentations
1 P, NP, and NP-Complete Dr. Ying Lu RAIK 283 Data Structures & Algorithms.
Advertisements

Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Polynomial-time reductions We have seen several reductions:
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,
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 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
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
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
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.
P, NP, and NP-Complete Suzan Köknar-Tezel.
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 UNIT -6 P, NP, and NP-Complete. 2 Tractability u Some problems are intractable: as they grow large, we are unable to solve them in reasonable time u.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
MCS312: NP-completeness and Approximation Algorithms
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,
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Summary  NP-hard and NP-complete  NP-completeness proof  Polynomial time reduction  List of NP-complete problems  Knapsack problem  Isomprphisim.
Polynomial-time reductions We have seen several reductions:
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
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.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Unit 9: Coping with NP-Completeness
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.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
NP-Complete Problems Algorithm : Design & Analysis [23]
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
“One ring to rule them all” Analogy (sort of) Lord of The Rings Computational Complexity “One problem to solve them all” “my preciousss…”
LIMITATIONS OF ALGORITHM POWER
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
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.
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
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
Chapter 10 NP-Complete Problems.
Lecture 2-2 NP Class.
Hard Problems Introduction to NP
Lecture 5 NP Class.
ICS 353: Design and Analysis of Algorithms
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
P, NP and NP-Complete Problems
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
P, NP and NP-Complete Problems
Our old list of problems
RAIK 283 Data Structures & Algorithms
Presentation transcript:

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 testing b Traveling salesman problem b Knapsack problem b Chess b Towers of Hanoi b Program termination

Design and Analysis of Algorithms - Chapter 102 Classifying a problem’s complexity Is there a polynomial-time algorithm that solves the problem? Possible answers: b yes b no because it can be proved that all algorithms take exponential timebecause it can be proved that all algorithms take exponential time because it can be proved that no algorithm exists at all to solve this problembecause it can be proved that no algorithm exists at all to solve this problem b don’t know b don’t know, but if such algorithm were to be found, then it would provide a means of solving many other problems in polynomial time

Design and Analysis of Algorithms - Chapter 103 Types of problems b Optimization problem: construct a solution that maximizes or minimizes some objective function b Decision problem: answer yes/no to a question Many problems will have decision and optimization versions. Eg: Traveling salesman problem b optimization: find hamiltonian cycle of minimum weight b decision: find hamiltonian cycle of weight < k

Design and Analysis of Algorithms - Chapter 104 Some more problems b Partition: Given n positive integers, determine whether it is possible to partition them into two disjoint subsets with the same sum b Bin packing: given n items whose sizes are positive rational numbers not larger than 1, put them into the smallest number of bins of size 1 b Graph coloring: For a given graph find its chromatic number, ie, the smallest number of colors that need to be assigned to the graph’s vertices so that no two adjacent vertices are assigned the same color b CNF satisfiability: Given a boolean expression in conjunctive normal form (conjunction of disjunctions of literals), is there a truth assignment to the variables that makes the expression true?

Design and Analysis of Algorithms - Chapter 105 The class P P: the class of decision problems that are solvable in O(p(n)), where p(n) is a polynomial on n Why polynomial? b if not, very inefficient b nice closure properties b machine independent in a strong sense

Design and Analysis of Algorithms - Chapter 106 The class NP NP: the class of decision problems that are solvable in polynomial time on a nondeterministic machine b (A determinstic computer is what we know) b A nondeterministic computer is one that can “guess” the right answer or solution b Thus NP can also be thought of as the class of problems whose solutions can be verified in polynomial time; orwhose solutions can be verified in polynomial time; or that can be solved in polynomial time on a machine that can pursue infinitely many paths of the computation in parallelthat can be solved in polynomial time on a machine that can pursue infinitely many paths of the computation in parallel b Note that NP stands for “Nondeterministic Polynomial- time”

Design and Analysis of Algorithms - Chapter 107 Example: CNF satisfiability b This problem is in NP. Nondeterministic algorithm: Guess truth assignmentGuess truth assignment Check assignment to see if it satisfies CNF formulaCheck assignment to see if it satisfies CNF formula b Example: (A⋁¬B ⋁ ¬C ) ⋀ (¬A ⋁ B) ⋀ (¬ B ⋁ D ⋁ F ) ⋀ (F ⋁ ¬ D) b Truth assignments: A B C D E F A B C D E F (how many more?) b Checking phase: Θ(n)

Design and Analysis of Algorithms - Chapter 108 Where are we now? b Exhibited nondeterministic poly-time algorithm for CNF- satisfiability b CNF-sat is in NP b Similar algorithms can be found for TPS, HC, Partition, etc proving that these problems are also in NP b All the problems in P can also be solved in this manner (but no guessing is necessary), so we have: P ⊆ NP b Big question: P = NP ?

Design and Analysis of Algorithms - Chapter 109 NP-complete problems b A decision problem D is NP-complete iff 1.D ∈ NP 2.every problem in NP is polynomial-time reducible to D b Cook’s theorem (1971): CNF-sat is NP-complete b Other NP-complete problems obtained through polynomial-time reductions of known NP-complete problems b The class of NP-complete problems is denoted NPC

Design and Analysis of Algorithms - Chapter 1010 Reductions b Example: Polynomial-time reduction of directed HC to undirected HC y v u x y3y3 v3v3 What does this prove? HC is harder or easier for directed graphs? HC is harder or easier for directed graphs? if HC is NPC for directed graphs, is it also NPC for undirected graphs? if HC is NPC for directed graphs, is it also NPC for undirected graphs? OR OR if HC is NPC for undirected graphs, is it also NPC for directed graphs? if HC is NPC for undirected graphs, is it also NPC for directed graphs? → x3x3 x2x2 x1x1 y1y1 y2y2 u1u1 u2u2 u3u3 v2v2 v1v1