optimized_dynamic_programming: optimized_dynamic_programming

Description Usage Arguments Value Examples

View source: R/optimized_dynamic_programming.R

Description

Optimized version of the dynamic programming algorithm.

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)

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

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