knapsack: Solving knapsack problem using three different solutions

Description Functions Author(s) References

Description

The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.

Functions

brute_force_knapsack(x, W)

returns the solution for knapsack problem using brute force algorithm.

greedy_knapsack(x, W)

returns the solution for knapsack problem using Greedy approximation algorithm.

knapsack_dynamic(x, W)

returns the solution for knapsack problem using Dynamic programming algorithm.

Author(s)

Ali Etminan, Mohsen Pirmoradiyan

References

http://en.wikipedia.org/wiki/Knapsack_problem


mpirmoradiyan/knapsack documentation built on Nov. 4, 2019, 7:31 p.m.