博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
计算复杂性(Computing Complexity) (转)
阅读量:2500 次
发布时间:2019-05-11

本文共 5502 字,大约阅读时间需要 18 分钟。

计算复杂性(Computing Complexity) (转)[@more@]
Computational complexity theory
From Wikipedia, the free encyclopedia.
| 12.234.196.121
|
  RM action=http://www.wikipedia.com/wiki.phtml method=get>

| | | | Page" rel="nofollow">Random Page |
Complexity Theory is a part of the dealing with the re s required during computation to solve a given problem. The most common resources are
time (how many steps does it take to solve a problem) and
space (how much memory does it take to solve a problem). Other resources can also be cons red, such as how many parallel processors are needed to solve a problem in parallel. Complexity theory differs from , which deals with whether a problem can be solved at all, regardless of the resources required.

A single "problem" is an entire set of related questions, where each question is a finite-length . For example, the problem is: given an integer written in binary, return all of the factors of that number. A particular question is called an instance. For example, "give the factors of the number 15" is one instance of the FACTORIZE problem.

The time complexity of a problem is the number of steps that it takes to solve an instance, as a function of the size of the instance. If an instance that is n bits long can be solved in n2 steps, then we say it has a time complexity of n2. Of course, the exact number of steps will depend on exactly what machine or language is being used. To avoid that problem, we generally use notation. If a problem has time complexity O(n2) on one typical computer, then it will also have complexity O(n2) on most other computers, so this notation allows us to generalize away from the details of a particular computer.

 

Decision Problems

Much of complexity theory deals with decision problems. A is a problem where the answer is always YES/NO. For example, the problem IS-PRIME is: given an integer written in binary, return whether it is a prime number or not. A decision problem is equivalent to a language, which is a set of finite-length strings. For a given decision problem, the equivalent language is the set of all strings for which the answer is YES.

Decision problems are often considered because an arbitrary problem can always be reduced to a decision problem. For example, the problem HAS-FACTOR is: given integers n and k written in binary, return whether n has any prime factors less than k. If we can solve HAS-FACTOR with a certain amount of resources, then we can use that solution to solve FACTORIZE without much more resources. Just do a binary search on k until you find the smallest factor of n. Then divide out that factor, and repeat until you find all the factors.

Complexity theory often makes a distinction between YES answers and NO answers. For example, the set NP is defined as the set of problems where the YES instances can be checked quickly. The set Co-NP is the set of problems where the NO instances can be checked quickly. The "Co" in the name stands for "complement". The complement of a problem is one where all the YES and NO answers are sped, such as IS-COMPOSITE for IS-PRIME.

 

 

The P=NP Question

The set is the set of decision problems that can be solved in . The question of whether P is the same set as is the most important open question in theoretical computer science. There is even a for solving it. (See and machine" style="TEXT-DECORATION: underline" href="http://www.wikipedia.com/wiki/Oracle+machine">oracles).

Questions like this motivate the concepts of hard and complete. A set of problems X is hard for a set of problems Y if every problem in Y can be tranormed easily into some problem in X with the same answer. The definition of "easily" is different in different contexts. The most important hard set is . Set X is complete for Y if it is hard for Y, and is also a subset of Y. The most important complete set is . See the articles on those two sets for more detail on the definition of "hard" and "complete".

 

Famous Complexity Classes

The following are some of the classes of problems considered in complexity theory, along with rough definitions. See for a chart showing which classes are subsets of other classes.

 

  Solvable in polynomial time (see )   YES answers checkable in polynomial time (see )   NO answers checkable in polynomial time   The hardest problems in NP   The hardest problems in Co-NP   Either NP-complete or harder   non-decision-problem analogue to NP   non-decision-problem analogue to NP-complete -P style="TEXT-DECORATION: underline" href="http://www.wikipedia.com/wiki/Sharp-P">#P   Count solutions to an NP problem   The hardest problems in #P   Solvable efficiently on parallel computers   The hardest problems in P to solve on parallel computers   Solvable with polynomial memory and unlimited time   The hardest problems in PSPACE   Solvable with exponential time   Solvable with exponential memory and unlimited time   Solvable in polynomial time on a (answer is probably right)   Solvable in polynomial time by randomized algorithms (answer is probably right)   Solvable in polynomial time by randomized algorithms (NO answer is probably right, YES is certainly right)   Solvable by randomized algorithms (answer is always right, average running time is polynomial)

 

" rel="nofollow">Upload files

+Reports" rel="nofollow">Bug reports


| | | | |

This page has been accessed 2248 times. Other namespaces :

Last edited: Sunday, June 2, 2002, 13:50

   

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10748419/viewspace-959375/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10748419/viewspace-959375/

你可能感兴趣的文章
BZOJ3158: 千钧一发
查看>>
Sharepoint学习笔记—习题系列--70-576习题解析 -(Q32-Q35)
查看>>
【Spark调优】Shuffle原理理解与参数调优
查看>>
Coverage报告生成
查看>>
【BZOJ】2342: [Shoi2011]双倍回文(Manacher)
查看>>
『实践』Java Web开发之分页(ajax)
查看>>
机器学习之 XGBoost和LightGBM
查看>>
E. 打击判定 判断矩形是否相交
查看>>
python之路_django入门项目(学生表)
查看>>
洛谷P3877 [TJOI2010]打扫房间 解题报告
查看>>
java.util.concurrent.locks.Condition 例子程序探讨
查看>>
微软面试题
查看>>
caffe添加自己的层
查看>>
WPF动画2
查看>>
Handlebar
查看>>
深入浅出mybatis之缓存机制
查看>>
ABP教程-对Person信息进行操作
查看>>
读《构建之法》第六章
查看>>
Aspose.Cell 生成带水印的excel文件
查看>>
【BZOJ-1913】signaling信号覆盖 极角排序 + 组合
查看>>