Pseudo-polynomial-time algorithm pseudo-polynomial algorithms-----geeksforgeek Translation

Source: Internet
Author: User

What is a pseudo-polynomial?

When the worst time complexity of an algorithm is based on the order of magnitude of the input, we call the algorithm's time complexity even pseudo polynomial time (the interpretation on a wiki may be better understood if the time complexity of a numerical algorithm can be expressed as a polynomial of the input numerical scale n, But its running time and the bits number of input numerical scale n are exponential growth, it is called the time complexity of pseudo polynomial time . This is because the value of n is the power of the number of bits of n, so the time complexity of the algorithm should actually be considered as the power from Wiki of the number of bits of the input number n.

For example: counts the frequency of occurrences of all positive numbers in an array. The algorithm finds the maximum number Max and then iterates from 1 to Max to find out how often this number appears in the array. The time required for this algorithm depends on the size of the largest number in the array, so the algorithm is pseudo polynomial time. In other words, the time complexity of an algorithm is only based on the number of input elements, we think the algorithm is a polynomial time algorithm.

Pseudo-polynomial and NP-complete problems

Some NP problems are the solution of pseudo polynomial time, such as: 0-1 knapsack problem Dynamic programming solution, subset and problem (find out the problem of subset in array and equal to some value), slicing problem. This is all pseudo polynomial time. If a NP-complete problem has a pseudo polynomial-time solution, then we call this problem weak NP-complete problem.

Original link:

http://www.geeksforgeeks.org/pseudo-polynomial-in-algorithms/

Translation:

Rui

Pseudo-polynomial-time algorithm pseudo-polynomial algorithms-----geeksforgeek Translation

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.