Description Usage Arguments Value Examples
Solve knapsack problem by Dynamic programming. This approach is of complexity O(Wn).
1 | dynamic_knapsack(x, W)
|
x |
data.frame, first column x:weight of object, second column v:value of object |
W |
numeric, weight limit of knapsack |
list, value: total value of objects, elements: the rows of objects
1 2 | data(knapsack_objects)
dynamic_knapsack(x = knapsack_objects[1:8,], W = 3500)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.