Description Usage Arguments Details Value References
View source: R/brute_knapsack.R
This is a brute force algorthm which check all possible combinations
1 | brute_force_knapsack(x, W, parallel = FALSE)
|
x |
is a data frame represents the total items, containing the two columns w and v, w represents thw weight of item and v represnets the value |
W |
is an integer that represents the maximum weight of the container |
parallel |
It's for the code to run on multiple cores of a computer to excute the code faster |
Knapsack
It return the list, which the total value of item in knapsack and their position in the data frame
https://en.wikipedia.org/wiki/Knapsack problem#0.2F1 knapsack problem
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.