in reply to split directories with sizes
A typical, basic, example of the Knapsack Problem is this:
Suppose a burglar finds a lot of valuable goodies, more than he can carry, and he has limited space in his knapsack. What should he take, and how should he stack it, to maximize his loot?
The algorithm library (see Google) has a lot to say about it, in many variations, too, but let me tell you: it's probably harder than you think. Think of each master directory as a knapsack that can hold 195MB, and you have to devide the loot (your directories) among them.
And my advice is to do this in the abstract: build a large datastructure with the data on the directories, in particular their sizes, fugure out how to stack them, and only then start to move things around, as a final step. And only after you verified the solution is acceptable to you — you never know with bugs, otherwise you might lose valuable files.
|
|---|