Top Banner
Solving Sudoku Puzzles CS221 Fall 2016: Final Project Report [p-final] Supanath Juthacharoenwong Chonnuttida Koracharkornradt Thanapat Worasaran December 16, 2016 1 Task Definition Sudoku is a partially completed 9x9 grid puzzle. The task is to fill the grid with digits such that each row, each column, and each 3x3 block contains digits from 1 to 9 exactly once. We focus on the Sudoku puzzle because it is both constraint satisfaction problems (CSP) in which we’ve learned in this class, and an NP-complete problem for generalized version with NxN grid in which solving the problem using any currently known algorithm for a reasonable amount of time remains undiscovered. The scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using different search algorithms and heuristics. The success of this program will be evaluated by using time measurement of how long the algorithm, on average, uses to solve significant amount of puzzles (50 easy-level and 50 hard-level puzzles) compared relatively to the time measurement of the baseline and of the oracle. 2 Infrastructure: Input/Output The input of each sudoku puzzle will be a string of the values of each position of the board. For example, the input string has the format ...........98.51...519.742.29.4.1.65.........14.5.8.93.267.958...51.36...........The dot represents unspecified value for that position. As we read through the input string, we fill the row from left to right, when one row is full, we repeat the process by filling the next row from left to right until the whole board is filled. You can see the input below (left). ...|...|... 782|614|359 ..9|8.5|1.. 439|825|176 .51|9.7|42. 651|937|428 ------+------+------ ------+------+------ 29.|4.1|.65 293|471|865 ...|...|... 568|392|714 14.|5.8|.93 147|568|293 ------+------+------ ------+------+------ .26|7.9|58. 326|749|581 ..5|1.3|6.. 975|183|642 ...|...|... 814|256|937 Our output which would be the completely solve puzzle which for this case is: 1
11

SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

Jul 13, 2018

Download

Documents

hoangdat
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

Solving Sudoku PuzzlesCS221 Fall 2016: Final Project Report [p-final]

Supanath JuthacharoenwongChonnuttida Koracharkornradt

Thanapat Worasaran

December 16, 2016

1 Task Definition

Sudoku is a partially completed 9x9 grid puzzle. The task is to fill the grid with digits such thateach row, each column, and each 3x3 block contains digits from 1 to 9 exactly once. We focuson the Sudoku puzzle because it is both constraint satisfaction problems (CSP) in which we’velearned in this class, and an NP-complete problem for generalized version with NxN grid in whichsolving the problem using any currently known algorithm for a reasonable amount of time remainsundiscovered.

The scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using differentsearch algorithms and heuristics.

The success of this program will be evaluated by using time measurement of how long the algorithm,on average, uses to solve significant amount of puzzles (50 easy-level and 50 hard-level puzzles)compared relatively to the time measurement of the baseline and of the oracle.

2 Infrastructure: Input/Output

The input of each sudoku puzzle will be a string of the values of each position of the board. Forexample, the input string has the format

’...........98.51...519.742.29.4.1.65.........14.5.8.93.267.958...51.36...........’

The dot represents unspecified value for that position. As we read through the input string, we fillthe row from left to right, when one row is full, we repeat the process by filling the next row fromleft to right until the whole board is filled. You can see the input below (left).

. . . |. . . |. . . 7 8 2 |6 1 4 |3 5 9

. . 9 |8 . 5 |1 . . 4 3 9 |8 2 5 |1 7 6

. 5 1 |9 . 7 |4 2 . 6 5 1 |9 3 7 |4 2 8------+------+------ ------+------+------2 9 . |4 . 1 |. 6 5 2 9 3 |4 7 1 |8 6 5. . . |. . . |. . . 5 6 8 |3 9 2 |7 1 41 4 . |5 . 8 |. 9 3 1 4 7 |5 6 8 |2 9 3------+------+------ ------+------+------. 2 6 |7 . 9 |5 8 . 3 2 6 |7 4 9 |5 8 1. . 5 |1 . 3 |6 . . 9 7 5 |1 8 3 |6 4 2. . . |. . . |. . . 8 1 4 |2 5 6 |9 3 7

Our output which would be the completely solve puzzle which for this case is:

1

Page 2: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

’782614359439825176651937428293471865568392714147568293326749581975183642814256937’

This corresponds to the Sudoku board on the right above which can be visually inspected.

We’ll test our algorithms with 2 datasets; 50 easy-level and 50 hard-level Sudoku puzzles fromPeter Novig website (http://norvig.com/sudoku.html), generally the puzzles are considered to beharder if there’re more unassigned cells.

Sample Inputs for easy-level:

’..3.2.6..9..3.5..1..18.64....81.29..7.......8..67.82....26.95..8..2.3..9..5.1.3..2...8.3...6..7..84.3.5..2.9...1.54.8.........4.27.6...3.1..7.4.72..4..6...4.1...3......9.7...42.18....7.5.261..9.4....5.....4....5.7..992.1.8....34.59...5.7.......3..5..4...8.1.5..46.....12.7.5.2.8....6.3....4.1.9.3.25.....98..1.2.6...8..6..2..2.81.74.7....31...9...28.5..9.4..874..2.8..316..3.2..3.27...6...56....8.76.51.9.’

Sample Inputs for hard-level:

’4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......52...6.........7.13...........4..8..6......5...........418.........3..2...87.....6.....8.3.4.7.................5.4.7.3..2.....1.6.......2.....5.....8.6......1....48.3............71.2.......7.5....6....2..8.............1.76...3.....4......5........14....3....2...7..........9...3.6.1.............8.2.....1.4....5.6.....7.8...’

3 Related Work

Sudoku puzzles have become popular in recent years. Thus, it is not surprising that many peoplehave created their own version of Sudoku solver. In our project, the first place we look at for thebest implementation of Sudoku solver is Peter Norvig’s website (http://norvig.com/sudoku.html).In his essay, he clearly described how he use backtracking with constraint propagation to solveSudoku puzzles. He provided both illustrations as well as the code for his program. His codesuccessfully solved all puzzles–although some puzzles still take a long time to complete. In ourproject, we adopt his input and output format and also use his implementation as our oracle.

We also look at CS221 project from past year (”Sudoku Solver” by Angelo Scorza, Quaizar Vohra).In this paper, Angelo and Quaizar modeled Sudoku puzzle as a constraint satisfaction problemand use backtracking with heuristics to solve it. However, instead of using the same AC-3 weused in our project, they generalized this AC-3 heuristics using 3 different techniques: SubregionExclusion, Naked Twins, and Hidden Twins. Comparing to their baseline (implementing MCV),their generalized AC-3 heuristic (Subregion Exclusion + Naked Twins + Hidden Twins + LCV)reduced the solving time by 84.67%. In this project, we also use CSP with MCV as our baseline.

We also explore other algorithms to solve Sudoku puzzles. The two main ones we looked at aredescribed in Donald Knuth’s paper "Dancing Link" [8] and a Stochastic search algorithm describedin [9]. These approaches have their own advantage and disadvantage which we will go into furtherdetails in later sections.

4 Approach

4.1 Baseline

For baseline implementation, we use Constraints Satisfaction Problem with Most ConstrainedVariable heuristic. Please see part 4.3 for more details.

4.2 Oracle

We based our oracle on the solver written by Peter Norvig. In this website, he used constraintpropagation along with backtracking search to create efficient sudoku solver. By the simplicity of

2

Page 3: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

his code and the speed in which it can solve most sudoku problems, we decided to use it as ouroracle and compare our own implementation against his implementation.

4.3 Solving using Constraint Satisfaction Problem (CSP)

For the first model, we cast the Sudoku puzzle as a constraint satisfaction problem described inclass. The details are as followed:

Figure 1: Illustration of CSP constraints: blue and green lines represents binary constraint for tileA1 while red represents unary constraints for the input tiles.

• The variables are each cell on the grid, so there are 81 variables: Xij = the cell value at rowi and column j, A ≤ i ≤ I, 1 ≤ j ≤ 9.

• The domain of each cell is 1, 2, 3, ..., 9.

• The constraints are:

1. Unary Constraint: m constraints, f(Xij) : xij = initially assigned value, where m isnumber of initially assigned cells

2. Binary Constraint: 810 constraints, f(Xij , Yij): return x ! = y, for

– Digits in the same row have to be distinct (8 constraints per tile)– Digits in the same column have to be distinct (8 constraints per tile)– Digits in the same block have to be distinct (4 more constraints per tile)

There are 20 constraints per tile. Therefore, there are 20 * 81 / 2 = 810 constraints intotal where factor of 1/2 accounts for double counting.

With this setup, we will use backtracking search with three heuristics to solve for solution.

• Most Constrained Variable (MCV): to choose an unassigned cell, pick the cell that has thefewest consistent values left in the domain

• Least Constrained Variable (LCV): order values of selected unassigned cell by number oftimes the value presents in its peers’ domain (peers = cells in the same row, column, andblock) in ascending order

• Arc Consistency (AC-3): to prune the domains of unassigned cells

4.4 Solving using Stochastic Search

According to [9], sudoku problem can be solved using cultural genetic algorithm and quantumannealing algorithm. Here we try a novel approach using similar idea. For convenience, we willcall this ’Minimize Error Algorithm’. The algorithm is as follow:

3

Page 4: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

1. Randomly assign numbers on the board so that each small 3x3 block has no repeated numbers.

2. Select a tile and try switching the number with all of the the non-fixed tiles in that same 3x3block. (The fixed tile is the one given on the problem).

3. Choose the second tile that, after switching, minimize the error function. Here error functionis defined by the sum of the repeated number in all row and column (with this method, the3x3 grid will never have repeated number, and thus we omit this sum)

4. Switch the two tiles and repeat 2-4 until the whole board is covered.

5. Repeat until the board cannot be change (without increasing the error).

6. Repeat 1-5 until the solution is found.

After the process, we will often find the program stuck at local minima (Where you cannot changethe board without increasing the error). In an attempt to solve the issue, we implemented thereproduction algorithm which works as follow:

1. Start with two initial boards: this is generation 1 board. Run the minimize error algorithm(step 1-5 above) until both board reach the local minimum.

2. Reproduction process : Compare all the tiles between the two board. If the numbers are thesame, the number is passed on to the next generation, otherwise discard the number (replacewith blank space). This new board will be in generation 2.

3. Repeat step 1-5 in minimize error algorithm for the new board until it reaches local minimum.

4. Next step is to create generation 3 and further: For generation 3, We need to produce 2 moregeneration 1, and reproduce them down to generation 3.

5. Repeat this process to produce next generations. Note that we can see that we need 2M−1

of generation 1 to produce 1 generation M.

4.5 Solving using Exact Cover Problem

The last model we are going to use is an exact cover problem. We use this model based on DonaldKnuth’s paper which describes an algorithm called “Dancing Link” that can efficiently solve thisproblem. Exact cover problem is very simple. The input to this problem are vectors of 0 and 1.And we would like to choose a subset of those input vectors so that the sum of them results in avector of ones. Example of this problem is shown in Figure 2.

Figure 2: Example of an exact cover problem

In this problem, each row represents each input vector. We see that by choosing the first, secondand fourth row, their sum will be a vector of ones. Thus, this set is the solution.

4

Page 5: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

In his paper, Knuth introduced AlgorithmX to solve an exact cover problem. He also included theimplementation of this algorithm called dancing link algorithm which use Doubly linked list. How-ever, in our project, we used another variant of algorithmX using the manipulation of dictionaryof set and list as seen in [4] instead.

AlgorithmX is a simple algorithm. It is just a “recursive, non-deterministic, depth-first, backtrack-ing” search. There are six steps to this algorithm [8].

If matrix A (input matrix) has no columnsThe current partial solution is a valid solution; terminate successfully.

Choose a column c (the one where there is the least amount of value 1).Choose a row r such that A(r,c) = 1 (nondeterministically).Include row r in the partial solution.For each column j such that A(r,j) = 1,

for each row i such that A(i,j) = 1,delete row i from matrix A.

delete column j from matrix A.Repeat this algorithm recursively on the reduced matrix A.

By recursively reduced the matrix A till it is empty and backtrack if it is not, we are guaranteedto find a solution of this exact cover problem if one exists. With algorithm X as our tool, we willnow show how we can transform a Sudoku puzzle into an exact cover problem which can then beeasily solved by this algorithm.

Each row of our exact cover problem will be the Value-Position pair of each position of our sudokupuzzle. For example, for tile position A1, as the domain is from 1 to 9. We will have 9 rows here,each represented by each element of this list:

[(1,A1),(2,A1),(3,A1),(4,A1),(5,A1),(6,A1),(7,A1),(8,A1),(9,A1)]

The columns represent 4 types of constraints:

• Each tile can contains only one number.

• The number cannot be repeated within each row.

• The number cannot be repeated within each column.

• The number cannot be repeated within each square.

For example, for the 4x4 grid Sudoku puzzle, the exact cover problem will look like the one shownin Figure 3.

Figure 3: Exact cover problem representation of a 4x4 board. The columns here represents thefour constraints described above. This example only shows the rows for only two tiles (A1 and A2)

With the columns forming the four constraints, we now have the exact cover problem. However,we still have to delete some rows because some tiles already have a designated value from the

5

Page 6: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

beginning. For example, if for our input, tile A1 is fixed to have value 4. Then we must delete 8rows from A1 tiles which are shown below:

[(1,A1),(2,A1),(3,A1),(5,A1),(6,A1),(7,A1),(8,A1),(9,A1)]

Thus, in the end, we will have 324 columns and (9*81 - 8*x) rows where x is the number of pre-filled input tiles. We can also further simplified the input vectors; instead of using 1 and 0 foreach column, we can use the index (the column in which value 1 appears). As there are only 4constraints, each row is now turn into a length 4 vectors. For example:

From Figure 3, row 1 for (1,’A’,1) is

[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

We can see that this is a sparse vector. We can instead use the index and the input becomes[1,17,33,49] (keep in mind that this example is for 4x4 puzzle, our 9x9 implementation will havedifferent values but still have the same dimension]. We also have to change the output vector. ForFigure 3, our goal is for the sum of the solution set to be

[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]

By using index, we will instead use [1,2,3,4,5,6,7,8,9,10,...,64]. These two implementation areequivalent and both can be solved using the algorithm we have. We included a sample of howalgorithm X solve exact cover problem in the appendix.

5 Results

We implemented 6 different variant of algorithms described in the approach sections and are shownin Table 1, and 2 on two sets of puzzles: easy-level and hard-level sudoku. We then find the averagetime it uses to solve 50 of these puzzles as well as the average number of operations each algorithmtakes. We also include one additional experiment shown in Table 3 where we run Stochastic search,Algorithm X and Peter Norvig’s code on an extremely hard Sudoku puzzle (shown in Appendix).We did not include any implementation of CSP here because it takes too long to solve this puzzle.

Algorithm Average Solving Time (sec) Average Number of OperationsBaseline: MCV 0.81322 372.12MCV + LCV 0.84067 372.12MCV + AC3 0.71353 181.36

ACV + LCV + AC3 0.73161 181.36Stochastic 134.76 6026.9

Algorithm X 0.006792 86.14Oracle: Peter Norvig 0.008373 301.42

Table 1: Solving 50 easy Sudoku puzzles.

Algorithm Average Solving Time (sec) Average Number of OperationsBaseline: MCV 51.701 24166.8MCV + LCV 53.711 24166.8MCV + AC3 42.793 10726.26

ACV + LCV + AC3 44.215 19726.26Stochastic >3hr N/A

Algorithm X 0.051916 721.92Oracle: Peter Norvig 0.034118 1515.6

Table 2: Solving 50 hard Sudoku puzzles.

6

Page 7: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

Algorithm Average Solving Time (sec) Average Number of OperationsStochastic: 1.83 75Algorithm X > 1hr N/A

Oracle: Peter Norvig 169.85 6543822

Table 3: Solving 1 extremely hard Sudoku puzzle.

6 Analysis

6.1 CSP with Backtracking and Heuristics

By casting Sudoku puzzles as a constraint satisfaction problem, we are able to solve the hardSudoku problems within 1 minute on average. The most efficient heuristic is the combination ofMCV and AC3. With AC-3 heuristic, the algorithm can solve the puzzles faster than backtrackingwithout AC-3 heuristic by 20%, because pruning the domain of unassigned cell can significantlyreduce the number of times the algorithm “backtrack”. As you can see from Table 1 and 2, AC-3can reduce the number of operations by more than 50%.

We also implemented LCV heuristic by using both list and priority queue data structure. However,it does not decrease run-time of the algorithm. Due to the large number of constraints, the selectedunassigned cell from MCV usually has at most 2 values left in its domain, therefore implementingLCV to sort these values by iterating through 20 peers’ domain doesn’t help.

Overall, CSP is slower than Algorithm X and Peter Norvig’s algorithms because of the complexityof constraint satisfaction increases immensely when the variables/domains/constraints grow [7] asyou need to assign values from the domain to a set of variables without violating constraints, andfor our case, we have large number of binary constraints.

6.2 Stochastic Search

Figure 4: Result for stochastic search

We run the algorithm as described in the section 4.4. It is much slower compared to other methods.The runtime depends on the complexity of the problem (number of unassigned tile). As seen inFigure 4, the runtime is approximately exponential with number of unassigned tiles (linear withLog(runtime) in figure). This is why the problem in top50.txt (around 67 unassigned tile) doesnot finish the run within 3 hours. Compared to the result in the literature [9], our runtime issignificantly better. They use Cultural Genetic Algorithm and Quantum Simulated Annealing and

7

Page 8: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

test their program with only 1 Sudoku puzzle with 47 unassigned tile, and the runtime is between1.5 seconds to 3 minutes. Our runtime for the same puzzle is 4.8 seconds and on average andranging from 0.4 seconds to 10 seconds.

The speed of the runtime reflect the fact that the algorithm mostly land on local minima, and giventhat a good sudoku problem has unique solution, it is very hard to land on the global minimum.

There is one notable example as shown in Table 3, however, where all other algorithm struggle tosolve (180 seconds for oracle), the stochastic search can solve with ease (1.8 seconds on average).Upon further inspection, it seems that this case is not a good sudoku puzzle i.e. the solution isnot unique, hence, there is a larger probability that it will land on the global minimum.

Another perk of this method is it can be used to find the solution from blank board very quickly.And in contrast to backtracking method where it will give same solution every time (feature ofdepth first search), this method will give different solutions every time. We can then use this togenerate sudoku problem by removing number out randomly.

To sum up, this method is another approach to solve the sudoku problem non-deterministically.It is very suitable for the complex problem with non unique solution.

6.3 Exact Cover Problem with Algorithm X

This approach is more efficient and much faster than the variable-based model like CSP. In Table 1and 2, Algorithm X runs approximately 100 times faster for easy problems, and 1000 times faster forhard problem compared to MCV + AC3, the fastest CSP. This algorithm enables us to use pythondictionary to represent constraints, where keys are each row of exact cover problem and values arelist of columns e.g. (1, ‘A’, 1): [1, 82, 163, 244] as described in Part 4.5. Removing/inserting rowis removing/inserting element from/to dictionary which takes only O(1) time. This is the mainreason why AlgorithmX can perform backtracking much faster than doing CSP.

When looking at Table 3, however, we can see that algorithm X performs much worse than bothStochastic search and our oracle. This is a rare case where traditional backtracking actually takesa lot of time to solve and casting it as an exact cover problem takes an even longer time.

6.4 Peter Norvig Algorithm

According to Table 1 and 2, although Algorithm X and Peter Norvig algorithm can solve Sudokuin approximately the same amount of time, the number of “backtrack” calls for Peter Norvig isgreater. The main reason is because when choosing which value in the domain to branch outnext, the search heuristic for Peter Norvig takes into account fewer constraints than algorithm Xdoes. Norvig’s approach only considers the constraint where each tiles can only have one valuewhile algorithm X, with its setup, considers all constraints: unique value in cell, row, column andblock. With less constraints, Peter Norvig’s solver needs to backtrack more often than algorithmX– resulting in significantly higher number of operation calls.

Comparing to our baseline implementation, Norvig’s approach is also much faster even when bothuses backtracking with MCV. This is because, by casting the problem as CSP and include toomany binary factors, the code for our baseline becomes too slow and inefficient. Direct use ofbacktracking search is much faster.

8

Page 9: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

7 Reference

1. Solving Every Sudoku Puzzle by Peter Norvig (http://norvig.com/sudoku.html)

2. ”Sudoku Solver” by Angelo Scorza, Quaizar Vohra

3. A Sudoku Solver in Java implementing Knuth’s Dancing Links Algorithm by Jonathan Chu(ttps://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/sudoku.paper.html)

4. Algorithm X in 30 lines by Ali Assaf (http://www.cs.mcgill.ca/~aassaf9/python/algorithm_x.html)

5. Sudoku: Knuth vs Norvig vs Cohen by Ben Lynn (http://benlynn.blogspot.com/2012/04/sudoku-knuth-vs-norvig-vs-cohen.html)

6. Sudoku Solving Algorithms (https://en.wikipedia.org/wiki/Sudoku_solving_algorithms)

7. Complexity of Constraint Satisfaction (https://en.wikipedia.org/wiki/Complexity_of_constraint_satisfaction)

8. Dancing Links by Donald Knuth (https://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/0011047.pdf)

9. Stochastic Optimization Approaches for Solving Sudoku (https://arxiv.org/pdf/0805.0697v1.pdf)

9

Page 10: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

8 Appendix

8.1 Algorithm X on an exact cover problem

Figure 5: Implementation of algorithm X on an exact cover problem defined in figure 2

10

Page 11: SolvingSudokuPuzzles CS221Fall2016: … scope of this project is to minimize time to solve 9x9 grid Sudoku puzzle by using ... using the algorithm ... Backtracking and Heuristics By

8.2 Extremely Hard Sudoku puzzle

. . . |. . 6 |. . .

. 5 9 |. . . |. . 82 . . |. . 8 |. . .------+------+------. 4 5 |. . . |. . .. . 3 |. . . |. . .. . 6 |. . 3 |. 5 4------+------+------. . . |3 2 5 |. . 6. . . |. . . |. . .. . . |. . . |. . .

11