Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87000

Re: Speeding up permutations generation

From Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
Subject Re: Speeding up permutations generation
Date 2015-03-06 09:44 +0100
References <CADgpKWb=q2=YEJSS1yRkgzF37nO5BNRnywm+zhcwF-MAOr6MdA@mail.gmail.com> <mdboqc$7s6$2@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.98.1425631533.21433.python-list@python.org> (permalink)

Show all headers | View raw


On 03/06/2015 09:34 AM, Mark Lawrence wrote:
> On 06/03/2015 06:44, Abhiram R wrote:
>> Hi all,
>> Is there a way to generate permutations of large arrays of sizes say,in
>> the hundreds, faster than in the time itertools.permutations() can
>> return?
>>
>> ​-Abhiram.R
>> /~Never give up/
>>
>
> If there is I'd guess that you'd use numpy http://www.numpy.org/.  The
> more mathematically minded may well be able to give better answers.
>

Well, numpy would be faster if you could call into it once and retrieve 
all permutations as an array. This would allow you to do all 
calculations in C, while itertools.permutations has to jump back and 
forth between C and Pyhon code.

However, 50! is still ~ 3*10^64. So where would you want to store the 
array of these many permutations ?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Speeding up permutations generation Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2015-03-06 09:44 +0100

csiph-web