[Tutor] 6x6 word square solver too slow
R. Alan Monroe
amonroe at columbus.rr.com
Sat Apr 26 17:04:22 CEST 2008
> I'd suggest googling for 'trie'. Tries are method of
> indexing sets of strings by prefix.
Ah, will look it up.
> As I recall, English words are more similar at the
> front, so once you have an indexing scheme you'll
> probably to do even less work if you index and search
> from the back of the words towards the front.
I'll have to consider that. In the meantime, my current version is
much improved - it caches rejects, so that if one word starting with
'ab' fails, it doesn't bother testing any further words starting with
'ab'. Also I started using psyco on it.
Alan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4cyte013b.py
URL: <http://mail.python.org/pipermail/tutor/attachments/20080426/1c3db8df/attachment.txt>
More information about the Tutor
mailing list