Re: Distribute MP3 recordings optimally to CD-Rs by pboin (Deacon) on Sep 30, 2005 at 12:18 UTC |
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
|
| [reply] |
Re: Distribute MP3 recordings optimally to CD-Rs by Limbic~Region (Chancellor) on Sep 30, 2005 at 13:15 UTC |
| [reply] |
|
Search is your friend, if you know how to tell what you search for. It is an art for itself to create proper titles and feeding proper keywords. I was not able to find that thread, thank you for pointing out.
And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)
| [reply] |
Re: Distribute MP3 recordings optimally to CD-Rs by revdiablo (Prior) on Sep 30, 2005 at 14:22 UTC |
As pboin points out, this can be approached in terms of the knapsack problem. But there is a specialization of that, called the bin packing problem, which is simpler and also makes sense here. You can read about it at http://en.wikipedia.org/wiki/Bin_packing.
Since I do this fairly frequently, I wrote a module called Algorithm::BinPack to help me solve it. Even if you don't use my module, you might want to take a look at it -- the algorithm it uses has an intuitive simplicity that I really like. (And no, I didn't invent the algorithm, I just codified it into a module.)
| [reply] |
Re: Distribute MP3 recordings optimally to CD-Rs by eric256 (Parson) on Sep 30, 2005 at 14:58 UTC |
It seems this problem would be best solved by sorting your data biggest to smallest. Then just go over the list picking the next file that still fits in the space you have left. That should be pretty straight forward and fast. /me begins working on a general solution.
| [reply] |
|
| [reply] |
|
That's basically the algorithm I used in Algorithm::BinPack. Sort by biggest-first, then iterate on each item. If it doesn't fit in the first bin, try the next bin. Rinse, repeat.
| [reply] |
|
Don't know if this is relevant but do you need to allow space for overheads like directories etc?
Is that part of the rough 700Mb per CD?
Does that overhead change with number of files? ie can you fit 2 x 349 Mb files (698Mb) but only 195 x 3.49 Mb (680Mb).
Doesn't really change the principal behind the algorithm.
Although not directly relevent to computer files there is also the issue of retrieval. The best packing method my be less efficient if the files you most want to retrieve are scattered. This is part of programming for loading a lorry for a drop load. You need to make the best packing but also take into account the best route for the drop and how they will get stuff off.
| [reply] |
|
That was my manual solution, but it is not the best. Think of having sizes of 5,4,3,2 to fit on a 10 unit disk. After (5,4) nothing will fit, but (5,3,2) is better. That is the reason, why I try to check all solutions.
And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)
| [reply] |
Re: Distribute MP3 recordings optimally to CD-Rs by Aristotle (Chancellor) on Oct 08, 2005 at 20:09 UTC |
| [reply] |