knapsack_dynamic: Solving the knapsack problem through dynamic programming

Description Usage Arguments Value

View source: R/knapsack_dynamic.R

Description

Solving the knapsack problem through dynamic programming

Usage

1

Arguments

x

is a data.frame containing knapsack data. It has two columns: v with values and w with weights.

W

is a numeric scalar which defined the maximum possible weight knapsack can handle before breaking.

Value

a list object containing the best bag value given the weight and the elements that make up the best bag.


TheodorEmanuelsson/knapsack documentation built on Dec. 18, 2021, 4:11 p.m.