Brief introduction of algorithm time complexity and NP problem

Source: Internet
Author: User

Here is a brief introduction to the algorithm's time complexity and NP, after all, the analysis algorithm of time complexity of the upper bound to help analyze the quality of the algorithm, the analysis algorithm is also helpful to analyze whether there are better algorithms;

One, the complexity of time:

The general concern is also the time complexity of the recursive problem: ( reference:http://blog.csdn.net/so_geili/article/details/53444816)

Cases:

Second, NP problem:

P-Class problem : The decision problem can be solved by using deterministic algorithm in polynomial time;

NP class Problem : The decision problem can be solved by using non-deterministic algorithm in polynomial time;

NPC Problem (NP-complete problem): The complexity of some problems in NP is associated with the complexity of the entire class. Any of these problems if there is a polynomial-time algorithm, then all NP problems are polynomial time solvable;

Note: (1) The time of the polynomial time here is for the scale of the problem;

(2) We will be able to solve the problem in polynomial time called "easy" problem, will need to solve the problem in exponential time called "difficult" problem;

(3) From the definition is easy to find that p belongs to NP, but P is not a true subset of NP, this problem is currently one of the seven major problems in the world;

(4) The definition of a problem can be found in the following example:

Brief introduction of algorithm time complexity and NP problem

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: info-contact@alibabacloud.com 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.