So...A long time ago I did the classic knapsack problem.
The knapsack problem goes like this: You have a backpack or a knapsack that can only hold a certain weight. And you have a bunch of items that each have a certain weight and value. Now you want to put items into your backpack so that you can maximize the value. It's fine if you don't fill up the entire backpack and you still have space left. But I'm revisiting this problem, and I tried to make sure that you fit the backpack EXACTLY. You use EXACTLY all the weight in the backpack, no less, no more. My original solution doesn't work because it isn't optimized to conserve space, only to get the maximum value. Does anybody know the proper algorithm to do this kind of problem?
that sometimes isn't possible
each item has weight 3 and the backpack can hold 52 weight