Description Usage Arguments Examples
Brute force search
1 | brute_force_knapsack(x, W, parallel = FALSE)
|
x |
knapsack objects - data frame |
W |
capacity of knapsack - integer |
parallel |
parallelize - logical |
1 2 3 4 5 6 7 8 9 10 11 | 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 = 3500)
brute_force_knapsack(x = knapsack_objects[1:12,], W = 3500)
brute_force_knapsack(x = knapsack_objects[1:8,], W = 2000)
brute_force_knapsack(x = knapsack_objects[1:12,], W = 2000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.