Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Algorithm for best fitting numbers

Name: Someawe 2006-10-20 19:06

Ok Guys I'm really stuck here,
I try to make an algorithm that tries to find the best combination of the same numeric values into different Numbers.
Let me give you an example: you have a 700MB CD and you have 30Files ranging from some kilobytes to 50MB. Now the algorithm has to find out which files to burn so that the least amount of unused space is left.

While I already developed and implemented 2 algorithms which both work fine on a small amount of elements but 16 Elements already take one implementation one hour to calculate while the other one does it in about 10 seconds but at the price of saving 65535 integer Values. Now if I wanted to calculate a List of 30 Elements I would need either to save about 1*10^10 integer Values or calculate for about a week.
I can't calculate what 1000 elements would take me because when I try I get Overflow Exceptions in my calculator.
And also until now I use recursive functions but I could replace it with an iterative one in the memory hungry program BUT if I wanted to save the values to a file I would need 4Gigs for the 30 Element Example.

So I hope you can help me with your leet programming skills because I am just to stupid to think of an algorithm that could run on my pc. I mean maybe there already is an algorithm for this programm but I just couldn't find it with google.

Name: Anonymous 2006-10-22 11:17

You'll find that optimality isn't as important as maintaining consistent paths and locality of files.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List