<html>

<head><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MyFirstUnitAd -->
<ins class="adsbygoogle"
     style="display:inline-block;width:970px;height:250px"
     data-ad-client="ca-pub-5778386704669218"
     data-ad-slot="1503492166"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Latin Square</title>
</head>

<body>



<p align="left"><span lang="en-ca"><font size="6" color="#FF0000"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Sudoku Solver</b></font></span><font size="6" color="#FF0000"><b><span lang="en-ca"> (enhanced 
Latin square)</span></b></font></p>

<div align="left">
  <pre><b><font color="#ff0000" size="5">A. <span lang="en-ca">First</span> Edition</font></b></pre>
</div>
<div align="left">
  <pre><b><span lang="en-ca">This is </span>only <span lang="en-ca">an enhanced Latin square search and it is assignment from comb. algo.</span></b></pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">B</span>.<span lang="en-ca"><a name="problem"></a>The problem</span></font></b></pre>
</div>
<div align="left">
  <font FACE="TimesNewRomanPSMT">
  </font>
  <p ALIGN="LEFT">Sudoku Solver<br>
	In the Sudoku puzzle, you are given a partially filled latin square of order 
	9. The<br>
	9 〜 9 matrix is further subdivided into nine 3 〜 3 submatrices. The 
	objective is to<br>
	complete it to a latin square, with the additional constraint that each of 
	the nine<br>
	submatrices also contains only the numbers from 1 to 9. For more information 
	on<br>
	Sudoku, please consult a local newspaper or visit the many web sites on this 
	subject,<br>
	e.g. http://en.wikipedia.org/wiki/Sudoku.<br>
	Write a backtrack program that solves the Sudoku puzzle. The input will be a 
	9 〜 9<br>
	matrix, where the unknowns are represented by a 0(zero). You should print 
	out a<br>
	solution, if it exists, and also the the number of solutions. Normally, a 
	Sudoku puzzle<br>
	has a unique solution. However, for our exercise, some input may have no 
	solutions,<br>
	and others may have more than one solutions.</div>
<div align="left">
  <p ALIGN="LEFT">　</div>
<div align="left">
  <b><font color="#ff0000" size="5"><span lang="en-ca"><a name="explain"></a>C</span>.<span lang="en-ca">The
  </span></font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>idea of 
  program</b></font></span></div>
<div align="left">
  　</div>
<div align="left">
	<pre><span lang="en-ca"><font size="3">Is there anything special for this program? I cannot see.</font></span></pre>
</div>
<div align="left">
	<pre><span lang="en-ca"><font size="3">It is a trivial backtrack or depth-first-search or deterministic-finite-automaton etc.</font></span></pre>
</div>
<div align="left">
	<pre>　</pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5">D.<span lang="en-ca"><a name="Method"></a>The </span>major functions</font></b></pre>
</div>
<div align="left">
  <pre><span lang="en-ca">I think it is a trivial program because this kind of DFS or DFA program has a <a href="DFS.htm">kind</a> of <a href="DFSArray.htm">pattern</a> or <a href="DFSstd.htm">template</a> <a href="ZebraDFS.htm">which</a> I <a href="seqDFA.htm">have</a> even written one a </span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca">couple of years ago.</span></pre>
</div>
<div align="left">
  <pre><span lang="en-ca">Or you may want to know some details about <a href="latinSquare.htm">Latin square.</a></span></pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">E</span>.</font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>Further improvement</b></font></span></pre>
</div>
<div align="left">
  <pre>　</pre>
</div>
<div align="left">
  <pre><b><font color="#ff0000" size="5"><span lang="en-ca">F</span>.</font></b><span lang="en-ca"><font size="5" color="#FF0000"><b>File listing</b></font></span></pre>
</div>
<div align="left" style="width: 898; height: 86">
  <pre><font size="3"><b><span lang="en-ca">1. </span>main.cpp (main)</b></font></pre>
  <pre><span lang="en-ca"><font size="3" color="#FF0000"><b>file name: main</b></font></span><font size="3" color="#FF0000"><b>.<span lang="en-ca">cpp</span></b></font></pre>
  <pre>#include &lt;iostream&gt;
#include &lt;fstream&gt;

using namespace std;

const size_t SquareSize=9;

typedef size_t Vector[SquareSize];

typedef Vector Square[SquareSize];

//size_t primeMap[SquareSize+1]={1, 2, 3, 5, 7, 11,13, 17, 23, 29};

//const size_t Checker=2*3*5*7*11*13*17*23*29;

Square square;
Square original;
size_t counter=0;
void readFromFile(char* fileName);
void doFilling(size_t row, size_t col);
void printSquare();
bool checkRowCol(size_t row, size_t col);

int main()
{
	size_t row=0, col=0;

	readFromFile(&quot;data3.txt&quot;);
	counter=0;
	printSquare();
	doFilling(row, col);


	return 0;
}

void printSquare()
{
	size_t row, col;

	for (row=0; row&lt;SquareSize; row++)
	{			
		for (col=0; col&lt;SquareSize; col++)
		{
			cout&lt;&lt;square[row][col]&lt;&lt;&quot;,&quot;;
		}
		cout&lt;&lt;&quot;\n&quot;;
	}
}


void readFromFile(char* fileName)
{
	ifstream in(fileName);
	for (int i=0; i&lt;SquareSize; i++)
	{
		for (int j=0; j&lt;SquareSize; j++)
		{
			in&gt;&gt;square[i][j];
			original[i][j]=square[i][j];//make an old copy
		}
	}
}


void doFilling(size_t row, size_t col)
{
	//cout&lt;&lt;&quot;row=&quot;&lt;&lt;row&lt;&lt;&quot;  col=&quot;&lt;&lt;col&lt;&lt;&quot;\n&quot;;
	//printSquare();
	if (row==SquareSize)
	{
		counter++;
		cout&lt;&lt;&quot;this is &quot;&lt;&lt;counter&lt;&lt;&quot;th solution\n&quot;;
		printSquare();
		return;
	}

	if (original[row][col]!=0)
	{
		if (col&lt;SquareSize-1)
		{
			doFilling(row, col+1);	
		}
		else
		{
			doFilling(row+1, 0);		
		}
	}
	else
	{
		//oldValue= square[row][col];
		for (size_t choice=1; choice&lt;=SquareSize; choice++)
		{
			square[row][col]=choice;
			if (checkRowCol(row, col))
			{
				if (col&lt;SquareSize-1)
				{
					doFilling(row, col+1);				
				}
				else
				{
					doFilling(row+1, 0);			
				}
			}
		}
		//restore
		square[row][col]=0;		
	}	
}

bool checkRowCol(size_t row, size_t col)
{
	bool rowFlag[SquareSize], colFlag[SquareSize];
	size_t i, j;
	size_t subRowOffset=(row/3)*3;
	size_t subColOffset=(col/3)*3;

	for (i=0; i&lt;3; i++)
	{
		for (j=0; j&lt;3; j++)
		{
			if (row!=i+subRowOffset||col!=j+subColOffset)
			{
				if (square[row][col]==square[i+subRowOffset][j+subColOffset])
				{
					return false;
				}
			}
		}
	}
	

	for (i=0; i&lt;SquareSize; i++)
	{
		rowFlag[i]=true;
		colFlag[i]=true;
	}
	for (i=0; i&lt;SquareSize; i++)
	{
		//no repeat number
		if (square[row][i]!=0)
		{
			if (rowFlag[square[row][i]-1])
			{
				rowFlag[square[row][i]-1]=false;
			}
			else
			{
				return false;
			}
		}
		if (square[i][col]!=0)
		{
			if (colFlag[square[i][col]-1])
			{
				colFlag[square[i][col]-1]=false;
			}
			else
			{
				return false;
			}
		}
	}

	return true;
}






</pre>
  <pre>

	
</pre>
</div>
<pre></pre>
<pre><b><font color="#0000FF"><span lang="en-ca">The result is like following:</span></font></b></pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>data1.txt</b></font></span></pre>

<pre>2 0 4 0 0 7 0 0 5
0 0 0 0 0 0 0 0 7
0 5 0 1 0 0 0 9 2
5 0 2 0 7 3 0 1 0
0 0 0 0 0 0 0 0 0
0 3 0 6 8 0 7 0 4
8 6 0 0 0 4 0 2 0
3 0 0 0 0 0 0 0 0
4 0 0 2 0 0 8 0 1</pre>
<pre>　</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>result:</b></font></span></pre>

<pre>2,0,4,0,0,7,0,0,5,
0,0,0,0,0,0,0,0,7,
0,5,0,1,0,0,0,9,2,
5,0,2,0,7,3,0,1,0,
0,0,0,0,0,0,0,0,0,
0,3,0,6,8,0,7,0,4,
8,6,0,0,0,4,0,2,0,
3,0,0,0,0,0,0,0,0,
4,0,0,2,0,0,8,0,1,
now begin searching solutions:

this is 1th solution
2,8,4,3,9,7,1,6,5,
9,1,6,4,2,5,3,8,7,
7,5,3,1,6,8,4,9,2,
5,4,2,9,7,3,6,1,8,
6,7,8,5,4,1,2,3,9,
1,3,9,6,8,2,7,5,4,
8,6,1,7,5,4,9,2,3,
3,2,7,8,1,9,5,4,6,
4,9,5,2,3,6,8,7,1,
Press any key to continue</pre>
<pre>　</pre>
<pre>　</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>data2.txt</b></font></span></pre>

<pre>2 0 4 0 0 7 0 0 5
0 0 0 0 0 0 0 0 7
0 5 0 1 0 0 0 9 2
5 0 2 0 0 3 0 1 0
0 0 0 0 0 0 0 0 0
0 3 0 6 8 0 7 0 4
8 6 0 0 0 4 0 2 0
3 0 0 0 0 0 0 0 0
4 0 0 2 0 0 8 0 1</pre>

<pre><span lang="en-ca"><font color="#0000FF"><b>result:</b></font></span></pre>
<pre><span lang="en-ca">2,0,4,0,0,7,0,0,5,
0,0,0,0,0,0,0,0,7,
0,5,0,1,0,0,0,9,2,
5,0,2,0,0,3,0,1,0,
0,0,0,0,0,0,0,0,0,
0,3,0,6,8,0,7,0,4,
8,6,0,0,0,4,0,2,0,
3,0,0,0,0,0,0,0,0,
4,0,0,2,0,0,8,0,1,
now begin searching solutions:

this is 1th solution
2,8,4,3,9,7,1,6,5,
9,1,6,4,2,5,3,8,7,
7,5,3,1,6,8,4,9,2,
5,4,2,9,7,3,6,1,8,
6,7,8,5,4,1,2,3,9,
1,3,9,6,8,2,7,5,4,
8,6,1,7,5,4,9,2,3,
3,2,7,8,1,9,5,4,6,
4,9,5,2,3,6,8,7,1,
this is 2th solution
2,8,4,3,9,7,1,6,5,
9,1,6,4,2,5,3,8,7,
7,5,3,1,6,8,4,9,2,
5,7,2,9,4,3,6,1,8,
6,4,8,5,7,1,2,3,9,
1,3,9,6,8,2,7,5,4,
8,6,1,7,5,4,9,2,3,
3,2,7,8,1,9,5,4,6,
4,9,5,2,3,6,8,7,1,
this is 3th solution
2,8,4,3,9,7,1,6,5,
9,1,6,4,2,5,3,8,7,
7,5,3,1,6,8,4,9,2,
5,7,2,9,4,3,6,1,8,
6,4,8,7,5,1,2,3,9,
1,3,9,6,8,2,7,5,4,
8,6,1,5,7,4,9,2,3,
3,2,7,8,1,9,5,4,6,
4,9,5,2,3,6,8,7,1,
this is 4th solution
2,8,4,3,9,7,1,6,5,
9,1,6,4,2,5,3,8,7,
7,5,3,1,6,8,4,9,2,
5,7,2,9,4,3,6,1,8,
6,4,8,7,5,1,2,3,9,
1,3,9,6,8,2,7,5,4,
8,6,7,5,1,4,9,2,3,
3,2,1,8,7,9,5,4,6,
4,9,5,2,3,6,8,7,1,
Press any key to continue</span></pre>
<pre>　</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>data3.txt</b></font></span></pre>

<pre>1 0 0 0 6 0 0 0 8
0 2 0 3 0 0 0 7 0
0 0 3 0 0 1 6 0 0
0 0 0 4 0 9 0 2 0
3 0 0 0 5 0 0 0 6
0 8 0 1 0 6 0 0 0
0 0 2 8 0 0 7 0 0
0 3 1 0 0 0 0 8 0
4 0 0 0 2 0 3 0 9
</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>result:</b></font></span></pre>
<pre>1,5,7,9,6,2,4,3,8,
8,2,6,3,4,5,9,7,1,
9,4,3,7,8,1,6,5,2,
6,1,5,4,3,9,8,2,7,
3,7,9,2,5,8,1,4,6,
2,8,4,1,7,6,5,9,3,
5,9,2,8,1,3,7,6,4,
7,3,1,6,9,4,2,8,5,
4,6,8,5,2,7,3,1,9,
this is 24th solution
1,5,7,9,6,2,4,3,8,
8,2,6,3,4,5,9,7,1,
9,4,3,7,8,1,6,5,2,
6,1,5,4,7,9,8,2,3,
3,7,4,2,5,8,1,9,6,
2,8,9,1,3,6,5,4,7,
5,9,2,8,1,3,7,6,4,
7,3,1,6,9,4,2,8,5,
4,6,8,5,2,7,3,1,9,
this is 25th solution
1,5,7,9,6,2,4,3,8,
8,2,6,3,4,5,9,7,1,
9,4,3,7,8,1,6,5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,7,1,
8,4,3,9,7,1,6,5,2,
7,6,5,4,8,9,1,2,3,
3,1,4,2,5,7,8,9,6,
2,8,9,1,3,6,5,4,7,
9,5,2,8,1,3,7,6,4,
6,3,1,7,9,4,2,8,5,
4,7,8,6,2,5,3,1,9,
this is 49th solution
1,9,7,5,6,2,4,3,8,
5,2,6,3,4,8,9,7,1,
8,4,3,9,7,1,6,5,2,
7,6,5,4,8,9,1,2,3,
3,1,9,2,5,7,8,4,6,
2,8,4,1,3,6,5,9,7,
9,5,2,8,1,3,7,6,4,
6,3,1,7,9,4,2,8,5,
4,7,8,6,2,5,3,1,9,
this is 50th solution
1,9,7,5,6,2,4,3,8,
6,2,5,3,4,8,9,7,1,
8,4,3,9,7,1,6,5,2,
5,7,6,4,8,9,1,2,3,
3,1,4,2,5,7,8,9,6,
2,8,9,1,3,6,5,4,7,
9,5,2,8,1,3,7,6,4,
7,3,1,6,9,4,2,8,5,
4,6,8,7,2,5,3,1,9,
this is 51th solution
1,9,7,5,6,2,4,3,8,
6,2,5,3,4,8,9,7,1,
8,4,3,9,7,1,6,5,2,
5,7,6,4,8,9,1,2,3,
3,1,9,2,5,7,8,4,6,
2,8,4,1,3,6,5,9,7,
9,5,2,8,1,3,7,6,4,
7,3,1,6,9,4,2,8,5,
4,6,8,7,2,5,3,1,9,
this is 52th solution
1,9,7,5,6,4,2,3,8,
5,2,6,3,9,8,4,7,1,
8,4,3,2,7,1,6,9,5,
7,6,5,4,8,9,1,2,3,
3,1,9,7,5,2,8,4,6,
2,8,4,1,3,6,9,5,7,
9,5,2,8,1,3,7,6,4,
6,3,1,9,4,7,5,8,2,
4,7,8,6,2,5,3,1,9,
Press any key to continue</pre>

<pre>　</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>data4.txt</b></font></span></pre>

<pre>2 0 4 0 0 7 0 0 5
0 0 0 0 0 0 0 0 7
0 5 0 1 0 0 0 9 2
5 0 2 0 7 3 0 1 0
0 0 0 0 0 0 0 0 0
0 3 0 6 8 0 7 0 4
8 6 0 0 0 4 0 2 0
3 0 0 0 9 0 0 0 0
4 0 0 2 0 0 8 0 1
</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>result:</b></font></span></pre>

<pre>2,0,4,0,0,7,0,0,5,
0,0,0,0,0,0,0,0,7,
0,5,0,1,0,0,0,9,2,
5,0,2,0,7,3,0,1,0,
0,0,0,0,0,0,0,0,0,
0,3,0,6,8,0,7,0,4,
8,6,0,0,0,4,0,2,0,
3,0,0,0,9,0,0,0,0,
4,0,0,2,0,0,8,0,1,
now begin searching solutions:

Press any key to continue</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>data5.txt</b></font></span></pre>

<pre>0 2 0 0 0 8 1 0 0
0 3 0 0 5 0 7 0 0
0 0 8 0 3 0 0 0 4
0 0 0 8 0 0 5 0 0
8 7 0 0 0 0 0 9 3
0 0 6 0 0 9 0 0 0
6 0 0 0 1 0 2 0 0
0 0 3 0 9 0 0 1 0
0 0 9 2 0 0 0 7 0</pre>

<pre>　</pre>
<pre><span lang="en-ca"><font color="#0000FF"><b>result:</b></font></span></pre>
<pre>0,2,0,0,0,8,1,0,0,
0,3,0,0,5,0,7,0,0,
0,0,8,0,3,0,0,0,4,
0,0,0,8,0,0,5,0,0,
8,7,0,0,0,0,0,9,3,
0,0,6,0,0,9,0,0,0,
6,0,0,0,1,0,2,0,0,
0,0,3,0,9,0,0,1,0,
0,0,9,2,0,0,0,7,0,
now begin searching solutions:

this is 1th solution
7,2,5,9,4,8,1,3,6,
9,3,4,6,5,1,7,8,2,
1,6,8,7,3,2,9,5,4,
3,9,1,8,2,4,5,6,7,
8,7,2,1,6,5,4,9,3,
5,4,6,3,7,9,8,2,1,
6,8,7,5,1,3,2,4,9,
2,5,3,4,9,7,6,1,8,
4,1,9,2,8,6,3,7,5,
Press any key to continue</pre>

<pre><span lang="en-ca">			</span></pre>

<pre><span lang="en-ca">				</span> <a href="game24.htm"><img src="picture/back.gif" style="border: medium none" alt="back.gif (341 bytes)" width="32" height="35"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="index.htm"><img src="picture/up.gif" style="border: medium none" alt="up.gif (335 bytes)" width="35" height="32"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="picture/next.gif" style="border: medium none" alt="next.gif (337 bytes)" width="32" height="35"> </pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<pre></pre>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                                   
&nbsp;&nbsp;&nbsp;</p>

</body>

</html>