<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Misadventures of a Celtic Geek &#187; sudoku</title>
	<atom:link href="http://blog.guesny.net/tag/sudoku/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.guesny.net</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sun, 03 Jun 2012 19:25:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>On a soduku solver&#8230;</title>
		<link>http://blog.guesny.net/2009/10/03/on-a-soduku-solver/</link>
		<comments>http://blog.guesny.net/2009/10/03/on-a-soduku-solver/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 10:10:43 +0000</pubDate>
		<dc:creator>welsh_dwarf</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[personnel]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sudoku]]></category>

		<guid isPermaLink="false">http://blog.guesny.net/?p=84</guid>
		<description><![CDATA[Yesterday, when I was on the bus, I got pulled into a sudoku. Then I started wondering how a machine could be programmed to solve these puzzles. Note: For the rest of this post: A square is the un-devidable unit &#8230; <a href="http://blog.guesny.net/2009/10/03/on-a-soduku-solver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday, when I was on the bus, I got pulled into a sudoku. Then I started wondering how a machine could be programmed to solve these puzzles.</p>
<p>Note: For the rest of this post:</p>
<ul>
<li>A square is the un-devidable unit containing 1 number</li>
<li>A section is a 3&#215;3 grid of squares</li>
<li>A column is a 10 square vertical strip</li>
<li>A row is a 10 square horizontal strip</li>
<li>A board is the 9&#215;9 sudoku board</li>
</ul>
<p>There a few simple rules that go into solving these puzzles. Namely :</p>
<ul>
<li>What are the possible values for this square (based on row, column and section)</li>
<li>What are the possible places for this number (in this section)</li>
</ul>
<p>The two questions aren&#8217;t identical, since a numbers position can be influenced by the positions of numbers in other columns or rows that share the section.</p>
<p>The first question comes down to :</p>
<ol>
<li>Take the ensemble of possible numbers</li>
<li>Remove all that are already in the current row</li>
<li>Remove all that are already in the current column</li>
<li>Remove all that are already in the current section</li>
<li>if there is only one left, put it in the square</li>
<li>lather</li>
<li>rinse</li>
<li>repeat</li>
</ol>
<p>The second question comes down to:</p>
<p>For each number not entered in each section</p>
<ol>
<li>Check for number in the rows that pass through this section, eliminate the squares that belong to them if found</li>
<li>Check for number in the columns that pass through this section, eliminate the squares that belong to them if found</li>
<li>if only one square is left, put the number in it</li>
<li>&#8230;</li>
<li>profit</li>
</ol>
<p>OK, mabey that one&#8217;s a bit vague, I&#8217;ll try to make it clearer with a drawing</p>
<div id="attachment_91" class="wp-caption alignnone" style="width: 348px"><img class="size-full wp-image-91" title="Example" src="http://blog.guesny.net/wp-content/uploads/2009/09/sudoku1.png" alt="Example of a row and column problem" width="338" height="335" /><p class="wp-caption-text">Example of a row and column problem</p></div>
<p>In the above image, concentrate on the bottom middle section. If you look, you&#8217;ll notice that there are 4s in the top 2 rows of this section, we can conclude that our 4 must be on the bottom row. We also notice that there is a 4 in the left most column of this section, which only leaves the bottom middle square as a possibility for this 4.</p>
<p>By combining the 2 rules stated above, we should be able to solve any sudoku puzzle.</p>
<p>Any how, that&#8217;s all for now. Proof by code will be comeing in an update.</p>
<p><img src="file:///tmp/moz-screenshot-4.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guesny.net/2009/10/03/on-a-soduku-solver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

