






Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Prepara tus exámenes
Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Prepara tus exámenes con los documentos que comparten otros estudiantes como tú en Docsity
Encuentra los documentos específicos para los exámenes de tu universidad
Estudia con lecciones y exámenes resueltos basados en los programas académicos de las mejores universidades
Responde a preguntas de exámenes reales y pon a prueba tu preparación
Consigue puntos base para descargar
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Comunidad
Pide ayuda a la comunidad y resuelve tus dudas de estudio
Ebooks gratuitos
Descarga nuestras guías gratuitas sobre técnicas de estudio, métodos para controlar la ansiedad y consejos para la tesis preparadas por los tutores de Docsity
Asignatura: Analisis y diseño de algoritmos I, Profesor: , Carrera: I. T. Infor. Sistemas, Universidad: UCA
Tipo: Apuntes
1 / 12
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!







STEPHEN COOK
L(M ) = {w ∈ Σ∗^ | M accepts w}.
We denote by tM (w) the number of steps in the computation of M on input w (see the appendix). If this computation never halts, then tM (w) = ∞. For n ∈ N we denote by TM (n) the worst case run time of M ; that is,
TM (n) = max{tM (w) | w ∈ Σn},
where Σn^ is the set of all strings over Σ of length n. We say that M runs in polynomial time if there exists k such that for all n, TM (n) ≤ nk^ + k. Now we 1
2 STEPHEN COOK
define the class P of languages by
P = {L | L = L(M ) for some Turing machine M that runs in polynomial time}.
The notation NP stands for “nondeterministic polynomial time”, since originally NP was defined in terms of nondeterministic machines (that is, machines that have more than one possible move from a given configuration). However, now it is customary to give an equivalent definition using the notion of a checking relation, which is simply a binary relation R ⊆ Σ∗^ × Σ∗ 1 for some finite alphabets Σ and Σ 1. We associate with each such relation R a language LR over Σ ∪ Σ 1 ∪ {#} defined by LR = {w#y | R(w, y)}
where the symbol # is not in Σ. We say that R is polynomial-time iff LR ∈ P. Now we define the class NP of languages by the condition that a language L over Σ is in NP iff there is k ∈ N and a polynomial-time checking relation R such that for all w ∈ Σ∗,
w ∈ L ⇐⇒ ∃y(|y| ≤ |w|k^ and R(w, y)),
where |w| and |y| denote the lengths of w and y, respectively.
Problem Statement. Does P = NP?
It is easy to see that the answer is independent of the size of the alphabet Σ (we assume |Σ| ≥ 2), since strings over an alphabet of any fixed size can be efficiently coded by strings over a binary alphabet. (For |Σ| = 1 the problem is still open, although it is possible that P = NP in this case but not in the general case.) It is trivial to show that P ⊆ NP, since for each language L over Σ, if L ∈ P then we can define the polynomial-time checking relation R ⊆ Σ∗^ ∪ Σ∗^ by
R(w, y) ⇐⇒ w ∈ L
for all w, y ∈ Σ∗. Here are two simple examples, using decimal notation to code natural numbers: The set of perfect squares is in P, since Newton’s method can be used to efficiently approximate square roots. The set of composite numbers is in NP, where (denoting the decimal notation for a natural number c by c) the associated polynomial time checking relation R is given by
(1) R(a, b) ⇐⇒ 1 < b < a and b|a.
(Recently it was shown that in fact the set of composite numbers is also in P [1], answering a longstanding open question.)
4 STEPHEN COOK
prove that every minor-closed family of graphs can be recognized in polynomial time (in fact, in time O(n^3 )), but the algorithms supplied by their method have such huge constants that they are not feasible. However, each potential counterex- ample can be removed by finding a feasible algorithm for it. For example, a feasible recognition algorithm is known for the class of planar graphs, but none is currently known for the class of graphs embeddable in R^3 with no two cycles linked. (Both examples are minor-closed families.) Of course the words “natural” and “feasible”in the thesis above should be explained; generally we do not consider a class with a parameter as natural, such as the set of graphs embeddable on a surface of genus k, k > 1. We mention two concerns related to the “only if” direction of the thesis. The first comes from randomized algorithms. We discuss at the end of Section 3 the possibility that a source of random bits might be used to greatly reduce the recog- nition time required for some language. Note, however, that it is not clear whether a truly random source exists in nature. The second concern comes from quan- tum computers. This computer model incorporates the idea of superposition of states from quantum mechanics and allows a potential exponential speed-up of some computations over Turing machines. For example, Shor [32] has shown that some quantum computer algorithm is able to factor integers in polynomial time, but no polynomial-time integer-factoring algorithm is known for Turing machines. Physicists have so far been unable to build a quantum computer that can handle more than a half-dozen bits, so this threat to the feasibility thesis is hypothetical at present. Returning to the historical treatment of complexity theory, in 1971 the present author [9] introduced a notion of NP-completeness as a polynomial-time analog of c.e.-completeness, except that the reduction used was a polynomial-time analog of Turing reducibility rather than of many-one reducibility. The main results in [9] are that several natural problems, including Satisfiability and 3-SAT (defined below) and subgraph isomorphism are NP-complete. A year later Karp [21] used these completeness results to show that 20 other natural problems are NP-complete, thus forcefully demonstrating the importance of the subject. Karp also introduced the now standard notation P and NP and redefined NP-completeness using the polynomial-time analog of many-one reducibility, a definition that has become stan- dard. Meanwhile Levin [23], independently of Cook and Karp, defined the notion of “universal search problem”, similar to the NP-complete problem, and gave six examples, including Satisfiability. The standard definitions concerning NP-completeness are close analogs of Defi- nitions 1 and 2 above.
Definition 3. Suppose that Li is a language over Σi, i = 1, 2. Then L 1 ≤p L 2 (L 1 is p-reducible to L 2 ) iff there is a polynomial-time computable function f : Σ∗ 1 → Σ∗ 2 such that x ∈ L 1 ⇐⇒ f (x) ∈ L 2 , for all x ∈ Σ∗ 1.
Definition 4. A language L is NP-complete iff L is in NP, and L′^ ≤p L for every language L′^ in NP.
The following proposition is easy to prove: Part (b) uses the transitivity of ≤p, and part (c) follows from part (a).
Proposition 1. (a) If L 1 ≤p L 2 and L 2 ∈ P, then L 1 ∈ P. (b) If L 1 is NP-complete, L 2 ∈ NP, and L 1 ≤p L 2 , then L 2 is NP-complete.
THE P VERSUS NP PROBLEM 5
(c) If L is NP-complete and L ∈ P, then P=NP.
Notice that parts (a) and (b) have close analogs in computability theory. The analog of part (c) is simply that if L is c.e.-complete then L is undecidable. Part (b) is the basic method for showing new problems are NP-complete, and part (c) explains why it is probably a waste of time looking for a polynomial-time algorithm for an NP-complete problem. In practice, a member of NP is expressed as a decision problem, and the corre- sponding language is understood to mean the set of strings coding YES instances to the decision problem using standard coding methods. Thus the problem Satisfi- ability is: Given a propositional formula F , determine whether F is satisfiable. To show that this is in NP, we define the polynomial-time checking relation R(x, y), which holds iff x codes a propositional formula F and y codes a truth assignment to the variables of F that makes F true. This problem was shown in [9] to be NP-complete essentially by showing that, for each polynomial-time Turing ma- chine M that recognizes a checking relation R(x, y) for an NP language L, there is a polynomial-time algorithm that takes as input a string x and produces a proposi- tional formula Fx (describing the computation of M on input (x, y), with variables representing the unknown string y) such that Fx is satisfiable iff M accepts the input (x, y) for some y with |y| ≤ |x|O(1). An important special case of Satisfiability is 3-SAT, which was also shown to be NP-complete in [9]. Instances of 3-SAT are restricted to formulas in conjunctive normal form with three literals per clause. For example, the formula
(2) (P ∨ Q ∨ R) ∧ ( P¯ ∨ Q ∨ R¯) ∧ (P ∨ Q¯ ∨ S) ∧ ( P¯ ∨ R¯ ∨ S¯)
is a YES instance to 3-SAT since the truth assignment τ satisfies the formula, where τ (P ) = τ (Q) = T rue and τ (R) = τ (S) = F alse. Many hundreds of NP-complete problems have been identified, including Sub- setSum (given a set of positive integers presented in decimal notation, and a target T, is there a subset summing to T?), many graph problems (given a graph G, does G have a Hamiltonian cycle? Does G have a clique consisting of half of the vertices? Can the vertices of G be colored with three colors with distinct colors for adjacent vertices?). These problems give rise to many scheduling and routing problems with industrial importance. The book [15] provides an excellent reference to the subject, with 300 NP-complete problems listed in the appendix. Associated with each decision problem in NP there is a search problem, which is, given a string x, find a string y satisfying the checking relation R(x, y) for the problem (or determine that x is a NO instance to the problem). Such a y is said to be a certificate for x. In the case of an NP-complete problem it is easy to see that the search problem can be efficiently reduced to the corresponding decision problem. In fact, if P = NP, then the associated search problem for every NP problem has a polynomial-time algorithm. For example, an algorithm for the decision problem Satisfiability can be used to find a truth assignment τ satisfying a given satisfiable formula F by, for each variable P in F in turn, setting P to True in F or False in F , whichever case keeps F satisfiable. The set of complements of NP languages is denoted coNP. The complement of an NP-complete language is thought not to be in NP; otherwise NP = coNP. The set TAUT of tautologies (propositional formulas true under all assignments) is the standard example of a coNP-complete language. The conjecture NP 6 = coNP
THE P VERSUS NP PROBLEM 7
in which the P = NP question is replaced by the question of whether every NP problem with any reasonable probability distribution on its inputs can be solved in polynomial time on average. In [34] Smale lists the P vs NP question as problem 3 of mathematical problems for the next century. However, Smale is interested not only in the classical version of the question, but also in a version expressed in terms of the field of complex numbers. Here Turing machines must be replaced by a machine model that is capable of doing exact arithmetic and zero tests on arbitrary complex numbers. The P vs NP question is replaced by a question related to Hilbert’s Nullstellensatz: Is there a polynomial-time algorithm that, given a set of k multivariate polynomials over C, determines whether they have a common zero? See [4] for a development of complexity theory in this setting. The books by Papadimitriou [25] and Sipser [33] provide good introductions to mainstream complexity theory.
cn steps in the worst case, for some c > 0. In general, lower bounds using diagonalization and reduction relativize; that is,
8 STEPHEN COOK
they continue to apply in a setting in which both the problem instance and the solving Turing machine can make membership queries to an arbitrary oracle set A. However, in [3] it was shown that there is an oracle set A relative to which P = NP, suggesting that diagonalization with reduction cannot be used to separate these two classes. (There are nonrelativizing results in complexity theory, as will be mentioned below.) It is interesting to note that relative to a generic oracle, P 6 = NP [5, 11]. A Boolean circuit is a finite acyclic graph in which each non-input node, or gate, is labelled with a Boolean connective; typically from {AND , OR, NOT}. The input nodes are labeled with variables x 1 , ..., xn, and for each assignment of 0 or 1 to each variable, the circuit computes a bit value at each gate, including the output gate, in the obvious way. It is not hard to see that if L is a language over { 0 , 1 } that is in P, then there is a polynomial-size family of Boolean circuits 〈Bn〉 such that Bn has n inputs, and for each bit string w of length n, when w is applied to the n input nodes of Bn, then the output bit of Bn is 1 iff w ∈ L. In this case we say that 〈Bn〉 computes L. Thus to prove P 6 = NP it suffices to prove a super-polynomial lower bound on the size of any family of Boolean circuits solving some specific NP-complete problem, such as 3-SAT. Back in 1949 Shannon [31] proved that for almost all Boolean functions f : { 0 , 1 }n^ → { 0 , 1 }, any Boolean circuit computing f requires at least 2 n/n gates. Unfortunately, his counting argument gives no clue as to how to prove lower bounds for problems in NP. Exponential lower bounds for NP problems have been proved for restricted circuit models, including monotone circuits [26], [2] and bounded depth circuits with unbounded fan-in gates [17], [35] (see [6]). However, all attempts to find even super-linear lower bounds for unrestricted Boolean circuits for “explicitly given” Boolean functions have met with total failure; the best such lower bound proved so far is about 4n. Razborov and Rudich [27] explain this failure by pointing out that all methods used so far can be classified as “natural proofs”, and natural proofs for general circuit lower bounds are doomed to failure, assuming a certain complexity-theoretic conjecture asserting that strong pseudo- random number generators exist. Since such generators have been constructed assuming the hardness of integer factorization, we can infer the surprising result that a natural proof for a general circuit lower bound would give rise to a more efficient factoring algorithm than is currently known. The failure of complexity theory to prove interesting lower bounds on a general model of computation is much more pervasive than the failure to prove P 6 = NP. It is consistent with present knowledge that not only could Satisfiability have a polynomial-time algorithm, it could have a linear time algorithm on a multitape Turing machine. The same applies for all 21 problems mentioned in Karp’s original paper [21]. There are complexity class separations that we know exist but cannot prove. For example, consider the sequence of complexity class inclusions
LOGSPACE ⊆ P⊆ NP⊆ PSPACE.
A simple diagonal argument shows that the first is a proper subset of the last, but we cannot prove any particular adjacent inclusion is proper. As another example, let LINEAR-SIZE be the class of languages over { 0 , 1 } that can be computed by a family 〈Bn〉 of Boolean circuits of size O(n). It is not known whether either P or NP is a subset of LINEAR-SIZE, although Kannan [20] proved that there are languages in the polynomial hierarchy (a generalization of
10 STEPHEN COOK
the initial state q 0. At each step M is in some state q and the head is scanning a tape square containing some tape symbol s, and the action performed depends on the pair (q, s) and is specified by the machine’s transition function (or program) δ. The action consists of printing a symbol on the scanned square, moving the head left or right one square, and assuming a new state. Formally, a Turing machine M is a tuple 〈Σ, Γ, Q, δ〉, where Σ, Γ, Q are finite nonempty sets with Σ ⊆ Γ and b ∈ Γ − Σ. The state set Q contains three special states q 0 , qaccept, qreject. The transition function δ satisfies
δ : (Q − {qaccept, qreject}) × Γ → Q × Γ × {− 1 , 1 }.
If δ(q, s) = (q′, s′, h), the interpretation is that, if M is in state q scanning the symbol s, then q′^ is the new state, s′^ is the symbol printed, and the tape head moves left or right one square depending on whether h is −1 or 1. We assume that the sets Q and Γ are disjoint. A configuration of M is a string xqy with x, y ∈ Γ∗, y not the empty string, and q ∈ Q. The interpretation of the configuration xqy is that M is in state q with xy on its tape, with its head scanning the left-most symbol of y.
If C and C′^ are configurations, then C →M C′^ if C = xqsy and δ(q, s) = (q′, s′, h) and one of the following holds: C′^ = xs′q′y and h = 1 and y is nonempty. C′^ = xs′q′b and h = 1 and y is empty. C′^ = x′q′as′y and h = −1 and x = x′a for some a ∈ Γ. C′^ = q′bs′y and h = −1 and x is empty. A configuration xqy is halting if q ∈ {qaccept, qreject}. Note that for each non-
halting configuration C there is a unique configuration C′^ such that C →M C′. The computation of M on input w ∈ Σ∗^ is the unique sequence C 0 , C 1 , ... of
configurations such that C 0 = q 0 w (or C 0 = q 0 b if w is empty) and Ci M → Ci+1 for each i with Ci+1 in the computation, and either the sequence is infinite or it ends in a halting configuration. If the computation is finite, then the number of steps is one less than the number of configurations; otherwise the number of steps is infinite. We say that M accepts w iff the computation is finite and the final configuration contains the state qaccept.
Acknowledgments My thanks to Avi Wigderson and Hugh Woodin for many helpful suggestions for improving an earlier version of this paper.
References [1] M. Agrawal, N. Kayal, and N. Saxena, Primes is in P, Ann. Math. 160 (2004), 781–793. [2] N. Alon and R.B. Boppana, The monotone circuit complexity of boolean functions, Combi- natorica 7 (1987), 1–22. [3] T. Baker, J. Gill, and R. Solovay, Relativizations of the P =? NP question, SICOMP: SIAM Journal on Computing, 1975. [4] L. Blum, F. Cucker, M. Shub, and S. Smale, Complexity and Real Computation, Springer- Verlag, New York, 1998. [5] M. Blum and R. Impagliazzo, Generic oracles and oracle classes, in Proceedings of the 28th Annual Symposium on Foundations of Computer Science, A.K. Chandra, ed., IEEE Computer Society Press, Los Angeles, 1987, 118–126.
THE P VERSUS NP PROBLEM 11
[6] R.B. Boppana and M. Sipser, The complexity of finite functions, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity, J. Van Leeuwen, ed., Elsevier and The MIT Press, Cambridge, MA, 1990, 759–804. [7] T. Cormen, C. Leiserson, R. Rivest, and C. Stein, Introduction to Algorithms, 2nd edition, McGraw Hill, New York, 2001. [8] A. Cobham, The intrinsic computational difficulty of functions, in Proceedings of the 1964 International Congress for Logic, Methodology, and Philosophy of Science, Y. Bar-Hille, ed., Elsevier/North-Holland, Amsterdam, 1964, 24–30. [9] S. Cook, The complexity of theorem-proving procedures, in Conference Record of Third An- nual ACM Symposium on Theory of Computing, ACM, New York, 1971, 151–158. [10] S. Cook, Computational complexity of higher type functions, in Proceedings of the Interna- tional Congress of Mathematicians, Kyoto, Japan, Springer-Verlag, Berlin, 1991, 55–69. [11] S. Cook, R. Impagliazzo, and T. Yamakami, A tight relationship between generic oracles and type-2 complexity theory, Information and Computation 137 (1997), 159–170. [12] S. Cook and R. Reckhow, The relative efficiency of propositional proof systems, J. Symbolic Logic 44 (1979), 36–50. [13] J. Edmonds, Minimum partition of a matroid into independent subsets, J. Res. Nat. Bur. Standards Sect. B 69 (1965), 67–72. [14] M.J. Fischer and M.O. Rabin, Super-exponential complexity of Presburger arithmetic, in Complexity of Computation 7 , AMS, Providence, RI, 1974, 27–41. [15] M.R. Garey and D.S. Johnson, Computers and Intractability, a Guide to the Theory of NP- Completeness, W.H. Freeman and Co., San Francisco, 1979. [16] O. Goldreich, The Foundations of Cryptography — Volume 1, Cambridge University Press, Cambridge, UK, 2000. [17] J. Hastad, Almost optimal lower bounds for small depth circuits, in Randomness and Com- putation, Advances in Computing Research 5 , JAI Press Inc., Greenwich, CT, 1989, 143–170. [18] R. Impagliazzo, A personal view of average-case complexity, in 10th IEEE Annual Conference on Structure in Complexity Theory, IEEE Computer Society Press, Washington, DC, 1995, 134–147. [19] R. Impagliazzo and A. Wigderson, P = BPP if E requires exponential circuits: Derandomizing the XOR lemma, in ACM Symposium on Theory of Computing (STOC), ACM, New York, 1997, 220–229. [20] R. Kannan, Circuit-size lower bounds and non-reducibility to sparse sets, Information and Control 55 (1982), 40–56.. [21] R.M. Karp, Reducibility among combinatorial problems, in Complexity of Computer Com- putations, R. E. Miller and J. W. Thatcher, eds., Plenum Press, New York, 1972, 85–103. [22] J. Krajicek, Bounded Arithmetic, Propositional Logic, and Complexity Theory, Cambridge University Press, Cambridge, 1995. [23] L. Levin, Universal search problems (in Russian), Problemy Peredachi Informatsii 9 (1973), 265–266. English translation in B. A. Trakhtenbrot, A survey of Russian approaches to Pere- bor (brute-force search) algorithms, Annals of the History of Computing 6 (1984), 384-400. [24] L. Levin, Average case complete problems, SIAM J. Computing 15 (1986), 285–286. [25] C. Papadimitriou, Computational Complexity, Addison-Wesley, Reading, MA, 1994. [26] A.A. Razborov, Lower bounds on the monotone complexity of some boolean functions, Soviet Math. Dokl. 31 (1985), 354–357. [27] A.A. Razborov and S. Rudich, Natural proofs, Journal of Computer and System Sciences 55 (1997), 24–35. [28] R.L. Rivest, A. Shamir, and L. Adleman, A method for obtaining digital signatures and public-key cryptosystems, Comm. ACM 21 (1978), 120–126. [29] N. Robertson and P.D. Seymour, Graph minors i-xiii, Journal of Combinatorial Theory B, 1983–1995. [30] A. Shamir, IP = PSPACE, J.A.C.M. 39 (1992), 869–977. [31] C. Shannon, The synthesis of two-terminal switching circuits, Bell System Technical Journal 28 (1949), 59–98. [32] P. Shor, Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer, SIAM J. Computing 26 (1997), 1484–1509. [33] M. Sipser, Introduction to the Theory of Computation, PWS Publ., Boston, 1997.