SlideShare a Scribd company logo
1 of 12
David Luebke 1 1/4/2023
CS 332: Algorithms
NP Completeness Continued
David Luebke 2 1/4/2023
Homework 5
● Extension: due midnight Monday 22 April
David Luebke 3 1/4/2023
Review: Tractibility
● Some problems are undecidable: no computer
can solve them
■ E.g., Turing’s “Halting Problem”
■ We don’t care about such problems here; take a
theory class
● Other problems are decidable, but intractable:
as they grow large, we are unable to solve
them in reasonable time
■ What constitutes “reasonable time”?
David Luebke 4 1/4/2023
Review: P
● Some problems are provably decidable in
polynomial time on an ordinary computer
■ We say such problems belong to the set P
■ Technically, a computer with unlimited memory
■ How do we typically prove a problem  P?
David Luebke 5 1/4/2023
Review: NP
● Some problems are provably decidable in
polynomial time on a nondeterministic
computer
■ We say such problems belong to the set NP
■ Can think of a nondeterministic computer as a
parallel machine that can freely spawn an infinite
number of processes
■ How do we typically prove a problem  NP?
● Is P  NP? Why or why not?
David Luebke 6 1/4/2023
Review: P And NP Summary
● P = set of problems that can be solved in
polynomial time
● NP = set of problems for which a solution can
be verified in polynomial time
● P  NP
● The big question: Does P = NP?
David Luebke 7 1/4/2023
Review: NP-Complete Problems
● The NP-Complete problems are an interesting
class of problems whose status is unknown
■ No polynomial-time algorithm has been
discovered for an NP-Complete problem
■ No suprapolynomial lower bound has been proved
for any NP-Complete problem, either
● Intuitively and informally, what does it mean
for a problem to be NP-Complete?
David Luebke 8 1/4/2023
Review: Reduction
● A problem P can be reduced to another problem
Q if any instance of P can be rephrased to an
instance of Q, the solution to which provides a
solution to the instance of P
■ This rephrasing is called a transformation
● Intuitively: If P reduces in polynomial time to
Q, P is “no harder to solve” than Q
David Luebke 9 1/4/2023
An Aside: Terminology
● What is the difference between a problem and
an instance of that problem?
● To formalize things, we will express instances
of problems as strings
■ How can we express a instance of the hamiltonian
cycle problem as a string?
● To simplify things, we will worry only about
decision problems with a yes/no answer
■ Many problems are optimization problems, but we
can often re-cast those as decision problems
David Luebke 10 1/4/2023
NP-Hard and NP-Complete
● If P is polynomial-time reducible to Q, we
denote this P p Q
● Definition of NP-Hard and NP-Complete:
■ If all problems R  NP are reducible to P, then P is
NP-Hard
■ We say P is NP-Complete if P is NP-Hard
and P  NP
■ Note: I got this slightly wrong Friday
● If P p Q and P is NP-Complete, Q is also
NP- Complete
David Luebke 11 1/4/2023
Why Prove NP-Completeness?
● Though nobody has proven that P != NP, if
you prove a problem NP-Complete, most
people accept that it is probably intractable
● Therefore it can be important to prove that a
problem is NP-Complete
■ Don’t need to come up with an efficient algorithm
■ Can instead work on approximation algorithms
David Luebke 12 1/4/2023
Proving NP-Completeness
● What steps do we have to take to prove a
problem P is NP-Complete?
■ Pick a known NP-Complete problem Q
■ Reduce Q to P
○ Describe a transformation that maps instances of Q to
instances of P, s.t. “yes” for P = “yes” for Q
○ Prove the transformation works
○ Prove it runs in polynomial time
■ Oh yeah, prove P  NP (What if you can’t?)

More Related Content

Similar to np complete.ppt

Similar to np complete.ppt (16)

CNIT 141 9. Hard Problems
CNIT 141 9. Hard ProblemsCNIT 141 9. Hard Problems
CNIT 141 9. Hard Problems
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
CNIT 141: 9. Hard Problems
CNIT 141: 9. Hard ProblemsCNIT 141: 9. Hard Problems
CNIT 141: 9. Hard Problems
 
AA ppt9107
AA ppt9107AA ppt9107
AA ppt9107
 
lecture 27
lecture 27lecture 27
lecture 27
 
A Survey Of NP-Complete Puzzles
A Survey Of NP-Complete PuzzlesA Survey Of NP-Complete Puzzles
A Survey Of NP-Complete Puzzles
 
P versus NP
P versus NPP versus NP
P versus NP
 
Discrete Markov Random Field Relaxation
Discrete Markov Random Field RelaxationDiscrete Markov Random Field Relaxation
Discrete Markov Random Field Relaxation
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
 
NP Complete Problems
NP Complete ProblemsNP Complete Problems
NP Complete Problems
 
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
 
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxmteteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
 
Complexity theory
Complexity theory Complexity theory
Complexity theory
 
Np completeness
Np completenessNp completeness
Np completeness
 
Poscat seminar 6
Poscat seminar 6Poscat seminar 6
Poscat seminar 6
 

More from chetanvchaudhari

More from chetanvchaudhari (8)

chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
 
auditing-190520092523.pdf
auditing-190520092523.pdfauditing-190520092523.pdf
auditing-190520092523.pdf
 
chapter2-190516054412.pdf
chapter2-190516054412.pdfchapter2-190516054412.pdf
chapter2-190516054412.pdf
 
BranchandBoundAlgorithms[1].ppt
BranchandBoundAlgorithms[1].pptBranchandBoundAlgorithms[1].ppt
BranchandBoundAlgorithms[1].ppt
 
graph coloring.ppt
graph coloring.pptgraph coloring.ppt
graph coloring.ppt
 
chapter16[1].ppt
chapter16[1].pptchapter16[1].ppt
chapter16[1].ppt
 
M.tech computerunitwise
M.tech computerunitwiseM.tech computerunitwise
M.tech computerunitwise
 
Format for address_change_by_mpmla_gazzeted_officer
Format for address_change_by_mpmla_gazzeted_officerFormat for address_change_by_mpmla_gazzeted_officer
Format for address_change_by_mpmla_gazzeted_officer
 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 

np complete.ppt

  • 1. David Luebke 1 1/4/2023 CS 332: Algorithms NP Completeness Continued
  • 2. David Luebke 2 1/4/2023 Homework 5 ● Extension: due midnight Monday 22 April
  • 3. David Luebke 3 1/4/2023 Review: Tractibility ● Some problems are undecidable: no computer can solve them ■ E.g., Turing’s “Halting Problem” ■ We don’t care about such problems here; take a theory class ● Other problems are decidable, but intractable: as they grow large, we are unable to solve them in reasonable time ■ What constitutes “reasonable time”?
  • 4. David Luebke 4 1/4/2023 Review: P ● Some problems are provably decidable in polynomial time on an ordinary computer ■ We say such problems belong to the set P ■ Technically, a computer with unlimited memory ■ How do we typically prove a problem  P?
  • 5. David Luebke 5 1/4/2023 Review: NP ● Some problems are provably decidable in polynomial time on a nondeterministic computer ■ We say such problems belong to the set NP ■ Can think of a nondeterministic computer as a parallel machine that can freely spawn an infinite number of processes ■ How do we typically prove a problem  NP? ● Is P  NP? Why or why not?
  • 6. David Luebke 6 1/4/2023 Review: P And NP Summary ● P = set of problems that can be solved in polynomial time ● NP = set of problems for which a solution can be verified in polynomial time ● P  NP ● The big question: Does P = NP?
  • 7. David Luebke 7 1/4/2023 Review: NP-Complete Problems ● The NP-Complete problems are an interesting class of problems whose status is unknown ■ No polynomial-time algorithm has been discovered for an NP-Complete problem ■ No suprapolynomial lower bound has been proved for any NP-Complete problem, either ● Intuitively and informally, what does it mean for a problem to be NP-Complete?
  • 8. David Luebke 8 1/4/2023 Review: Reduction ● A problem P can be reduced to another problem Q if any instance of P can be rephrased to an instance of Q, the solution to which provides a solution to the instance of P ■ This rephrasing is called a transformation ● Intuitively: If P reduces in polynomial time to Q, P is “no harder to solve” than Q
  • 9. David Luebke 9 1/4/2023 An Aside: Terminology ● What is the difference between a problem and an instance of that problem? ● To formalize things, we will express instances of problems as strings ■ How can we express a instance of the hamiltonian cycle problem as a string? ● To simplify things, we will worry only about decision problems with a yes/no answer ■ Many problems are optimization problems, but we can often re-cast those as decision problems
  • 10. David Luebke 10 1/4/2023 NP-Hard and NP-Complete ● If P is polynomial-time reducible to Q, we denote this P p Q ● Definition of NP-Hard and NP-Complete: ■ If all problems R  NP are reducible to P, then P is NP-Hard ■ We say P is NP-Complete if P is NP-Hard and P  NP ■ Note: I got this slightly wrong Friday ● If P p Q and P is NP-Complete, Q is also NP- Complete
  • 11. David Luebke 11 1/4/2023 Why Prove NP-Completeness? ● Though nobody has proven that P != NP, if you prove a problem NP-Complete, most people accept that it is probably intractable ● Therefore it can be important to prove that a problem is NP-Complete ■ Don’t need to come up with an efficient algorithm ■ Can instead work on approximation algorithms
  • 12. David Luebke 12 1/4/2023 Proving NP-Completeness ● What steps do we have to take to prove a problem P is NP-Complete? ■ Pick a known NP-Complete problem Q ■ Reduce Q to P ○ Describe a transformation that maps instances of Q to instances of P, s.t. “yes” for P = “yes” for Q ○ Prove the transformation works ○ Prove it runs in polynomial time ■ Oh yeah, prove P  NP (What if you can’t?)