<div>In the London Dojo last month, we worked on Word Chains or Word Ladders.</div><div><br></div>I have finally got round to implementing the breadth first algorithm:<div><a href="https://github.com/c4m3lo/word-chains/blob/master/team_1/wordchain_bf.py" target="_blank">https://github.com/c4m3lo/word-chains/blob/master/team_1/wordchain_bf.py</a> <br>

<div><br></div><div>It seems to perform reasonably well:</div><div><div><font face="courier new, monospace">$ python wordchain_bf.py ape man</font></div><div><font face="courier new, monospace">Using a dictionary with 585 3-letter words</font></div>
<div><span style="font-family:&#39;courier new&#39;,monospace">Solution in 5 steps: [&#39;ape&#39;, &#39;apt&#39;, &#39;opt&#39;, &#39;oat&#39;, &#39;mat&#39;, &#39;man&#39;]</span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><br>
</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">$ time python wordchain_bf.py flour bread</span></div><div><font face="courier new, monospace">Using a dictionary with 4607 5-letter words</font></div>
<div><span style="font-family:&#39;courier new&#39;,monospace">Solution in 6 steps: [&#39;flour&#39;, &#39;floor&#39;, &#39;flood&#39;, &#39;blood&#39;, &#39;brood&#39;, &#39;broad&#39;, &#39;bread&#39;]</span></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">real    0m0.588s</font></div><div><font face="courier new, monospace">user    0m0.320s</font></div><div><font face="courier new, monospace">sys     0m0.090s</font></div>
</div><div><br></div><div>Using Ubuntu&#39;s <font face="courier new, monospace">/usr/share/dict/words</font></div><div><div><font face="courier new, monospace">$ time python wordchain_bf.py seven eight</font></div><div><font face="courier new, monospace">Using a dictionary with 4608 5-letter words</font></div>
<div><span style="font-family:&#39;courier new&#39;,monospace">No solution</span></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">real    0m13.318s</font></div><div>
<font face="courier new, monospace">user    0m13.020s</font></div><div><font face="courier new, monospace">sys     0m0.110s</font></div></div><div><br></div><div>Using SOWPODS:</div><div><div><font face="courier new, monospace">$ time python wordchain_bf.py -d sowpods seven eight</font></div>
<div><font face="courier new, monospace">Using a dictionary with 12478 5-letter words</font></div><div><font face="courier new, monospace">Solution in 9 steps: [&#39;seven&#39;, &#39;semen&#39;, &#39;samen&#39;, &#39;sames&#39;, &#39;sanes&#39;, &#39;sines&#39;, &#39;sinhs&#39;, &#39;sighs&#39;, &#39;sight&#39;, &#39;eight&#39;]</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">real    1m10.842s</font></div><div><font face="courier new, monospace">user    1m10.500s</font></div><div><font face="courier new, monospace">sys     0m0.120s</font></div>
</div><div><br></div><div>See you tomorrow for the next one!</div><div><br></div><div>Dave</div><div><br></div><div><br></div><div><div class="gmail_quote">On 8 June 2012 14:47, Nicholas H.Tollervey <span dir="ltr">&lt;<a href="mailto:ntoll@ntoll.org" target="_blank">ntoll@ntoll.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div>Hi Dave,<br>
<br>
See <a href="https://github.com/ntoll/word-chains" target="_blank">https://github.com/ntoll/word-chains</a> (the team_1 folder).<br>
<br>
Enjoy your weekend hack! ;-)<br>
<br>
N.<br>
<div><br>
On 08/06/12 14:44, David Walker wrote:<br>
&gt; Nick,<br>
&gt;<br>
&gt; Did you manage to get the code we wrote last night onto Github?  I<br>
&gt; fancy trying to fix my bugs.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Dave<br>
&gt;<br>
&gt; On 31 May 2012 11:04, Nicholas H.Tollervey &lt;<a href="mailto:ntoll@ntoll.org" target="_blank">ntoll@ntoll.org</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:ntoll@ntoll.org" target="_blank">ntoll@ntoll.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; Carles has booked two slots for a 10minute talk on, well, let&#39;s<br>
&gt; just say it&#39;ll be fun to watch and smell his presentation.<br>
&gt;<br>
&gt; One more space left... any takers..?<br>
&gt;<br>
&gt; :-)<br>
&gt;<br>
</div>&gt; N. _______________________________________________ python-uk<br>
&gt; mailing list <a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a> &lt;mailto:<a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a>&gt;<br>
&gt; <a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
<div>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________ python-uk mailing<br>
&gt; list <a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
<br>
</div><div>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
</div>iQEcBAEBAgAGBQJP0gKFAAoJEP0qBPaYQbb6OQAIAJOZDTAMI87RmS5Xrr2cltqV<br>
zLvAq0NFVzXqm48/6C5UKsqJXA+ib9Qs1c+gy+QkwBvwe4qswC6VbJ3evzKmXV4e<br>
6iRZh50+ZEpWqidNzrrw6+wRv65CeTXk2L2YOo05klmtW2drylHCAvCWRe8vB/Si<br>
dYZ53mFavcEjxDQbanfG0SZwDOuI81znDVnU5TdSSGqUZiJCiq/t7s2RIkmbw8cc<br>
PSds6EohbS4wJIlizfermG6ZYjvlVykiJqjrKxh1VCExsCmm88C0wF+1YTrc0QOr<br>
i9UrKCJyx/fSq3XnimMUIdflteO5NInSlzxDZM5eHgTLHT8pRV2uMxhTouTXbuc=<br>
=Zz+0<br>
<div><div>-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
python-uk mailing list<br>
<a href="mailto:python-uk@python.org" target="_blank">python-uk@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-uk" target="_blank">http://mail.python.org/mailman/listinfo/python-uk</a><br>
</div></div></blockquote></div><br></div></div>