Description Usage Arguments Value References
View source: R/brute_force_knapsack.R
Solution to the knapsack problem using brute-force search.
The algorithm goes through all possible alternatives and returns the maximum value found.
Correct answer guaranteed in all situations.
1 | brute_force_knapsack(x, W, parallel = FALSE)
|
x |
Dataframe with variables v and w. |
W |
Integer. Size of the knapsack. |
Returns a list with the total final value and the items added to the knapsack.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.