SlideShare a Scribd company logo
Module 3
Three classes of decision problems
• P is the set of decision problems that can be
solved in polynomial time.3 Intuitively, P is the
set of problems that can be solved quickly.
• NP is the set of decision problems with the
following property: If the answer is YES, then
there is a proof of this fact that can be checked in
polynomial time.
• co-NP is the opposite of NP. If the answer to a
problem in co-NP is NO, then there is a proof of
this fact that can be checked in polynomial time.
Three classes of decision problems
NP-Completeness
• How would you define NP-Complete?
• They are the “hardest” problems in NP
P
NP
NP-Complete
Definition of NP-Complete
• Q is an NP-Complete problem if:
• 1) Q is in NP
• 2) every other NP problem polynomial time
reducible to Q
SAT
• 3SAT:
– n variables (taking values 0 and 1)
– m clauses, each being OR of 3 variables or their
negations
• E.g. (¬x1) x2 (¬x3)
– 3SAT formula: AND of these m clauses
• E.g. ((¬x1) x2 x3) ((¬x2) x4 (¬x5)) (x1 x3 x5)
• 3SAT Problem: Is there an assignment of
variables s.t. the formula evaluates to 1?
– i.e. satisfying all clauses.
Hard
• 3SAT is known as an NP-complete problem.
– Very hard: no polynomial algorithm is known.
– Conjecture: no polynomial algorithm exists.
– If a polynomial algorithm exists for 3SAT, then
polynomial algorithms exist for all NP problems.
• Later in this course
NP-Complete
• To prove a problem is NP-Complete show a
polynomial time reduction from 3-SAT
• Other NP-Complete Problems:
– PARTITION
– SUBSET-SUM
– CLIQUE
– HAMILTONIAN PATH (TSP)
– GRAPH COLORING
– MINESWEEPER (and many more)
NP-Completeness Proof Method
• To show that Q is NP-Complete:
• 1) Show that Q is in NP
• 2) Pick an instance, R, of your favorite NP-
Complete problem (ex: Φ in 3-SAT)
• 3) Show a polynomial algorithm to transform
R into an instance of Q
Example: Clique
• CLIQUE = { <G,k> | G is a graph with a clique
of size k }
• A clique is a subset of vertices that are all
connected
• Why is CLIQUE in NP?
Reduce 3-SAT to Clique
• Pick an instance of 3-SAT, Φ, with k clauses
• Make a vertex for each literal
• Connect each vertex to the literals in other
clauses that are not the negation
• Any k-clique in this graph corresponds to a
satisfying assignment
Example: Independent Set
• INDEPENDENT SET = { <G,k> | where G has an
independent set of size k }
• An independent set is a set of vertices that
have no edges
• How can we reduce this to clique?
Independent Set to CLIQUE
• This is the dual problem!

More Related Content

What's hot

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
 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common Subsequence
Krishma Parekh
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
Abhishek Singh
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
Rajendran
 
Artificial Neural Networks for Data Mining
Artificial Neural Networks for Data MiningArtificial Neural Networks for Data Mining
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
Andres Mendez-Vazquez
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
Waqar Akram
 
Problems, Problem spaces and Search
Problems, Problem spaces and SearchProblems, Problem spaces and Search
Problems, Problem spaces and Search
BMS Institute of Technology and Management
 
ProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) IntroductionProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) Introduction
wahab khan
 
01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming
Fenil Shah
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
sandeep54552
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th Sem
DigiGurukul
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
Md. Main Uddin Rony
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Yıldırım Tam
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
Harry Potter
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchNilu Desai
 
knapsack problem
knapsack problemknapsack problem
knapsack problem
Adnan Malak
 

What's hot (20)

Np complete
Np completeNp complete
Np complete
 
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
 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common Subsequence
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Artificial Neural Networks for Data Mining
Artificial Neural Networks for Data MiningArtificial Neural Networks for Data Mining
Artificial Neural Networks for Data Mining
 
Np complete
Np completeNp complete
Np complete
 
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
 
Problems, Problem spaces and Search
Problems, Problem spaces and SearchProblems, Problem spaces and Search
Problems, Problem spaces and Search
 
ProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) IntroductionProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) Introduction
 
01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th Sem
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
knapsack problem
knapsack problemknapsack problem
knapsack problem
 

Similar to np complete

class23.ppt
class23.pptclass23.ppt
class23.ppt
AjayPratap828815
 
Complexity theory
Complexity theory Complexity theory
Complexity theory
Dr Shashikant Athawale
 
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxmteteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
zoobiarana76
 
SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...
SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...
SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...
SMART Infrastructure Facility
 
lect5-1.ppt
lect5-1.pptlect5-1.ppt
Unit 5
Unit 5Unit 5
Unit 5
guna287176
 
Teori pnp
Teori pnpTeori pnp
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
S.Shayan Daneshvar
 
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 questionguest577718
 
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 Problemguest577718
 
Mar25.pptx
Mar25.pptxMar25.pptx
Mar25.pptx
AlImran58344
 
Np completeness h4
Np completeness  h4Np completeness  h4
Np completeness h4
Rajendran
 

Similar to np complete (20)

AA ppt9107
AA ppt9107AA ppt9107
AA ppt9107
 
class23.ppt
class23.pptclass23.ppt
class23.ppt
 
Complexity theory
Complexity theory Complexity theory
Complexity theory
 
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxmteteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
 
DAA.pdf
DAA.pdfDAA.pdf
DAA.pdf
 
SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...
SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...
SMART Seminar Series: "A polynomial algorithm to solve hard np 3 cnf-sat prob...
 
lect5-1.ppt
lect5-1.pptlect5-1.ppt
lect5-1.ppt
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 5
Unit 5Unit 5
Unit 5
 
Teori pnp
Teori pnpTeori pnp
Teori pnp
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
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
 
Pnp
PnpPnp
Pnp
 
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
 
Mar25.pptx
Mar25.pptxMar25.pptx
Mar25.pptx
 
Np completeness h4
Np completeness  h4Np completeness  h4
Np completeness h4
 
csps.ppt
csps.pptcsps.ppt
csps.ppt
 

Recently uploaded

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 

Recently uploaded (20)

Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 

np complete

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Three classes of decision problems • P is the set of decision problems that can be solved in polynomial time.3 Intuitively, P is the set of problems that can be solved quickly. • NP is the set of decision problems with the following property: If the answer is YES, then there is a proof of this fact that can be checked in polynomial time. • co-NP is the opposite of NP. If the answer to a problem in co-NP is NO, then there is a proof of this fact that can be checked in polynomial time.
  • 8. Three classes of decision problems
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. NP-Completeness • How would you define NP-Complete? • They are the “hardest” problems in NP P NP NP-Complete
  • 15. Definition of NP-Complete • Q is an NP-Complete problem if: • 1) Q is in NP • 2) every other NP problem polynomial time reducible to Q
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. SAT • 3SAT: – n variables (taking values 0 and 1) – m clauses, each being OR of 3 variables or their negations • E.g. (¬x1) x2 (¬x3) – 3SAT formula: AND of these m clauses • E.g. ((¬x1) x2 x3) ((¬x2) x4 (¬x5)) (x1 x3 x5) • 3SAT Problem: Is there an assignment of variables s.t. the formula evaluates to 1? – i.e. satisfying all clauses.
  • 22. Hard • 3SAT is known as an NP-complete problem. – Very hard: no polynomial algorithm is known. – Conjecture: no polynomial algorithm exists. – If a polynomial algorithm exists for 3SAT, then polynomial algorithms exist for all NP problems. • Later in this course
  • 23.
  • 24.
  • 25.
  • 26. NP-Complete • To prove a problem is NP-Complete show a polynomial time reduction from 3-SAT • Other NP-Complete Problems: – PARTITION – SUBSET-SUM – CLIQUE – HAMILTONIAN PATH (TSP) – GRAPH COLORING – MINESWEEPER (and many more)
  • 27. NP-Completeness Proof Method • To show that Q is NP-Complete: • 1) Show that Q is in NP • 2) Pick an instance, R, of your favorite NP- Complete problem (ex: Φ in 3-SAT) • 3) Show a polynomial algorithm to transform R into an instance of Q
  • 28. Example: Clique • CLIQUE = { <G,k> | G is a graph with a clique of size k } • A clique is a subset of vertices that are all connected • Why is CLIQUE in NP?
  • 29. Reduce 3-SAT to Clique • Pick an instance of 3-SAT, Φ, with k clauses • Make a vertex for each literal • Connect each vertex to the literals in other clauses that are not the negation • Any k-clique in this graph corresponds to a satisfying assignment
  • 30.
  • 31. Example: Independent Set • INDEPENDENT SET = { <G,k> | where G has an independent set of size k } • An independent set is a set of vertices that have no edges • How can we reduce this to clique?
  • 32. Independent Set to CLIQUE • This is the dual problem!