SlideShare a Scribd company logo
CS 332: Algorithms NP Completeness Continued: Reductions
Homework 7 Check the web later today… Change in grading policy: drop lowest hw
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 Open question: Does  P = NP ?
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
Review:  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 If P   p  Q and P is NP-Complete, Q is also NP- Complete
Review: Proving NP-Completeness What steps do we have to take to prove a problem Q   is NP-Complete? Pick a known NP-Complete problem P Reduce P to Q Describe a transformation that maps instances of P to instances of Q, s.t. “yes” for Q = “yes” for P Prove the transformation works Prove it runs in polynomial time Oh yeah, prove Q     NP  ( What if you can’t? )
Directed Hamiltonian Cycle   Undirected Hamiltonian Cycle What was the hamiltonian cycle problem again? For my next trick, I will reduce the  directed hamiltonian cycle   problem to the  undirected hamiltonian cycle   problem before your eyes Which variant am I proving NP-Complete? Draw a directed example on the board What transformation do I need to effect?
Transformation: Directed    Undirected Ham. Cycle  Transform graph G = (V, E) into G’ = (V’, E’): Every vertex  v  in V transforms into 3 vertices  v 1 ,  v 2 ,  v 3  in V’ with edges ( v 1 , v 2 ) and ( v 2 , v 3 ) in E’ Every directed edge ( v ,  w ) in E transforms into the undirected edge ( v 3 ,  w 1 ) in E’ (draw it) Can this be implemented in polynomial time? Argue that a directed hamiltonian cycle in G implies an undirected hamiltonian cycle in G’ Argue that an undirected hamiltonian cycle in G’ implies a directed hamiltonian cycle in G
Undirected Hamiltonian Cycle  Thus we can reduce the directed problem to the undirected problem What’s left to prove the undirected hamiltonian cycle problem NP-Complete? Argue that the problem is in  NP
Hamiltonian Cycle    TSP The well-known  traveling salesman problem : Optimization variant: a salesman must travel to  n  cities, visiting each city exactly once and finishing where he begins.  How to minimize travel time? Model as complete graph with cost c( i,j ) to go from city  i  to city  j How would we turn this into a decision problem? A: ask if     a TSP with cost <  k
Hamiltonian Cycle    TSP The steps to prove TSP is NP-Complete: Prove that TSP     NP  ( Argue this ) Reduce the undirected hamiltonian cycle problem to the TSP So if we had a TSP-solver, we could use it to solve the hamilitonian cycle problem in polynomial time How can we transform an instance of the hamiltonian cycle problem to an instance of the TSP? Can we do this in polynomial time?
The TSP Random asides:  TSPs (and variants) have enormous practical importance E.g., for shipping and freighting companies Lots of research into good approximation algorithms Recently made famous as a DNA computing problem

More Related Content

What's hot (20)

Teori pnp
Teori pnpTeori pnp
Teori pnp
Tenia Wahyuningrum
 
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
 
np complete
np completenp complete
np complete
Gayathri Gaayu
 
P versus NP
P versus NPP versus NP
P versus NP
Farid El Hajj
 
Np completeness
Np completenessNp completeness
Np completeness
Rajendran
 
Np complete
Np completeNp complete
Np complete
Md. Shafiuzzaman Hira
 
Np Completeness
Np CompletenessNp Completeness
Np Completeness
Rajan Shah
 
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
 
Daa notes 3
Daa notes 3Daa notes 3
Daa notes 3
smruti sarangi
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
Np completeness-Design and Analysis of Algorithms
Np completeness-Design and Analysis of Algorithms Np completeness-Design and Analysis of Algorithms
Np completeness-Design and Analysis of Algorithms
adeel990
 
Algorithm_NP-Completeness Proof
Algorithm_NP-Completeness ProofAlgorithm_NP-Completeness Proof
Algorithm_NP-Completeness Proof
Im Rafid
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
chidabdu
 
Np completeness
Np completenessNp completeness
Np completeness
Muhammad Saim
 
Tsp is NP-Complete
Tsp is NP-CompleteTsp is NP-Complete
Tsp is NP-Complete
Emre Can Kucukoglu
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
Np complete
Np completeNp complete
Np complete
Dr. C.V. Suresh Babu
 
A comprehensive view on P vs NP
A comprehensive view on P vs NPA comprehensive view on P vs NP
A comprehensive view on P vs NP
Abhay Pai
 
Computability - Tractable, Intractable and Non-computable Function
Computability - Tractable, Intractable and Non-computable FunctionComputability - Tractable, Intractable and Non-computable Function
Computability - Tractable, Intractable and Non-computable Function
Reggie Niccolo Santos
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Amrinder Arora
 
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
 
Np completeness
Np completenessNp completeness
Np completeness
Rajendran
 
Np Completeness
Np CompletenessNp Completeness
Np Completeness
Rajan Shah
 
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
 
Np completeness-Design and Analysis of Algorithms
Np completeness-Design and Analysis of Algorithms Np completeness-Design and Analysis of Algorithms
Np completeness-Design and Analysis of Algorithms
adeel990
 
Algorithm_NP-Completeness Proof
Algorithm_NP-Completeness ProofAlgorithm_NP-Completeness Proof
Algorithm_NP-Completeness Proof
Im Rafid
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
chidabdu
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
A comprehensive view on P vs NP
A comprehensive view on P vs NPA comprehensive view on P vs NP
A comprehensive view on P vs NP
Abhay Pai
 
Computability - Tractable, Intractable and Non-computable Function
Computability - Tractable, Intractable and Non-computable FunctionComputability - Tractable, Intractable and Non-computable Function
Computability - Tractable, Intractable and Non-computable Function
Reggie Niccolo Santos
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Amrinder Arora
 

Viewers also liked (20)

Li shengli ppt on pilot scheme
Li shengli ppt on pilot schemeLi shengli ppt on pilot scheme
Li shengli ppt on pilot scheme
Kenneth Chen
 
Midterm powerpoint app
Midterm powerpoint appMidterm powerpoint app
Midterm powerpoint app
bethlycruz
 
La Biblioteca te ayuda a subir la cuesta
La Biblioteca te ayuda a subir la cuestaLa Biblioteca te ayuda a subir la cuesta
La Biblioteca te ayuda a subir la cuesta
Bibliotecadicoruna
 
RevisedresumeJune2015 (1)
RevisedresumeJune2015 (1)RevisedresumeJune2015 (1)
RevisedresumeJune2015 (1)
Pamela Stegink
 
Calendario venezuela 2014
Calendario venezuela 2014Calendario venezuela 2014
Calendario venezuela 2014
Jose Camacaro
 
Lojacono & Tempesta • Marketing Communication • Slide presentation
Lojacono & Tempesta • Marketing Communication • Slide presentationLojacono & Tempesta • Marketing Communication • Slide presentation
Lojacono & Tempesta • Marketing Communication • Slide presentation
LOJACONO & TEMPESTA • Marketing Communication
 
UAB 2011 - Seekda Webservices Portal
UAB 2011 - Seekda Webservices PortalUAB 2011 - Seekda Webservices Portal
UAB 2011 - Seekda Webservices Portal
INSEMTIVES project
 
onboarding brochure1
onboarding brochure1onboarding brochure1
onboarding brochure1
Badger4460
 
1902022 pm
1902022 pm1902022 pm
1902022 pm
Maria Polcari
 
Electrónica digital curso virtual
Electrónica digital curso virtualElectrónica digital curso virtual
Electrónica digital curso virtual
sapxxx
 
Costa rica
Costa ricaCosta rica
Costa rica
davard
 
Green skills eoppep
Green skills eoppepGreen skills eoppep
Green skills eoppep
Konstantinos Kotsidis
 
Braincandy W+K
Braincandy W+KBraincandy W+K
Braincandy W+K
etiennema
 
CashGO
CashGOCashGO
CashGO
startuptour
 
WWW.MIPROPIAEMPRESA.COM
WWW.MIPROPIAEMPRESA.COMWWW.MIPROPIAEMPRESA.COM
WWW.MIPROPIAEMPRESA.COM
joelbenarroyo
 
Digital marketing live 2015
Digital marketing live 2015Digital marketing live 2015
Digital marketing live 2015
webpower
 
Wii
WiiWii
Wii
GUEIM
 
Mobile Convention Amsterdam 2015 - Withlocals - Dick Koopman
Mobile Convention Amsterdam 2015 - Withlocals - Dick KoopmanMobile Convention Amsterdam 2015 - Withlocals - Dick Koopman
Mobile Convention Amsterdam 2015 - Withlocals - Dick Koopman
Mobile Convention Amsterdam 2015
 
Li shengli ppt on pilot scheme
Li shengli ppt on pilot schemeLi shengli ppt on pilot scheme
Li shengli ppt on pilot scheme
Kenneth Chen
 
Midterm powerpoint app
Midterm powerpoint appMidterm powerpoint app
Midterm powerpoint app
bethlycruz
 
La Biblioteca te ayuda a subir la cuesta
La Biblioteca te ayuda a subir la cuestaLa Biblioteca te ayuda a subir la cuesta
La Biblioteca te ayuda a subir la cuesta
Bibliotecadicoruna
 
RevisedresumeJune2015 (1)
RevisedresumeJune2015 (1)RevisedresumeJune2015 (1)
RevisedresumeJune2015 (1)
Pamela Stegink
 
Calendario venezuela 2014
Calendario venezuela 2014Calendario venezuela 2014
Calendario venezuela 2014
Jose Camacaro
 
UAB 2011 - Seekda Webservices Portal
UAB 2011 - Seekda Webservices PortalUAB 2011 - Seekda Webservices Portal
UAB 2011 - Seekda Webservices Portal
INSEMTIVES project
 
onboarding brochure1
onboarding brochure1onboarding brochure1
onboarding brochure1
Badger4460
 
Electrónica digital curso virtual
Electrónica digital curso virtualElectrónica digital curso virtual
Electrónica digital curso virtual
sapxxx
 
Costa rica
Costa ricaCosta rica
Costa rica
davard
 
Braincandy W+K
Braincandy W+KBraincandy W+K
Braincandy W+K
etiennema
 
WWW.MIPROPIAEMPRESA.COM
WWW.MIPROPIAEMPRESA.COMWWW.MIPROPIAEMPRESA.COM
WWW.MIPROPIAEMPRESA.COM
joelbenarroyo
 
Digital marketing live 2015
Digital marketing live 2015Digital marketing live 2015
Digital marketing live 2015
webpower
 
Mobile Convention Amsterdam 2015 - Withlocals - Dick Koopman
Mobile Convention Amsterdam 2015 - Withlocals - Dick KoopmanMobile Convention Amsterdam 2015 - Withlocals - Dick Koopman
Mobile Convention Amsterdam 2015 - Withlocals - Dick Koopman
Mobile Convention Amsterdam 2015
 
Ad

Similar to lecture 29 (20)

NP Problems in design and analysis of alogorithm
NP Problems in design and analysis of alogorithmNP Problems in design and analysis of alogorithm
NP Problems in design and analysis of alogorithm
keshavrohilla987
 
NP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxNP-Completeness-myppt.pptx
NP-Completeness-myppt.pptx
SanchayKedia2
 
np hard, np complete, polynomial and non polynomial
np hard, np complete, polynomial and non polynomialnp hard, np complete, polynomial and non polynomial
np hard, np complete, polynomial and non polynomial
govindnarayanpatel
 
P versus NP
P versus NPP versus NP
P versus NP
Rituraj Joshi
 
P, NP, NP-Hard & NP-complete problems, Optimization
P, NP, NP-Hard & NP-complete problems, OptimizationP, NP, NP-Hard & NP-complete problems, Optimization
P, NP, NP-Hard & NP-complete problems, Optimization
DrSMeenakshiSundaram1
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
Arivukkarasu Dhanapal
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
Arivukkarasu Dhanapal
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
RishuRaj953240
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
AbirChakraborty38
 
class23.ppt
class23.pptclass23.ppt
class23.ppt
AjayPratap828815
 
NP-Completeewwwwwwwwwwwkkjjejjwjjjjjjjjj
NP-CompleteewwwwwwwwwwwkkjjejjwjjjjjjjjjNP-Completeewwwwwwwwwwwkkjjejjwjjjjjjjjj
NP-Completeewwwwwwwwwwwkkjjejjwjjjjjjjjj
priyaaajadhav31
 
Data structure and algorithms lecture22 presentation
Data structure and algorithms lecture22 presentationData structure and algorithms lecture22 presentation
Data structure and algorithms lecture22 presentation
AmitBhola17
 
algorithm_8beyond_polynomial_running_times.pdf
algorithm_8beyond_polynomial_running_times.pdfalgorithm_8beyond_polynomial_running_times.pdf
algorithm_8beyond_polynomial_running_times.pdf
HsuChi Chen
 
Design and analysis of algorithms unit 6 non deterministic polynomial
Design and analysis of algorithms unit 6 non deterministic polynomialDesign and analysis of algorithms unit 6 non deterministic polynomial
Design and analysis of algorithms unit 6 non deterministic polynomial
nowicam882
 
CSE680-17NP-Complete.pptx
CSE680-17NP-Complete.pptxCSE680-17NP-Complete.pptx
CSE680-17NP-Complete.pptx
AjayPratap828815
 
optimal merge pattern notes - algorithms
optimal merge pattern notes - algorithmsoptimal merge pattern notes - algorithms
optimal merge pattern notes - algorithms
devivisalakshi2010
 
Np completeness
Np completeness Np completeness
Np completeness
tusharKanwaria
 
NP Hard Presentation
NP Hard Presentation NP Hard Presentation
NP Hard Presentation
FoodieVlogger
 
Introduction to Computational Complexity Theory pptx
Introduction to Computational Complexity Theory pptxIntroduction to Computational Complexity Theory pptx
Introduction to Computational Complexity Theory pptx
Minakshee Patil
 
Internship
InternshipInternship
Internship
Seshagiri Rao Kornepati
 
NP Problems in design and analysis of alogorithm
NP Problems in design and analysis of alogorithmNP Problems in design and analysis of alogorithm
NP Problems in design and analysis of alogorithm
keshavrohilla987
 
NP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxNP-Completeness-myppt.pptx
NP-Completeness-myppt.pptx
SanchayKedia2
 
np hard, np complete, polynomial and non polynomial
np hard, np complete, polynomial and non polynomialnp hard, np complete, polynomial and non polynomial
np hard, np complete, polynomial and non polynomial
govindnarayanpatel
 
P, NP, NP-Hard & NP-complete problems, Optimization
P, NP, NP-Hard & NP-complete problems, OptimizationP, NP, NP-Hard & NP-complete problems, Optimization
P, NP, NP-Hard & NP-complete problems, Optimization
DrSMeenakshiSundaram1
 
NP-Completeewwwwwwwwwwwkkjjejjwjjjjjjjjj
NP-CompleteewwwwwwwwwwwkkjjejjwjjjjjjjjjNP-Completeewwwwwwwwwwwkkjjejjwjjjjjjjjj
NP-Completeewwwwwwwwwwwkkjjejjwjjjjjjjjj
priyaaajadhav31
 
Data structure and algorithms lecture22 presentation
Data structure and algorithms lecture22 presentationData structure and algorithms lecture22 presentation
Data structure and algorithms lecture22 presentation
AmitBhola17
 
algorithm_8beyond_polynomial_running_times.pdf
algorithm_8beyond_polynomial_running_times.pdfalgorithm_8beyond_polynomial_running_times.pdf
algorithm_8beyond_polynomial_running_times.pdf
HsuChi Chen
 
Design and analysis of algorithms unit 6 non deterministic polynomial
Design and analysis of algorithms unit 6 non deterministic polynomialDesign and analysis of algorithms unit 6 non deterministic polynomial
Design and analysis of algorithms unit 6 non deterministic polynomial
nowicam882
 
optimal merge pattern notes - algorithms
optimal merge pattern notes - algorithmsoptimal merge pattern notes - algorithms
optimal merge pattern notes - algorithms
devivisalakshi2010
 
NP Hard Presentation
NP Hard Presentation NP Hard Presentation
NP Hard Presentation
FoodieVlogger
 
Introduction to Computational Complexity Theory pptx
Introduction to Computational Complexity Theory pptxIntroduction to Computational Complexity Theory pptx
Introduction to Computational Complexity Theory pptx
Minakshee Patil
 
Ad

More from sajinsc (20)

lecture 26
lecture 26lecture 26
lecture 26
sajinsc
 
lecture 25
lecture 25lecture 25
lecture 25
sajinsc
 
lecture 24
lecture 24lecture 24
lecture 24
sajinsc
 
lecture 23
lecture 23lecture 23
lecture 23
sajinsc
 
lecture 22
lecture 22lecture 22
lecture 22
sajinsc
 
lecture 21
lecture 21lecture 21
lecture 21
sajinsc
 
lecture 20
lecture 20lecture 20
lecture 20
sajinsc
 
lecture 19
lecture 19lecture 19
lecture 19
sajinsc
 
lecture 18
lecture 18lecture 18
lecture 18
sajinsc
 
lecture 17
lecture 17lecture 17
lecture 17
sajinsc
 
lecture 16
lecture 16lecture 16
lecture 16
sajinsc
 
lecture 15
lecture 15lecture 15
lecture 15
sajinsc
 
lecture 14
lecture 14lecture 14
lecture 14
sajinsc
 
lecture 13
lecture 13lecture 13
lecture 13
sajinsc
 
lecture 12
lecture 12lecture 12
lecture 12
sajinsc
 
lecture 11
lecture 11lecture 11
lecture 11
sajinsc
 
lecture 10
lecture 10lecture 10
lecture 10
sajinsc
 
lecture 9
lecture 9lecture 9
lecture 9
sajinsc
 
lecture 8
lecture 8lecture 8
lecture 8
sajinsc
 
lecture 7
lecture 7lecture 7
lecture 7
sajinsc
 
lecture 26
lecture 26lecture 26
lecture 26
sajinsc
 
lecture 25
lecture 25lecture 25
lecture 25
sajinsc
 
lecture 24
lecture 24lecture 24
lecture 24
sajinsc
 
lecture 23
lecture 23lecture 23
lecture 23
sajinsc
 
lecture 22
lecture 22lecture 22
lecture 22
sajinsc
 
lecture 21
lecture 21lecture 21
lecture 21
sajinsc
 
lecture 20
lecture 20lecture 20
lecture 20
sajinsc
 
lecture 19
lecture 19lecture 19
lecture 19
sajinsc
 
lecture 18
lecture 18lecture 18
lecture 18
sajinsc
 
lecture 17
lecture 17lecture 17
lecture 17
sajinsc
 
lecture 16
lecture 16lecture 16
lecture 16
sajinsc
 
lecture 15
lecture 15lecture 15
lecture 15
sajinsc
 
lecture 14
lecture 14lecture 14
lecture 14
sajinsc
 
lecture 13
lecture 13lecture 13
lecture 13
sajinsc
 
lecture 12
lecture 12lecture 12
lecture 12
sajinsc
 
lecture 11
lecture 11lecture 11
lecture 11
sajinsc
 
lecture 10
lecture 10lecture 10
lecture 10
sajinsc
 
lecture 9
lecture 9lecture 9
lecture 9
sajinsc
 
lecture 8
lecture 8lecture 8
lecture 8
sajinsc
 
lecture 7
lecture 7lecture 7
lecture 7
sajinsc
 

Recently uploaded (20)

Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Fatman Book HD Pdf by aayush songare.pdf
Fatman Book  HD Pdf by aayush songare.pdfFatman Book  HD Pdf by aayush songare.pdf
Fatman Book HD Pdf by aayush songare.pdf
Aayush Songare
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
Dashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo SlidesDashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo Slides
Celine George
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptxRai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Fatman Book HD Pdf by aayush songare.pdf
Fatman Book  HD Pdf by aayush songare.pdfFatman Book  HD Pdf by aayush songare.pdf
Fatman Book HD Pdf by aayush songare.pdf
Aayush Songare
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
Dashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo SlidesDashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo Slides
Celine George
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 

lecture 29

  • 1. CS 332: Algorithms NP Completeness Continued: Reductions
  • 2. Homework 7 Check the web later today… Change in grading policy: drop lowest hw
  • 3. 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 Open question: Does P = NP ?
  • 4. 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
  • 5. Review: 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 If P  p Q and P is NP-Complete, Q is also NP- Complete
  • 6. Review: Proving NP-Completeness What steps do we have to take to prove a problem Q is NP-Complete? Pick a known NP-Complete problem P Reduce P to Q Describe a transformation that maps instances of P to instances of Q, s.t. “yes” for Q = “yes” for P Prove the transformation works Prove it runs in polynomial time Oh yeah, prove Q  NP ( What if you can’t? )
  • 7. Directed Hamiltonian Cycle  Undirected Hamiltonian Cycle What was the hamiltonian cycle problem again? For my next trick, I will reduce the directed hamiltonian cycle problem to the undirected hamiltonian cycle problem before your eyes Which variant am I proving NP-Complete? Draw a directed example on the board What transformation do I need to effect?
  • 8. Transformation: Directed  Undirected Ham. Cycle Transform graph G = (V, E) into G’ = (V’, E’): Every vertex v in V transforms into 3 vertices v 1 , v 2 , v 3 in V’ with edges ( v 1 , v 2 ) and ( v 2 , v 3 ) in E’ Every directed edge ( v , w ) in E transforms into the undirected edge ( v 3 , w 1 ) in E’ (draw it) Can this be implemented in polynomial time? Argue that a directed hamiltonian cycle in G implies an undirected hamiltonian cycle in G’ Argue that an undirected hamiltonian cycle in G’ implies a directed hamiltonian cycle in G
  • 9. Undirected Hamiltonian Cycle Thus we can reduce the directed problem to the undirected problem What’s left to prove the undirected hamiltonian cycle problem NP-Complete? Argue that the problem is in NP
  • 10. Hamiltonian Cycle  TSP The well-known traveling salesman problem : Optimization variant: a salesman must travel to n cities, visiting each city exactly once and finishing where he begins. How to minimize travel time? Model as complete graph with cost c( i,j ) to go from city i to city j How would we turn this into a decision problem? A: ask if  a TSP with cost < k
  • 11. Hamiltonian Cycle  TSP The steps to prove TSP is NP-Complete: Prove that TSP  NP ( Argue this ) Reduce the undirected hamiltonian cycle problem to the TSP So if we had a TSP-solver, we could use it to solve the hamilitonian cycle problem in polynomial time How can we transform an instance of the hamiltonian cycle problem to an instance of the TSP? Can we do this in polynomial time?
  • 12. The TSP Random asides: TSPs (and variants) have enormous practical importance E.g., for shipping and freighting companies Lots of research into good approximation algorithms Recently made famous as a DNA computing problem