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


Groups > comp.lang.python > #61111 > unrolled thread

Re: Recursive generator for combinations of a multiset?

Started byDan Stromberg <drsalists@gmail.com>
First post2013-12-05 20:05 -0800
Last post2013-12-05 20:05 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Recursive generator for combinations of a multiset? Dan Stromberg <drsalists@gmail.com> - 2013-12-05 20:05 -0800

#61111 — Re: Recursive generator for combinations of a multiset?

FromDan Stromberg <drsalists@gmail.com>
Date2013-12-05 20:05 -0800
SubjectRe: Recursive generator for combinations of a multiset?
Message-ID<mailman.3621.1386302707.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On Wed, Nov 20, 2013 at 10:46 PM, John O'Hagan <research@johnohagan.com>wrote:

>
> Short story: the subject says it all, so if you have an answer already,
> fire away. Below is the long story of what I'm using it for, and why I
> think it needs to be recursive. It may even be of more general
> interest in terms of filtering the results of generators.
>


> Any suggestions?
>
I've updated my code at
http://stromberg.dnsalias.org/svn/anagrams/trunk/; It's multiword now.
 It can blast through the word "punishment" in 4
seconds, but for "The public art galleries" it ate about 7 gigabytes of RAM
and ran for more than a day before I killed it.

I believe it's an exponential problem.  Parallelization might help, but
it'd probably take a lot of RAM that way.  Maybe the RAM use would be
better with CPython, but it's much faster with Pypy; I did most of my
testing with Pypy 2.2.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web