Description Usage Arguments Value References
View source: R/greedy_knapsack.R
Returns the maximum value given the capacity of knapsack by sorting the items in decreasing order of value per unit of weight.
1 | greedy_knapsack(x, W)
|
x |
A |
W |
the maximum capacity of the knapsack. |
A list
containing the maximum value and the elements.
en.wikipedia.org/wiki/Knapsack_problem
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.