Description Usage Arguments Value References See Also Examples
View source: R/greedy_knapsack.R
Implements Greedy ALgorithm for knapsack problem
1 | greedy_knapsack(x, W)
|
x |
data.frame, contains variables weight(w) and value(v) |
W |
weight threshold for the knapsack |
Total v and position of w's for that value
https://en.wikipedia.org/wiki/Knapsack_problem#0.2F1%20knapsack%20problem
brute_force_knapsack
knapsack_dynamic
1 2 | greedy_knapsack(x = knapsack_objects[1:800,], W = 3500)
greedy_knapsack(x = knapsack_objects[1:1200,], W = 2000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.