greedy_knapsack_better: greedy_knapsack_better function

Description Usage Arguments Value

View source: R/greedy_knapsack_better.R

Description

evaluates the solution for knapsack problem by choosing elements with highest value per unit weight and using complete knapsack capacity

Usage

1

Arguments

x

as a data.frame containing the weights and values of knapsack objects with column names 'w' & 'v' respectively

W

as a numeric value defining the constraint of the knapsack capacity

Value

list containing sum of values of chosen elements and the reference of the elements chosen in the final solution


JS2387/Group8knapsack documentation built on Dec. 18, 2021, 12:27 a.m.