計算複雜性(Computing Complexity) (轉)
From Wikipedia, the free encyclopedia.
| 12.234.196.121
|
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="">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="">#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)
">Upload files
+Reports">Bug reports
| | | | |
This page has been accessed 2248 times. Other namespaces :
Last edited: Sunday, June 2, 2002, 13:50
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-998317/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何計算並測量ABAP及Java程式碼的環複雜度Cyclomatic complexityJava複雜度
- 時間複雜度怎麼算?如何計算時間複雜度?時間複雜度
- 時間複雜度的計算時間複雜度
- 關於計算時間複雜度和空間複雜度時間複雜度
- 網路模型複雜度計算方法模型複雜度
- cloud computing雲端計算概念Cloud
- Guru of The week #20 程式碼的複雜性 Ⅰ. (轉)
- 【招募完成】《量子計算公開課:從德謨克里特、計算複雜性到自由意志》
- 演算法系列1 初識演算法 演算法複雜性模型 演算法複雜度的計算演算法模型複雜度
- 複雜性Complex與複雜Complicated區別 - Sonja
- 時間複雜度計算和舉例說明時間複雜度
- 演算法複雜性分析演算法
- 說說你對演算法中時間複雜度,空間複雜度的理解?如何計算?演算法時間複雜度
- 複雜的行列轉換
- 複雜性是心智殺手 - PhilipK
- 如何降低軟體的複雜性?
- 解決DDD核心的複雜性
- 什麼是 幾何複雜性
- 資料複雜性和簡單
- 百行以內實現複雜數學表示式計算
- 圖計算:一張圖秒級洞察千億級複雜關係
- 一文講透演算法中的時間複雜度和空間複雜度計算方式演算法時間複雜度
- 計算機雜誌計算機
- 專案複雜度模型(轉)複雜度模型
- 訂製化、複雜性仍是ERP應用主要障礙(轉)
- 複雜性正在殺死軟體開發者
- 思考複雜性免費電子書
- 害怕軟體的複雜嗎?其實複雜性是必須存在的 - ferd
- vivo商城計價中心 - 從容應對複雜場景價格計算
- 《程式是怎樣跑起來的》,計算機程式很複雜嗎?計算機
- SQL 複雜的求值計算---師哥師姐給個幫助SQL
- 【資料結構】根據主定理,計算時間複雜度資料結構時間複雜度
- 複利計算
- DDD函式程式設計案例:戰勝軟體開發的複雜性! 戰勝方式本身有點複雜哦!函式程式設計
- 軟體複雜性正在殺死我們
- 軟體的複雜性:命名的藝術
- codeforces #340B(簡單計算幾何 自己想複雜了)
- 複雜性系統設計:福特CEO談特斯拉的三個特點