Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Fastest way to do permutations with replacement

by grinder (Bishop)
on Apr 16, 2008 at 15:51 UTC ( [id://680841]=note: print w/replies, xml ) Need Help??


in reply to Fastest way to do permutations with replacement

Does Algorithm::Combinatorics do what want you want? It's written in XS and thus probably one of the fastest ways of doing anything with combinations and permutations. The author has also taken care to use implementations that minimise the amount of memory required to keep track of where it is in the permutation space.

I've used it in the past and am very happy with it. The few conversations I had with the developer led to new releases being made in a short space of time.

• another intruder with the mooring in the heart of the Perl

  • Comment on Re: Fastest way to do permutations with replacement

Replies are listed 'Best First'.
Re^2: Fastest way to do permutations with replacement
by wdef2 (Acolyte) on Apr 16, 2008 at 19:24 UTC
    Thanks Monks for the replies. Algorithm::Combinatorics appears to do this with:

    variations_with_repetition(\@data, $k)

    which is probably the correct name for it.

    As far as a brute force cracker goes, the question then might be: is it more efficient to use Alorithm::Combinatronics in XScode and no threading, or divide the namespace into slabs for each thread of an Algorithm::Loop threaded implementation.

      Those who wish to peruse or berate my humble code as fumbling heresy may find it here:

      http://damnsmalllinux.org/cgi-bin/forums/ikonboard.cgi?act=ST&f=23&t=19676&st=60&&#entry101014

      But please send me for flagellation back here and not there, since I am the only candidate for entry to the Perlmonks novitiate in that spartan flock, almost none of whom seem to speak any of the Prophet Larry's programming language.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://680841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-18 02:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found