knapsack icon indicating copy to clipboard operation
knapsack copied to clipboard

failing test

Open karpikpl opened this issue 8 years ago • 1 comments

I think there's an issue with the algorithm - see provided test

karpikpl avatar Oct 22 '17 02:10 karpikpl

Indeed. This implementation doesn't appear to solve the knapsack problem at all. It simply fills the knapsack with the biggest item it can until there's not enough capacity for the remaining items. The possibility of smaller items being optimal is what makes this problem NP-Complete.

ojchase avatar Apr 13 '19 20:04 ojchase