Algorithm::Combinatorics has good documentation and a very good interface. It's intuitive to use.
It would be good to refine optional parameters $min:
subsets(\@data[, $max, $min])
$max ($k) --- the iteration runs over subsets of data of size $max ($k)
$min --- the bottom limit.
subsets( [A, B, C, D], 4, 2)
A B C D
A B C
A B D
A C D
B C D
Many thanks for the module.
1 out of 1 found this review helpful. Was this review helpful to you? Yes No
I believe it was MJD who said that he couldn't think of a good reason, outside of academic curiousity, why someone would need to generate all the permutations of a set. My need wasn't perhaps exactly real world, but I did need to generate permutations and combinations of lists to prepare data for a test suite.
I found out about this module through fairly arduous process, mainly because searching "combination" or "combinations" on search.cpan.org has it lost somewhere beyond the fifth page of results. Perhaps adding "(permutations and combinations)" in the NAME would help raise its visibility. Yucky, but that's life with the search engines.
Nonetheless, if you do manage to find this module, it is a joy to use. The documenation is clear and to the point. You have an immediate idea of what the different functions do. It offers both procedural and object-oriented interfaces. The object-oriented interface feels "Just Right". The heavy lifting is done in XS. The author has chosen efficient non-recursive, non-stack-based algorithms.
My only quibble would be that the distribution lacks an ./eg directory. I like to have example scripts that exercise a distribution in different ways (and ways that perhaps you, as a user, would not think of). But the documentation is good enough that this is not strictly necessary.
3 out of 3 found this review helpful. Was this review helpful to you? Yes No