请输入您要查询的百科知识:

 

词条 NP-completeness
释义

  1. Overview

  2. Formal definition

  3. Background

  4. NP-complete problems

  5. Solving NP-complete problems

  6. Completeness under different types of reduction

  7. Naming

  8. Common misconceptions

  9. Properties

  10. See also

  11. References

      Citations    Sources  

  12. Further reading

{{confusing |date = July 2012}}

In computational complexity theory, an NP-complete decision problem is one belonging to both the NP and the NP-hard complexity classes. In this context, NP stands for "nondeterministic polynomial time". The set of NP-complete problems is often denoted by NP-C or NPC.

Although a solution to an NP-complete problem can be verified "quickly," there is no known way to find a solution quickly. That is, the time required to solve the problem using any currently known algorithm increases rapidly as the size of the problem grows. As a consequence, determining whether it is possible to solve these problems quickly, called the P versus NP problem, is one of the fundamental unsolved problems in computer science today.

While a method for computing the solutions to NP-complete problems quickly remains undiscovered, computer scientists and programmers still frequently encounter NP-complete problems. NP-complete problems are often addressed by using heuristic methods and approximation algorithms.

In this context "quickly" means in polynomial time. That is, "efficient" or "fast" algorithms can be developed to solve the problem.[1]

Overview

NP-complete problems are in NP, the set of all decision problems whose solutions can be verified in polynomial time; NP may be equivalently defined as the set of decision problems that can be solved in polynomial time on a non-deterministic Turing machine. A problem p in NP is NP-complete if every other problem in NP can be transformed (or reduced) into p in polynomial time.

It is not known whether every problem in NP can be quickly solved—this is called the P versus NP problem. But if any NP-complete problem can be solved quickly, then every problem in NP can, because the definition of an NP-complete problem states that every problem in NP must be quickly reducible to every NP-complete problem (that is, it can be reduced in polynomial time). Because of this, it is often said that NP-complete problems are harder or more difficult than NP problems in general.

Formal definition

{{See also |P %3D NP problem#NP-completeness |l1 = formal definition for NP-completeness (article P = NP)}}

A decision problem is NP-complete if:

  1. is in NP, and
  2. Every problem in NP is reducible to in polynomial time.&91;2&93;

can be shown to be in NP by demonstrating that a candidate solution to can be verified in polynomial time.

Note that a problem satisfying condition 2 is said to be NP-hard, whether or not it satisfies condition 1.[3]

A consequence of this definition is that if we had a polynomial time algorithm (on a UTM, or any other Turing-equivalent abstract machine) for , we could solve all problems in NP in polynomial time.

Background

The concept of NP-completeness was introduced in 1971 (see Cook–Levin theorem), though the term NP-complete was introduced later. At the 1971 STOC conference, there was a fierce debate between the computer scientists about whether NP-complete problems could be solved in polynomial time on a deterministic Turing machine. John Hopcroft brought everyone at the conference to a consensus that the question of whether NP-complete problems are solvable in polynomial time should be put off to be solved at some later date, since nobody had any formal proofs for their claims one way or the other. This is known as the question of whether P=NP.

Nobody has yet been able to determine conclusively whether NP-complete problems are in fact solvable in polynomial time, making this one of the great unsolved problems of mathematics. The Clay Mathematics Institute is offering a US$1 million reward to anyone who has a formal proof that P=NP or that P≠NP.

The Cook–Levin theorem states that the Boolean satisfiability problem is NP-complete. In 1972, Richard Karp proved that several other problems were also NP-complete (see Karp's 21 NP-complete problems); thus there is a class of NP-complete problems (besides the Boolean satisfiability problem). Since the original results, thousands of other problems have been shown to be NP-complete by reductions from other problems previously shown to be NP-complete; many of these problems are collected in Garey and Johnson's 1979 book A Guide to the Theory of NP-Completeness.[4]

NP-complete problems

{{Main|List of NP-complete problems}}

An interesting example is the graph isomorphism problem, the graph theory problem of determining whether a graph isomorphism exists between two graphs. Two graphs are isomorphic if one can be transformed into the other simply by renaming vertices. Consider these two problems:

  • Graph Isomorphism: Is graph G1 isomorphic to graph G2?
  • Subgraph Isomorphism: Is graph G1 isomorphic to a subgraph of graph G2?

The Subgraph Isomorphism problem is NP-complete. The graph isomorphism problem is suspected to be neither in P nor NP-complete, though it is in NP. This is an example of a problem that is thought to be hard, but is not thought to be NP-complete.

The easiest way to prove that some new problem is NP-complete is first to prove that it is in NP, and then to reduce some known NP-complete problem to it. Therefore, it is useful to know a variety of NP-complete problems. The list below contains some well-known problems that are NP-complete when expressed as decision problems.

{{div col|colwidth=25em}}
  • Boolean satisfiability problem (SAT)
  • Knapsack problem
  • Hamiltonian path problem
  • Travelling salesman problem (decision version)
  • Subgraph isomorphism problem
  • Subset sum problem
  • Clique problem
  • Vertex cover problem
  • Independent set problem
  • Dominating set problem
  • Graph coloring problem
{{div col end}}

To the right is a diagram of some of the problems and the reductions typically used to prove their NP-completeness. In this diagram, an arrow from one problem to another indicates the direction of the reduction. Note that this diagram is misleading as a description of the mathematical relationship between these problems, as there exists a polynomial-time reduction between any two NP-complete problems; but it indicates where demonstrating this polynomial-time reduction has been easiest.

There is often only a small difference between a problem in P and an NP-complete problem. For example, the 3-satisfiability problem, a restriction of the boolean satisfiability problem, remains NP-complete, whereas the slightly more restricted 2-satisfiability problem is in P (specifically, NL-complete), and the slightly more general max. 2-sat. problem is again NP-complete. Determining whether a graph can be colored with 2 colors is in P, but with 3 colors is NP-complete, even when restricted to planar graphs. Determining if a graph is a cycle or is bipartite is very easy (in L), but finding a maximum bipartite or a maximum cycle subgraph is NP-complete. A solution of the knapsack problem within any fixed percentage of the optimal solution can be computed in polynomial time, but finding the optimal solution is NP-complete.

Solving NP-complete problems

At present, all known algorithms for NP-complete problems require time that is superpolynomial in the input size, and it is unknown whether there are any faster algorithms.

The following techniques can be applied to solve computational problems in general, and they often give rise to substantially faster algorithms:

  • Approximation: Instead of searching for an optimal solution, search for a solution that is at most a factor from an optimal one.
  • Randomization: Use randomness to get a faster average running time, and allow the algorithm to fail with some small probability. Note: The Monte Carlo method is not an example of an efficient algorithm in this specific sense, although evolutionary approaches like Genetic algorithms may be.
  • Restriction: By restricting the structure of the input (e.g., to planar graphs), faster algorithms are usually possible.
  • Parameterization: Often there are fast algorithms if certain parameters of the input are fixed.
  • Heuristic: An algorithm that works "reasonably well" in many cases, but for which there is no proof that it is both always fast and always produces a good result. Metaheuristic approaches are often used.

One example of a heuristic algorithm is a suboptimal greedy coloring algorithm used for graph coloring during the register allocation phase of some compilers, a technique called graph-coloring global register allocation. Each vertex is a variable, edges are drawn between variables which are being used at the same time, and colors indicate the register assigned to each variable. Because most RISC machines have a fairly large number of general-purpose registers, even a heuristic approach is effective for this application.

Completeness under different types of reduction

In the definition of NP-complete given above, the term reduction was used in the technical meaning of a polynomial-time many-one reduction.

Another type of reduction is polynomial-time Turing reduction. A problem is polynomial-time Turing-reducible to a problem if, given a subroutine that solves in polynomial time, one could write a program that calls this subroutine and solves in polynomial time. This contrasts with many-one reducibility, which has the restriction that the program can only call the subroutine once, and the return value of the subroutine must be the return value of the program.

If one defines the analogue to NP-complete with Turing reductions instead of many-one reductions, the resulting set of problems won't be smaller than NP-complete; it is an open question whether it will be any larger.

Another type of reduction that is also often used to define NP-completeness is the logarithmic-space many-one reduction which is a many-one reduction that can be computed with only a logarithmic amount of space. Since every computation that can be done in logarithmic space can also be done in polynomial time it follows that if there is a logarithmic-space many-one reduction then there is also a polynomial-time many-one reduction. This type of reduction is more refined than the more usual polynomial-time many-one reductions and it allows us to distinguish more classes such as P-complete. Whether under these types of reductions the definition of NP-complete changes is still an open problem. All currently known NP-complete problems are NP-complete under log space reductions. All currently known NP-complete problems remain NP-complete even under much weaker reductions.[5] It is known, however, that AC0 reductions define a strictly smaller class than polynomial-time reductions.[6]

Naming

According to Donald Knuth, the name "NP-complete" was popularized by Alfred Aho, John Hopcroft and Jeffrey Ullman in their celebrated textbook "The Design and Analysis of Computer Algorithms". He reports that they introduced the change in the galley proofs for the book (from "polynomially-complete"), in accordance with the results of a poll he had conducted of the theoretical computer science community.[7] Other suggestions made in the poll[8] included "Herculean", "formidable", Steiglitz's "hard-boiled" in honor of Cook, and Shen Lin's acronym "PET", which stood for "probably exponential time", but depending on which way the P versus NP problem went, could stand for "provably exponential time" or "previously exponential time".[9]

Common misconceptions

The following misconceptions are frequent.[10]

  • "NP-complete problems are the most difficult known problems." Since NP-complete problems are in NP, their running time is at most exponential. However, some problems provably require more time, for example Presburger arithmetic.
  • "NP-complete problems are difficult because there are so many different solutions." On the one hand, there are many problems that have a solution space just as large, but can be solved in polynomial time (for example minimum spanning tree). On the other hand, there are NP-problems with at most one solution that are NP-hard under randomized polynomial-time reduction (see Valiant–Vazirani theorem).
  • "Solving NP-complete problems requires exponential time." First, this would imply P ≠ NP, which is still an unsolved question. Further, some NP-complete problems actually have algorithms running in superpolynomial, but subexponential time such as O(2{{sqrt|n}}n). For example, the independent set and dominating set problems are NP-complete when restricted to planar graphs, but can be solved in subexponential time on planar graphs using the planar separator theorem.[11]
  • "All instances of an NP-complete problem are difficult." Often some instances, or even most instances, may be easy to solve within polynomial time. However, unless P=NP, any polynomial-time algorithm must asymptotically be wrong on more than polynomially many of the exponentially many inputs of a certain size.[12]
  • "If P=NP, all cryptographic ciphers can be broken." A polynomial-time problem can be very difficult to solve in practice if the polynomial's degree or constants are large enough. For example, ciphers with a fixed key length, such as Advanced Encryption Standard, can all be broken in constant time (and are thus already known to be in P), though with current technology that constant may exceed the age of the universe. In addition, information-theoretic security provides cryptographic methods that cannot be broken even with unlimited computing power.

Properties

Viewing a decision problem as a formal language in some fixed encoding, the set NPC of all NP-complete problems is not closed under:

  • union
  • intersection
  • concatenation
  • Kleene star

It is not known whether NPC is closed under complementation, since NPC=co-NPC if and only if NP=co-NP, and whether NP=co-NP is an open question.[13]

See also

{{Portal|Computer science}}
  • Almost complete
  • Gadget (computer science)
  • Ladner's theorem
  • List of NP-complete problems
  • NP-hard
  • P = NP problem
  • Strongly NP-complete

References

Citations

1. ^{{Cite book| last=Cobham | first=Alan | authorlink=Alan Cobham | year = 1965 | chapter = The intrinsic computational difficulty of functions | title = Proc. Logic, Methodology, and Philosophy of Science II | publisher = North Holland}}
2. ^{{cite book |author = J. van Leeuwen |year = 1998 |title = Handbook of Theoretical Computer Science |publisher = Elsevier |isbn = 978-0-262-72014-4 |page = 84}}
3. ^{{cite book |author = J. van Leeuwen |year = 1998 |title = Handbook of Theoretical Computer Science |publisher = Elsevier |isbn = 978-0-262-72014-4 |page = 80}}
4. ^{{cite book |last1=Garey |first1=Michael R. |authorlink1 = Michael R. Garey |last2=Johnson |first2 = D. S. |authorlink2=David S. Johnson |title=Computers and Intractability: A Guide to the Theory of NP-Completeness |year=1979 |isbn = 978-0-7167-1045-5 |pages=x+338 |url= |doi= |series=A Series of Books in the Mathematical Sciences|editor=Victor Klee |publisher=W. H. Freeman and Co. |location=San Francisco, Calif. |mr=519066 |ref=harv|title-link=Computers and Intractability: A Guide to the Theory of NP-Completeness }}
5. ^{{Cite journal | doi=10.1006/jcss.1998.1583 | last1=Agrawal | first1=M. | author1-link=Manindra Agrawal | last2=Allender | first2=E. | last3=Rudich | first3=Steven | author3-link=Steven Rudich | title=Reductions in Circuit Complexity: An Isomorphism Theorem and a Gap Theorem | year=1998 | journal=Journal of Computer and System Sciences | issn=1090-2724 | volume=57 | issue=2 | pages=127–143 | postscript= | ref=harv}}
6. ^{{Cite journal | last1=Agrawal | first1=M. | author1-link=Manindra Agrawal | last2=Allender | first2=E. | last3=Impagliazzo | first3=R. | last4=Pitassi | first4=T. | author4-link = Toniann Pitassi | last5=Rudich | first5=Steven | author5-link=Steven Rudich | title=Reducing the complexity of reductions | doi=10.1007/s00037-001-8191-1 | year=2001 | journal=Computational Complexity | issn=1016-3328 | volume=10 | pages=117–138 | issue=2 | postscript={{inconsistent citations}} | ref=harv}}
7. ^Don Knuth, Tracy Larrabee, and Paul M. Roberts, Mathematical Writing § 25, MAA Notes No. 14, MAA, 1989 (also Stanford Technical Report, 1987).
8. ^{{Cite journal|doi = 10.1145/1811129.1811130|volume = 6|issue = 1|pages = 12–18|last = Knuth|first = D. F.|title = A terminological proposal|journal = SIGACT News|accessdate = 2010-08-28|year = 1974|url = http://portal.acm.org/citation.cfm?id=1811130|ref = harv}}
9. ^See the poll, or  .
10. ^{{Cite news|url=http://www.nature.com/news/2000/000113/full/news000113-10.html|doi = 10.1038/news000113-10|title = DNA computer helps travelling salesman|first = Philip |last= Ball}}
11. ^{{harvtxt|Bern|1990}}; {{harvtxt|Deĭneko|Klinz|Woeginger|2006}}; {{harvtxt|Dorn|Penninks|Bodlaender|Fomin|2005}}; {{harvtxt|Lipton|Tarjan|1980}}.
12. ^{{Cite journal | last1 = Hemaspaandra | first1 = L. A. | last2 = Williams | first2 = R. | doi = 10.1145/2421119.2421135 | title = SIGACT News Complexity Theory Column 76 | journal = ACM SIGACT News | volume = 43 | issue = 4 | page = 70 | year = 2012 | pmid = | pmc = }}
13. ^{{citation |title = Complexity and Cryptography: An Introduction |first1 = John |last1 = Talbot|first2=D. J. A.|last2 = Welsh |author2-link = Dominic Welsh |publisher = Cambridge University Press |year = 2006 |isbn = 9780521617710 |page=57 |url = https://books.google.com/books?id=y_ZwupY8pzUC&pg=PA57 |quote = The question of whether NP and co-NP are equal is probably the second most important open problem in complexity theory, after the P versus NP question.}}

Sources

{{refbegin |colwidth = 30em}}
  • {{Cite book

|last1 = Garey
|first1 = M.R.
|author1-link = Michael Garey
|author2 = Johnson, D.S.
|author2-link = David S. Johnson
|title = Computers and Intractability: A Guide to the Theory of NP-Completeness
|year = 1979
|publisher = W.H. Freeman
|location = New York
|isbn = 978-0-7167-1045-5
|title-link = Computers and Intractability: A Guide to the Theory of NP-Completeness
  • {{Cite conference

|last = Cook
|first = S.A.
|authorlink = Stephen A. Cook
|title = The complexity of theorem proving procedures
|booktitle = Proceedings, Third Annual ACM Symposium on the Theory of Computing, ACM, New York
|year = 1971
|pages = 151–158
|doi = 10.1145/800157.805047
  • {{cite web

|last = Dunne
|first = P.E
|title = An annotated list of selected NP-complete problems
|publisher = COMP202, Dept. of Computer Science, University of Liverpool
|url = http://www.csc.liv.ac.uk/~ped/teachadmin/COMP202/annotated_np.html
|accessdate = 2008-06-21
}}
  • {{cite web

|last = Crescenzi
|first = P.
|author2=Kann, V. |author3=Halldórsson, M. |author4=Karpinski, M. |author5=Woeginger, G
|title = A compendium of NP optimization problems
|publisher = KTH NADA, Stockholm
|url = http://www.nada.kth.se/~viggo/problemlist/compendium.html
|accessdate = 2008-06-21
}}
  • {{cite web

|last = Dahlke
|first = K
|title = NP-complete problems
|work = Math Reference Project
|url = http://www.mathreference.com/lan-cx-np,intro.html
|accessdate = 2008-06-21
}}
  • {{cite web |last = Karlsson |first = R |title = Lecture 8: NP-complete problems |publisher = Dept. of Computer Science, Lund University, Sweden |url = http://www.cs.lth.se/home/Rolf_Karlsson/bk/lect8.pdf |accessdate = 2008-06-21 |deadurl = yes |archiveurl = https://web.archive.org/web/20090419082030/http://www.cs.lth.se/home/Rolf_Karlsson/bk/lect8.pdf |archivedate = April 19, 2009 }}
  • {{cite web

|last = Sun
|first = H.M
|title = The theory of NP-completeness
|publisher = Information Security Laboratory, Dept. of Computer Science, National Tsing Hua University, Hsinchu City, Taiwan
|url = http://is.cs.nthu.edu.tw/course/2008Spring/cs431102/hmsunCh08.ppt
|format = PPT
|accessdate = 2008-06-21
}}
  • {{cite web

|last = Jiang
|first = J.R
|title = The theory of NP-completeness
|publisher = Dept. of Computer Science and Information Engineering, National Central University, Jhongli City, Taiwan
|url = http://www.csie.ncu.edu.tw/%7Ejrjiang/alg2006/NPC-3.ppt
|format = PPT
|accessdate = 2008-06-21
}}
  • {{Cite book

|last = Cormen
|first = T.H.
|authorlink = Thomas H. Cormen
|author2=Leiserson, C.E. |author3=Rivest, R.L. |author4=Stein, C.
|title = Introduction to Algorithms
|edition = 2nd
|year = 2001
|publisher = MIT Press and McGraw-Hill
|isbn = 978-0-262-03293-3
|chapter = Chapter 34: NP–Completeness
|pages = 966–1021
|title-link = Introduction to Algorithms
  • {{Cite book

|last = Sipser
|first = M.
|authorlink = Michael Sipser
|title = Introduction to the Theory of Computation
|year = 1997
|publisher = PWS Publishing
|chapter = Sections 7.4–7.5 (NP-completeness, Additional NP-complete Problems)
|pages = 248–271
|isbn = 978-0-534-94728-6
}}
  • {{Cite book

|last = Papadimitriou
|first = C.
|authorlink = Christos Papadimitriou
|title = Computational Complexity
|edition = 1st
|year = 1994
|publisher = Addison Wesley
|chapter = Chapter 9 (NP-complete problems)
|pages = 181–218
|isbn = 978-0-201-53082-7
}}
  • Computational Complexity of Games and Puzzles
  • [https://arxiv.org/abs/cs.CC/0210020 Tetris is Hard, Even to Approximate]
  • Minesweeper is NP-complete!
  • {{Cite journal

|last = Bern |first = Marshall
|doi = 10.1002/net.3230200110
|issue = 1
|journal = Networks
|pages = 109–120
|title = Faster exact algorithms for Steiner trees in planar networks
|volume = 20
|year = 1990
|ref = harv
|postscript = {{inconsistent citations}}}}.
  • {{Cite journal

|last1 = Deĭneko |first1 = Vladimir G.
|last2 = Klinz |first2 = Bettina
|last3 = Woeginger |first3 = Gerhard J. |author3-link = Gerhard J. Woeginger
|doi = 10.1016/j.orl.2005.04.013
|issue = 3
|journal = Operations Research Letters
|pages = 269–274
|title = Exact algorithms for the Hamiltonian cycle problem in planar graphs
|volume = 34
|year = 2006
|ref = harv
|postscript = {{inconsistent citations}}}}.
  • {{Cite book

|last1 = Dorn |first1 = Frederic
|last2 = Penninkx |first2 = Eelko
|last3 = Bodlaender |first3 = Hans L. author3-link = Hans L. Bodlaender
|last4 = Fomin |first4 = Fedor V.
|doi = 10.1007/11561071_11
|pages = 95–106
|publisher = Springer-Verlag
|series = Lecture Notes in Computer Science
|title = Proc. 13th European Symposium on Algorithms (ESA '05)
|volume = 3669
|year = 2005
|chapter = Efficient Exact Algorithms on Planar Graphs: Exploiting Sphere Cut Branch Decompositions
|isbn = 978-3-540-29118-3
|ref = harv
|postscript = {{inconsistent citations}}}}.
  • {{Cite journal

|last1 = Lipton |first1 = Richard J. |author1-link = Richard J. Lipton
|last2 = Tarjan |first2 = Robert E. |author2-link = Robert Tarjan
|doi = 10.1137/0209046
|journal = SIAM Journal on Computing
|pages = 615–627
|title = Applications of a planar separator theorem
|volume = 9
|year = 1980
|issue = 3
|ref = harv
|postscript = {{inconsistent citations}}}}.{{refend}}

Further reading

{{refbegin}}
  • Scott Aaronson, [https://arxiv.org/abs/quant-ph/0502072 NP-complete Problems and Physical Reality], ACM SIGACT News, Vol. 36, No. 1. (March 2005), pp. 30–52.
  • Lance Fortnow, The status of the P versus NP problem, Commun. ACM, Vol. 52, No. 9. (2009), pp. 78–86.
{{refend}}{{ComplexityClasses}}{{DEFAULTSORT:Np-Complete}}

5 : 1971 in computer science|NP-complete problems|Complexity classes|Mathematical optimization|Articles with inconsistent citation formats

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/20 22:32:51