tags:

views:

55

answers:

1

I'm looking for a technique or algorithm that will give me a subset of integers from a given set that, when summed, most closely match a given target number.

I have a music video and I want video for 248 frames. I have a set of clips of various lengths, all less than 248. I would like a subset of those that are closest to 248 when their lengths are summed.

Is there something on the linux command line that I can use to do this?

+1  A: 

Ye Olde Bin Packing Problem and oddly I can't think of a standard implementation.

msw