Knapsack is a well known problem of packing the knapsack with maximum amount of items within the given weight constraint however of higher value among the available items. The problem description and some of the approaches to solve the problem are laid out in the following wikipedia page “http://en.wikipedia.org/wiki/Knapsack_problem“
Here are Java implementation of two of the approaches. To download the source code visit my github account @ https://github.com/sangs/knapsack-ads
Meet in the middle approach to solving 0-1 knapsack problem:
0-1 knapsack problem is where item of each type are either avaiable or not available for packaging. Also, there are not more than one item of each type. By type here i refer to weight, value combination of the item.
Read full article from Knapsack problem – A Java implementation | mytwocentsads
No comments:
Post a Comment