Description Usage Arguments Value See Also Examples
View source: R/bruteForceKnapsackSolver.R
This function takes a data frame with items and a knapsack capacity and returns the solution that maximises the total value.
1 | bruteForceKnapsackSolver(x, W)
|
x |
A data frame containing items |
W |
The weight capacity of the knapsack |
A list describing the solution
https://en.wikipedia.org/wiki/Knapsack_problem
1 2 3 4 5 6 | ## Not run:
if(interactive()){
bruteForceKnapsackSolver(data.frame(w = c(1,2,3), v = c(1,9,4)), W=5)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.