Professional Documents
Culture Documents
CT065-3.5-3
NP Completeness
Level 3 – Computing (Software Engineering)
Topic & Structure of Lesson
• Motivation
• Introduction
– Computational problems
– Complexity classes
• P
– Definition
– Examples
• NP
– Definition
– Examples
Module Code and Module Title Title of Slides Slide 2 (of 27)
Learning Outcomes
Module Code and Module Title Title of Slides Slide 3 (of 27)
Motivation
Module Code and Module Title Title of Slides Slide 4 (of 27)
Motivation
Module Code and Module Title Title of Slides Slide 5 (of 27)
Motivation
Module Code and Module Title Title of Slides Slide 6 (of 27)
Motivation
Module Code and Module Title Title of Slides Slide 7 (of 27)
Motivation
Module Code and Module Title Title of Slides Slide 8 (of 27)
Introduction
Module Code and Module Title Title of Slides Slide 9 (of 27)
Introduction
Module Code and Module Title Title of Slides Slide 10 (of 27)
Introduction
Module Code and Module Title Title of Slides Slide 11 (of 27)
Introduction
Module Code and Module Title Title of Slides Slide 12 (of 27)
P and NP
Module Code and Module Title Title of Slides Slide 13 (of 27)
Decision Problems
Examples:
Given a string T and a string P, is P a substring of
T?
Module Code and Module Title Title of Slides Slide 14 (of 27)
Decision Problems
Example:
Does a weighted graph G, contain a
minimum spanning tree of k weight?
Module Code and Module Title Title of Slides Slide 15 (of 27)
Complexity Class P
• “Deterministic polynomial-time”
• In this theory, the class P consists of all
those decision problems that can be
solved (i.e. a “yes” output) on a
deterministic sequential machine in an
amount of time that is polynomial in the
size of the input
Module Code and Module Title Title of Slides Slide 16 (of 27)
Complexity Class P
Module Code and Module Title Title of Slides Slide 17 (of 27)
Complexity Class NP
• "Non-deterministic polynomial-time"
• the class NP consists of all those decision problems
where
a) positive solutions can be verified in polynomial time
by a deterministic Turing machine given the right
information
OR
Module Code and Module Title Title of Slides Slide 18 (of 27)
Complexity Class NP
Module Code and Module Title Title of Slides Slide 19 (of 27)
Complexity Class NP
Module Code and Module Title Title of Slides Slide 20 (of 27)
Complexity Class NP
Module Code and Module Title Title of Slides Slide 21 (of 27)
P and NP Question
Q: Is P = NP?
Module Code and Module Title Title of Slides Slide 22 (of 27)
P and NP Question
P = “easy” to solve.
NP = “easy” to check given solution. Producing
solution from scratch often harder than checking
presented solution.
Module Code and Module Title Title of Slides Slide 23 (of 27)
P and NP Question
So far, we have
NP Problems
P Problems
Module Code and Module Title Title of Slides Slide 24 (of 27)
P and NP Question
Module Code and Module Title Title of Slides Slide 25 (of 27)
Summary
Module Code and Module Title Title of Slides Slide 26 (of 27)
Q&A
Module Code and Module Title Title of Slides Slide 27 (of 27)