Description Usage Arguments Value Examples
Brute Force Approch to Solve Knapsack Problem
1 | brute_force_knapsack(x, W, parallel = FALSE)
|
x |
data.frame with colnames 'v' & 'w' |
W |
Knapsack Maximum Weight |
parallel |
Bool value to pass to active parallel |
Return best Knapsack combination with maximum value
1 2 3 4 5 6 7 8 | set.seed(42)
n <- 2000
knapsack_objects <-
data.frame(
w=sample(1:4000, size = n, replace = TRUE),
v=runif(n = n, 0, 10000)
)
brute_force_knapsack(x = knapsack_objects[1:8,], W = 2000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.