Skip to content

computational-problem-solving/knapsack

Repository files navigation


© xkcd.com

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

License Version Tests Dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

📖 References