Thanks so much, I see the light now. This logic along with Mike's (RMGir) Algorithm::Bucketizer insight will get me all the way home.

I plan on building the total size for each of the "project_1" trees and pushing them into Algorithm::Bucketizer if they are < 4.2 gig. If not I will jump down one tree level from "project_1" and use a method similar to the one you show to create a bucket_like object that I can then insert into Algorithm::Bucketizer until I am out of data in the sub tree.


After all that, Algorithm::Bucketizer can optimize the distribution over the buckets with:
$b->optimize(algorithm => "brute_force");


With a smaller number if items in the buckets brute forcing the "Knapsack Problem 0-1" should not be too time consuming (thank god it is not fractional =).

I think this will cover all of my requirements.


Thanks so much JAS and Mike for pointing me in the right direction! =)

-Waswas

In reply to Re: Re: My brain hurts! Recursive directory algorithm.. by waswas-fng
in thread My brain hurts! Recursive directory algorithm.. by waswas-fng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.