greedy_knapsack: Greedy Heuristic Algorithm

Description Usage Arguments Value References

View source: R/greedy_knapsack.R

Description

Solution to the knapsack problem following a greedy approach.
The algorithm solves the knapsack problem exact by iterating over all possible values of weight.
Do not expect an exact result.

Usage

1

Arguments

x

Dataframe with variables v and w.

W

Integer. Size of the knapsack.

Value

Returns a list with the total final value and the items added to the knapsack.

References

Wikipedia


abhi-vellala/732A94lab6 documentation built on Oct. 31, 2019, 1:54 a.m.