SlideShare a Scribd company logo
1 of 16
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

What's hot

What's hot (20)

ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.pptANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
ANALYSIS-AND-DESIGN-OF-ALGORITHM.ppt
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Analysis of algorithm
Analysis of algorithmAnalysis of algorithm
Analysis of algorithm
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Np complete
Np completeNp complete
Np complete
 
Marge Sort
Marge SortMarge Sort
Marge Sort
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
 
Strassen.ppt
Strassen.pptStrassen.ppt
Strassen.ppt
 
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
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Theory of Computation Unit 1
Theory of Computation Unit 1Theory of Computation Unit 1
Theory of Computation Unit 1
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of Algorithms
 
Divide and conquer - Quick sort
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sort
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Satisfiability
SatisfiabilitySatisfiability
Satisfiability
 

Similar to Complexity theory (20)

AA ppt9107
AA ppt9107AA ppt9107
AA ppt9107
 
lect5-1.ppt
lect5-1.pptlect5-1.ppt
lect5-1.ppt
 
UNIT -IV DAA.pdf
UNIT  -IV DAA.pdfUNIT  -IV DAA.pdf
UNIT -IV DAA.pdf
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
 
Np completeness
Np completenessNp completeness
Np completeness
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
 
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
 
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
 

More from Dr Shashikant Athawale (20)

multi threaded and distributed algorithms
multi threaded and distributed algorithms multi threaded and distributed algorithms
multi threaded and distributed algorithms
 
Amortized analysis
Amortized analysisAmortized analysis
Amortized analysis
 
Model and Design
Model and Design Model and Design
Model and Design
 
Fundamental of Algorithms
Fundamental of Algorithms Fundamental of Algorithms
Fundamental of Algorithms
 
CUDA Architecture
CUDA ArchitectureCUDA Architecture
CUDA Architecture
 
Parallel Algorithms- Sorting and Graph
Parallel Algorithms- Sorting and GraphParallel Algorithms- Sorting and Graph
Parallel Algorithms- Sorting and Graph
 
Analytical Models of Parallel Programs
Analytical Models of Parallel ProgramsAnalytical Models of Parallel Programs
Analytical Models of Parallel Programs
 
Basic Communication
Basic CommunicationBasic Communication
Basic Communication
 
Parallel Processing Concepts
Parallel Processing Concepts Parallel Processing Concepts
Parallel Processing Concepts
 
Parallel Processing Concepts
Parallel Processing Concepts Parallel Processing Concepts
Parallel Processing Concepts
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Parallel algorithms
Parallel algorithms Parallel algorithms
Parallel algorithms
 
Greedy method
Greedy method Greedy method
Greedy method
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Advanced Wireless Technologies
Advanced Wireless TechnologiesAdvanced Wireless Technologies
Advanced Wireless Technologies
 
Vo ip
Vo ipVo ip
Vo ip
 
Vehicular network
Vehicular networkVehicular network
Vehicular network
 
Delay telerant network
Delay telerant networkDelay telerant network
Delay telerant network
 
Advance Network Technologies
Advance Network TechnologiesAdvance Network Technologies
Advance Network Technologies
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
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
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
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
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
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
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
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
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

Complexity theory

  • 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.