Description Usage Arguments Value
View source: R/greedy_knapsack.r
A Greedy Solution for the Knapsack Problem
1 | greedy_knapsack(x, W)
|
x |
a |
W |
the maximum weight that the knapsack can hold |
a list
containing two elements: value
and elements
, representing the maximum value that can be realised with the given knapsack and the indices of the items to be packed in the knapsack for realising maximum value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.