






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







A given problem can be solved by many different algorithms. WhichALGORITHMS will be useful in practice?A working definition: (Jack Edmonds, 1962)^ n
Efficient: polynomial time for ALL inputs. n^
Inefficient: "exponential time" for SOME inputs. Robust definition has led to explosion of useful algorithms for widespectrum of problems.^ n
Notable exception: simplex algorithm.
3
Exponential growth dwarfs technological change.^ n
Suppose each electron in the universe had power of today’ssupercomputers. n^
And each works for the life of the universe in an effort to solve TSPproblem using N! algorithm. n^
Will not succeed for 1,000 city TSP!
1000
79
13
12
Quantity
Number
Home PC instructions / second
9
Supercomputer instructions / second
12
Seconds per year
9
Age of universe †
13
Electrons in universe †
79
Some Numbers
† Estimated
Which PROBLEMS will we be able to solve in practice?^ n
Those with efficient algorithms. n^
How can I tell if I am trying to solve such a problem?
Theory of NP-completeness helps.Yes
Probably No
Shortest path
Longest path
Euler cycle
Hamiltonian cycle
Min cut
Max cut
Matching
3D-Matching
UnknownPrimalityFactoring
Graph isomorphism
Baseball elimination
Soccer elimination
Bipartite vertex cover
Vertex cover
5
Decision problem X.^ n
X is a (possibly infinite) set of binary strings. n^
Instance: finite binary string s, of length |s|. n^
Algorithm A solves X if A(s) = YES
s
Polynomial time.^ n
Algorithm A runs in polynomial-time if for every instance s, Aterminates in at most p(s) "steps", where p is some polynomial. Definition of P.^ n
Set of all decision problems solvable in polynomial time on adeterministic Turing machine. Examples:^ n
MULTIPLE: Is the integer y a multiple of x? n^
RELPRIME: Are the integers x and y relatively prime? n^
PERFECT-MATCHING: Given graph G, is there a perfect matching?
Definition of P fundamental because of SCT.Strong Church-Turing thesis:^ n
P is the set of decision problems solvable in polynomial time onREAL computers. Evidence supporting thesis:^ n
True for all physical computers. n^
Can create deterministic TM that efficiently simulates any realgeneral-purpose machine (and vice versa). Possible exception?^ n
Quantum computers: no conventional gates.
7
Certification algorithm.^ n
Design an algorithm that checks whether proposed solution is aYES instance. Algorithm C is an efficient certifier for X if:^ n
C is a polynomial-time algorithm that takes two inputs s and t. n^
There exists a polynomial p( ) so that for every string s, s
there exists a string t such that |t|
p(|s|) and C(s, t) = YES.
Intuition.^ n
Efficient certifier views things from "managerial" viewpoint. n^
It doesn’t determine whether s
X on its own.
n^
Rather, it evaluates a proposed proof t that s
n^
Accepts if and only if given a "short" proof of this fact.
COMPOSITE: Given integer s, is s composite?Observation. s is composite
there exists an integer 1 < t < ssuch that s is a multiple of t.^ n
YES instance: s = 437,669.^ –
certificate t = 541 or 809 (a factor)
Certifier:Is s a multiple of t?
Input s:437,
Certificate t: 541
s is a YES instance
no conclusion
13
Definition of EXP:^ n
Set of all decision problems solvable in exponential time on adeterministic Turing machine. Claim: NP
Proof: Consider problem X
n^
Then, there exists efficient certifier C(s, t) for X. n^
To solve input s, run C(s, t) on all strings t with |t|
p(|s|).
n^
Return YES, if C(s, t) returns YES for any of these. Useful alternate definition of NP:^ n
Set of all decision problems solvable in polynomial time on aNONDETERMINISTIC Turing machine. n^
Intuition: act of searching for t is viewed as a non-deterministicsearch over the space of possible proofs. Nondeterministic TMcan try all possible solutions in parallel.
Does P = NP?
(Edmonds, 1962)
n^
Is the original DECISION problem as easy as CERTIFICATION? n^
Does nondeterminism help you solve problems faster? Most important open problem in computer science.^ n
If yes, staggering practical significance. n^
Clay Foundation Millennium $1 million prize.
P If P
If P = NP
15
Generator (P)
Certifier (NP)
n^
Factor integer s.
n^
Is s a multiple of t?
n^
Color a map with minimum # colors.
n^
Check if all adjacent regionshave different colors.
n^
Design airfoil of minimum drag.
n^
Compute drag of airfoil.
n^
Prove a beautiful theorem.
n^
Understand its proof.
n^
Write a beautiful sonnet.
n^
Appreciate it.
n^
Devise a good joke.
n^
Laugh at it.
n^
Vinify fine wine.
n^
Be a wine snob.
n^
Orate a good lecture.
n^
Know when you’ve heard one.
n^
Ace an exam.
n^
Verify TA’s solutions.
Imagine the wealth of a society that produces optimal planes, bridges,rockets, theorems, art, music, wine, jokes.
Does P = NP?^ n
Is the original DECISION problem as easy as CERTIFICATION? If yes, then:^ n
Efficient algorithms for 3-COLOR, TSP, FACTOR,... n^
Cryptography is impossible (except for one-time pads) onconventional machines. n^
Modern banking system will collapse. n^
Harmonial bliss. If no, then:^ n
Can’t hope to write efficient algorithm for TSP. n^
But maybe efficient algorithm still exists for FACTOR....
17
Does P = NP?^ n
Is the original DECISION problem as easy as CERTIFICATION? Probably no, since:^ n
Thousands of researchers have spent four frustrating decades insearch of polynomial algorithms for many fundamental NPproblems without success. n^
Consensus opinion: P
But maybe yes, since:^ n
No success in proving P
NP either.
Problem X polynomial reduces (Cook-Turing) to problem Y (X
P^
Y) if
arbitrary instances of problem X can be solved using:^ n
Polynomial number of standard computational steps, plus n^
Polynomial number of calls to oracle that solves problem Y. Problem X polynomial transforms (Karp) to problem Y if given anyinput x to X, we can construct an input y such that x is a YES instanceof X if and only if y is a YES instance of Y.^ n
We require |y| to be of size polynomial in |x|. Polynomial transformation is polynomial reduction with just one callto oracle for Y, exactly at the end of the algorithm for X.Note: all previous reductions were of this form!
19
Definition of NP-complete:^ n
A problem Y in NP with the property that for every problem X in NP,X polynomial transforms to Y. n^
"Hardest computational problems" in NP. EXP
P If P
If P = NP
complete
Definition of NP-complete:^ n
A problem Y in NP with the property that for every problem X in NP,X polynomial transforms to Y. Significance.^ n
Efficient algorithm for any NP-complete problem
efficient algorithm for every other problem in NP. n^
Links together a huge and diverse number of fundamentalproblems:^ –
n^
Can implement any computer program in 3-COLOR. Notorious complexity class.^ n
Only exponential algorithms known for these problems. n^
Called "intractable" - unlikely that they can be solved given limitedcomputing resources.
25
Minesweeper consistency problem.^ n
Given a state of what purports to be a Minesweeper games, is itlogically consistent.
Minesweeper consistency problem.^ n
Given a state of what purports to be a Minesweeper games, is itlogically consistent. Claim. Minesweeper consistency is NP-complete.^ n
Proof idea: reduce from circuit satisfiability. n^
Build circuit by laying out appropriate minesweeperconfigurations.
A Minesweeper Wire
27
A NOT Gate
An AND Gate
A OR Gate
A 3-way Splitter A Phase Changer
29
A Wire Crossing
Hope that worst case doesn’t occur.^ n
Complexity theory deals with worst case behavior. The instance(s)you want to solve may be "easy."^ –
TSP where all points are on a line or circle – 13,509 US city TSP problem solved
(Cook et. al., 1998)
31
Hope that worst case doesn’t occur.Change the problem.^ n
Develop a heuristic, and hope it produces a good solution. n^
Design an approximation algorithm:
algorithm that is guaranteed
to find a high-quality solution in polynomial time.^ –
active area of research, but not always possibleunless P = NP! – Euclidean TSP tour within 1% of optimal – stay tuned
Sanjeev Arora (1997)
Hope that worst case doesn’t occur.Change the problem.Exploit intractability.^ n
Cryptography.
37
PRIME: Given integer s, is s prime?Observation. s is composite if andonly if there exists an integer 1 < t < ssuch that s is a multiple of t.^ n
NO instance: s = 437,669. Conclusions.^ n
co-NP.
n^
Certifier:Is s a multiple of t?
Input s:437,
Certificate t: 541
s is a NO instance
no conclusion
COMPOSITE: Given integer s, is s composite?Fact (Pratt). s is prime if and only ifs > 2 is odd and there exists aninteger 1 < t < s s.t.^ n
NO instance: 437,677. Conclusions.^ n
co-NP.
n^
Certifier:17^(s-1) mod s = 1s - 1 = 2
17^(s-1)/2 mod s = 437,67617^(s-1)/3 mod s = 329,41517^(s-1)/36,473 mod s = 305,
Input s:437,
Certificate t: 17
s is a NO instance
no conclusion
/) 1 ( 1
p s s
− −
39
Fundamental question: does NP = co-NP?^ n
Do YES-instances have short certificates if and only if NO-instances have short certificates. n^
Consensus opinion: no. Theorem. If NP
co-NP, then P
Proof. We prove if P = NP, then NP = co-NP.^ n
Key idea: P is closed under complementation, so if P = NP, thenNP is closed under complementation as well. n^
More formally, using the assumption P = NP: n^
Thus, NP
co-NP and co-NP
NP, so co-NP = NP.
co ∈ ⇒ ∈ ⇒ ∈ ⇒ ∈ ⇒ ∈
NP X
P X
P X
NP X
NP
X^
co
Good characterization: NP
s
co-NP.
n^
If problem X is in NP and co-NP, then:^ –
for YES instance, there is a short certificate – for NO instance, there is a short certificate n^
Provides conceptual leverage for reasoning about a problem. Examples.^ n
MAX-FLOW: given a network, is there an s-t flow of value
-^ if yes, can exhibit s-t flow that achieves this value -^ if no, can exhibit s-t cut whose capacity is less than W n^
PERFECT-MATCHING: given a bipartite graph, is there a perfectmatching.^ –
if yes, can exhibit a perfect matching – if no, can exhibit a set of vertices S
L such that the total
number of neighbors of S is strictly less than |S|
41
Observation. P
s
co-NP.
n^
Proof of max-flow min-cut theorem and Hall’s theorem led tostronger results that max-flow and bipartite matching are in P. n^
Sometimes finding a good characterization seems easier thanfinding an efficient algorithm: linear programming. Fundamental question: does P = NP
s
co-NP?
n^
Mixed opinions. n^
Many examples where problem found to have a non-trivial goodcharacterization, but only years later discovered to be in P. n^
Note: PRIME
s
co-NP, but not known to be in P.
Knuth. (SIGACT News 6, January 1974, p. 12 – 18)Find an adjective x that sounds good in sentences like.^ n
FIND-TSP-TOUR is x. n^
It is x to decide whether a given graph has a Hamiltonian cycle. n^
It is unknown whether FACTOR is an x problem. Note: x does not necessarily imply that a problem is in NP or even adecision problem.Knuth's original suggestions.^ n
Hard. n^
Tough. n^
Herculean. n^
Formidable. n^
Arduous.
43
Some English word write-ins.^ n
Impractical. n^
Bad. n^
Heavy. n^
Tricky. n^
Intricate. n^
Prodigious. n^
Difficult. n^
Intractable. n^
Costly. n^
Obdurate. n^
Obstinate. n^
Exorbitant. n^
Interminable.
Hard-boiled. (Ken Steiglitz)^ n
In honor of Cook. Hard-ass. (Al Meyer)^ n
Hard as satisfiability. Sisyphean. (Bob Floyd)^ n
Problem of Sisyphus was time-consuming. n^
Hercules needed great strength. n^
Problem: Sisyphus never finished his task
unsolvable.
Ulyssean. (Don Knuth)^ n
Ulysses was note for his persistence and also finished.