Is this variant of the subset sum problem easier to solve?

后端 未结 8 813
旧巷少年郎
旧巷少年郎 2020-12-08 23:18

I have a problem related to the subset sum problem and am wondering if the differences make it easier, i.e. solvable in a reasonable amount of time.

Given a value V,

相关标签:
8条回答
  • 2020-12-09 00:19

    Well, for one thing since you're specifying size=L then even if you can't think of anything clever and just use brute force you'll have (N choose L) separate sums in the worst case, so it's a bit better than n^^L (well, L+1, as you'd then sum each subset).

    0 讨论(0)
  • 2020-12-09 00:20

    I'm not prepared to present a proof, but that sounds like it might be amenable to a dynamic programming scheme: tabulate the list of subsets of size 2use them to computer subsets of size 3, etc, so that hyou only need to examine a small collection of prospects.

    0 讨论(0)
提交回复
热议问题