SlideShare a Scribd company logo
1 of 17
Download to read offline
Lecture 22:
The NP-Completeness Challenge
         Steven Skiena

Department of Computer Science
 State University of New York
 Stony Brook, NY 11794–4400

http://www.cs.sunysb.edu/∼skiena
Problem of the Day
Show that the Hitting Set problem is NP-complete:
Input: A collection C of subsets of a set S, positive integer k.
Question: Does S contain a subset S such that |S | ≤ k and
each subset in C contains at least one element from S ?
Techniques for Proving N P -completeness

1. Restriction – Show that a special case of your problem
   is N P -complete. E.g. the problem of finding a path of
   length k is really Hamiltonian Path.
2. Local Replacement – Make local changes to the structure.
   An example is the reduction SAT ∝ 3 − SAT . Another
   is showing isomorphism is no easier for bipartite graphs:




  For any graph, replacing an edge with makes it bipartite.
3. Component Design - These are the ugly, elaborate
   constructions
The Art of Proving Hardness
Proving that problems are hard is an skill. Once you get the
hang of it, it is surprisingly straightforward and pleasurable to
do. Indeed, the dirty little secret of NP-completeness proofs
is that they are usually easier to recreate than explain, in the
same way that it is usually easier to rewrite old code than the
try to understand it.
I offer the following advice to those needing to prove the
hardness of a given problem:
Make your source problem as simple (i.e.
restricted) as possible
Never use the general traveling salesman problem (TSP) as a
target problem. Instead, use TSP on instances restricted to the
triangle inequality. Better, use Hamiltonian cycle, i.e. where
all the weights are 1 or ∞. Even better, use Hamiltonian
path instead of cycle. Best of all, use Hamiltonian path on
directed, planar graphs where each vertex has total degree 3.
All of these problems are equally hard, and the more you
can restrict the problem you are reducing, the less work your
reduction has to do.
Make your target problem as hard as possible
Don’t be afraid to add extra constraints or weights or
freedoms in order to make your problem more general (at
least temporarily).
Select the right source problem for the right
reason
Selecting the right source problem makes a big difference is
how difficult it is to prove a problem hard. This is the first
and easiest place to go wrong.
I usually consider four and only four problems as candidates
for my hard source problem. Limiting them to four means
that I know a lot about these problems – which variants of
these problems are hard and which are soft. My favorites are:
 • 3-Sat – that old reliable. . . When none of the three
   problems below seem appropriate, I go back to the source.
 • Integer partition – the one and only choice for problems
   whose hardness seems to require using large numbers.
• Vertex cover – for any graph problems whose hardness
  depends upon selection. Chromatic number, clique, and
  independent set all involve trying to select the correct
  subset of vertices or edges.
• Hamiltonian path – for any graph problems whose
  hardness depends upon ordering. If you are trying to route
  or schedule something, this is likely your lever.
Amplify the penalties for making the undesired
transition
You are trying to translate one problem into another, while
making them stay the same as much as possible. The easiest
way to do this is to be bold with your penalties, to punish
anyone trying to deviate from your proposed solution. “If
you pick this, then you have to pick up this huge set which
dooms you to lose.” The sharper the consequences for doing
what is undesired, the easier it is to prove if and only if.
Think strategically at a high level, then build
gadgets to enforce tactics.
You should be asking these kinds of questions. “How can I
force that either A or B but not both are chosen?” “How can
I force that A is taken before B?” “How can I clean up the
things I did not select?”
Alternate between looking for an algorithm or
a reduction if you get stuck
Sometimes the reason you cannot prove hardness is that there
is an efficient algorithm to solve your problem! When you
can’t prove hardness, it likely pays to change your thinking at
least for a little while to keep you honest.
Now watch me try it!
To demonstrate how one goes about proving a problem hard,
I accept the challenge of showing how a proof can be built on
the fly.
I need a volunteer to pick a random problem from the 400+
hard problems in the back of Garey and Johnson.
The Problem
The Solution
Other N P -complete Problems

 • Partition - can you partition n integers into two subsets so
   that the sums of the subset are equal?
 • Bin Packing - how many bins of a given size do you need
   to hold n items of variable size?
 • Chromatic Number - how many colors do you need to
   color a graph?
 • N × N checkers - does black have a forced win from a
   given position?
Open: Graph Isomorphism, Factoring Integers.
Polynomial or Exponential?
Just changing a problem a little can make the difference
between it being in P or N P -complete:

           P                     N P -complete
           Shortest Path          Longest Path
           Eulerian Circuit Hamiltonian Circuit
           Edge Cover             Vertex Cover

The first thing you should do when you suspect a problem
might be NP-complete is look in Garey and Johnson,
Computers and Intractability.

More Related Content

Viewers also liked

lecture 27
lecture 27lecture 27
lecture 27
sajinsc
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
chidabdu
 

Viewers also liked (15)

P vs NP
P vs NP P vs NP
P vs NP
 
Np completeness-Design and Analysis of Algorithms
Np completeness-Design and Analysis of Algorithms Np completeness-Design and Analysis of Algorithms
Np completeness-Design and Analysis of Algorithms
 
Unit7
Unit7Unit7
Unit7
 
lecture 27
lecture 27lecture 27
lecture 27
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
 
An Education
An EducationAn Education
An Education
 
Np cooks theorem
Np cooks theoremNp cooks theorem
Np cooks theorem
 
Np completeness h4
Np completeness  h4Np completeness  h4
Np completeness h4
 
np complete
np completenp complete
np complete
 
University timetable scheduling
University timetable schedulingUniversity timetable scheduling
University timetable scheduling
 
Introduction to NP Completeness
Introduction to NP CompletenessIntroduction to NP Completeness
Introduction to NP Completeness
 
Np complete
Np completeNp complete
Np complete
 
Vertex cover Problem
Vertex cover ProblemVertex cover Problem
Vertex cover Problem
 
NP completeness
NP completenessNP completeness
NP completeness
 
Time Table Management System
Time Table Management SystemTime Table Management System
Time Table Management System
 

Similar to Skiena algorithm 2007 lecture22 np completeness challenge

The Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and BackThe Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and Back
Moshe Vardi
 

Similar to Skiena algorithm 2007 lecture22 np completeness challenge (20)

bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptxbcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
 
DynamicProgramming.pptx
DynamicProgramming.pptxDynamicProgramming.pptx
DynamicProgramming.pptx
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
 
Knapsack problem using fixed tuple
Knapsack problem using fixed tupleKnapsack problem using fixed tuple
Knapsack problem using fixed tuple
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 5
Unit 5Unit 5
Unit 5
 
Data Analysis and Algorithms Lecture 1: Introduction
 Data Analysis and Algorithms Lecture 1: Introduction Data Analysis and Algorithms Lecture 1: Introduction
Data Analysis and Algorithms Lecture 1: Introduction
 
Introduction to Support Vector Machines
Introduction to Support Vector MachinesIntroduction to Support Vector Machines
Introduction to Support Vector Machines
 
Greedy_Backtracking graph coloring.ppt
Greedy_Backtracking graph coloring.pptGreedy_Backtracking graph coloring.ppt
Greedy_Backtracking graph coloring.ppt
 
Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programming
 
26 assumptions
26 assumptions26 assumptions
26 assumptions
 
04-Unit Four - OR.pptx
04-Unit Four - OR.pptx04-Unit Four - OR.pptx
04-Unit Four - OR.pptx
 
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWERUndecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
 
NC-NETS Employability Skills: Problem Solving
NC-NETS Employability Skills: Problem SolvingNC-NETS Employability Skills: Problem Solving
NC-NETS Employability Skills: Problem Solving
 
lect5-1.ppt
lect5-1.pptlect5-1.ppt
lect5-1.ppt
 
Introduction to Optimization revised.ppt
Introduction to Optimization revised.pptIntroduction to Optimization revised.ppt
Introduction to Optimization revised.ppt
 
Lec 6 bsc csit
Lec 6 bsc csitLec 6 bsc csit
Lec 6 bsc csit
 
The Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and BackThe Automated-Reasoning Revolution: from Theory to Practice and Back
The Automated-Reasoning Revolution: from Theory to Practice and Back
 
Introduction
IntroductionIntroduction
Introduction
 
Hands on Math Powerpoint
Hands on Math Powerpoint Hands on Math Powerpoint
Hands on Math Powerpoint
 

More from zukun

My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
zukun
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCV
zukun
 
ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Information
zukun
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statistics
zukun
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibration
zukun
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
zukun
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
zukun
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
zukun
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
zukun
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectors
zukun
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-intro
zukun
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
zukun
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video search
zukun
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video search
zukun
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learning
zukun
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer vision
zukun
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick start
zukun
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
zukun
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structures
zukun
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities
zukun
 

More from zukun (20)

My lyn tutorial 2009
My lyn tutorial 2009My lyn tutorial 2009
My lyn tutorial 2009
 
ETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCVETHZ CV2012: Tutorial openCV
ETHZ CV2012: Tutorial openCV
 
ETHZ CV2012: Information
ETHZ CV2012: InformationETHZ CV2012: Information
ETHZ CV2012: Information
 
Siwei lyu: natural image statistics
Siwei lyu: natural image statisticsSiwei lyu: natural image statistics
Siwei lyu: natural image statistics
 
Lecture9 camera calibration
Lecture9 camera calibrationLecture9 camera calibration
Lecture9 camera calibration
 
Brunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer visionBrunelli 2008: template matching techniques in computer vision
Brunelli 2008: template matching techniques in computer vision
 
Modern features-part-4-evaluation
Modern features-part-4-evaluationModern features-part-4-evaluation
Modern features-part-4-evaluation
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
 
Modern features-part-1-detectors
Modern features-part-1-detectorsModern features-part-1-detectors
Modern features-part-1-detectors
 
Modern features-part-0-intro
Modern features-part-0-introModern features-part-0-intro
Modern features-part-0-intro
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
 
Lecture 01 internet video search
Lecture 01 internet video searchLecture 01 internet video search
Lecture 01 internet video search
 
Lecture 03 internet video search
Lecture 03 internet video searchLecture 03 internet video search
Lecture 03 internet video search
 
Icml2012 tutorial representation_learning
Icml2012 tutorial representation_learningIcml2012 tutorial representation_learning
Icml2012 tutorial representation_learning
 
Advances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer visionAdvances in discrete energy minimisation for computer vision
Advances in discrete energy minimisation for computer vision
 
Gephi tutorial: quick start
Gephi tutorial: quick startGephi tutorial: quick start
Gephi tutorial: quick start
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
 
Object recognition with pictorial structures
Object recognition with pictorial structuresObject recognition with pictorial structures
Object recognition with pictorial structures
 
Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities Iccv2011 learning spatiotemporal graphs of human activities
Iccv2011 learning spatiotemporal graphs of human activities
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Skiena algorithm 2007 lecture22 np completeness challenge

  • 1. Lecture 22: The NP-Completeness Challenge Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794–4400 http://www.cs.sunysb.edu/∼skiena
  • 2. Problem of the Day Show that the Hitting Set problem is NP-complete: Input: A collection C of subsets of a set S, positive integer k. Question: Does S contain a subset S such that |S | ≤ k and each subset in C contains at least one element from S ?
  • 3. Techniques for Proving N P -completeness 1. Restriction – Show that a special case of your problem is N P -complete. E.g. the problem of finding a path of length k is really Hamiltonian Path. 2. Local Replacement – Make local changes to the structure. An example is the reduction SAT ∝ 3 − SAT . Another is showing isomorphism is no easier for bipartite graphs: For any graph, replacing an edge with makes it bipartite.
  • 4. 3. Component Design - These are the ugly, elaborate constructions
  • 5. The Art of Proving Hardness Proving that problems are hard is an skill. Once you get the hang of it, it is surprisingly straightforward and pleasurable to do. Indeed, the dirty little secret of NP-completeness proofs is that they are usually easier to recreate than explain, in the same way that it is usually easier to rewrite old code than the try to understand it. I offer the following advice to those needing to prove the hardness of a given problem:
  • 6. Make your source problem as simple (i.e. restricted) as possible Never use the general traveling salesman problem (TSP) as a target problem. Instead, use TSP on instances restricted to the triangle inequality. Better, use Hamiltonian cycle, i.e. where all the weights are 1 or ∞. Even better, use Hamiltonian path instead of cycle. Best of all, use Hamiltonian path on directed, planar graphs where each vertex has total degree 3. All of these problems are equally hard, and the more you can restrict the problem you are reducing, the less work your reduction has to do.
  • 7. Make your target problem as hard as possible Don’t be afraid to add extra constraints or weights or freedoms in order to make your problem more general (at least temporarily).
  • 8. Select the right source problem for the right reason Selecting the right source problem makes a big difference is how difficult it is to prove a problem hard. This is the first and easiest place to go wrong. I usually consider four and only four problems as candidates for my hard source problem. Limiting them to four means that I know a lot about these problems – which variants of these problems are hard and which are soft. My favorites are: • 3-Sat – that old reliable. . . When none of the three problems below seem appropriate, I go back to the source. • Integer partition – the one and only choice for problems whose hardness seems to require using large numbers.
  • 9. • Vertex cover – for any graph problems whose hardness depends upon selection. Chromatic number, clique, and independent set all involve trying to select the correct subset of vertices or edges. • Hamiltonian path – for any graph problems whose hardness depends upon ordering. If you are trying to route or schedule something, this is likely your lever.
  • 10. Amplify the penalties for making the undesired transition You are trying to translate one problem into another, while making them stay the same as much as possible. The easiest way to do this is to be bold with your penalties, to punish anyone trying to deviate from your proposed solution. “If you pick this, then you have to pick up this huge set which dooms you to lose.” The sharper the consequences for doing what is undesired, the easier it is to prove if and only if.
  • 11. Think strategically at a high level, then build gadgets to enforce tactics. You should be asking these kinds of questions. “How can I force that either A or B but not both are chosen?” “How can I force that A is taken before B?” “How can I clean up the things I did not select?”
  • 12. Alternate between looking for an algorithm or a reduction if you get stuck Sometimes the reason you cannot prove hardness is that there is an efficient algorithm to solve your problem! When you can’t prove hardness, it likely pays to change your thinking at least for a little while to keep you honest.
  • 13. Now watch me try it! To demonstrate how one goes about proving a problem hard, I accept the challenge of showing how a proof can be built on the fly. I need a volunteer to pick a random problem from the 400+ hard problems in the back of Garey and Johnson.
  • 16. Other N P -complete Problems • Partition - can you partition n integers into two subsets so that the sums of the subset are equal? • Bin Packing - how many bins of a given size do you need to hold n items of variable size? • Chromatic Number - how many colors do you need to color a graph? • N × N checkers - does black have a forced win from a given position? Open: Graph Isomorphism, Factoring Integers.
  • 17. Polynomial or Exponential? Just changing a problem a little can make the difference between it being in P or N P -complete: P N P -complete Shortest Path Longest Path Eulerian Circuit Hamiltonian Circuit Edge Cover Vertex Cover The first thing you should do when you suspect a problem might be NP-complete is look in Garey and Johnson, Computers and Intractability.