Are there any 'tricks' to speed up sampling of a very large knapsack combination type prob?

前端 未结 9 2025
情话喂你
情话喂你 2020-12-29 10:21

UPDATE: I have realized the problem below is not possible to answer in its current form because of the large amount of data involved(15k+ items). I just found out, the

9条回答
  •  青春惊慌失措
    2020-12-29 10:53

    The problem you are trying to solve is called number partitioning. It is a special case of the knapsack problem. If the values are all integers and you are trying to get to value M, then then you can find a single solution in O(n*M) time. To enumerate all combinations could be exponential because there are potentially an exponential number of solutions.

提交回复
热议问题