Description Arguments Value References Examples
knapsack problem by brute_force method
x |
A takes a data.frame cx with two variables v and w |
W |
The variable W is the knapsack size. |
parallel |
in brute force knapsack() that is FALSE by default (so it works with the test suite where we have not specifed the argument parallel). If set to TRUE, the function should parallelize over the detected cores. $elements which indicates which row objects in data.frame x was put in the knapsack. |
the maximum knapsack
http://en.wikipedia.org/wiki/Knapsack_problem
1 2 3 4 5 6 | data(knapsack_objects)
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.