greedy_knapsack: Implements Greedy ALgorithm for knapsack problem

Description Usage Arguments Value References See Also Examples

View source: R/greedy_knapsack.R

Description

Implements Greedy ALgorithm for knapsack problem

Usage

1

Arguments

x

data.frame, contains variables weight(w) and value(v)

W

weight threshold for the knapsack

Value

Total v and position of w's for that value

References

https://en.wikipedia.org/wiki/Knapsack_problem#0.2F1%20knapsack%20problem

See Also

brute_force_knapsack knapsack_dynamic

Examples

1
2
greedy_knapsack(x = knapsack_objects[1:800,], W = 3500)
greedy_knapsack(x = knapsack_objects[1:1200,], W = 2000)

shaiq681/KnapSacked documentation built on Oct. 13, 2020, 1:27 a.m.