Re: [Tutor] Generating Unique Permutations

2009-12-18 Thread Robert Johansson
: tutor-bounces+robert.johansson=math.umu...@python.org [mailto:tutor-bounces+robert.johansson=math.umu...@python.org] För Michael Morrissey Skickat: den 18 december 2009 06:54 Till: tutor@python.org Ämne: [Tutor] Generating Unique Permutations I'm just a philosophy teacher, and I don't

Re: [Tutor] Generating Unique Permutations

2009-12-18 Thread Kent Johnson
On Fri, Dec 18, 2009 at 12:54 AM, Michael Morrissey wrote: > I'm looking for an efficient way to create all the unique, non-duplicated > permutations of a list (I believe these are called "necklaces" in > combinatorics). I need to do this without actually generating every possible > permutation (w

Re: [Tutor] Generating Unique Permutations

2009-12-18 Thread Shashwat Anand
may be this can be helpful: http://blog.bjrn.se/2008/04/lexicographic-permutations-using.html On Fri, Dec 18, 2009 at 6:01 PM, R. Alan Monroe wrote: > > > I'm looking for an efficient way to create all the unique, non-duplicated > > permutations of a list > > This may or may not help: > http://c

Re: [Tutor] Generating Unique Permutations

2009-12-18 Thread R. Alan Monroe
> I'm looking for an efficient way to create all the unique, non-duplicated > permutations of a list This may or may not help: http://code.activestate.com/recipes/190465/ Alan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscripti

Re: [Tutor] Generating Unique Permutations

2009-12-18 Thread spir
Michael Morrissey dixit: > I'm just a philosophy teacher, and I don't know much about mathematics or > computers. I'm writing a python program (not the best language for this > topic, but it is what I know), and I need to solve a problem which requires > more knowledge than I have. I'm hoping you

Re: [Tutor] Generating Unique Permutations

2009-12-17 Thread Shashwat Anand
create your desired list >>> l = ['a', 'a', 'b', 'b'] do a permutation and take unique values >> import itertools >> set(itertools.permutations(l)) HTH On Fri, Dec 18, 2009 at 11:24 AM, Michael Morrissey wrote: > I'm just a philosophy teacher, and I don't know much about mathematics or > comput

[Tutor] Generating Unique Permutations

2009-12-17 Thread Michael Morrissey
I'm just a philosophy teacher, and I don't know much about mathematics or computers. I'm writing a python program (not the best language for this topic, but it is what I know), and I need to solve a problem which requires more knowledge than I have. I'm hoping you can help me. =) I'm looking for a