Welcome to the Monastery | |
PerlMonks |
Re: Partitioning a set into parts of given sizesby Limbic~Region (Chancellor) |
on Nov 21, 2006 at 14:49 UTC ( [id://585272]=note: print w/replies, xml ) | Need Help?? |
blokhead,
I recently used your code because Set::Partition seems to be misnamed. According to Wikipedia, there is a difference between Set Partitioning and Ordered Set Partitioning. The latter distinguishing between the order the sets appear. It should probably be named Set::Partition::Ordered. In any case, I have a few comments. First, why do you require that the block sizes add up to the total number of items? I had to work around this restriction by generating the combinations of a fixed size and then using your code to partition the combinations. It would be nice if that restriction were @sum @block_size <= @items. The second comment is about availability on CPAN. I think this is something that might be of great value to others. I had intended to simplify my code but would love to make this a collaborative effort. Your thoughts? Cheers - L~R
In Section
Meditations
|
|