bin packing algorithm

path

Disciple
Hey anyone here who has studied the bin packing algorithm while studying computer science? Im trying to script out a small tool to automatically arrange downloads into dvd sized folders to optimise the number of dvds.
 
Are you referring to the data formats ISO and UDF? As far as I know they are tools to convert data into udfs or isofs on all operating systems and then you could burn them to disc. In case you happen to be using linux a simple approach to accomplish what you want would be using a bash script that monitors various folders, checks the size of the data in them (perhaps using du? or some form of inotify), arranges them so as to fit into DVDs (say based on an upper limit of 4 G or something) and uses mkisofs of mkudffs to create an image, then (optionally) burns it to disc using cdrecord.

On Windows, apparently you can use the Nero SDK to create ISO and UDF images. No experience with that, just the results of a Google query.

In either case, re-creating the ISO or UDF image creating algorithm might be a little difficult. But if your project requires it then you should definitely read up on it (Google is your friend)

Disclaimer: I'm not a computer science graduate.
 
Im referring to just the bit about arranging folders into dvd sizes. Im trying to optimise it so I dont waste too much space
 
This is a very complex problem so may not be possible to get an optimal solution. Only a brute force approach which tries out all combinations will be optimal.

You can try out some kind of "greedy" approach. Sort all the files and assign to temp directories in a round robin fashion. The files in the temp directories can be burnt to DVDs.

Good luck. Once you decide your approach, scripting it should be doable (in linux at least)
 
yeah so I first ended up solving it using some heuristic called "best fit decreasing". But overtime Ive been ending up with a large bunch of folders which dont seem to match anything else. Now Im attempting some more complex solution from some 1980 paper I found. Its a brute force approach but uses a branch and bound strategy to cut down the number of bad branches
 
Back
Top