Dating problem cryptography
The knapsack problem, though NP-Hard, is one of a collection of algorithms that can still be approximated to any specified degree.This means that the problem has a polynomial time approximation scheme.
Here the maximum of the empty set is taken to be zero. However, since this runtime is pseudopolynomial, this makes the (decision version of the) knapsack problem a weakly NP-complete problem.
To be exact, the knapsack problem has a fully polynomial time approximation scheme (FPTAS)..
It then proceeds to insert them into the sack, starting with as many copies as possible of the first kind of item until there is no longer space in the sack for more.
Example of a one-dimensional (constraint) knapsack problem: which boxes should be chosen to maximize the amount of money while still keeping the overall weight under or equal to 15 kg?
A multiple constrained problem could consider both the weight and volume of the boxes.