SlideShare a Scribd company logo
NP-COMPLETE
Prof. Manjusha Amritkar
Assistant Professor
Department of Information Technology
Hope Foundation’s
International Institute of Information
Technology, I²IT
www.isquareit.edu.in
THE TRAVELING SALESMAN PROBLEM
 Suppose that you are given the road map of India.
 You need to find a traversal that covers all the
cities/towns/villages of population ≥ 1, 000.
 And the traversal should have a short distance, say,
≤ 9, 000 kms.
 You will have to generate a very large number of
traversals to find out a short traversal.
 Suppose that you are also given a claimed short
traversal.
 It is now easy to verify that given claimed traversal
is indeed a short traversal.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
THE BIN PACKING PROBLEM
 Suppose you have a large container of volume 1000
cubic meter and 150 boxes of varying sizes with
volumes between 10 to 25 cubic meters.
 You need to fit at least half of these boxes in the
container.
 You will need to try out various combinations of 75
boxes (there are 1040 combinations) and various ways
of laying them in the container to find a fitting.
 Suppose that you are also given a set of 75 boxes and
a way of laying them.
 It is now easy to verify if these 75 boxes layed out in
the given way will fit in the container.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
HALL-I ROOM ALLOCATION
 Each wing of Hall-I has 72 rooms.
 Suppose from a batch of 540 students, 72 need to be
housed in C-wing.
 There are several students that are “incompatible”
with each other, and so no such pair should be
present in the wing.
 If there are a large number of incompatibilities, you
will need to try out many combinations to get a
correct one.
 Suppose you are also given the names of 72
students to be housed.
 It is now easy to verify if they are all compatible.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
DISCOVERY VERSUS VERIFICATION
 In all these problems, finding a solution appears to
be far more difficult than checking the correctness of
a given solution.
 Informally, this makes sense as discovering a
solution is often much more difficult than verifying its
correctness.
 Can we formally prove this?
 Leads to the P versus NP problem.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
FORMALIZING EASY-TO-SOLVE
 A problem is easy to solve if the solution can be
computed quickly.
 Gives rise to two questions:
I. How is it computed?
II. How do we define “quickly”?
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
COMPUTING METHOD
 We will use an algorithm to compute.
 In practice, the algorithm will run on a computer via
a computer program.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
ALGORITHMS
 An algorithm is a set of precise instructions for
computation.
 The algorithm can perform usual computational
steps, e.g., assignments, arithmetic and Boolean
operations, loops.
 For us, an algorithm will always have input presented
as a sequence of bits.
 The input size is the number of bits in the input to the
algorithm.
 The algorithm stops after outputting the solution.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
TIME COMPLEXITY OF PROBLEMS
 A problem has time complexity TA(n) if there is an
algorithm A that solves the problem on every input.
 Addition has time complexity O(n).
 Multiplication has time complexity O(n2)
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
TIME MEASUREMENT
 Let A be an algorithm and x be an input to it.
 Let TA(x) denote the number of steps of the algorithm
on input x.
 Let TA(n) denote the maximum of TA(x) over all inputs
x of size n.
 We will use TA(n) to quantify the time taken by
algorithm A to solve a problem on different input sizes.
 For example, an algorithm A that adds two n bit
numbers using school method has TA(n) = O(n).
 An algorithm B that multiplies two n bits numbers
using school method has TA(n) = O(n2)
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
QUANTIFYING EASY-TO-COMPUTE
 The problems of adding and multiplying are definitely
easy.
 Also, if a problem is easy, and another problem can be
solved in time n · T(n) where T(n) is the time
complexity of the easy problem, then the new problem
is also easy.
 This leads to the following definition:
A problem is efficiently solvable if its time complexity is n
O(1) . Such problems are also called polynomial-time
problems.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
THE CLASS P
 The class P contains all efficiently solvable
problems.
 Specifically, they are the problems that can be
solved in time O(n k) for some constant k, where n
is the size of input to the problem.
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
THE CLASS NP
 NP = Non-Deterministic polynomial time
 The class NP contains those problems that are
“verifiable” in polynomial time.
 e.g 1. Hamiltonian cycle
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
HAMILTONIAN CYCLE
 Determining whether a directed graph has a
Hamiltonian cycle does not have a polynomial time
algorithm (yet!)
 However if someone was to give you a sequence of
vertices, determining whether or not that sequence
forms a Hamiltonian cycle can be done in
polynomial time
 Therefore Hamiltonian cycles are in NP
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
SAT
 A boolean formula is satisfiable if there exists
some assignment of the values 0 and 1 to its
variables that causes it to evaluate
to 1.
 CNF – Conjunctive Normal Form. ANDing of
clauses of ORs
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
2-CNF SAT
 Each or operation has two arguments that are either
variables or negation of variables
 The problem in 2 CNF SAT is to find true/false(0 or 1)
assignments to the variables in order to make the entire
formula true.
 Any of the OR clauses can be converted to implication
clauses
(xy)(yz)(xz)(zy)
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
2-SAT IS IN P
 Create the implication graph
x
y
x
z
z
y
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
SATISFIABILITY VIA PATH FINDING
 If there is a path from
 And if there is a path from
 Then FAIL!
 How to find paths in graphs?
 DFS/BFS and modifications thereof
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
3 CNF SAT (3 SAT)
 Not so easy anymore.
 Implication graph cannot be constructed
 No known polytime algorithm
 Is it NP?
 If someone gives you a solution how long does it take to
verify it?
 Make one pass through the formula and check
 This is an NP problem
Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
REFERENCES
 Contents are referred from following web
resources
 https://www.seas.upenn.edu/~bhusnur4/cit596_spri
ng2014/PNP.pptx
 https://www.cse.iitk.ac.in/users/manindra/presentati
ons/IITKTalk.pdf
THANK YOU
For further details, please contact
Manjusha Amritkar
manjushaa@isquareit.edu.in
Department of Information Technology
Hope Foundation’s
International Institute of Information Technology, I²IT
P-14,Rajiv Gandhi Infotech Park
MIDC Phase 1, Hinjawadi, Pune – 411057
Tel - +91 20 22933441/2/3
www.isquareit.edu.in | info@isquareit.edu.in

More Related Content

PPT
Importance of Theory of Computations
PPTX
DAA Introduction to Algorithms & Application
PPTX
Engineering Mathematics & Probability Distributions
PPTX
Machine Learning: Bias and Variance Trade-off
PPTX
Engineering Mathematics with Examples and Applications
PPTX
PPTX
Importance of Theory of Computations
DAA Introduction to Algorithms & Application
Engineering Mathematics & Probability Distributions
Machine Learning: Bias and Variance Trade-off
Engineering Mathematics with Examples and Applications

What's hot (20)

PPTX
Operating System Scheduling Algorithms
PPTX
PPTX
Systems Programming & Operating Systems - Overview of LEX-and-YACC
PPTX
PPTX
Human Computer Interaction - INPUT OUTPUT CHANNELS
PPTX
Equivalence Calculation Under Inflation
PDF
Engineering Graphics and Engineering Curves
PPTX
Conformal Mapping - Introduction & Examples
PPTX
Cloud Computing & Virtual Infrastructure
PPTX
Operating System Scheduling Algorithms
Systems Programming & Operating Systems - Overview of LEX-and-YACC
Human Computer Interaction - INPUT OUTPUT CHANNELS
Equivalence Calculation Under Inflation
Engineering Graphics and Engineering Curves
Conformal Mapping - Introduction & Examples
Cloud Computing & Virtual Infrastructure
Ad

Similar to NP-Complete Problem (20)

PDF
The Automated-Reasoning Revolution: from Theory to Practice and Back
PDF
P versus NP
PDF
Introduction
PDF
9. chapter 8 np hard and np complete problems
PPTX
Np completeness
PPTX
DAA_Hard_Problems_(4th_Sem).pptxxxxxxxxx
PDF
UNIT -IV DAA.pdf
PPTX
Data structure and algorithms lecture22 presentation
PDF
Lect 31_32 NP and Intractability_Part 1.pdf
PDF
np hard, np complete, polynomial and non polynomial
PPTX
NP-Completeness-myppt.pptx
PPTX
lec2cct computational cmplexity theory.pptx
PPTX
CSE680-17NP-Complete.pptx
PPTX
Np Completeness
PPTX
Lower bound theory Np hard & Np completeness
PPT
Complexity theory
PDF
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
PPT
UNIT-V.ppt
PPT
PDF
Data Structures and Algorithms Made Easy in Java ( PDFDrive ).pdf
The Automated-Reasoning Revolution: from Theory to Practice and Back
P versus NP
Introduction
9. chapter 8 np hard and np complete problems
Np completeness
DAA_Hard_Problems_(4th_Sem).pptxxxxxxxxx
UNIT -IV DAA.pdf
Data structure and algorithms lecture22 presentation
Lect 31_32 NP and Intractability_Part 1.pdf
np hard, np complete, polynomial and non polynomial
NP-Completeness-myppt.pptx
lec2cct computational cmplexity theory.pptx
CSE680-17NP-Complete.pptx
Np Completeness
Lower bound theory Np hard & Np completeness
Complexity theory
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
UNIT-V.ppt
Data Structures and Algorithms Made Easy in Java ( PDFDrive ).pdf
Ad

More from International Institute of Information Technology (I²IT) (20)

PPTX
Understanding Natural Language Processing
PPTX
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
PPTX
Writing Skills: Importance of Writing Skills
PPTX
Professional Communication | Introducing Oneself
PPTX
PPTX
What Is Jenkins? Features and How It Works
PPTX
Data Science, Big Data, Data Analytics
PPTX
PPTX
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
PPTX
Sentiment Analysis in Machine Learning
PPT
Java as Object Oriented Programming Language
PPTX
Data Visualization - How to connect Microsoft Forms to Power BI
PPTX
Yoga To Fight & Win Against COVID-19
Understanding Natural Language Processing
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Writing Skills: Importance of Writing Skills
Professional Communication | Introducing Oneself
What Is Jenkins? Features and How It Works
Data Science, Big Data, Data Analytics
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Sentiment Analysis in Machine Learning
Java as Object Oriented Programming Language
Data Visualization - How to connect Microsoft Forms to Power BI
Yoga To Fight & Win Against COVID-19

Recently uploaded (20)

PPTX
Internet Safety for Seniors presentation
PDF
Understand the Gitlab_presentation_task.pdf
PPTX
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
PPTX
The-Importance-of-School-Sanitation.pptx
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PPTX
Layers_of_the_Earth_Grade7.pptx class by
PDF
The Evolution of Traditional to New Media .pdf
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
PPT
250152213-Excitation-SystemWERRT (1).ppt
PDF
simpleintnettestmetiaerl for the simple testint
PDF
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PPTX
Reading as a good Form of Recreation
PPTX
E -tech empowerment technologies PowerPoint
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
Database Information System - Management Information System
PDF
Exploring The Internet Of Things(IOT).ppt
PPTX
newyork.pptxirantrafgshenepalchinachinane
PDF
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
Internet Safety for Seniors presentation
Understand the Gitlab_presentation_task.pdf
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
The-Importance-of-School-Sanitation.pptx
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
Layers_of_the_Earth_Grade7.pptx class by
The Evolution of Traditional to New Media .pdf
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
250152213-Excitation-SystemWERRT (1).ppt
simpleintnettestmetiaerl for the simple testint
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
Reading as a good Form of Recreation
E -tech empowerment technologies PowerPoint
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
Database Information System - Management Information System
Exploring The Internet Of Things(IOT).ppt
newyork.pptxirantrafgshenepalchinachinane
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf

NP-Complete Problem

  • 1. NP-COMPLETE Prof. Manjusha Amritkar Assistant Professor Department of Information Technology Hope Foundation’s International Institute of Information Technology, I²IT www.isquareit.edu.in
  • 2. THE TRAVELING SALESMAN PROBLEM  Suppose that you are given the road map of India.  You need to find a traversal that covers all the cities/towns/villages of population ≥ 1, 000.  And the traversal should have a short distance, say, ≤ 9, 000 kms.  You will have to generate a very large number of traversals to find out a short traversal.  Suppose that you are also given a claimed short traversal.  It is now easy to verify that given claimed traversal is indeed a short traversal. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 3. THE BIN PACKING PROBLEM  Suppose you have a large container of volume 1000 cubic meter and 150 boxes of varying sizes with volumes between 10 to 25 cubic meters.  You need to fit at least half of these boxes in the container.  You will need to try out various combinations of 75 boxes (there are 1040 combinations) and various ways of laying them in the container to find a fitting.  Suppose that you are also given a set of 75 boxes and a way of laying them.  It is now easy to verify if these 75 boxes layed out in the given way will fit in the container. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 4. HALL-I ROOM ALLOCATION  Each wing of Hall-I has 72 rooms.  Suppose from a batch of 540 students, 72 need to be housed in C-wing.  There are several students that are “incompatible” with each other, and so no such pair should be present in the wing.  If there are a large number of incompatibilities, you will need to try out many combinations to get a correct one.  Suppose you are also given the names of 72 students to be housed.  It is now easy to verify if they are all compatible. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 5. DISCOVERY VERSUS VERIFICATION  In all these problems, finding a solution appears to be far more difficult than checking the correctness of a given solution.  Informally, this makes sense as discovering a solution is often much more difficult than verifying its correctness.  Can we formally prove this?  Leads to the P versus NP problem. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 6. FORMALIZING EASY-TO-SOLVE  A problem is easy to solve if the solution can be computed quickly.  Gives rise to two questions: I. How is it computed? II. How do we define “quickly”? Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 7. COMPUTING METHOD  We will use an algorithm to compute.  In practice, the algorithm will run on a computer via a computer program. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 8. ALGORITHMS  An algorithm is a set of precise instructions for computation.  The algorithm can perform usual computational steps, e.g., assignments, arithmetic and Boolean operations, loops.  For us, an algorithm will always have input presented as a sequence of bits.  The input size is the number of bits in the input to the algorithm.  The algorithm stops after outputting the solution. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 9. TIME COMPLEXITY OF PROBLEMS  A problem has time complexity TA(n) if there is an algorithm A that solves the problem on every input.  Addition has time complexity O(n).  Multiplication has time complexity O(n2) Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 10. TIME MEASUREMENT  Let A be an algorithm and x be an input to it.  Let TA(x) denote the number of steps of the algorithm on input x.  Let TA(n) denote the maximum of TA(x) over all inputs x of size n.  We will use TA(n) to quantify the time taken by algorithm A to solve a problem on different input sizes.  For example, an algorithm A that adds two n bit numbers using school method has TA(n) = O(n).  An algorithm B that multiplies two n bits numbers using school method has TA(n) = O(n2) Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 11. QUANTIFYING EASY-TO-COMPUTE  The problems of adding and multiplying are definitely easy.  Also, if a problem is easy, and another problem can be solved in time n · T(n) where T(n) is the time complexity of the easy problem, then the new problem is also easy.  This leads to the following definition: A problem is efficiently solvable if its time complexity is n O(1) . Such problems are also called polynomial-time problems. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 12. THE CLASS P  The class P contains all efficiently solvable problems.  Specifically, they are the problems that can be solved in time O(n k) for some constant k, where n is the size of input to the problem. Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 13. THE CLASS NP  NP = Non-Deterministic polynomial time  The class NP contains those problems that are “verifiable” in polynomial time.  e.g 1. Hamiltonian cycle Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 14. HAMILTONIAN CYCLE  Determining whether a directed graph has a Hamiltonian cycle does not have a polynomial time algorithm (yet!)  However if someone was to give you a sequence of vertices, determining whether or not that sequence forms a Hamiltonian cycle can be done in polynomial time  Therefore Hamiltonian cycles are in NP Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 15. SAT  A boolean formula is satisfiable if there exists some assignment of the values 0 and 1 to its variables that causes it to evaluate to 1.  CNF – Conjunctive Normal Form. ANDing of clauses of ORs Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 16. 2-CNF SAT  Each or operation has two arguments that are either variables or negation of variables  The problem in 2 CNF SAT is to find true/false(0 or 1) assignments to the variables in order to make the entire formula true.  Any of the OR clauses can be converted to implication clauses (xy)(yz)(xz)(zy) Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 17. 2-SAT IS IN P  Create the implication graph x y x z z y Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 18. SATISFIABILITY VIA PATH FINDING  If there is a path from  And if there is a path from  Then FAIL!  How to find paths in graphs?  DFS/BFS and modifications thereof Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 19. 3 CNF SAT (3 SAT)  Not so easy anymore.  Implication graph cannot be constructed  No known polytime algorithm  Is it NP?  If someone gives you a solution how long does it take to verify it?  Make one pass through the formula and check  This is an NP problem Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 | www.isquareit.edu.in | info@isquareit.edu.in
  • 20. REFERENCES  Contents are referred from following web resources  https://www.seas.upenn.edu/~bhusnur4/cit596_spri ng2014/PNP.pptx  https://www.cse.iitk.ac.in/users/manindra/presentati ons/IITKTalk.pdf
  • 21. THANK YOU For further details, please contact Manjusha Amritkar manjushaa@isquareit.edu.in Department of Information Technology Hope Foundation’s International Institute of Information Technology, I²IT P-14,Rajiv Gandhi Infotech Park MIDC Phase 1, Hinjawadi, Pune – 411057 Tel - +91 20 22933441/2/3 www.isquareit.edu.in | info@isquareit.edu.in