300 likes | 476 Views
Polynomial Church-Turing thesis. A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only if it can be solved in polynomial time by a Turing machine. The complexity class P.
E N D
Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only if it can be solved in polynomial time by a Turing machine.
The complexity class P • P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at most p(|x|) steps on input x. • By the Polynomial Church-Turing Thesis, P is “robust” with respect to changes of the machine model. • Is P also robust with respect to changes of the representation of decision problems as languages?
How to encode max flow instance? java MaxFlow 6#0|16|13|0|0|0#0|0|10|12|0|0 #0|4|0|0|14|0#0|0|9|0|0|20 #0|0|0|7|0|4|#0|0|0|0|0|0
java MaxFlow 111111 #|1111111111111111|1111111111111||| #||1111111111|111111111111|| #|1111|||11111111111111| #||111111111|||11111111111111111111 #|||1111111||1111 #|||||
Ford-Fulkerson • Ford-Fulkerson algorithm is not a polynomial time algorithm if input is encoded in binary. • Ford-Fulkerson is a polynomial time algorithm if input is ecoded in unary.
Polynomial time computable maps f: {0,1}* ! {0,1}* is called polynomial time computable if for some polynomial p, - For all x, |f(x)| ·p(|x|). - Lf2P.
Polynomial time computable maps • A map is polynomial time computable if and only if there is a Turing machine that on every input x accepts after at most a polynomial number of steps and leaves f(x) on its tape when terminating.
Good and polynomially equivalent representations • A representation is good if the language of valid representations is in P. • Two different representations of objects (say graphs, numbers) are called polynomially equivalent if we may translate between them using polynomial time computable maps. • Ex: Adjacency matrices vs. Edge lists • Ex: Binary vs. Decimal • Counterexample: Binary vs. Unary
Robustness of Representation • Given two good, polynomially equivalent representations of the instances of a decision problem, resulting in languages L1 and L2 we have L12P iff L22P.
Terminology • When we say, “Problem X can be solved in polynomial time”, we mean LbinaryX2 P, i.e., we assume binary representation of integers of input. • If we want to say LunaryX2 P, i.e., assume unary representation of integers, we say “Problem X can be solved in pseudopolynomial time”,
Search Problems: NP L is in NP iff there is a language L’ in P and a polynomial p so that:
Intuition • The y-strings are the possible solutions to the instance x. • We require that solutions are not too long and that it can be checked efficiently if a given y is indeed a solution (we have a “simple” search problem)
P vs. NP • P is a subset of NP • Is P=NP? Then any “simple” search problem has a polynomial time algorithm. • This is the most famous open problem of mathematical computer science!
P vs. NP and mathematics • If P=NP, mathematicians may be replaced by (much more reliable) computers: P=NP ) There is an algorithmic procedure that takes as input any formal math statement and always outputs its shortest formal proof in time polynomial in the length of the proof. • This is usually regarded as evidence that P and NP are different.
Reductions • A reduction r of L1 to L2 is a polynomial time computable map so that 8 x: x 2 L1 iff r(x) 2L2 • We write L1· L2 if there is a reduction of L1 to L2. • Intuition: Efficient software for L2 can also be used to efficiently solve L1.
Example • LTSP· LILP
Properties of reductions Transitivity: L1·L2Æ L2· L3)L1·L3 • Follows from Polynomial Church-Turing thesis.
Properties of reductions Downward closure of P: L1·L2Æ L22P ) L12P. • Follows from Polynomial Church-Turing thesis.
NP-hardness • A language L is called NP-hard iff 8L’ 2NP: L’ ·L • Intuition: Software for L is strong enough to be used to solve any simple search problem. • Proposition: If some NP-hard language is in P, then P=NP.
NPC • A language L 2NP that is NP-hard is called NP-complete. • NPC := the class of NP-complete problems. • Proposition: L2NPC) [L2P iff P=NP].
Usefulness of NPC • Languages in NPC are the least likely problems in NP to be in P. • Suppose we would like to find a worst case efficient algorithm for L 2NPC. • If we believe that P is not NP, we know that no worst case efficient algorithm exists. • If we have no opinion about P vs. NP, we know that if we find a worst case efficient algorithm for L, we’ll earn $1,000,000.
How to establish NP-hardness • Thousands of natural problems are NP-complete: • Empiric fact: Most natural problems in NP are either in P or NP-hard. • Lemma: If L1 is NP-hard and L1· L2 then L2 is NP-hard. • We need to establish one problem to be NP-hard, the rest follows using chains of reductions. Cook (1972) established SAT to be NP-hard.
TSP HAMILTONIAN CYCLE MIN VERTEX COLORING SAT MAX INDEPENDENT SET SET COVER ILP MILP KNAPSACK TRIPARTITE MATCHING BINPACKING