<div dir="ltr">Greetings,<div><br></div><div>I apologize for the long delay in getting back to you on this.</div><div><br></div><div>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!</div><div><br></div><div>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.</div><div><br></div><div>Thanks again for taking the time, I appreciate your efforts here and I think it's going to make quite a difference.</div><div><br></div><div>Best Regards,</div><div>Robert Stone</div><div><br></div><div><br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 14, 2016 at 9:52 AM, Todd Rinaldo <span dir="ltr"><<a href="mailto:todd@rinaldo.us" target="_blank">todd@rinaldo.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Robert,<br>
<br>
I spent way to much time thinking about this problem yesterday.<br>
<br>
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.<br>
<br>
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?"<br>
<br>
So the joke is that I now had my program running time on this program from 5+ minutes to 30 seconds:<br>
<br>
$> time perl -Ilib -MWordBrain::Combos -E'WordBrain::Combos::find_words("ssehrckeionisswl", [4, 4, 8]);'<br>
<br>
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.<br>
<br>
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.<br>
<br>
I could not divine how to go about altering the code to make this work.<br>
<br>
Code attached.<span class="im HOEnZb"><br>
<br>
<br>
<br>
<br>
On Wed, Feb 17, 2016 at 7:48 PM, Robert Stone via Houston <<a>houston@pm.org</a>> wrote:<br></span><div class="HOEnZb"><div class="h5">
> Greetings,<br>
><br>
> A tremendous THANK YOU to everyone who was able to join me for my "Solving<br>
> WordBrain" presentation.  It certainly is a little rough around the edges<br>
> but I really appreciate the opportunity to present to everyone.<br>
><br>
> Moreover, the feedback provided was fantastic!  I'm looking forward to<br>
> implementing some of the changes everyone suggested.<br>
><br>
> I hope everyone enjoyed the presentation as much as I enjoyed delivering it.<br>
> Thank you all again for having me.<br>
><br>
> Best Regards,<br>
> Robert Stone<br>
><br></div></div><div class="HOEnZb"><div class="h5">
> _______________________________________________<br>
> Houston mailing list<br>
> <a>Houston@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/houston" target="_blank">http://mail.pm.org/mailman/listinfo/houston</a><br>
> Website: <a href="http://houston.pm.org/" target="_blank">http://houston.pm.org/</a><br>
<br>
<br>
<br>
--<br></div></div><span class="HOEnZb"><font color="#888888">
Todd Rinaldo<br>
<a>todd@rinaldo.us</a><br>
<br><br>-- <br>Todd Rinaldo<br><a href="mailto:todd@rinaldo.us" target="_blank">todd@rinaldo.us</a><br>
</font></span></blockquote></div><br></div>