# HG changeset patch # User Christian Urban # Date 1479395813 0 # Node ID f099bcf9cff1e67b8a7d7b02caa12ac47521c6d8 # Parent 8e866d0af03a2339e0167df2e07cd042b37bed1c updated diff -r 8e866d0af03a -r f099bcf9cff1 cws/cw02.pdf Binary file cws/cw02.pdf has changed diff -r 8e866d0af03a -r f099bcf9cff1 cws/cw02.tex --- a/cws/cw02.tex Thu Nov 17 15:12:47 2016 +0000 +++ b/cws/cw02.tex Thu Nov 17 15:16:53 2016 +0000 @@ -163,15 +163,15 @@ You are asked to implement the knight's tour problem such that the dimension of the board can be changed. Therefore most functions will take the dimension of the board as an argument. The fun with this -problem is that even for small chessbord dimensions it has already an -incredably large search space---finding a tour is like finding a +problem is that even for small chessboard dimensions it has already an +incredibly large search space---finding a tour is like finding a needle in a haystack. In the first task we want to see how far we get with exhaustively exploring the complete search space for small chessboards.\medskip \noindent Let us first fix the basic datastructures for the implementation. The -board dimension is an integer (we will never go boyond board sizes of +board dimension is an integer (we will never go beyond board sizes of $100 \times 100$). A \emph{position} (or field) on the chessboard is a pair of integers, like $(0, 0)$. A \emph{path} is a list of positions. The first (or 0th move) in a path is the last element in @@ -294,7 +294,7 @@ setpieces={Na3}] \noindent -Warnsdorf's rule states that the moves on the board above sould be +Warnsdorf's rule states that the moves on the board above should be tried in the order \[ @@ -302,7 +302,7 @@ \] \noindent -Whenever there are ties, the correspoding onward moves can be in any +Whenever there are ties, the corresponding onward moves can be in any order. When calculating the number of onward moves for each field, we do not count moves that revisit any field already visited. @@ -316,7 +316,7 @@ \item[(3b)] Implement a first-closed-tour-heuristic function that searches for a \textbf{closed} tour on a $6\times 6$ board. It should use the - first-function from (2a) and tries out onwards moves according to + first-function from (2a) and tries out onward moves according to the ordered-moves function from (3a). It is more likely to find a solution when started in the middle of the board (that is position $(dimension / 2, dimension / 2)$).