<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"	>
<channel>
	<title>Comments on: Why TDD makes a lot of sense for Sudoko</title>
	<atom:link href="http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/feed/" rel="self" type="application/rss+xml" />
	<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/</link>
	<description>Johannes Brodwall&#039;s Musings on Software Architecture and Programming</description>
	<lastBuildDate>Fri, 13 Apr 2012 19:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: [translation] solve all the problems (sudoku)</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-128957</link>
		<dc:creator>[translation] solve all the problems (sudoku)</dc:creator>
		<pubDate>Sun, 12 Jun 2011 17:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-128957</guid>
		<description>[...]  Java version by Johannes Brodwall [...]</description>
		<content:encoded><![CDATA[<p>[...]  Java version by Johannes Brodwall [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous Guest</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-128844</link>
		<dc:creator>Anonymous Guest</dc:creator>
		<pubDate>Wed, 30 Mar 2011 03:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-128844</guid>
		<description>You did misread Norvig.  He describes his algorithm as &quot;systematically try all possibilities until we hit one that works&quot;. Thus his algorithm is almost the same as yours, except that (a) he uses heuristics to choose the variable ordering while you go in linear order, and (b) he is more aggressive about propagating constraints. The result is an algorithm that is complete, but is about 1000 times faster (and more compact in terms of lines of code, which some see as an advantage and some as a disadvantage). To the extent that your solution looks simpler, it is because it is simpler: it is doing so much less. You should get down to the .01 second per puzzle range before you can compare apples to apples.</description>
		<content:encoded><![CDATA[<p>You did misread Norvig.  He describes his algorithm as &#8220;systematically try all possibilities until we hit one that works&#8221;. Thus his algorithm is almost the same as yours, except that (a) he uses heuristics to choose the variable ordering while you go in linear order, and (b) he is more aggressive about propagating constraints. The result is an algorithm that is complete, but is about 1000 times faster (and more compact in terms of lines of code, which some see as an advantage and some as a disadvantage). To the extent that your solution looks simpler, it is because it is simpler: it is doing so much less. You should get down to the .01 second per puzzle range before you can compare apples to apples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johannes Brodwall</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-128843</link>
		<dc:creator>Johannes Brodwall</dc:creator>
		<pubDate>Tue, 29 Mar 2011 21:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-128843</guid>
		<description>My solution turned out to be a lot slower than I initially thought, taking up to 2 minutes for a complex sudoku. I made some initial very stupid mistakes after I wrote the text but before I published it that made me optimistic. I had to change the text after that.

As I understand Norvig&#039;s solution, it is a heuristic solution, which means that there are some (theoretic) cases it can miss. The solution I use (brute forcing) is complete, so it&#039;s guaranteed to find a solution if there is one. I may have misread Norvig, though.

I&#039;ve considered whether to write a follow-up post where I refactor the solution for speed. Would you be interested  in this?</description>
		<content:encoded><![CDATA[<p>My solution turned out to be a lot slower than I initially thought, taking up to 2 minutes for a complex sudoku. I made some initial very stupid mistakes after I wrote the text but before I published it that made me optimistic. I had to change the text after that.</p>
<p>As I understand Norvig&#8217;s solution, it is a heuristic solution, which means that there are some (theoretic) cases it can miss. The solution I use (brute forcing) is complete, so it&#8217;s guaranteed to find a solution if there is one. I may have misread Norvig, though.</p>
<p>I&#8217;ve considered whether to write a follow-up post where I refactor the solution for speed. Would you be interested  in this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous Guest</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-128842</link>
		<dc:creator>Anonymous Guest</dc:creator>
		<pubDate>Tue, 29 Mar 2011 20:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-128842</guid>
		<description>Thanks for the very nice article.  I didn&#039;t understand the &quot;all cases (unlike Norvig)&quot; part.  Norvig&#039;s article says that his program was tested on 2 million examples and worked correctly on all of them (correctly failing to find a solution on the puzzles that in fact have no solution).  Do you have examples of cases that his does wrong and yours does right? Also, what is the mean run time (and variance) or your program?</description>
		<content:encoded><![CDATA[<p>Thanks for the very nice article.  I didn&#8217;t understand the &#8220;all cases (unlike Norvig)&#8221; part.  Norvig&#8217;s article says that his program was tested on 2 million examples and worked correctly on all of them (correctly failing to find a solution on the puzzles that in fact have no solution).  Do you have examples of cases that his does wrong and yours does right? Also, what is the mean run time (and variance) or your program?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aamonty</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-127815</link>
		<dc:creator>aamonty</dc:creator>
		<pubDate>Sun, 11 Jul 2010 12:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-127815</guid>
		<description>Title:&lt;br&gt;Tenga Japan Sex Toys &#124; Rends &#124; Fliphole Black Fliphole Eggs Masturbators&lt;br&gt;Keywords:&lt;br&gt;Tenga Fliplite, Flip Lite, Fliphole&lt;br&gt;Black Fliphole, Deep Throat Cup, Rolling Head Cup, Fliplite Solid Black, Melty White Fliplite, Japanese Sex toys, Japan sex toys, Tenga Singapore, sex shop, sex toys, masturbators, Felliato, Men Sex toy, masturbate, Tenga Eggs, Tenga Egg Wavy, Tenga Egg Spider, Tenga Egg Wavy, Tenga Lotion, Tenga Real Lotion, Tenga Wild Lotion, Mild Lotion, Tenga Warmer, Tenga Sex toys, Tenga Japan, japnese sex toys, adult novelty, adult toys &lt;br&gt;&lt;br&gt;Link: &lt;br&gt;&lt;a href=&quot;http://www.kujotoys.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.kujotoys.com/&lt;/a&gt;&lt;br&gt;Description:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://kujotoys.com&quot; rel=&quot;nofollow&quot;&gt;kujotoys.com&lt;/a&gt; is established with the objective of selling sex toys to consumers who may find it embarrassing or inconvenient to purchase one directly from the retail shop front. It is located in both in Japan and Singapore and will ship to ensure that the customers get the product at the fastest time possible. It offers different kinds of sex toys for you and you can get it very easily by communicating with this site.&lt;br&gt;&lt;br&gt;For more please visit:  &lt;a href=&quot;http://www.kujotoys.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.kujotoys.com/&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Title:<br />Tenga Japan Sex Toys | Rends | Fliphole Black Fliphole Eggs Masturbators<br />Keywords:<br />Tenga Fliplite, Flip Lite, Fliphole<br />Black Fliphole, Deep Throat Cup, Rolling Head Cup, Fliplite Solid Black, Melty White Fliplite, Japanese Sex toys, Japan sex toys, Tenga Singapore, sex shop, sex toys, masturbators, Felliato, Men Sex toy, masturbate, Tenga Eggs, Tenga Egg Wavy, Tenga Egg Spider, Tenga Egg Wavy, Tenga Lotion, Tenga Real Lotion, Tenga Wild Lotion, Mild Lotion, Tenga Warmer, Tenga Sex toys, Tenga Japan, japnese sex toys, adult novelty, adult toys </p>
<p>Link: <br /><a href="http://www.kujotoys.com/" rel="nofollow">http://www.kujotoys.com/</a><br />Description:</p>
<p><a href="http://kujotoys.com" rel="nofollow">kujotoys.com</a> is established with the objective of selling sex toys to consumers who may find it embarrassing or inconvenient to purchase one directly from the retail shop front. It is located in both in Japan and Singapore and will ship to ensure that the customers get the product at the fastest time possible. It offers different kinds of sex toys for you and you can get it very easily by communicating with this site.</p>
<p>For more please visit:  <a href="http://www.kujotoys.com/" rel="nofollow">http://www.kujotoys.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johannes Brodwall</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-127742</link>
		<dc:creator>Johannes Brodwall</dc:creator>
		<pubDate>Thu, 06 May 2010 11:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-127742</guid>
		<description>Thanks for your comments, Elliott. You raise many valid points on how to make the solution better. I will be studying the dancing links information more, but my initial impression is that this is fairly difficult stuff.&lt;br&gt;&lt;br&gt;When it comes to the context of the kata, it&#039;s fast enough for it&#039;s purpose. I&#039;d rather focus on making an algorithm that&#039;s easy to understand than one that&#039;s as fast as it could be. That being said, the unit tests constrain the design quite a bit, and it would be interesting to see how easy it is to optimize this solution.&lt;br&gt;&lt;br&gt;Generalizing to 16x16 boards (or some of the other possible board configurations) requires more thinking than simply replacing all &quot;9&quot;s with variables. This is the sort of premature generalization I try to avoid until I understand what problems I&#039;m required to solve.&lt;br&gt;&lt;br&gt;If you&#039;re up to the task, I would love to see a screencast where you solve sudoku using Dancing Links, though!</description>
		<content:encoded><![CDATA[<p>Thanks for your comments, Elliott. You raise many valid points on how to make the solution better. I will be studying the dancing links information more, but my initial impression is that this is fairly difficult stuff.</p>
<p>When it comes to the context of the kata, it&#39;s fast enough for it&#39;s purpose. I&#39;d rather focus on making an algorithm that&#39;s easy to understand than one that&#39;s as fast as it could be. That being said, the unit tests constrain the design quite a bit, and it would be interesting to see how easy it is to optimize this solution.</p>
<p>Generalizing to 16&#215;16 boards (or some of the other possible board configurations) requires more thinking than simply replacing all &#8220;9&#8243;s with variables. This is the sort of premature generalization I try to avoid until I understand what problems I&#39;m required to solve.</p>
<p>If you&#39;re up to the task, I would love to see a screencast where you solve sudoku using Dancing Links, though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliott</title>
		<link>http://johannesbrodwall.com/2010/04/06/why-tdd-makes-a-lot-of-sense-for-sudoko/comment-page-1/#comment-127738</link>
		<dc:creator>Elliott</dc:creator>
		<pubDate>Tue, 04 May 2010 22:09:10 +0000</pubDate>
		<guid isPermaLink="false">http://johannesbrodwall.com/?p=526#comment-127738</guid>
		<description>TDD is awesome.  We all know and love it.  However there are lots of times when the a few minutes on google will give you a better start then setting out the first tests.  Google first, then test, then code will give a good code base that implements the correct solution, not just one that passes tests.&lt;br&gt;&lt;br&gt;While this result is correct it is wildly more computationally expensive than it needs to be.  Sudoku is an exact cover problem and should be solved with variations on the exact cover algorithms, if a backtracking solver is to be used.&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dancing_Links&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Dancing_Links&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.ocf.berkeley.edu/%7Ejchu/publicportal/sudoku/sudoku.paper.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ocf.berkeley.edu/~jchu/publicportal/...&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.sudocue.net/dancinglinks.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.sudocue.net/dancinglinks.htm&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On top of that looking at the code I am reasonably sure that the code will find a solution to invalid puzzles.  Puzzles where there are more than one solution will return the first found result.&lt;br&gt;&lt;br&gt;Fitting the board into a smaller memory footprint will result in less cache invalidation and a rather large speed up. (Yea yeah it&#039;s pre-mature optimization but solving these are not as hard as getting the code great.)&lt;br&gt;&lt;br&gt;Try and make sure that nothing makes the assumption that the board is 9x9 there are lots of more advanced puzzles that are 16x16(they take forever but are a real accomplishment when solved.)</description>
		<content:encoded><![CDATA[<p>TDD is awesome.  We all know and love it.  However there are lots of times when the a few minutes on google will give you a better start then setting out the first tests.  Google first, then test, then code will give a good code base that implements the correct solution, not just one that passes tests.</p>
<p>While this result is correct it is wildly more computationally expensive than it needs to be.  Sudoku is an exact cover problem and should be solved with variations on the exact cover algorithms, if a backtracking solver is to be used.</p>
<p><a href="http://en.wikipedia.org/wiki/Dancing_Links" rel="nofollow">http://en.wikipedia.org/wiki/Dancing_Links</a><br /><a href="http://www.ocf.berkeley.edu/%7Ejchu/publicportal/sudoku/sudoku.paper.html" rel="nofollow">http://www.ocf.berkeley.edu/~jchu/publicportal/&#8230;</a><br /><a href="http://www.sudocue.net/dancinglinks.htm" rel="nofollow">http://www.sudocue.net/dancinglinks.htm</a></p>
<p>On top of that looking at the code I am reasonably sure that the code will find a solution to invalid puzzles.  Puzzles where there are more than one solution will return the first found result.</p>
<p>Fitting the board into a smaller memory footprint will result in less cache invalidation and a rather large speed up. (Yea yeah it&#39;s pre-mature optimization but solving these are not as hard as getting the code great.)</p>
<p>Try and make sure that nothing makes the assumption that the board is 9&#215;9 there are lots of more advanced puzzles that are 16&#215;16(they take forever but are a real accomplishment when solved.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

