Description Usage Arguments Value
View source: R/brute_force_knapsack.R
An algorithm that tries every possible alternatives of items in the knapsack and returns the optimal solution.
1 | brute_force_knapsack(x, W, parallel = FALSE)
|
x |
dataframe with columns w and v (weight and value) representing the items |
W |
double representing the weight limit of the knapsack |
parallel |
boolean whether the code should be run in parallel or not. Default is to FALSE. |
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.