Description Usage Arguments Value
This function uses Greedy heuristic. It does not return an exact result but it will reduce the computational complexity.
1 | greedy_knapsack(x, W)
|
x |
Data frame which consists the value and the weight for each object. |
W |
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.