[pm-h] Thanks Again For Joining Me for "Solving WordBrain"

Robert Stone drzigman at drzigman.com
Mon Mar 21 16:04:02 PDT 2016


Greetings,

I apologize for the long delay in getting back to you on this.

I'm glad you found the problem interesting and that you had fun playing
with it!  I can certainly see where you are getting your speedups from and
I'll absolutely be incorporating your algorithmic changes (and likely some
of your actual code) into the Solver!

I'm still polishing, moving, and refactoring in an effort to put together
some better "Doing This Saved Me X" type numbers and I'll be sure to share
those figures as well as updated source code once everything is ready.

Thanks again for taking the time, I appreciate your efforts here and I
think it's going to make quite a difference.

Best Regards,
Robert Stone





On Mon, Mar 14, 2016 at 9:52 AM, Todd Rinaldo <todd at rinaldo.us> wrote:

> Robert,
>
> I spent way to much time thinking about this problem yesterday.
>
> I came up with this REALLY cool recursive algorithm to find all the
> possible 8 letter combinations given 16 characters. and then piped it into
> aspell -a since Text::Aspell is too slow. It turns out aspell  -a is too
> slow too also. I think it's because it's spending all its time trying to
> give you alternate spellings when you really just want it to tell you yes
> or no.
>
> Watching the output I realized the code was spending WAY too much time
> determining if a series of combinations was right when the human watching
> the output scroll by could obviously see that nothing starts with "sse". So
> I went and found a 350,000 word text dictionary and wrote something that
> could answer: anything_starts_with("sse"); It turns out you can save even
> more time if you know what the word length will need to be since what you
> really want to know is "does any word of length 8 start with sse?"
>
> So the joke is that I now had my program running time on this program from
> 5+ minutes to 30 seconds:
>
> $> time perl -Ilib -MWordBrain::Combos
> -E'WordBrain::Combos::find_words("ssehrckeionisswl", [4, 4, 8]);'
>
> At this point I was still using aspell when I had the final word to verify
> it. It occurred to me I could use my anything_starts_with check on the 8
> character string just as good as the partials. I made this change and
> suddenly the program time dropped to 3 seconds.
>
> So TL;DR; Aspell sucks for what this code needs it for. Code attached to
> make run time reasonable. What I'd probably do is NOT use find_words but
> instead just use anything_starts_with() to short my maze walker when I get
> to an invalid sequence. I suspect that would bring almost all puzzles down
> to a manageable time. NOTE You have to clear the cache and set
> $max_dict_word_len when your word length changes.
>
> I could not divine how to go about altering the code to make this work.
>
> Code attached.
>
>
>
>
> On Wed, Feb 17, 2016 at 7:48 PM, Robert Stone via Houston <houston at pm.org>
> wrote:
> > Greetings,
> >
> > A tremendous THANK YOU to everyone who was able to join me for my
> "Solving
> > WordBrain" presentation.  It certainly is a little rough around the edges
> > but I really appreciate the opportunity to present to everyone.
> >
> > Moreover, the feedback provided was fantastic!  I'm looking forward to
> > implementing some of the changes everyone suggested.
> >
> > I hope everyone enjoyed the presentation as much as I enjoyed delivering
> it.
> > Thank you all again for having me.
> >
> > Best Regards,
> > Robert Stone
> >
> > _______________________________________________
> > Houston mailing list
> > Houston at pm.org
> > http://mail.pm.org/mailman/listinfo/houston
> > Website: http://houston.pm.org/
>
>
>
> --
> Todd Rinaldo
> todd at rinaldo.us
>
>
> --
> Todd Rinaldo
> todd at rinaldo.us
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/houston/attachments/20160321/74f58fd3/attachment.html>


More information about the Houston mailing list