knapsack_dynamic: knapsack_dynamic

Description Usage Arguments Value Examples

View source: R/knapsack_dynamic.R

Description

Solver for the knapsack problem based on dynamic programming.

Usage

1

Arguments

x

Dataframe containing weight and value of objects

W

maximum weight allowed in knapsack

Value

List with the optimal value and the respective elements, that are included in the solution.

Examples

1
2
3
knapsack_objects <- get_knapsack_objects(2000)

knapsack_dynamic(x = knapsack_objects[1:8, ], W = 3500)

PatrickSVM/knapsack documentation built on Dec. 18, 2021, 6:42 a.m.