Description Usage Arguments Value Examples
View source: R/greedy_heuristic.R
Solver for the knapsack problem based on the greedy heuristic.
1 | greedy_knapsack(x, W)
|
x |
Dataframe containing weight and value of objects |
W |
maximum weight allowed in knapsack |
List with the optimal value and the respective elements, that are included in the solution.
1 2 3 | knapsack_objects <- get_knapsack_objects(2000)
greedy_knapsack(x = knapsack_objects[1:800,], W = 3500)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.