Permutation Generator

David Isaac aisaac0 at verizon.net
Sun Aug 14 14:39:23 EDT 2005


"Casey Hawthorne" <caseyhHAMMER_TIME at istar.ca> wrote in message
news:s13vf1l9enq2el0kkpbikcmp3m9bvkaqav at 4ax.com...
> It's hard to make "complete" permutation generators, Knuth has a whole
> fascicle on it - "The Art of Computer Programming - Volume 4 Fascicle
> 2 - Generating All Tuples and Permutations" - 2005


Can you elaborate a bit on what you mean?
Given a list of unique elements, it is easy enough to produce a
complete permutation generator in Python,
in the sense that it yields every possible permuation.
(See my previous post.)  So you must mean
something else?

Cheers,
Alan Isaac

PS If the elements are not unique, that is easy enough to
deal with too, as long as you say what you want the
outcome to be.





More information about the Python-list mailing list