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


Groups > comp.lang.python > #87015

Re: Speeding up permutations generation

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.107
X-Spam-Level *
X-Spam-Evidence '*H*': 0.79; '*S*': 0.00; 'arrays': 0.09; 'force.': 0.16; 'loop.': 0.16; 'loops': 0.16; 'subject:generation': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'header:User-Agent:1': 0.23; '(or': 0.24; 'header:In-Reply-To:1': 0.27; '[1]': 0.29; 'am,': 0.29; 'code': 0.31; '50,': 0.31; 'problem': 0.35; 'there': 0.35; 'next': 0.36; 'to:addr:python-list': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'solve': 0.60; "you're": 0.61; 'charset:windows-1252': 0.65; 'received:74.208': 0.68; 'hoping': 0.75; 'presumably': 0.84
Date Fri, 06 Mar 2015 06:29:06 -0500
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Speeding up permutations generation
References <CADgpKWb=q2=YEJSS1yRkgzF37nO5BNRnywm+zhcwF-MAOr6MdA@mail.gmail.com>
In-Reply-To <CADgpKWb=q2=YEJSS1yRkgzF37nO5BNRnywm+zhcwF-MAOr6MdA@mail.gmail.com>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V03:K0:Abw70I6GYbfiCNF3I/W8nB0dvZmxXw2wZiy6XDSAPXTkSy5Ch6r 5fAl75G27T6/fbvCsAUP9F7Ez4TohUd2nrUE+nFccELkhb/8sj2L4RDUrOKOMP5qIigQ59i YHWekzjf8ETBgIIWcewdiB09akD2buO094jz+FRLVILM0pUgm4/ECAvZMHAO2kVxNNm8jCa e6N3gvB4GdmyCUi4O9YlQ==
X-UI-Out-Filterresults notjunk:1;
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.19
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.106.1425641363.21433.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1425641363 news.xs4all.nl 2869 [2001:888:2000:d::a6]:59640
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:87015

Show key headers only | View raw


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

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


Thread

Re: Speeding up permutations generation Dave Angel <davea@davea.name> - 2015-03-06 06:29 -0500

csiph-web