Description Usage Arguments Value Examples
View source: R/knapsack_dynamic.R
knapsack dynamic force.
1 | knapsack_dynamic(x, W)
|
x |
An object with the class “data frame”, the weight of the data in the first column and price in the second column. |
W |
A numeric value grater than 0, the maximal capacity of the knapsack. |
A list of the greatest combined value and the elements.
1 2 3 | x<-knapsack_data(8)
knapsack_dynamic(x,3500)
system.time(knapsack_dynamic(x,3500))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.