5 ms·
This is basically the knapsack problem right? https://en.m.wikipedia.org/wiki/Knapsack_problem https://en.m.wikipedia.org/wiki/Knapsack_problem
by DubiousPusher 7y ago
This is basically the knapsack problem right?
https://en.m.wikipedia.org/wiki/Knapsack_problem https://en.m.wikipedia.org/wiki/Knapsack_problem
- maweki 7y agoNo. Linear optimization. Edit: Sorry. It's linear optimization with integers and therefore in the same complexity class as any other np complete problem.
- maweki 7y agoFor anybody reading this: IN THEORY In practice the nugget per package gets cheaper as the package size increases and therefore a greedy algorithm is very useful and probably linear in the number of package types.