Bin-packing (or knapsack?) problem
问题 I have a collection of 43 to 50 numbers ranging from 0.133 to 0.005 (but mostly on the small side). I would like to find, if possible, all combinations that have a sum between L and R, which are very close together.* The brute-force method takes 2 43 to 2 50 steps, which isn't feasible. What's a good method to use here? Edit: The combinations will be used in a calculation and discarded. (If you're writing code, you can assume they're simply output; I'll modify as needed.) The number of