Description Usage Arguments Details Author(s) References See Also Examples
Greedy algorithm for the knapsack problem
1 | greedy_knapsack(x, W)
|
x |
is a data.frame containing variables 'w' and 'v', weights and values |
W |
is the total size of the knapsack |
This algorithm gives the approximate answer to our problem,it is able to show at least 50
Aqeel Ahmed, Marhawi Tewolde
https://en.wikipedia.org/wiki/Knapsack_problem#Greedy_approximation_algorithm
1 2 | greedy_knapsack(knapsack_objects[1:800], 3500)
greedy_knapsack(knapsack_objects[1:1200], 2000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.