Description Usage Arguments Value
View source: R/knapsack_dynamic.R
Solving the knapsack problem through dynamic programming
1 | knapsack_dynamic(x, W)
|
x |
is a data.frame containing knapsack data. It has two columns: v with values and w with weights. |
W |
is a numeric scalar which defined the maximum possible weight knapsack can handle before breaking. |
a list object containing the best bag value given the weight and the elements that make up the best bag.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.