SlideShare a Scribd company logo
Complexity Theory
Prof. Shashikant V. Athawale
Assistant Professor | Computer Engineering
Department | AISSMS College of Engineering,
Kennedy Road, Pune , MH, India - 411001
CONTENTS
1. Asymptotic notation
2. Deterministic Algorithm
3. Non-Deterministic Algorithm
4. Difference between Deterministic Algorithm & Non-Deterministic Algorithm
5. P problems
6. NP problems
7. Difference between P and NP problems
8. 3-Satisfiability
9. Hamiltonian Cycle
Asymptotic notation
• Big Theta (T)
• Big Oh(O)
• Big Omega ()
• The Big O notation defines an upper bound of an algorithm, it bounds
a function only from above. For example, consider the case of
Insertion Sort.
• g(n) is upper bound of the f(n) if there is exists some positive
constants c and n0.It is denoted as f(n)=O(g(n)).
• The Big Omega notation defines an lower bound of an algorithm.
• Running time of the algorithem cannot be less than asymptotic lower
bound for sequence of the data.
• Big Theta defines the tight bound for the algorithem.
• Running time of the algorithem cannot be less than or greater than its
asymptotic tight bound for random sequence of the data.
DETERMINISTIC ALGORITHM
• In Deteministic algorithem For a particular input the computer will give same
output every time.
• examples are finding odd or even,sorting,finding max etc.
• Most of the algorithem are deterministic in nature.
NON-DETERMINISTIC ALGORITHM
• In non deterministic algorithem for a same input the computer will
give different output on different execution.
• This algorithem operates in two phases Guessing and Verification.
• Randomly picking some elements from the list and check if it is
maximum is non-deterministic.
Difference between Deterministic and Non-
deterministic Algorithms
Deterministic Algorithm
• For a particular input the computer will give different output on different
execution.
• Can solve the problem in polynomial time.
Non-deterministic Algorithm
• For a particular input the computer will give different output on different
execution.
• Can’t solve the problem in polynomial time.
P and NP class
Problem
P class NP class
NP Complete NP hard
P-Class Problem
• The class P consists of those problems that are solvable in polynomial
time, i.e. these problems can be solved in time O(nk) in worst-case,
where k is constant.
• These problems are called tractable, while others are called
intractable or super polynomial.
• The advantages in considering the class of polynomial-time
algorithms is that all reasonable deterministic single processor model
of computation can be simulated on each other with at most a
polynomial slow-d
NP-Class Problem
• The class NP consists of those problems that are verifiable in
polynomial time. NP is the class of decision problems for which it is
easy to check the correctness of a claimed answer, with the aid of a
little extra information.
• Every problem in this class can be solved in exponential time using
exhaustive search.
Difference between P and NP class problem
• All problems in P can be solved with polynomial time algorithms,
whereas all problems in NP - P are intractable.
• P is set of problems that can be solved by a deterministic Turing
machine in Polynomial time.
• NP is set of decision problems that can be solved by a Non-
deterministic Turing Machine in Polynomial time.
• NP-complete problems are the hardest problems in NP set.
NP-complete problems
A decision problem L is NP-complete if:
1) L is in NP (Any given solution for NP-complete problems can be
verified quickly, but there is no efficient known solution).
2) Every problem in NP is reducible to L in polynomial time (Reduction
is defined below).
A problem is NP-Hard if it follows property 2 mentioned above, doesn’t
need to follow property 1. Therefore, NP-Complete set is also a subset
of NP-Hard set.
Examples:
• Knapsack problem
• Hamiltonian path problem
• vertex cover problem
• Boolen satisfiabiltiy problem
• clique problem
3-Satisfiability
• Satisfiability's role as the first NP-complete problem implies that the problem
is hard to solve in the worst case, but certain instances of the problem are not
necessarily so tough. .
• Input: A collection of clauses C where each clause contains exactly 3 literals,
over a set of Boolean variables V.
• Output: Is there a truth assignment to V such that each clause is satisfied?
Since this is a more restricted problem than satisfiablity, the hardness of 3-SAT
implies that satisfiability is hard. The converse isn't true, as the hardness of
general satisfiability might depend upon having long clauses. We can show the
hardness of 3-SAT using a reduction that translates every instance of
satisfiability into an instance of 3-S.
Hamiltonian Cycle
Hamiltonian Path in an undirected graph is a path that visits each
vertex exactly once.
A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian Path
such that there is an edge (in the graph) from the last vertex to the
first vertex of the Hamiltonian Path.
Thank you

More Related Content

Similar to teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm

DAA.pdf
DAA.pdfDAA.pdf
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
rajinooka
 
Unit 5
Unit 5Unit 5
Unit 5
guna287176
 
Unit 5
Unit 5Unit 5
Np complete
Np completeNp complete
Proving Lower Bounds to Answer the P versus NP question
Proving Lower Bounds to Answer the P versus NP questionProving Lower Bounds to Answer the P versus NP question
Proving Lower Bounds to Answer the P versus NP question
guest577718
 
Np Completeness
Np CompletenessNp Completeness
Np Completeness
Rajan Shah
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
chidabdu
 
Proving Lower Bounds to Answer the P versus NP Problem
Proving Lower Bounds to Answer the P versus NP ProblemProving Lower Bounds to Answer the P versus NP Problem
Proving Lower Bounds to Answer the P versus NP Problem
guest577718
 
class23.ppt
class23.pptclass23.ppt
class23.ppt
AjayPratap828815
 
Np complete
Np completeNp complete
Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
Techglyphs
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
Abner Huang
 
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
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
np complete
np completenp complete
np complete
Gayathri Gaayu
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
Ankit Katiyar
 
Np completeness h4
Np completeness  h4Np completeness  h4
Np completeness h4
Rajendran
 
Proving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP QuestionProving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP Question
guest383ed6
 

Similar to teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm (20)

DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
 
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 5
Unit 5Unit 5
Unit 5
 
Np complete
Np completeNp complete
Np complete
 
Proving Lower Bounds to Answer the P versus NP question
Proving Lower Bounds to Answer the P versus NP questionProving Lower Bounds to Answer the P versus NP question
Proving Lower Bounds to Answer the P versus NP question
 
Np Completeness
Np CompletenessNp Completeness
Np Completeness
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
 
Proving Lower Bounds to Answer the P versus NP Problem
Proving Lower Bounds to Answer the P versus NP ProblemProving Lower Bounds to Answer the P versus NP Problem
Proving Lower Bounds to Answer the P versus NP Problem
 
class23.ppt
class23.pptclass23.ppt
class23.ppt
 
Np complete
Np completeNp complete
Np complete
 
Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
 
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
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems Webinar : P, NP, NP-Hard , NP - Complete problems
Webinar : P, NP, NP-Hard , NP - Complete problems
 
np complete
np completenp complete
np complete
 
NP completeness
NP completenessNP completeness
NP completeness
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Np completeness h4
Np completeness  h4Np completeness  h4
Np completeness h4
 
Proving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP QuestionProving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP Question
 

Recently uploaded

KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
shreyassri1208
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
RandolphRadicy
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
khabri85
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
andagarcia212
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
lakshayrojroj
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
Taste
 

Recently uploaded (20)

KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxxSimple-Present-Tense xxxxxxxxxxxxxxxxxxx
Simple-Present-Tense xxxxxxxxxxxxxxxxxxx
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
 

teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm

  • 1. Complexity Theory Prof. Shashikant V. Athawale Assistant Professor | Computer Engineering Department | AISSMS College of Engineering, Kennedy Road, Pune , MH, India - 411001
  • 2. CONTENTS 1. Asymptotic notation 2. Deterministic Algorithm 3. Non-Deterministic Algorithm 4. Difference between Deterministic Algorithm & Non-Deterministic Algorithm 5. P problems 6. NP problems 7. Difference between P and NP problems 8. 3-Satisfiability 9. Hamiltonian Cycle
  • 3. Asymptotic notation • Big Theta (T) • Big Oh(O) • Big Omega ()
  • 4. • The Big O notation defines an upper bound of an algorithm, it bounds a function only from above. For example, consider the case of Insertion Sort. • g(n) is upper bound of the f(n) if there is exists some positive constants c and n0.It is denoted as f(n)=O(g(n)). • The Big Omega notation defines an lower bound of an algorithm. • Running time of the algorithem cannot be less than asymptotic lower bound for sequence of the data. • Big Theta defines the tight bound for the algorithem. • Running time of the algorithem cannot be less than or greater than its asymptotic tight bound for random sequence of the data.
  • 5. DETERMINISTIC ALGORITHM • In Deteministic algorithem For a particular input the computer will give same output every time. • examples are finding odd or even,sorting,finding max etc. • Most of the algorithem are deterministic in nature.
  • 6. NON-DETERMINISTIC ALGORITHM • In non deterministic algorithem for a same input the computer will give different output on different execution. • This algorithem operates in two phases Guessing and Verification. • Randomly picking some elements from the list and check if it is maximum is non-deterministic.
  • 7. Difference between Deterministic and Non- deterministic Algorithms Deterministic Algorithm • For a particular input the computer will give different output on different execution. • Can solve the problem in polynomial time. Non-deterministic Algorithm • For a particular input the computer will give different output on different execution. • Can’t solve the problem in polynomial time.
  • 8. P and NP class Problem P class NP class NP Complete NP hard
  • 9. P-Class Problem • The class P consists of those problems that are solvable in polynomial time, i.e. these problems can be solved in time O(nk) in worst-case, where k is constant. • These problems are called tractable, while others are called intractable or super polynomial. • The advantages in considering the class of polynomial-time algorithms is that all reasonable deterministic single processor model of computation can be simulated on each other with at most a polynomial slow-d
  • 10. NP-Class Problem • The class NP consists of those problems that are verifiable in polynomial time. NP is the class of decision problems for which it is easy to check the correctness of a claimed answer, with the aid of a little extra information. • Every problem in this class can be solved in exponential time using exhaustive search.
  • 11. Difference between P and NP class problem • All problems in P can be solved with polynomial time algorithms, whereas all problems in NP - P are intractable. • P is set of problems that can be solved by a deterministic Turing machine in Polynomial time. • NP is set of decision problems that can be solved by a Non- deterministic Turing Machine in Polynomial time. • NP-complete problems are the hardest problems in NP set.
  • 12. NP-complete problems A decision problem L is NP-complete if: 1) L is in NP (Any given solution for NP-complete problems can be verified quickly, but there is no efficient known solution). 2) Every problem in NP is reducible to L in polynomial time (Reduction is defined below). A problem is NP-Hard if it follows property 2 mentioned above, doesn’t need to follow property 1. Therefore, NP-Complete set is also a subset of NP-Hard set.
  • 13. Examples: • Knapsack problem • Hamiltonian path problem • vertex cover problem • Boolen satisfiabiltiy problem • clique problem
  • 14. 3-Satisfiability • Satisfiability's role as the first NP-complete problem implies that the problem is hard to solve in the worst case, but certain instances of the problem are not necessarily so tough. . • Input: A collection of clauses C where each clause contains exactly 3 literals, over a set of Boolean variables V. • Output: Is there a truth assignment to V such that each clause is satisfied? Since this is a more restricted problem than satisfiablity, the hardness of 3-SAT implies that satisfiability is hard. The converse isn't true, as the hardness of general satisfiability might depend upon having long clauses. We can show the hardness of 3-SAT using a reduction that translates every instance of satisfiability into an instance of 3-S.
  • 15. Hamiltonian Cycle Hamiltonian Path in an undirected graph is a path that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian Path such that there is an edge (in the graph) from the last vertex to the first vertex of the Hamiltonian Path.