Pseudo-Polynomial algorithm

Source: Internet
Author: User
Pseudo-Polynomial algorithm

What is a pseudo-polynomial?
The worst-case time complexity is called a pseudo-polynomial algorithm, depending on the input value (not the number of inputs).
For example, consider the problem of calculating the frequency of all elements in a positive array. a pseudo-polynomial time solution is to find the maximum value first, then iterate from 1 to the maximum value, and for each value, find its frequency in the array. The solution takes time based on the maximum value in the input array and is therefore a pseudo-polynomial. on the other hand, its time complexity is only based on the number of elements in an array (not a value) is considered to be a polynomial-time algorithm.

Pseudo-polynomial and NP-integrity
some NP-complete problems have pseudo-polynomial time solutions. For example,a dynamic programming solution for 0-1 knapsack , subset, and partitioning problems is pseudo-polynomial. The NP-complete problem that can be solved by using pseudo-polynomial time algorithm is called weak NP completion.

Pseudo-Polynomial algorithm

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.