Description Usage Arguments Value
This function can solve the knapsack problem exact by iterating over all possible values of W.
1 | dynamic_knapsack(x, W)
|
x |
Data frame that consists of two numeric columns (order is not relevant):
|
W |
A numeric value, being the knapsack size. |
The functoin returns a list containing two named objects:
"value": maximum knapsack value;
"elements": a vector containing the indexes of the objects (rows of data.frame) used to obtain the final result.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.