knapsack_dynamic: knapsack_dynamic

Description Usage Arguments Value References

View source: R/Dynamic.R

Description

The 'knapsack_dynamic' function is a approach that use the a heuristic or approximation for knapsack package problem#' @param x is a 2dim matrix containing the weights and values.

Usage

1

Arguments

x

is a matrix containing the weights and values

W

a numeric string.

Value

A list cointaining a value and a element

References

https://en.wikipedia.org/wiki/Knapsack_problem#Dynamic_programming_in-advance_algorithm set.seed(42) n <- 2000 knapsack_objects <- data.frame( w=sample(1:4000, size = n, replace = TRUE), v=runif(n = n, 0, 10000) ) knapsack_dynamic(x = knapsack_objects[1:800,], W = 3500)


boxizhang/boxknapsack documentation built on May 24, 2019, 7:25 p.m.