分享
 
 
 

P = NP ?

王朝other·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

Complexity classes P and NP

From Wikipedia, the free encyclopedia.

Printable version | Pages that link here

12.234.196.121

Log in | Help

Main Page | Recent Changes | Edit this page | History | Random Page | Special Pages

In complexity theory, the class P consists of all those decision problems that can be solved on a deterministic sequential machine in an amount of time that is polynomial in the size of the input; the class NP consists of all those decision problems whose positive solutions can be verified in polynomial time given the right information, or equivalently, whose solution can be found in polynomial time on a non-deterministic machine. The biggest open question in theoretical computer science concerns the relationship between those two classes:

Is P = NP ?

Most people think that the answer is probably "no"; some people believe the question may be undecidable from the currently accepted axioms. A $1,000,000 prize has been offered for a correct solution.

In essence, the P = NP question asks: if positive solutions to a YES/NO problem can be verified quickly, can the answers also be computed quickly? Here is an example to get a feeling for the question. Given a natural numbers x with n digits, decide whether x is a composite number (i.e. not a prime). No fast algorithms are known for this problem, where "fast" means "finishing in a number of steps that is at most a fixed power of n". However, positive answers can be verified quickly given the right information: it is easy to check that 69799 is composite if given the information that 223 is a divisor of 69799. Verifying that a number is a divisor is much easier than finding the divisor in the first place. The information needed to verify a positive answer is also called a certificate. So we conclude that given the right certificates, positive answers to our problem can be verified quickly (i.e. in polynomial time) and that's why this problem is in NP. It is not known whether the problem is in P. It is widely suspected that the problem of recognizing a composite is in P, but the more general problem of actually finding the factors (the integer factorization problem) is not.

We will now define the two classes formally.

A decision problem is a problem that takes as input some string and requires as output either YES or NO. If there is an algorithm (say a Turing machine, or a LISP or Pascal program with unbounded memory) which is able to produce the correct answer for any input string of length n in at most nk steps, where k is some constant independent of the input string, then we say that the problem can be solved in polynomial time and we place it in the class P. Intuitively, we think of the problems in P as those that can be solved reasonably fast.

Now suppose there is an algorithm A(w,C) which takes two arguments, a string w which is an input string to our decision problem, and a string C which is a "proposed certificate", and such that A produces a YES/NO answer in at most nk steps (where n is the length of w and k doesn't depend on w). Suppose furthermore that

w is a YES instance of the decision problem if and only if there exists C such that A(w,C) returns YES.

Then we say that the problem can be solved in non-deterministic polynomial time and we place it in the class NP. We think of the algorithm A as a verifier of proposed certificates which runs reasonably fast. (Note that the abbreviation NP stands for "Non-deterministic Polynomial" and not for "Non-Polynomial".)

To attack the P = NP question, the concept of NP-completeness is very useful. Informally, the NP-complete problems are the "toughest" problems in NP in the sense that they are the ones most likely not to be in P. This means that if a single NP-complete problem could be shown to be in P, then it would follow that P = NP. Unfortunately, many important problems have been shown to be NP-complete and not a single fast algorithm for any of them is known.

The P = NP question has also been addressed using oracles.

Although we don't know whether P=NP, we do know of problems outside both P and NP. The problem of finding the best move in Chess or Go (on an n by n board) is EXPTIME-Complete?. This means it requires exponential time, and so is outside P and NP. The problem of deciding the truth of a statement in Presburger arithmetic is even harder. Fischer and Rabin proved in 1974 that every algorithm which decides the truth of Presburger statements has a runtime of at least 2^(2^(cn)) for some constant c. Here, n is the length of the Presburger statement. Hence, the problem provably needs more than exponential run time. Even more difficult are the undecidable problems, such as the halting problem. They cannot be solved in general given any amount of time.

All of the above discussion has assumed that P means "easy" and "not in P" means "hard". While this is a common and reasonably accurate assumption in complexity theory, it is not always true in practice, for several reasons:

It ignores constant factors. A problem that takes time 101000n is P (in fact, it's linear time), but is completely intractable in practice. A problem that takes time 10-100002n is not P (in fact, it's exponential time), but is very tractable for values of n up into the thousands.

It ignores the size of the exponents. A problem with time n1000 is P, yet intractable. A problem with time 2n/1000 is not P, yet is tractable for n up into the thousands.

It only considers worst-case times. There might be a problem that arises in the real world. Most of the time, it can be solved in time n, but on very rare occasions you'll see an instance of the problem that takes time 2n. This problem might have an average time that is polynomial, but the worst case is exponential, so the problem wouldn't be in P.

It only considers deterministic solutions. There might be a problem that you can solve quickly if you accept a tiny error probability, but a guaranteed correct answer is much harder to get. The problem would not belong to P even though in practice it can be solved fast. This is in fact a common approach to attack NP-complete problems.

New computing models such as quantum computers, which also work probabilistically, may be able to quickly solve some problems not known to be in P.

No one knows whether polynomial-time algorithms exist for NP-complete languages. But if such algorithms do exist, we already know some of them! For example, the following algorithm correctly accepts an NP-complete language, but no one knows how long it takes in general. This is a polynomial-time algorithm if and only if P=NP.

// Algorithm that accepts the NP-complete language SUBSET-SUM.

//

// This is a polynomial-time algorithm if and only if P=NP.

//

// "Polynomial-time" means it returns "YES" in polynomial time when

// the answer should be "YES", and runs forever when it's "NO".

//

// Input: S = a finite set of integers

// Output: "YES" if any subset of S adds up to 0.

// Otherwise, it runs forever with no output.

// Note: "Program number P" is the program you get by

// writing the integer P in binary, then

// considering that string of bits to be a

// program. Every possible program can be

// generated this way, though most do nothing

// because of syntax errors.

FOR N = 1...infinity

FOR P = 1...N

Run program number P for N steps with input S

IF the program outputs a list of distinct integers

AND the integers are all in S

AND the integers sum to 0

THEN

OUTPUT "YES" and HALT

If P=NP, then this is a polynomial-time algorithm accepting an NP-Complete language. "Accepting" means it gives "YES" answers in polynomial time, but is allowed to run forever when the answer is "NO".

Perhaps we want to "solve" the SUBSET-SUM problem, rather than just "accept" the SUBSET-SUM language. That means we want it to always halt and return a "YES" or "NO" answer. Does any algorithm exist that can provably do this in polynomial time? No one knows. But if such algorithms do exist, then we already know some of them! Just replace the IF statement in the above algorithm with this:

IF the program outputs a complete math proof

AND each step of the proof is legal

AND the conclusion is that S does (or does not) have a subset summing to 0

THEN

OUTPUT "YES" (or "NO" if that was proved) and HALT

See also:

A $1,000,000 offer from the Clay Mathematics Institute for a solution of the P versus NP question: http://www.claymath.org/prizeproblems/index.htm

A. S. Fraenkel and D. Lichtenstein, Computing a perfect strategy for n*n chess requires time exponential in n, Proc. 8th Int. Coll. Automata, Languages, and Programming, Springer LNCS 115 (1981) 278-293 and J. Comb. Th. A 31 (1981) 199-214.

E. Berlekamp and D. Wolfe, Mathematical Go: Chilling Gets the Last Point, A. K. Peters, 1994. D. Wolfe, Go endgames are hard, MSRI Combinatorial Game Theory Research Worksh., 2000.

Computational Complexity of Games and Puzzles

Main Page

Recent Changes

Watch page links

Edit this page

History

Upload files

Statistics

New pages

Orphans

Most wanted

Most popular

Random Page

Stub articles

Long articles

List users

Bug reports

June 23, 2002

Talk

Main Page | Recent Changes | Edit this page | History | Random Page | Special Pages

This page has been accessed 3146 times. Other namespaces : Talk

Last edited: Friday, May 31, 2002, 12:39 (diff)

Validate this page

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有