knapsack_dynamic: Dynamic programming algorithm for the knapsack problem

Description Usage Arguments Details Author(s) References See Also Examples

Description

Dynamic programming algorithm for the knapsack problem

Usage

1

Arguments

W

is the total size of the knapsack

x

is a data.frame containing variables 'w' and 'v', weights and values

Details

An algorithm that can solve the knapsack problem exact by iterating over all possible values of w all possbile values with good accuracy , and also gives the maximum value for the knapsack

Author(s)

Aqeel Ahmed, Marhawi Tewolde

References

https://en.wikipedia.org/wiki/Knapsack_problem

See Also

Dynamic Programming Knapsack

Examples

1
2
3
4
knapsack_dynamic(x = knapsack_objects[1:12,], W = 3500)
knapsack_dynamic(x = knapsack_objects[1:8,], W = 2000)
knapsack_dynamic(x = knapsack_objects[1:12,], W = 2000)
knapsack_dynamic(x = knapsack_objects[1:12,], W = 2000)

akilahmd/Knapsackpackage documentation built on May 12, 2019, 4:42 a.m.