Re:Knapsack problem
by danielovich on Tuesday April 23, 2013 @12:35PM
(#5596169)
Knapsack! And there is no way to determine the best solution before every combinations has been tried. I have been in the exact same spot as you but ended up making a specific module for it which didn't needed any computation beforehand.
Hold on, so you did you bruteforce all-all possible solutions and then just picked the best one out of them?
How many products you had? Was it close to what I have?
In my case there are just too many possible solution. I waited for an hour on my current one and it didn't finish :)
What was your strategy with regards of how much each bag type you select? Try all possible from current_max downto 7,500?
Now the problem is to find bags types and corresponding amounts such that total cost is maximized.