@problem-solving/knapsack
v0.0.1
Published
Knapsack problem algorithms for JavaScript
Downloads
3
Readme
:school_satchel: @problem-solving/knapsack
Knapsack problem algorithms for JavaScript. See docs.
import {
knapsackGreedy,
knapsackApprox,
} from '@problem-solving/knapsack';
knapsackGreedy(n, v, w, W); // 1/2 approximation
knapsackApprox(eps, n, v, w, W); // 1-eps approximation
:book: References
- The knapsack problem explained at Wikipedia.