Home Manual Reference Source

References

summary
public

F Item(weight: *, value: *)

public

Exact DP solution to the 0-1 knapsack problem with integer values given a known upper bound V on OPT.

public

F integerValuesKnapsackUnbounded(v: Array, w: Array, n: Number, W: Number, zero: Number | BigInt, V: Number, m: Array): Number

Exact DP solution to the unbounded knapsack problem with integer values given a known upper bound V on OPT.

public

Exact DP solution to the 0-1 knapsack problem with integer weights.

public

Exact DP solution to the unbounded knapsack problem with integer weights.

public

F knapsackApprox(eps: Number, v: Array, w: Array, n: Number, W: Number, P: Number): Number

(1-eps)-approx for the knapsack problem.

public

1/2-approximation to the 0-1 knapsack problem.

public

1/2-approximation to the unbounded knapsack problem.

public