SlideShare a Scribd company logo
1 of 3
Download to read offline
CHIPTEB 10
NP -Completeness
—=C/E'— —=$=— —=$=— —=Q=— —«a’>=— —=¢=— —=C>=— —=$=— —=C,Er—
3.2.1. NP-complete (polynomial time algorithm)
They are algorithms which on inputs of size n have a worst case
running time of O (nk) for some constant ‘k’.
Example: Quick sort running time :0 (n2) so its algorithm is called NP-complete
algorithm.
There are three classes of problem:-
0 P-class
0 NP-class
0 NPC-class
P-class:
The class P consist of those problems that are solvable in polynomial time
that is in time 0 (nk) for some constant’ k’ where n is input size.
Example: Quick sort running time :0 (n2)
NP—class:
The class NP consist of those problems that are verifiable in polynomial
time that is given a certificate of a solution use could verify that the certificate is
correct in time polynomial in the size of the input to the problem.
Example: Hamilton cycle
NFC-class:
The class NP-complete consists of those problems that are in NP and are as
hard as any problem in NP. Any NP-complete problem cannot be solved in
polynomial time.
3.2.2. Polynomial time reduction algorithm
Suppose there is a decision problem ‘A’ which we 1i ke to solve in
polynomial time. Suppose there is a different decision problem ’B’ that we already
know how to solve in polynomial time. Procedure that transforms any instance ‘ *’
of A into some instance ‘ +’ of B should have the following characteristics:
1. The transformation take polynomial time
2. The answers are the same that is the answer of * is yes if and only if
answer for + is also yes
This procedure is called as a polynomial time reduction algorithm.
Steps
1. Given an instance * of problem use polynomial time reduction algorithm
to transform it to an instance + of problem B.
2. Run the polynomial time decision algorithm for B on the instance +
3. Use the answer for + as the answer for *.
A finite NP-complete problem
Because the technique of reduction relies on having a problem already
known to be NP-complete in order to prove a different problem NP-complete we
need a fast NP-complete problem. For the problem we will use is the circuit
satisfiability problem in which we are given a Boolean combinational circuit
composed of AND, OR & NOT gates and we wish to know whether there is any set
of Boolean inputs to this circuit that causes its output to be one.
The circuit satisfiability problem is given Boolean combinational circuit
composed of AND, OR, NOT gates is it satisfiable. This problem arises in the area
of computer added hardware optimization.
Example: if a sub circuit always produces 0 then that sub circuit can be replaced by
a simpler sub circuit that omits all logic gates and provides the constant value 0 as
its output.
The three basic logic gates that we use in this problem are:
AND gate
2 Input AND gate
A B AB
fl, . U [I El
’3 )__. AB 0 1 U
_. 1 D U
AND 1 1 1
This gate’s output is 1, if all its inputs are 1 and output is 0 otherwise.
OR gate
2 Input 0R me
A B A+B
A 7! ,_ U 0 El
B _J 7/; A+B U 1 1
L 1 I] 1
OR 1 1 1
This gate’s output is 1, if any of its input is 1 and output is 0 otherwise.
NOT gate
NOT a
A _1 3;. . A
|.- a
1
041:1;
It takes a single binary input either 0 or 1 and produces a binary output
whose value is opposite to that of the input value.
A Boolean combinational circuit consist of one or more Boolean
combinational elements interconnected by wires. A wire connects the output of one
element to the input of another. The number of element inputs fed by wire is called
the fan-out of the wire. A one output Boolean combinational circuit is satisfiable if
it has a satisfying assignment that is a truth assignment that causes the output of the
circuit to be1.
3-CNF (conjunctive normal form):-
A Boolean formula is in CNF if it is expressed as an AND of clauses each
of which is the OR of one or more literals. A Boolean formula is in 3-CNF is each
clause has exactly 3 distinct literals.
Example:
(X1V "X4V *x2)V (X3 V XZV X4)V (Fxl V "X3V '—X4)
In 3-CNF satisfiability we are asked whether a given Boolean formula in 3-CNF is
satisfiable or not.

More Related Content

What's hot

Recursion and looping
Recursion and loopingRecursion and looping
Recursion and loopingxcoolanurag
 
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic SynthesisMinimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic SynthesisSajib Mitra
 
Smith et al. - Efficient auditory coding (Nature 2006)
Smith et al. - Efficient auditory coding (Nature 2006)Smith et al. - Efficient auditory coding (Nature 2006)
Smith et al. - Efficient auditory coding (Nature 2006)xrampino
 
A1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_solA1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_solmalasumathi
 
Iteration, induction, and recursion
Iteration, induction, and recursionIteration, induction, and recursion
Iteration, induction, and recursionMohammed Hussein
 
Divide and-conquer multiply two polynomials
Divide and-conquer multiply two polynomialsDivide and-conquer multiply two polynomials
Divide and-conquer multiply two polynomialsHasanain Alshadoodee
 
Module 4 Arithmetic Coding
Module 4 Arithmetic CodingModule 4 Arithmetic Coding
Module 4 Arithmetic Codinganithabalaprabhu
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMRajendran
 
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...Frank Nielsen
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scriptsAmeen San
 
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...ijsrd.com
 
Data Structures- Part2 analysis tools
Data Structures- Part2 analysis toolsData Structures- Part2 analysis tools
Data Structures- Part2 analysis toolsAbdullah Al-hazmy
 
Acquisition of Long Pseudo Code in Dsss Signal
Acquisition of Long Pseudo Code in Dsss SignalAcquisition of Long Pseudo Code in Dsss Signal
Acquisition of Long Pseudo Code in Dsss SignalIJMER
 
On Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational EquivalenceOn Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational Equivalencesatrajit
 
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, StructuresControl Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structuresindra Kishor
 

What's hot (20)

Recursion and looping
Recursion and loopingRecursion and looping
Recursion and looping
 
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic SynthesisMinimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
 
Smith et al. - Efficient auditory coding (Nature 2006)
Smith et al. - Efficient auditory coding (Nature 2006)Smith et al. - Efficient auditory coding (Nature 2006)
Smith et al. - Efficient auditory coding (Nature 2006)
 
Daa
DaaDaa
Daa
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
A1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_solA1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_sol
 
Iteration, induction, and recursion
Iteration, induction, and recursionIteration, induction, and recursion
Iteration, induction, and recursion
 
Divide and-conquer multiply two polynomials
Divide and-conquer multiply two polynomialsDivide and-conquer multiply two polynomials
Divide and-conquer multiply two polynomials
 
Module 4 Arithmetic Coding
Module 4 Arithmetic CodingModule 4 Arithmetic Coding
Module 4 Arithmetic Coding
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
 
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scripts
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
Theory of computation / Post’s Correspondence Problems (PCP)
Theory of computation / Post’s Correspondence Problems (PCP)Theory of computation / Post’s Correspondence Problems (PCP)
Theory of computation / Post’s Correspondence Problems (PCP)
 
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
 
Data Structures- Part2 analysis tools
Data Structures- Part2 analysis toolsData Structures- Part2 analysis tools
Data Structures- Part2 analysis tools
 
Algorithmic Notations
Algorithmic NotationsAlgorithmic Notations
Algorithmic Notations
 
Acquisition of Long Pseudo Code in Dsss Signal
Acquisition of Long Pseudo Code in Dsss SignalAcquisition of Long Pseudo Code in Dsss Signal
Acquisition of Long Pseudo Code in Dsss Signal
 
On Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational EquivalenceOn Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational Equivalence
 
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, StructuresControl Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
 

Similar to Daa chapter10

Np completeness
Np completenessNp completeness
Np completenessRajendran
 
Simplification of Circuits.pdf
Simplification of Circuits.pdfSimplification of Circuits.pdf
Simplification of Circuits.pdfMaryJacob24
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesEr. Nawaraj Bhandari
 
Paper id 27201430
Paper id 27201430Paper id 27201430
Paper id 27201430IJRAT
 
An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...ijsrd.com
 
4 logic circuit optimisation
4 logic circuit optimisation4 logic circuit optimisation
4 logic circuit optimisationchandkec
 
soft computing
soft computingsoft computing
soft computingAMIT KUMAR
 
Digital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraDigital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraelfeds916
 
chapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptxchapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptxRithinA1
 
Design and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpDesign and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpProgramming Exam Help
 
A review on reversible logic gates and their implementation
A review on reversible logic gates and their implementationA review on reversible logic gates and their implementation
A review on reversible logic gates and their implementationDebraj Maji
 
Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Techglyphs
 

Similar to Daa chapter10 (20)

Np completeness
Np completenessNp completeness
Np completeness
 
test generation
test generationtest generation
test generation
 
Simplification of Circuits.pdf
Simplification of Circuits.pdfSimplification of Circuits.pdf
Simplification of Circuits.pdf
 
9. logic gates._rr
9. logic gates._rr9. logic gates._rr
9. logic gates._rr
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
 
Paper id 27201430
Paper id 27201430Paper id 27201430
Paper id 27201430
 
A04220106
A04220106A04220106
A04220106
 
An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...
 
B sc ii sem unit 2(b) ba
B sc ii sem unit 2(b) baB sc ii sem unit 2(b) ba
B sc ii sem unit 2(b) ba
 
Boolean algebra
Boolean algebraBoolean algebra
Boolean algebra
 
4 logic circuit optimisation
4 logic circuit optimisation4 logic circuit optimisation
4 logic circuit optimisation
 
soft computing
soft computingsoft computing
soft computing
 
Digital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraDigital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebra
 
chapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptxchapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptx
 
13 Boolean Algebra
13 Boolean Algebra13 Boolean Algebra
13 Boolean Algebra
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
 
Design and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpDesign and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam Help
 
A review on reversible logic gates and their implementation
A review on reversible logic gates and their implementationA review on reversible logic gates and their implementation
A review on reversible logic gates and their implementation
 
Unit iii update
Unit iii updateUnit iii update
Unit iii update
 
Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
 

More from B.Kirron Reddi (18)

What after graduation_-_mba
What after graduation_-_mbaWhat after graduation_-_mba
What after graduation_-_mba
 
What after graduation_-_banks
What after graduation_-_banksWhat after graduation_-_banks
What after graduation_-_banks
 
What after graduation_-_mca
What after graduation_-_mcaWhat after graduation_-_mca
What after graduation_-_mca
 
Daa chpater14
Daa chpater14Daa chpater14
Daa chpater14
 
Daa chpater 12
Daa chpater 12Daa chpater 12
Daa chpater 12
 
Daa chapter13
Daa chapter13Daa chapter13
Daa chapter13
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
Daa chapter9
Daa chapter9Daa chapter9
Daa chapter9
 
Daa chapter8
Daa chapter8Daa chapter8
Daa chapter8
 
Daa chapter7
Daa chapter7Daa chapter7
Daa chapter7
 
Daa chapter6
Daa chapter6Daa chapter6
Daa chapter6
 
Daa chapter5
Daa chapter5Daa chapter5
Daa chapter5
 
Daa chapter4
Daa chapter4Daa chapter4
Daa chapter4
 
Daa chapter 3
Daa chapter 3Daa chapter 3
Daa chapter 3
 
Daa chapter 2
Daa chapter 2Daa chapter 2
Daa chapter 2
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
Daa contents by B.Kirron Reddi
Daa contents by B.Kirron ReddiDaa contents by B.Kirron Reddi
Daa contents by B.Kirron Reddi
 
Searching and sorting by B kirron Reddi
Searching and sorting by B kirron ReddiSearching and sorting by B kirron Reddi
Searching and sorting by B kirron Reddi
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Daa chapter10

  • 1. CHIPTEB 10 NP -Completeness —=C/E'— —=$=— —=$=— —=Q=— —«a’>=— —=¢=— —=C>=— —=$=— —=C,Er— 3.2.1. NP-complete (polynomial time algorithm) They are algorithms which on inputs of size n have a worst case running time of O (nk) for some constant ‘k’. Example: Quick sort running time :0 (n2) so its algorithm is called NP-complete algorithm. There are three classes of problem:- 0 P-class 0 NP-class 0 NPC-class P-class: The class P consist of those problems that are solvable in polynomial time that is in time 0 (nk) for some constant’ k’ where n is input size. Example: Quick sort running time :0 (n2) NP—class: The class NP consist of those problems that are verifiable in polynomial time that is given a certificate of a solution use could verify that the certificate is correct in time polynomial in the size of the input to the problem. Example: Hamilton cycle NFC-class: The class NP-complete consists of those problems that are in NP and are as hard as any problem in NP. Any NP-complete problem cannot be solved in polynomial time. 3.2.2. Polynomial time reduction algorithm Suppose there is a decision problem ‘A’ which we 1i ke to solve in polynomial time. Suppose there is a different decision problem ’B’ that we already know how to solve in polynomial time. Procedure that transforms any instance ‘ *’ of A into some instance ‘ +’ of B should have the following characteristics:
  • 2. 1. The transformation take polynomial time 2. The answers are the same that is the answer of * is yes if and only if answer for + is also yes This procedure is called as a polynomial time reduction algorithm. Steps 1. Given an instance * of problem use polynomial time reduction algorithm to transform it to an instance + of problem B. 2. Run the polynomial time decision algorithm for B on the instance + 3. Use the answer for + as the answer for *. A finite NP-complete problem Because the technique of reduction relies on having a problem already known to be NP-complete in order to prove a different problem NP-complete we need a fast NP-complete problem. For the problem we will use is the circuit satisfiability problem in which we are given a Boolean combinational circuit composed of AND, OR & NOT gates and we wish to know whether there is any set of Boolean inputs to this circuit that causes its output to be one. The circuit satisfiability problem is given Boolean combinational circuit composed of AND, OR, NOT gates is it satisfiable. This problem arises in the area of computer added hardware optimization. Example: if a sub circuit always produces 0 then that sub circuit can be replaced by a simpler sub circuit that omits all logic gates and provides the constant value 0 as its output. The three basic logic gates that we use in this problem are: AND gate 2 Input AND gate A B AB fl, . U [I El ’3 )__. AB 0 1 U _. 1 D U AND 1 1 1 This gate’s output is 1, if all its inputs are 1 and output is 0 otherwise. OR gate
  • 3. 2 Input 0R me A B A+B A 7! ,_ U 0 El B _J 7/; A+B U 1 1 L 1 I] 1 OR 1 1 1 This gate’s output is 1, if any of its input is 1 and output is 0 otherwise. NOT gate NOT a A _1 3;. . A |.- a 1 041:1; It takes a single binary input either 0 or 1 and produces a binary output whose value is opposite to that of the input value. A Boolean combinational circuit consist of one or more Boolean combinational elements interconnected by wires. A wire connects the output of one element to the input of another. The number of element inputs fed by wire is called the fan-out of the wire. A one output Boolean combinational circuit is satisfiable if it has a satisfying assignment that is a truth assignment that causes the output of the circuit to be1. 3-CNF (conjunctive normal form):- A Boolean formula is in CNF if it is expressed as an AND of clauses each of which is the OR of one or more literals. A Boolean formula is in 3-CNF is each clause has exactly 3 distinct literals. Example: (X1V "X4V *x2)V (X3 V XZV X4)V (Fxl V "X3V '—X4) In 3-CNF satisfiability we are asked whether a given Boolean formula in 3-CNF is satisfiable or not.