Longest path decision problem

NP-HARDNESS
May 07: Lecture 24
Clay Institute problems
• Your chance to be a millionaire
Problems with efficient algorithms
• The diameter problem:
Find the diameter in the input graph
Problems without known
efficient algorithms
• Longest path problem:
Find the longest no-cycles path in the input graph
Search and decision (yes or no) problems
• The diameter problem:
• Find the diameter in the input graph
• Shortest path decision problem
• Given a graph and a parameter k, is the diameter of the graph k?
• Decision in polynomial time
Search and decision (yes or no) problems
• Longest path search problem:
Find the longest no-cycles path in the input graph
• Longest path decision problem:
• Given a graph and a parameter k, is there a no-cycles path of
length equal to k?
• Fastest known algorithm: O(2k n3)
Innocent changes, huge gaps
• 2-SAT problem: Input is a formula like below,
with n Boolean variables, and m clauses of two literals each
(xy)(yz)(xz)(zy)
• Question for decision: Is this formula satisfiable?
• 3-SAT problem: Input is a formula like below,
with n Boolean variables, and m clauses of three literals each
(xy z)(yz   w)(xz w)(zy x)
• Question for decision: Is this formula satisfiable?
Another mysterious problem
• The k-clique:
• Given a graph and a parameter k, does the graph contain a
subgraph which consists of k nodes and has all edges (clique)
• Fastest known algorithm:
How common are mysterious problems?
• There are thousands of problems that people meet in the “realworld” that are mysterious. Nobody can find a polynomial time
algorithm and nobody can be sure that there is not a
polynomial time algorithm.
Are mysterious problems
unrelated?
• Most of them are related:
•
•
•
•
If 3SAT has a polynomial time algorithm then max-clique has one too.
If max-clique has a polynomial time algorithm then 3SAT has one too.
If 3SAT has a polynomial time algorithm then longest path has one too.
If longest path has polynomial time algorithm then 3SAT has one too.
• If max-clique has a polynomial time algorithm then longest path has one too
• If longest path has a polynomial time algorithm then max-clique has one too
Are mysterious problems
unrelated?
• How does this happen?
• The notion of reduction
Is this is a coincidence?
• The class of problems P:
• All decision problems that can be solved in
polynomial time by a usual algorithm.
• The class of problems NP:
• All decision problems that can be solved in
polynomial time by a non-deterministic
algorithm.
• All decision problems that can be verified in
polynomial time