greedy_knapsack: greedy_knapsack

Description Usage Arguments Value

View source: R/greedy_knapsack.R

Description

A greedy heuristic for solving the knapsack problem. The solution does not represent the optimal solution, but is computationally cheap.

Usage

1

Arguments

x

dataframe with columns w and v (weight and value) representing the items

W

double representing the weight limit of the knapsack

Value

list with the value of the items in the knapsack and the elements contained in the knapsack.


Marbr987/lab6 documentation built on Dec. 17, 2021, 2:20 a.m.