Description Usage Arguments Value
View source: R/greedy_knapsack.R
A greedy heuristic for solving the knapsack problem. The solution does not represent the optimal solution, but is computationally cheap.
1 | greedy_knapsack(x, W)
|
x |
dataframe with columns w and v (weight and value) representing the items |
W |
double representing the weight limit of the knapsack |
list with the value of the items in the knapsack and the elements contained in the knapsack.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.