Back to Home

Sudoku Methods

sudoku · sudoku

Sudoku Methods

  • Tutorial

1. The basics


Most of us hawkers know what sudoku is . I will not talk about the rules, but I will immediately turn to the techniques.
To solve the puzzle, no matter complex or simple, initially the cells that are obvious to be filled are searched.


1.1 "The last hero"



Consider the seventh square. Only four free cells, then something can be quickly filled.
" 8 " on D3 blocks the filling of H3 and J3 ; in the same way, “ 8 ” on G5 closes G1 and G2.
With a clear conscience, we put “ 8 ” on H1

1.2 "Last Hero" in the line



After looking at the squares for obvious solutions, go to the columns and rows.
Consider a “ 4 ” on the field. It is clear that it will be somewhere in the string A .
We have a “ 4 ” on G3 , which opens the A3 , there is a “ 4 ” on F7 , removing the A7 . And another “ 4 ” in the second square prohibits its repetition on A4 and A6 .
"The last hero" for our " 4 " is A2

1.3 “There is no choice”


Sometimes there are several reasons for a particular location. A " 4 " in the J8 would be a great example.
The blue arrows indicate that this is the last possible number squared. The red and blue arrows give us the last number in column 8 . Green arrows give the last possible number in a row J .
As you can see, we have no choice but to put this " 4 " in its place.

1.4 "And who, if not me?"


Filling numbers is easier to carry out by the above methods. However, checking the number as the last possible value also gives results. The method should be used when it seems that all numbers are there, but something is missing.
" 5 " in B1 is set based on the fact that all numbers from " 1 " to " 9 ", except for " 5 " are in the row, column and square (marked in green).

In jargon, this is Naked Alone . If you fill in the field with possible values ​​(candidates), then in the cell such a number will be the only possible. Developing this technique, you can search for " Hidden Singles " - numbers that are unique to a particular line,

2. The Naked Mile



2.1 “Naked” couples

" Naked" pair "- a set of two candidates located in two cells belonging to one common block: row, column, square.
It is clear that the correct puzzle solutions will be only in these cells and only with these values, while all other candidates from the general block can be removed.

In this example, several “naked pairs”. Cells A2 and A3 are highlighted in
red on row A , both containing “ 1 ” and “ 6 ”. I don’t know exactly how they are located here, but I can safely remove all the other “ 1 ” and “ 6 ” from line A (marked in yellow).A2 and A3 belong to a common square, so we remove " 1 " from C1 .


2.2 “Threesome”

The Naked Three is a sophisticated version of Naked Couples.
Any group of three cells in one block containing a total of three candidates is a “bare three” . When such a group was found, these three candidates can be removed from other cells in the block.

The combinations of candidates for the “naked three” can be as follows:

[abc] [abc] [abc] // three numbers in three cells.
[abc] [abc] [ab] // any combination.
[abc] [ab] [ab] // any combination.
[ab] [ac] [bc]

In this example, everything is pretty obvious. In the fifth square, cells E4 , E5 , E6 contain [ 5,8,9 ], [ 5,8], [ 5.9 ], respectively. It turns out that in general these three cells have [ 5,8,9 ], and only these numbers can be there. This allows us to remove them from other block candidates. This trick gives us a “ 3 ” solution for cell E7 .

2.3 "The magnificent four"

The Naked Four is a very rare occurrence, especially in its full form, and yet gives results when detected. The logic of the decision is the same as that of the “bare triples” .


In this example, in the first square, cells A1 , B1 , B2, and C1 generally contain [ 1,5,6,8 ], so only these cells and no others will occupy these numbers. We remove the candidates highlighted in yellow.

3. “Everything secret becomes apparent”



3.1 Hidden Pairs

A great way to open the field is to search for hidden pairs . This method allows you to remove unnecessary candidates from the cell and give the development of more interesting strategies.

In this puzzle, we see that 6 and 7 are in the first and second squares. In addition, 6 and 7 are in column 7 . By combining these conditions, we can argue that in cells A8 and A9 there will be only these values ​​and we will remove all other candidates.


A more interesting and complex example of hidden pairs . Blue highlighted pair [ 2,4 ] in D3 and E3 , removing 3, 5 , 6 , 7 of these cells. Two hidden pairs consisting of [ 3,7 ] are highlighted in red . C the one hand, they are unique to the two cells in a 7 column, on the other hand - for row E . Candidates highlighted in yellow are removed.

3.1 Hidden triples

We can develop hidden pairs to hidden triples or even hidden fours . The hidden triple consists of three pairs of numbers located in one block. Such as [a, b, c], [a, b, c] and [a, b, c]. However, as in the case of the “bare triples” , each of the three cells does not have to have three numbers. Will work in all three numbers in three locations. For example [ab], [ac], [bc]. Hidden triples will be masked by other candidates in the cells, so first you need to make sure that the triple is applicable to a specific block.


In this complex example, there are two hidden triples . The first one, marked in red, in column A. Cell A4 contains [ 2,5,6 ], A7 - [ 2,6 ] and cell A9 - [ 2,5 ]. These three cells are the only ones where there can be 2, 5 or 6, therefore only they will be there. Therefore, we remove unnecessary candidates.

The second, in column 9 . [ 4,7,8 ] unique to cells B9 , C9 and F9 . Using the same logic, we remove the candidates.

3.1 Hidden Fours


A great example of hidden fours . [ 1,4,6,9 ] in the fifth square can only be in four cells D4 , D6 , F4 , F6 . Following our logic, we remove all other candidates (marked in yellow).

4. "Nerezinovaya"



If any of the numbers appears twice or thrice in one block (row, column, square), then we can remove this number from the conjugate block. There are four types of pairing:
  1. Pair or Three in a square - if they are located on the same line, then you can remove all the other same values ​​from the corresponding line.
  2. Pair or Three in a square - if they are located in the same column, then you can remove all the other same values ​​from the corresponding column.
  3. Pair or Three in a row - if they are located in one square, then you can remove all the other same values ​​from the corresponding square.
  4. Pair or Three in a column - if they are located in one square, then you can remove all the other same values ​​from the corresponding square.

4.1 Pointing pairs, triples



I will show this puzzle as an example. In the third square, “ 3 ” is only found in B7 and B9 . Following statement No. 1 , we remove candidates from B1 , B2 , B3 . Similarly, “ 2 ” from the eighth square removes the possible value from G2 .


A special puzzle. It is very difficult to solve, but if you look closely, you will notice several pointing pairs . It is clear that it is not always necessary to find them all in order to advance in the solution, however, each such find makes our task easier.

4.2 Reduce the irreducible


This strategy includes accurate analysis and comparison of rows and columns with the contents of the squares (rules No. 3 , No. 4 ).
Consider the line A . " 2 " is possible only in A4 and A5 . Following rule No. 3 , we remove " 2 " their B5 , C4 , C5 .


We continue to solve the puzzle. We have a single arrangement of " 4 " within one square in the 8th column. According to rule No. 4 , we remove the unnecessary candidates and, in addition, we get the solution " 2 " for C7.

Afterword

There are hundreds of algorithms and programs for solving Sudoku. Sometimes, to get the result, it is enough to point the webcam . However, to train the brain and scroll through the algorithms in the head, it will be useful to sit with a pen and paper, solving sudoku.
The article cited the basic decision algorithms. Yes, yes, it is basic. The next step will be an analysis of advanced and complex techniques. Thanks for attention.


Read Next