greedy_knapsack: Greedy algorithm for the knapsack problem

Description Usage Arguments Details Author(s) References See Also Examples

Description

Greedy algorithm for the knapsack problem

Usage

1

Arguments

x

is a data.frame containing variables 'w' and 'v', weights and values

W

is the total size of the knapsack

Details

This algorithm gives the approximate answer to our problem,it is able to show at least 50

Author(s)

Aqeel Ahmed, Marhawi Tewolde

References

https://en.wikipedia.org/wiki/Knapsack_problem#Greedy_approximation_algorithm

See Also

Greedy Algorithm

Examples

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

akilahmd/Knapsackpackage documentation built on May 12, 2019, 4:42 a.m.