Speeding up permutations generation

Dave Angel davea at davea.name
Fri Mar 6 06:29:06 EST 2015


On 03/06/2015 01:44 AM, 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?
>

When dealing with large loops like that (or even permutations of 50, 
which is also gy-normous [1]), you have to consider what work you plan 
to do in the loop.

Even if the generation were instantaneous, you still presumably are 
going to have some code in the loop.

If you expect to do it on a set of 50, you're going to have to narrow 
down the possibilities with some approach other than brute force.

What's the problem you were hoping to solve in the next trillion years?


[1]  50! = 
30414093201713378043612608166064768844377641568960512000000000000L


-- 
DaveA



More information about the Python-list mailing list