SlideShare a Scribd company logo
Lecture 19:
Introduction to NP-Completeness
         Steven Skiena

Department of Computer Science
 State University of New York
 Stony Brook, NY 11794–4400

http://www.cs.sunysb.edu/∼skiena
Reporting to the Boss
Suppose you fail to find a fast algorithm. What can you tell
your boss?
 • “I guess I’m too dumb. . . ” (dangerous confession)
 • “There is no fast algorithm!” (lower bound proof)
 • “I can’t solve it, but no one else in the world can,
   either. . . ” (NP-completeness reduction)
The Theory of NP-Completeness
Several times this semester we have encountered problems
for which we couldn’t find efficient algorithms, such as the
traveling salesman problem.
We also couldn’t prove exponential-time lower bounds for
these problems.
By the early 1970s, literally hundreds of problems were stuck
in this limbo. The theory of NP-Completeness, developed by
Stephen Cook and Richard Karp, provided the tools to show
that all of these problems were really the same problem.
The Main Idea
Suppose I gave you the following algorithm to solve the
bandersnatch problem:
Bandersnatch(G)
     Convert G to an instance of the Bo-billy problem Y .
     Call the subroutine Bo-billy on Y to solve this instance.
     Return the answer of Bo-billy(Y ) as the answer to G.
Such a translation from instances of one type of problem to
instances of another type such that answers are preserved is
called a reduction.
What Does this Imply?
Now suppose my reduction translates G to Y in O(P (n)):
1. If my Bo-billy subroutine ran in O(P (n)) I can solve the
   Bandersnatch problem in O(P (n) + P (n ))
2. If I know that Ω(P (n)) is a lower-bound to compute
   Bandersnatch, then Ω(P (n) − P (n )) must be a lower-
   bound to compute Bo-billy.
The second argument is the idea we use to prove problems
hard!
What is a Problem?
A problem is a general question, with parameters for the input
and conditions on what is a satisfactory answer or solution.
Example: The Traveling Salesman
Problem: Given a weighted graph G, what tour {v1 , v2, ..., vn}
minimizes n−1 d[vi, vi+1] + d[vn, v1].
            i=1
What is an Instance?
An instance is a problem with the input parameters specified.
TSP instance: d[v1 , d2] = 10, d[v1, d3] = 5, d[v1, d4] = 9,
d[v2, d3] = 6, d[v2 , d4] = 9, d[v3 , d4 ] = 3
                                       1




                              10               5       9

                                   6   3           3

                                           9
                          2                                4




Solution: {v1 , v2, v3, v4} cost= 27
Input Encodings
Note that there are many possible ways to encode the input
graph: adjacency matrices, edge lists, etc. All reasonable
encodings will be within polynomial size of each other.
The fact that we can ignore minor differences in encoding
is important. We are concerned with the difference between
algorithms which are polynomial and exponential in the size
of the input.
Decision Problems
A problem with answers restricted to yes and no is called
a decision problem. Most interesting optimization problems
can be phrased as decision problems which capture the
essence of the computation.
For convenience, from now on we will talk only about
decision problems.
The Traveling Salesman Decision Problem
Given a weighted graph G and integer k, does there exist a
traveling salesman tour with cost ≤ k?
Using binary search and the decision version of the problem
we can find the optimal TSP solution.
Reductions
Reducing (tranforming) one algorithm problem A to another
problem B is an argument that if you can figure out how to
solve B then you can solve A.
We showed that many algorithm problems are reducible to
sorting (e.g. element uniqueness, mode, etc.).
A computer scientist and an engineer wanted some tea. . .
Satisfiability
Consider the following logic problem:
Instance: A set V of variables and a set of clauses C over V .
Question: Does there exist a satisfying truth assignment for
C?
Example 1: V = v1, v2 and C = {{v1, v2 }, {v1 , v2}}
A clause is satisfied when at least one literal in it is TRUE. C
is satisfied when v1 = v2 =TRUE.
Not Satisfiable
Example 2: V = v1, v2,
               C = {{v1, v2}, {v1, v 2}, {v 1}}
Although you try, and you try, and you try and you try, you
can get no satisfaction.
There is no satisfying assigment since v1 must be FALSE
(third clause), so v2 must be FALSE (second clause), but then
the first clause is unsatisfiable!

More Related Content

What's hot

Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
Amrinder Arora
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
Tsp is NP-Complete
Tsp is NP-CompleteTsp is NP-Complete
Tsp is NP-Complete
Emre Can Kucukoglu
 
Cerutti--TAFA 2011
Cerutti--TAFA 2011Cerutti--TAFA 2011
Cerutti--TAFA 2011
Federico Cerutti
 
Introduction to Approximation Algorithms
Introduction to Approximation AlgorithmsIntroduction to Approximation Algorithms
Introduction to Approximation Algorithms
Jhoirene Clemente
 
Dynamic Programming - Part 1
Dynamic Programming - Part 1Dynamic Programming - Part 1
Dynamic Programming - Part 1
Amrinder Arora
 
Automatski - Solution to NP-Complete Graph Coloring
Automatski - Solution to NP-Complete Graph ColoringAutomatski - Solution to NP-Complete Graph Coloring
Automatski - Solution to NP-Complete Graph Coloring
Aditya Yadav
 
lecture 28
lecture 28lecture 28
lecture 28
sajinsc
 
lecture 29
lecture 29lecture 29
lecture 29
sajinsc
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
Andres Mendez-Vazquez
 
Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)
Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)
Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)
Fynn McKay
 
CS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questio
CS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questioCS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questio
CS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questio
Karthik Venkatachalam
 
Daa notes 3
Daa notes 3Daa notes 3
Daa notes 3
smruti sarangi
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programming
zukun
 
Stamford university bangladesh
Stamford university bangladeshStamford university bangladesh
Stamford university bangladesh
Rj Porosh
 
lecture 27
lecture 27lecture 27
lecture 27
sajinsc
 
Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)
Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)
Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)
Universitat Politècnica de Catalunya
 
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUSQUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
JAMBIKA
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 

What's hot (20)

Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
 
NP completeness
NP completenessNP completeness
NP completeness
 
Tsp is NP-Complete
Tsp is NP-CompleteTsp is NP-Complete
Tsp is NP-Complete
 
Cerutti--TAFA 2011
Cerutti--TAFA 2011Cerutti--TAFA 2011
Cerutti--TAFA 2011
 
Introduction to Approximation Algorithms
Introduction to Approximation AlgorithmsIntroduction to Approximation Algorithms
Introduction to Approximation Algorithms
 
Dynamic Programming - Part 1
Dynamic Programming - Part 1Dynamic Programming - Part 1
Dynamic Programming - Part 1
 
Automatski - Solution to NP-Complete Graph Coloring
Automatski - Solution to NP-Complete Graph ColoringAutomatski - Solution to NP-Complete Graph Coloring
Automatski - Solution to NP-Complete Graph Coloring
 
lecture 28
lecture 28lecture 28
lecture 28
 
lecture 29
lecture 29lecture 29
lecture 29
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
 
Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)
Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)
Solution to Black-Scholes P.D.E. via Finite Difference Methods (MatLab)
 
CS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questio
CS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questioCS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questio
CS 6402 – DESIGN AND ANALYSIS OF ALGORITHMS questio
 
Daa notes 3
Daa notes 3Daa notes 3
Daa notes 3
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programming
 
Stamford university bangladesh
Stamford university bangladeshStamford university bangladesh
Stamford university bangladesh
 
lecture 27
lecture 27lecture 27
lecture 27
 
Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)
Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)
Language Model (D3L1 Deep Learning for Speech and Language UPC 2017)
 
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUSQUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 

Viewers also liked

Optimal Algorithm
Optimal AlgorithmOptimal Algorithm
Optimal Algorithmguest628caa
 
Np hard
Np hardNp hard
Np hard
jesal_joshi
 
Lru Counter
Lru CounterLru Counter
Lru Counter
guest628caa
 
Lru Stack
Lru StackLru Stack
Lru Stack
guest628caa
 
Graph theory in Practise
Graph theory in PractiseGraph theory in Practise
Graph theory in Practise
David Simons
 
CS6702 graph theory and applications notes pdf book
CS6702 graph theory and applications notes pdf bookCS6702 graph theory and applications notes pdf book
CS6702 graph theory and applications notes pdf book
appasami
 
NP Complete Problems in Graph Theory
NP Complete Problems in Graph TheoryNP Complete Problems in Graph Theory
NP Complete Problems in Graph Theory
Seshagiri Rao Kornepati
 

Viewers also liked (7)

Optimal Algorithm
Optimal AlgorithmOptimal Algorithm
Optimal Algorithm
 
Np hard
Np hardNp hard
Np hard
 
Lru Counter
Lru CounterLru Counter
Lru Counter
 
Lru Stack
Lru StackLru Stack
Lru Stack
 
Graph theory in Practise
Graph theory in PractiseGraph theory in Practise
Graph theory in Practise
 
CS6702 graph theory and applications notes pdf book
CS6702 graph theory and applications notes pdf bookCS6702 graph theory and applications notes pdf book
CS6702 graph theory and applications notes pdf book
 
NP Complete Problems in Graph Theory
NP Complete Problems in Graph TheoryNP Complete Problems in Graph Theory
NP Complete Problems in Graph Theory
 

Similar to Skiena algorithm 2007 lecture19 introduction to np complete

Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
Techglyphs
 
Teori pnp
Teori pnpTeori pnp
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
Jyotsna Suryadevara
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4
Deepak John
 
Lecture11
Lecture11Lecture11
Lecture11
Nv Thejaswini
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
Ankit Katiyar
 
Confidence interval two tail tests-lower bounds upperbounds
Confidence interval two tail tests-lower bounds upperboundsConfidence interval two tail tests-lower bounds upperbounds
Confidence interval two tail tests-lower bounds upperbounds
ssuser3c3f88
 
Crt
CrtCrt
Chap12 slides
Chap12 slidesChap12 slides
Chap12 slides
BaliThorat1
 
Algorithm Design and Complexity - Course 6
Algorithm Design and Complexity - Course 6Algorithm Design and Complexity - Course 6
Algorithm Design and Complexity - Course 6
Traian Rebedea
 
Skiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionSkiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reduction
zukun
 
Np completeness
Np completenessNp completeness
Np completeness
Rajendran
 
Design and Analysis of Algorithm Brute Force 1.ppt
Design and Analysis of Algorithm Brute Force 1.pptDesign and Analysis of Algorithm Brute Force 1.ppt
Design and Analysis of Algorithm Brute Force 1.ppt
moiza354
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
أحلام انصارى
 
Introduction
IntroductionIntroduction
Introduction
Gopi Saiteja
 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notes
Prof. Dr. K. Adisesha
 
Approx
ApproxApprox
Approx
guest0264d3b
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
IT Engineering Department
 
UNIT -IV DAA.pdf
UNIT  -IV DAA.pdfUNIT  -IV DAA.pdf
UNIT -IV DAA.pdf
Arivukkarasu Dhanapal
 

Similar to Skiena algorithm 2007 lecture19 introduction to np complete (20)

Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
 
Teori pnp
Teori pnpTeori pnp
Teori pnp
 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4
 
Lecture11
Lecture11Lecture11
Lecture11
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Confidence interval two tail tests-lower bounds upperbounds
Confidence interval two tail tests-lower bounds upperboundsConfidence interval two tail tests-lower bounds upperbounds
Confidence interval two tail tests-lower bounds upperbounds
 
Crt
CrtCrt
Crt
 
Chap12 slides
Chap12 slidesChap12 slides
Chap12 slides
 
Algorithm Design and Complexity - Course 6
Algorithm Design and Complexity - Course 6Algorithm Design and Complexity - Course 6
Algorithm Design and Complexity - Course 6
 
Skiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionSkiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reduction
 
Np completeness
Np completenessNp completeness
Np completeness
 
Design and Analysis of Algorithm Brute Force 1.ppt
Design and Analysis of Algorithm Brute Force 1.pptDesign and Analysis of Algorithm Brute Force 1.ppt
Design and Analysis of Algorithm Brute Force 1.ppt
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 
Introduction
IntroductionIntroduction
Introduction
 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notes
 
Approx
ApproxApprox
Approx
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
UNIT -IV DAA.pdf
UNIT  -IV DAA.pdfUNIT  -IV DAA.pdf
UNIT -IV DAA.pdf
 

More from zukun

My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
zukun
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCV
zukun
 
ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Information
zukun
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statistics
zukun
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibration
zukun
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
zukun
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
zukun
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
zukun
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
zukun
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectors
zukun
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-intro
zukun
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
zukun
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video search
zukun
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video search
zukun
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learning
zukun
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer vision
zukun
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick start
zukun
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
zukun
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structures
zukun
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities
zukun
 

More from zukun (20)

My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCV
 
ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Information
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statistics
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibration
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectors
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-intro
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video search
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video search
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learning
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer vision
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick start
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structures
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities
 

Recently uploaded

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 

Recently uploaded (20)

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 

Skiena algorithm 2007 lecture19 introduction to np complete

  • 1. Lecture 19: Introduction to NP-Completeness Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794–4400 http://www.cs.sunysb.edu/∼skiena
  • 2. Reporting to the Boss Suppose you fail to find a fast algorithm. What can you tell your boss? • “I guess I’m too dumb. . . ” (dangerous confession) • “There is no fast algorithm!” (lower bound proof) • “I can’t solve it, but no one else in the world can, either. . . ” (NP-completeness reduction)
  • 3. The Theory of NP-Completeness Several times this semester we have encountered problems for which we couldn’t find efficient algorithms, such as the traveling salesman problem. We also couldn’t prove exponential-time lower bounds for these problems. By the early 1970s, literally hundreds of problems were stuck in this limbo. The theory of NP-Completeness, developed by Stephen Cook and Richard Karp, provided the tools to show that all of these problems were really the same problem.
  • 4. The Main Idea Suppose I gave you the following algorithm to solve the bandersnatch problem: Bandersnatch(G) Convert G to an instance of the Bo-billy problem Y . Call the subroutine Bo-billy on Y to solve this instance. Return the answer of Bo-billy(Y ) as the answer to G. Such a translation from instances of one type of problem to instances of another type such that answers are preserved is called a reduction.
  • 5. What Does this Imply? Now suppose my reduction translates G to Y in O(P (n)): 1. If my Bo-billy subroutine ran in O(P (n)) I can solve the Bandersnatch problem in O(P (n) + P (n )) 2. If I know that Ω(P (n)) is a lower-bound to compute Bandersnatch, then Ω(P (n) − P (n )) must be a lower- bound to compute Bo-billy. The second argument is the idea we use to prove problems hard!
  • 6. What is a Problem? A problem is a general question, with parameters for the input and conditions on what is a satisfactory answer or solution. Example: The Traveling Salesman Problem: Given a weighted graph G, what tour {v1 , v2, ..., vn} minimizes n−1 d[vi, vi+1] + d[vn, v1]. i=1
  • 7. What is an Instance? An instance is a problem with the input parameters specified. TSP instance: d[v1 , d2] = 10, d[v1, d3] = 5, d[v1, d4] = 9, d[v2, d3] = 6, d[v2 , d4] = 9, d[v3 , d4 ] = 3 1 10 5 9 6 3 3 9 2 4 Solution: {v1 , v2, v3, v4} cost= 27
  • 8. Input Encodings Note that there are many possible ways to encode the input graph: adjacency matrices, edge lists, etc. All reasonable encodings will be within polynomial size of each other. The fact that we can ignore minor differences in encoding is important. We are concerned with the difference between algorithms which are polynomial and exponential in the size of the input.
  • 9. Decision Problems A problem with answers restricted to yes and no is called a decision problem. Most interesting optimization problems can be phrased as decision problems which capture the essence of the computation. For convenience, from now on we will talk only about decision problems.
  • 10. The Traveling Salesman Decision Problem Given a weighted graph G and integer k, does there exist a traveling salesman tour with cost ≤ k? Using binary search and the decision version of the problem we can find the optimal TSP solution.
  • 11. Reductions Reducing (tranforming) one algorithm problem A to another problem B is an argument that if you can figure out how to solve B then you can solve A. We showed that many algorithm problems are reducible to sorting (e.g. element uniqueness, mode, etc.). A computer scientist and an engineer wanted some tea. . .
  • 12. Satisfiability Consider the following logic problem: Instance: A set V of variables and a set of clauses C over V . Question: Does there exist a satisfying truth assignment for C? Example 1: V = v1, v2 and C = {{v1, v2 }, {v1 , v2}} A clause is satisfied when at least one literal in it is TRUE. C is satisfied when v1 = v2 =TRUE.
  • 13. Not Satisfiable Example 2: V = v1, v2, C = {{v1, v2}, {v1, v 2}, {v 1}} Although you try, and you try, and you try and you try, you can get no satisfaction. There is no satisfying assigment since v1 must be FALSE (third clause), so v2 must be FALSE (second clause), but then the first clause is unsatisfiable!