Simple understanding of NP, P, Np-complete and Np-hard

Source: Internet
Author: User

Pis a class of deterministic Turing (hereinafter referred to as Turing) in polynomial time ( Polynomial time) resolves problems within the collection.NPis a class that can be passed through a non-deterministic Turing ( NOn-deterministic Turing machine) in polynomial time ( Polynomial time) Resolves a set of decision issues within thePIsNP, which means that any problem that can be solved by a Turing in polynomial time can be solved by a non-deterministic Turing. Now, let's talk.NPThe most difficult problem in theNp-complete。 It is defined as follows if a decision problem L isNp-complete, then L has the following two properties: 1) L YesNP(Given a solutionNp-completeScenario (solution, interested readers can think about the difference between solution and answer) and can quickly verify that it is possible, but there is no known-efficient solution. ) 2)NPcan be converted to L within polynomial time. andNp-hardOnly need to haveNp-completeOf the second nature, soNp-completeIsNp-hardSubset of the. The relationships of the four are as follows (assuming P!=NP):

Simple understanding of NP, P, Np-complete and Np-hard

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.