The principle of playing Sudoku. Solving difficult sudoku

Feb 27, 2015 -

Sudoku is a number puzzle. Today it is so popular that most people are familiar with it or have just seen it in print. In our article we will tell you where this game came from, as well as who invented Sudoku.

Despite the Japanese name, the history of Sudoku does not begin in Japan. The prototype of the puzzle is considered to be the Latin squares of Leonard Euler, the famous mathematician who lived in the 18th century. However, as it is known today, Howard Garnes invented it. An architect by training, Garnes concocted puzzles for magazines and newspapers along the way. In 1979, an American edition called "Dell Pencil Puzzles and Word Games" first printed Sudoku on its pages. However, then the puzzle did not arouse interest among readers.

It was the Japanese who were the first to appreciate the rebus. In 1984, a Japanese print media published a puzzle for the first time. She immediately became widespread. It was then that the puzzle got its name - Sudoku. In Japanese, "su" means "number", "doku" means "stand alone." Some time later, this puzzle appeared in many Japanese prints. In addition, they released separate collections of Sudoku. In 2004, UK newspapers began printing the puzzle, which marked the beginning of the game's expansion outside of Japan.

The puzzle is a square field with a side of 9 cells, divided in turn into 3 by 3 squares. Thus, the large square is divided into 9 small ones, the total number of cells of which is 81. In some cells, hint numbers are initially put down. The essence of the rebus is to fill in empty cells with numbers so that they do not repeat themselves in rows, columns, or squares. Only numbers from 1 to 9 are used in Sudoku. The difficulty of the puzzle depends on the location of the clue numbers. The most difficult, of course, is the one with only one solution.

The history of Sudoku continues in our time, and successfully. The game is becoming an increasingly common puzzle largely due to the fact that now it can be found not only on the pages of the newspaper, but also on the phone or computer. In addition, various variations of this rebus have appeared - instead of numbers, letters are used, the number of cells and the shape change.

Select the topic that interests you:

Sumdoku

Sumdoku - Also known as killer sudoku or killer sudoku. In this type of puzzle, the numbers are arranged in the same way as in classic Sudoku. But on the field there are additionally colored blocks, for each of which the sum of the numbers is indicated. Please note that sometimes numbers can be repeated in these blocks!

How to solve sumdoku?

Consider a sumdoku (pictured on the right). To solve it, remember that the sum of the numbers in any row, any column and any small rectangle is the same. For our case, this is 1 + 2 + 3 +… + 9 + 10 = 55. For a 9x9 sumdoku it would be 45.

Let's pay attention to the blocks highlighted in gray. They almost completely (except for one number) cover the two lower rectangles. Let's calculate the sum of the digits in all marked blocks: 13 + 8 + 13 + 15 + 13 + 7 + 14 + 12 + 5 = (13 + 13 + 14) + (13 + 7) + (12 + 8) + (15 + 5 ) = 40 + 20 + 20 + 20 = 100. So, the sum of the digits in the marked blocks is 100. But if you take the two bottom rectangles completely, then the sum of the digits in them should be 55 + 55 = 110. So, in the only unmarked cell the figure is 10.

As you can see, constantly solving sumdoku, you masterfully master arithmetic. You can, of course, use a calculator, but this dark and slippery path is not for real samurai

Consider now the blocks highlighted in the figure on the right. They cover one penultimate horizontal line of the Sudoku and two "extra" cells. Let's calculate the sum of digits in blocks: 13 + 8 + 15 + 13 + 10 + 14 = (13 + 13 + 14) + (10 + 15) + 8 = 40 + 25 + 8 = 73. But we know that the sum of digits in the horizontal line is 55, which means that you can find out the sum of the digits in the two "extra" cells: 73 - 55 = 18.

Let's write down all possible combinations of numbers in these "extra" cells: 10 + 8, 9 + 9, 8 + 10.

Sudoku history

9 + 9 - we exclude, since the cells are located on the same horizontal, 10 + 8 and 8 + 10 remain. But if you put 8 in the first "extra" square, then in the penultimate horizontal you will get two fives, and the numbers in the horizontal lines should not be repeated. Thus, we get that in the first "extra" cell there can be only 10. We place the rest of the obvious numbers at once.

06/15/2013 How to solve Sudoku, rules with an example.

I would like to say that Sudoku is a really interesting and exciting task, riddle, puzzle, puzzle, digital crossword, you can call it whatever you like. The solution of which will not only bring real pleasure for thinking people, but will also allow developing and training logical thinking, memory, perseverance in the process of an exciting game.

For those who are already familiar with the game in any of its manifestations, the rules are known and understandable. And for those who are just thinking of getting started, our information can be useful.

The rules for playing Sudoku are not complicated, they can be found on the pages of newspapers or they can be found quite easily on the Internet.

The main points fit into two lines: the main task of the player is to fill all the cells with numbers from 1 to 9. This must be done in such a way that none of the numbers is repeated twice in the row, column and mini-square 3x3.

Today we offer you several variations of the electronic Sudoku-4tune game, with over a million built-in puzzle variations in every game player.

For clarity and a better understanding of the process of solving the riddle, consider one of the simple options, the first difficulty level Sudoku-4tune, 6 ** series.

And so, a playing field is given, consisting of 81 cells, which in turn are: 9 rows, 9 columns and 9 mini-squares with a size of 3x3 cells. (Fig. 1.)


Do not be confused by the further mention of the electronic game. You can find the game on the pages of newspapers or magazines, the basic principle is preserved.

The electronic version of the game provides great opportunities for choosing the difficulty level of the puzzle, the options for the puzzle itself and their number, at the request of the player, depending on his preparation.

When you turn on the electronic toy, key numbers will be given in the cells of the playing field. Which cannot be transferred or changed. You can choose the option that is more suitable for the solution, in your opinion. Reasoning logically, starting from the given numbers, it is necessary to gradually fill the entire playing field with numbers from 1 to 9.

An example of the initial arrangement of numbers is shown in Fig. 2. Key numbers, as a rule, in the electronic version of the game are marked with an underscore or dot in the cell. In order not to confuse them in the future with the numbers that will be set by you.


Looking at the playing field. It is necessary to decide where to start the decision. Typically, you want to define a row, column, or mini-square that has the minimum number of blank cells. In our variant, two lines can be distinguished at once, the top and the bottom. There is only one digit missing in these lines. Thus, a simple decision is made, having determined the missing digits -7 for the first row and 4 for the last one, we enter them into the free cells in Fig. 3.


The resulting result: two filled lines having numbers from 1 to 9 without repetitions.

Next move. Column number 5 (left to right) has only two free cells. After some deliberation, we determine the missing numbers - 5 and 8.

To achieve a successful result in the game, you need to understand that you need to navigate in three main directions - column, row and mini-square.

In this example, it is difficult to navigate only by rows or columns, but if you pay attention to the mini-squares, it becomes clear. You cannot enter the number 8 into the second (from the top) cell of the column in question, otherwise there will be two eights in the second mine-square. Similarly, with the number 5 for the second cell (bottom) and the second lower mini-square in Fig. 4 (not the correct location).


Although the solution seems to be correct for a column, nine digits, in a column, no repetition, it is contrary to the basic rules. Numbers in mini-squares should not be repeated either.

Accordingly, for the correct solution, it is necessary to enter 5 in the second (top) cell, and 8 in the second (bottom). This decision is fully compliant with the rules.

See Figure 5 for the correct option.

Further solution, seemingly simple, tasks, requires careful consideration of the playing field and the connection of logical thinking.

How to Solve Sudoku - Ways, Methods and Strategy

You can again use the principle of the minimum number of free cells and pay attention to the third and seventh columns (from left to right). Three cells were left empty in each of them. Having counted the missing numbers, we determine their values ​​- these are 2,3 and 9 for the third column and 1,3 and 6 for the seventh. Let's leave the filling of the third column for now, since there is no certain clarity with it, in contrast to the seventh. In the seventh column, you can immediately determine the location of the number 6 - this is the second free cell from the bottom. What is the basis for this conclusion?

When considering the mini-square, which includes the second cell, it becomes clear that it already contains the numbers 1 and 3. Of the digital combination we need, 1,3 and 6, there is no other alternative. Filling in the remaining two free cells of the seventh column is also straightforward. Since the third row already has a filled 1 in its composition, 3 fits into the third from the top cell of the seventh column, and 1 fits into the only remaining free second cell 1. See Figure 6 for an example.


Let's leave the third column for a clearer understanding of the moment. Although, if you wish, you can make a note for yourself, and enter the proposed version of the numbers necessary for setting in these cells, which can be corrected if the situation becomes clearer. Electronic games Sudoku-4tune, 6 ** series allow you to enter more than one number in the cells, for reference.

After analyzing the situation, we turn to the ninth (lower right) mini-square, in which after our solution there are three free cells.

After analyzing the situation, you can see (an example of filling a mini-square) that the next digits 2.5 and 8 are missing to complete it. Having considered the middle, free cell, you can see that only 5 of the necessary digits are suitable here. Since 2 is present in the upper cell column, and 8 in a row in the composition, which, in addition to the mini-square, includes this cell. Accordingly, in the middle cell of the last mini-square we enter the number 2, (it does not enter either the row or the column), and in the upper cell of this square we enter 8. Thus, we have completely filled the lower right (9th) mini- square in numbers from 1 to 9, while the numbers are not repeated in columns or rows, Fig. 7.


As the free cells are filled, their number decreases, and we are gradually approaching the solution of our puzzle. But at the same time, the solution of the problem can be both simplified and complicated. And the first way to fill in the minimum number of cells in rows, columns or mini-squares is no longer effective. Because it reduces the number of clearly defined digits in a particular row, column, or mini-square. (Example: the third column we left behind). In this case, it is necessary to use the method of searching for individual cells, setting numbers in which there is no doubt.

In the electronic games Sudoku-4tune, 6 ** series, it is possible to use a hint. Four times per game, you can use this function and the computer itself will set the correct number in the cell you have chosen. There is no such function in 8 ** series models, and the use of the second method becomes the most urgent.

Let's look at the second method in our example.

Let's take the fourth column for clarity. The number of empty cells in it is quite large, six. Having counted the missing numbers, we determine them - these are 1,4,6,7,8 and 9. To reduce the number of options, you can take as a basis the average mini-square, which has a fairly large number of certain numbers and only two free cells in this column. Comparing them with the numbers we need, we can see that 1.6, and 4 can be excluded. They should not be in this mini-square to avoid repetitions. There are 7,8 and 9. Note that in the row (the fourth from the top), which contains the cell we need, there are already numbers 7 and 8 from the three remaining that we need. Thus, the only option for this cell remains - this is the number 9, Fig. 8 There is no doubt about the correctness of this solution option, and the fact that all the numbers considered and excluded by us were originally given in the task. That is, they are not subject to any change or transfer, confirming the uniqueness of the digit we have chosen to install in this particular cell.


Using two methods at the same time, depending on the situation, analyzing and thinking logically, you fill in all the free cells and come to the correct solution to any Sudoku puzzle, and this one in particular. Try to complete the solution of our example in Fig. 9 on your own and compare it with the final answer shown in Fig. 10.


Perhaps you, for yourself, identify any additional key points in solving puzzles, and develop your own system. Or take our advice, and they will be useful to you, and will allow you to join a large number of fans and fans of this game. Good luck.

Sudoku ("Sudoku") Is a number puzzle. Translated from Japanese, "su" means "number", and "dook" means "standing alone." In a traditional Sudoku puzzle, the grid is a square sized 9 x 9, divided into smaller squares with a side of 3 cells ("regions"). Thus, the whole field has 81 cells. Some of them already contain numbers (from 1 to 9). Depending on how many cells are already filled, the puzzle task can be classified as easy or difficult.

Sudoku puzzle has only one rule. It is necessary to fill in the empty cells so that in each row, in each column and in each small square 3 x 3 each digit from 1 to 9 would appear only once.

Program Cross + A knows how to solve a large number of Sudoku varieties.

The task can be complicated: the main diagonals of the square must also contain numbers from 1 to 9. This puzzle is called diagonal sudoku ("Sudoku X"). To solve these tasks, you must put a "tick" in paragraph Diagonals.

Argyle Sudoku (Argyle Sudoku) contains a pattern of diagonal lines.

Sudoku rules

The argyle pattern, consisting of multi-colored diamonds of the same size, was present on the kilts of one of the Scottish clans. Each of the marked diagonals must contain non-repeating numbers.

The puzzle can contain regions of any shape; such sudoku are called geometric or curly (Jigsaw Sudoku, Geometry Sudoku, Irregular Sudoku, "Kikagaku Nanpure").

Letters can be used instead of numbers in Sudoku; such puzzles are called Godoku ("Wordoku", Alphabet Sudoku). After a solution, a keyword can be read in a row or column.

Asterisk Sudoku ("Asterisk") Is a variation of Sudoku that contains an additional area of ​​9 cells. These cells must also contain numbers from 1 to 9.

Girandole sudoku ("Girandola") also contains an additional area of ​​9 cells, with numbers from 1 to 9 (girandole is a fountain of several streams in the form of fireworks, a "wheel of fire").

Sudoku with center points (Center Dot) Is a variant of Sudoku where the central cells of each region 3 x 3 form an additional area.

The cells in this extra area must contain numbers from 1 to 9.

Sudoku can contain four additional regions 3 x 3... This kind of puzzle is called sudoku window ("Windoku", Four-Box Sudoku, Hyper Sudoku).

Sudoku mosaic ("Offset Sudoku", "Sudoku-DG") contains additional 9 groups of 9 cells. The cells within the group do not touch each other and are highlighted in the same color. In each group, each digit from 1 to 9 must appear only once.

Not a step with a horse (Anti-Knight Sudoku) has an additional condition: identical numbers cannot "beat" each other with a knight's move.

V hermit sudoku (Anti-King Sudoku, "Touchless Sudoku", "No Touch Sudoku") identical numbers cannot stand in adjacent cells (both diagonally and horizontally and vertically).

V antidiagonal sudoku (Anti Diagonal Sudoku) each diagonal of a square contains at most three different numbers.

Killer sudoku ("Killer Sudoku", "Sums Sudoku", "Sums Number Place", "Samunamupure", "Kikagaku Nampure"; another name - Sum-do-ku) is a variation of ordinary Sudoku. The only difference: additional numbers are specified - the sums of values ​​in groups of cells. The numbers contained in the group cannot be repeated.

Sudoku more less ("Greater Than Sudoku") contains comparison signs (">" and "<«), которые показывают, как соотносятся между собой числа в соседних ячейках. Еще одно название — Compdoku.

Sudoku even-odd (Even-Odd Sudoku) contains information about the evenness or oddness of the numbers in the cells. Cells with even numbers are marked in gray, cells with odd numbers are marked with white.

Sudoku neighbors (Consecutive Sudoku, "Divided Sudoku") Is a variation of ordinary Sudoku. It marks the boundaries between adjacent cells, which contain consecutive numbers (that is, numbers that differ from each other by one).

V Non-Consecutive Sudoku numbers in adjacent cells (horizontally and vertically) must differ by more than one. For example, if a cell contains number 3, adjacent cells should not contain numbers 2 or 4.

Sudoku dots ("Kropki Sudoku", "Dots Sudoku", "Sudoku with dots") contains white and black dots at the borders between cells. If the numbers in neighboring cells differ by one, then there is a white dot between them. If in adjacent cells one number is twice the other, then the cells are separated by a black point. A point of any of these colors can stand between 1 and 2.

Sukaku ("Sukaku", "Suuji Kakure", "Pencilmark Sudoku") is a square of size 9 x 9 containing 81 groups of numbers. It is necessary to leave only one number in each cell so that in each row, in each column and in each small square 3 x 3 each number from 1 to 9 would appear only once.

Sudoku Chains (Chain Sudoku, "Strimko", "Twist Sudoku") is a square of circles.

It is necessary to arrange the numbers in circles so that in each horizontal and each vertical all numbers are different. In the links of the same chain, all numbers must also be different.

The program can solve and create puzzles ranging in size from 4 x 4 before 9 x 9.

Sudoku frame (Frame Sudoku, Outside Sum Sudoku, "Sudoku - Side Sums", Summed Sudoku) is an empty square of size. The numbers outside the playing field represent the sum of the next three digits in a row or column.

Skyscraper Sudoku (Skyscraper Sudoku) contains key numbers along the sides of the grid. It is necessary to arrange the numbers in the grid; each number represents the number of floors in the skyscraper. The key numbers outside the grid show exactly how many houses are visible in the corresponding row or column when viewed from that number.

Tripod Sudoku (Tripod Sudoku) - a kind of Sudoku, in which the boundaries between regions are not indicated; instead, points are specified at the intersections of the lines. The dots represent the intersection of the region boundaries. Only three lines can extend from each point. It is necessary to restore the boundaries of the regions and fill the grid with numbers so that they do not repeat in each row, each column and each region.

Sudoku mines ("Sudoku Mine") combines the features of Sudoku and Minesweeper puzzles.

The task is a square size divided into smaller squares with a side of 3 cells. It is necessary to place mines in the grid so that there are three mines in each row, each column and each small square. The numbers show how many mines are in adjacent cells.

Half sudoku ("Sujiken") was invented by the American George Heineman. The puzzle is a triangular grid containing 45 cells. Some cells contain numbers. It is necessary to fill in all the cells of the grid with numbers from 1 to 9 so that in each row, in each column and on each diagonal the numbers are not repeated. Also, the same number cannot appear twice in each of the regions separated by thick lines.

Sudoku XV ("Sudoku XV") Is a kind of ordinary Sudoku. If the border between adjacent cells is marked with the Roman numeral "X", the sum of the values ​​in these two cells is 10, if the Roman numeral "V" - the sum is 5. If the border between two cells is not marked, the sum of the values ​​in these cells cannot be 5 or 10.

Sudoku edge (Outside Sudoku) is a variation of the regular Sudoku puzzle. Outside the grid are the numbers that must be present in the first three cells of the corresponding row or column.);

  • 16 x 16(size of regions 4 x 4).

Cross + A can solve and create variations of Sudoku consisting of multiple squares 9 x 9.

Such puzzles are called "Gattai"(translated from Japanese: "connected", "connected"). Depending on the number of squares, the puzzles indicate "Gattai-3", "Gattai-4", "Gattai-5" etc.

Samurai sudoku (Samurai Sudoku, "Gattai-5") Is a kind of Sudoku puzzle. The playing field consists of five squares of size 9 x 9... The numbers from 1 to 9 must be placed correctly in all five squares.

Flower sudoku (Flower Sudoku, Musketry Sudoku) is similar to samurai sudoku. The playing field consists of five squares of size 9 x 9; the central square is entirely covered by four others. The numbers from 1 to 9 must be placed correctly in all five squares.

Sohei Sudoku (Sohei Sudoku) is named after the warrior monks in medieval Japan. The playing field contains four squares of size 9 x 9

Sudoku mill ("Kazaguruma", Windmill Sudoku) consists of five squares of size 9 x 9: one in the center, four other squares almost completely cover the central square. The numbers from 1 to 9 must be placed correctly in all five squares.

Butterfly Sudoku (Butterfly Sudoku) contains four intersecting squares of size 9 x 9 which form a single square of size 12 x 12... The numbers from 1 to 9 must be placed correctly in all four squares.

Cross sudoku ("Cross Sudoku") consists of five squares. The numbers from 1 to 9 must be placed correctly in all five squares.

Sudoku Three ("Gattai-3") consists of three squares of size 9 x 9.

Double Sudoku ("Twodoku", Sensei Sudoku, "DoubleDoku") consist of two squares of size 9 x 9... The numbers from 1 to 9 must be placed correctly in both squares.

The program is able to solve double sudoku, in which the regions are of an arbitrary shape:

Triple Sudoku ("Triple Doku") are a puzzle of three squares in size 9 x 9... The numbers from 1 to 9 must be placed correctly in all squares.

Twin Sudoku ("Twin Corresponding Sudoku") is a pair of common Sudoku puzzles, each with several starting numbers. Both puzzles must be solved; in this case, each type of numbers in the first grid corresponds to the same type of numbers in the second grid. For example, if the number 9 is in the upper left corner of the first Sudoku puzzle, and the number 4 is in the upper left corner of the second puzzle, then in all cells where the first grid is 9, the second grid contains the number 4.

Hoshi ("Hoshi") consists of six large triangles; the numbers from 1 to 9 must be placed in the triangular cells of each large triangle. Each line (of any length, even a dashed line) contains non-repeating digits.

Unlike Hoshi, in star sudoku (Star Sudoku) the row on the outer edge of the mesh includes the cell located at the nearest sharp end of the shape.

Tridoku ("Tridoku") was invented by Japheth Light from the USA. The puzzle consists of nine large triangles; each of them contains nine small triangles. Numbers from 1 to 9 must be placed in the cells of each large triangle. The field contains additional lines, the cells of which must also contain non-repeating numbers. Two adjoining triangular cells must not contain the same numbers (even if the cells touch each other with only one point).

Online assistant in solving Sudoku.

If you cannot solve a difficult Sudoku, try it with a helper. It will highlight the options for you.

The Sudoku field is a 9x9 grid. A number from 1 to 9 is entered into each cell. The goal of the game is to arrange the numbers in such a way that there are no repetitions in each row, in each column and in each 3x3 block. In other words, every column, row, and block must contain all numbers from 1 to 9.

To solve the problem, candidates can be written in empty cells. For example, consider a cell in the 2nd column of the 4th row: the column in which it is located already contains numbers 7 and 8, the row contains numbers 1, 6, 9 and 4, and the block contains 1, 2, 8 and 9. Therefore, from the candidates in this cell we delete 1, 2, 4, 6, 7, 8, 9, and we have only two possible candidates - 3 and 5.

Similarly, we consider possible candidates for other cells and get the following table:

It is more interesting to solve with candidates and various logical methods can be applied. Below we will look at some of them.

Loners

The method consists in finding singles in the table, i.e. cells in which only one digit is possible and no other. We write this number into this cell and exclude it from other cells of this row, column and block. For example: in this table there are three "loners" (they are highlighted in yellow).

Hidden loners

If there are several candidates in a cell, but one of them does not occur anymore in any other cell of a given row (column or block), then such a candidate is called a "hidden loner". In the following example, the candidate "4" in the green box is found only in the center cell. This means that this cell will necessarily contain "4". We enter "4" into this cell and cross out the 2nd column and 5th row from other cells. Similarly, in the yellow column, the candidate "2" occurs once, therefore, in this cell we enter "2" and exclude "2" from the cells of the 7th row and the corresponding block.

The previous two methods are the only methods that uniquely determine the contents of a cell. The following methods can only reduce the number of candidates in the cells, which sooner or later will lead to loners or hidden loners.

Locked Candidate

There are times when a candidate within a block is in only one row (or one column). Due to the fact that one of these cells will necessarily contain this candidate, this candidate can be excluded from all other cells in this row (column).

In the example below, the center box contains candidate “2” only in the center column (yellow cells). This means that one of these two cells must definitely be "2", and no other cells in that row outside this block can be "2". Therefore, "2" can be excluded as a candidate from other cells in this column (cells in green).

Open pairs

If two cells in a group (row, column, block) contain an identical pair of candidates and nothing more, then no other cells of this group can have the value of this pair. These 2 candidates can be excluded from other cells in the group. In the example below, candidates "1" and "5" in columns eight and nine form an Open Pair within the block (yellow cells). Therefore, since one of these cells must be "1" and the other must be "5", candidates "1" and "5" are excluded from all other cells in this block (green cells).

The same can be formulated for 3 and 4 candidates, only 3 and 4 cells already participate, respectively. Open triplets: exclude the values ​​of the yellow cells from the green cells.

Open fours: exclude the values ​​of the yellow cells from the green cells.

Hidden couples

If two cells in a group (row, column, block) contain candidates, among which there is an identical pair that does not occur in any other cell of this block, then no other cells of this group can have the value of this pair. Therefore, all other candidates for these two cells can be excluded. In the example below, candidates "7" and "5" in the center column are only in yellow cells, which means that all other candidates can be excluded from these cells.

Likewise, you can search for hidden threes and fours.

x-wing

If a value has only two possible locations in a row (column), then it must be assigned to one of these cells. If there is another row (column), where the same candidate can also be in only two cells and the columns (rows) of these cells coincide, then no other cell of these columns (rows) can contain this number. Let's consider an example:

In the 4th and 5th lines, the number "2" can only be in two yellow cells, and these cells are in the same columns. Therefore, the number "2" can be written in only two ways: 1) if "2" is written in the 5th column of the 4th row, then from the yellow cells "2" must be excluded, and then in the 5th row the position "2" is uniquely identified by the 7th column.

2) if “2” is written in the 7th column of the 4th row, then “2” must be excluded from the yellow cells, and then in the 5th row the position “2” is uniquely determined by the 5th column.

Therefore, the 5th and 7th columns will necessarily have the number "2" either in the 4th row or in the 5th. Then from other cells of these columns the number "2" can be excluded (green cells).

Swordfish

This method is a variation of the method.

It follows from the rules of the puzzle that if a candidate is in three rows and only in three columns, then in other rows this candidate in those columns can be excluded.

Algorithm:

  • We are looking for lines in which the candidate occurs no more than three times, but at the same time he belongs to exactly three columns.
  • We exclude the candidate from these three columns from the other rows.

The same logic applies in the case of three columns, where the candidate is limited to three lines.

Let's look at an example. In three lines (3, 5 and 7) candidate "5" occurs no more than three times (cells are highlighted in yellow). Moreover, they belong to only three columns: 3, 4 and 7th. According to the Swordfish method, candidate 5 can be excluded from the other cells in these columns (green cells).

In the example below, the Swordfish method is also applied, but for the case of three columns. We exclude candidate "1" from the green cells.

X-wing and Swordfish can be generalized to the case of four rows and four columns. This method will be called "Medusa".

Colors

There are situations when a candidate only occurs twice in a group (in a row, column, or block). Then the required number will necessarily be in one of them. The strategy of the Colors method is to view this relationship using two colors, for example, yellow and green. In this case, the solution can be in cells of only one color.

We select all interconnected chains and make a decision:

  • If some unfilled candidate has two multi-colored neighbors in a group (row, column or block), then it can be excluded.
  • If there are two identical colors in a group (row, column, or block), then this color is false. A candidate can be excluded from all cells of this color.

In the following example, we will apply the Colors method to cells with candidate 9. We start coloring from the cell in the upper left block (2nd row, 2nd column), paint it yellow. In its block, it has only one neighbor with "9", let's paint it green. She also has only one neighbor in the column, and paint over it in green.

We work in the same way with the rest of the cells containing the number "9". We get:

The candidate "9" can be either only in all yellow cells, or in all green cells. In the right middle block there are two cells of the same color, therefore, the green color is incorrect, since in this block there are two "9", which is unacceptable. We exclude "9" from all green cells.

Another example for the "Colors" method. Let's mark paired cells for candidate "6".

The cell with "6" in the upper central block (highlight in lilac) has two multi-colored candidates:

"6" will necessarily be either in a yellow or green cell, therefore, from this lilac cell, "6" can be excluded.

VKontakte Facebook Odnoklassniki

For those who like to solve Sudoku riddles on their own and slowly, a formula that allows you to quickly calculate the answers may seem like an admission of weakness or a scam.

But for those who find it costing too much to solve Sudoku, this can literally be the perfect solution.

Two researchers have developed a mathematical algorithm that allows you to solve Sudoku very quickly, without guesswork and backtracking.

Complex network researchers Zoltan Torozhkay and Maria Ercy-Ravaz of the University of Notre Dame were also able to explain why some Sudoku puzzles are more difficult than others. The only drawback is that it takes a Ph.D. in mathematics to understand what they offer.


Can you solve this puzzle? Created by mathematician Arto Inkala, it is claimed to be the most difficult Sudoku in the world. Photo via nature.com

Torozhkai and Erksi-Ravaz began analyzing Sudoku as part of their exploration of optimization theory and computational complexity. They say that most Sudoku enthusiasts use a brute-force guessing technique to solve these problems. Thus, Sudoku enthusiasts arm themselves with a pencil and try all possible combinations of numbers until they find the correct answer. This method will inevitably lead to success, but it is laborious and time-consuming.

Instead, Torozhkay and Erksi-Ravaz proposed a universal analog algorithm that is absolutely deterministic (does not use guesswork or brute force) and always finds the correct solution to the problem, and rather quickly.


The researchers used a "deterministic analog solver" to fill in this Sudoku. Photo via nature.com

The researchers also found that the time it takes to solve a puzzle using their analog algorithm correlates with the degree of difficulty of the problem, which is assessed by a human. This inspired them to develop a ranking scale for the difficulty of a puzzle or problem.

They created a scale from 1 to 4, where 1 is "easy", 2 is "medium difficulty", 3 is "difficult", 4 is "very difficult". A puzzle with a rating of 2 takes on average 10 times longer than a puzzle with a rating of 1. According to this system, the most difficult puzzle still known has a rating of 3.6; more complex Sudoku problems are still unknown.


The theory starts by mapping the probabilities for each individual square. Photo via nature.com

“I wasn't interested in Sudoku until we started working on a more general class of Boolean satisfiability,” says Torozhkai. - Since Sudoku is part of this class, the 9th order Latin square turned out to be a good field for us to test, so I got to know them. I and many researchers studying such problems are fascinated by the question of how far we humans are able to go in solving Sudoku, deterministically, without brute force, which is a choice at random, and if the guess is not correct, you need to go back one step or a few steps back and start over. Our analog decision model is deterministic: there is no random choice or recurrence in dynamics. "


Chaos Theory: The degree of difficulty of the riddles is shown here as chaotic dynamics. Photo via nature.com

Torozhkay and Erksi-Ravaz believe that their analog algorithm is potentially suitable for solving a wide variety of problems and problems in industry, computer science and computational biology.

The research experience also made Torozhkaya a great Sudoku enthusiast.

“My wife and I have several Sudoku apps on our iPhones, and we must have played thousands of times already, competing in less time on every level,” he says. - She often intuitively sees combinations of patterns that I do not notice. I have to get them out. It becomes impossible for me to solve many of the puzzles that our scale categorizes as difficult or very difficult without writing down the probabilities in pencil. "

The methodology of Torozhkaya and Erksi-Ravaz was first published in the journal Nature Physics, and then in the journal Nature Scientific Reports.

So today I will teach you solve sudoku.

For clarity, let's take a specific example and consider the basic rules:

Rules for solving sudoku:

I highlighted the row and column in yellow. First rule each row and each column can contain numbers from 1 to 9, and they cannot be repeated. In short - 9 cells, 9 numbers - therefore, in the 1st and the same column there cannot be 2 fives, eights, etc. Likewise for strings.

Now I have highlighted the squares - this is second rule... Each square can contain numbers from 1 to 9 and they are not repeated. (As well as in rows and columns). The squares are highlighted with bold lines.

Hence we have general rule for solving sudoku: neither in lines nor in columns nor in squares numbers should not be repeated.

Well, let's now try to solve it:

I highlighted the units in green and showed the direction we are looking in. Namely, we are interested in the last upper square. It can be noted that in the 2nd and 3rd row of this square there cannot be units, otherwise there will be repetition. So - the unit is at the top:

Two is easy to find:

Now let's use the two we just found:

I hope the search algorithm has become clear, so from now on I will draw faster.

We look at the 1st square of the 3rd row (below):

Because we have 2 free cells left, then each of them can have one of two numbers: (1 or 6):

This means that in the column that I have highlighted there can no longer be either 1 or 6, which means that we put 6 in the top square.

For lack of time, I will dwell on this. I really hope that you get the logic. By the way, I took a not the simplest example, in which most likely all solutions will not be immediately visible unambiguously, and therefore it is better to use a pencil. We do not yet know about 1 and 6 in the lower square, so we draw them with a pencil - similarly, 3 and 4 will be drawn in the upper square with a pencil.

If we speculate a little more, using the rules, we will get rid of the question where is 3, and where is 4:

By the way, if some point seemed incomprehensible to you - write, I will explain in more detail. Good luck with your Sudoku.


Hello everyone! In this article, we will analyze in detail the solution of complex Sudoku using a specific example. Before starting the analysis, let us agree to call the small squares numbers, numbering them from left to right and from top to bottom. All the basic principles of solving Sudoku are described in this article.

As usual, we'll first look at open-ended singles. And there were only two of them b5- 5, e6-3. Next, we will arrange possible candidates for all empty fields.

We will arrange the candidates in small green print to distinguish them from the numbers already standing. We do this mechanically, simply by going through all the empty cells and entering in them the numbers that may be in them.

The fruit of our labors can be seen in Figure 2. Let's turn our attention to cell f2. She has two candidates 5 and 9. We will have to use the guessing method, and in case of an error, return to this choice. Let's put the number five. Remove the five from the candidates in row f, column 2, and square four.

We will constantly remove possible candidates after setting the number and in this article we will not focus on that anymore!

We look further at the fourth square, we have a tee - these are cells e1, d2, e3, which have candidates 2, 8 and 9. Let's remove them from the rest of the empty cells of the fourth square. Go ahead. In square six, the number five can only be on e8.

More at the moment, neither pairs, nor tees, nor even fours are visible. Therefore, we will take a different path. Let's go through all verticals and horizontals to remove unnecessary candidates.

And so on the second file 8 can only be on cells -h2 and i2, let's remove the eight from other empty cells of the seventh square. On the third file, the number eight can only be on e3. What we got is shown in Figure 3.

Further nothing for which you can catch on can not be found. We've got a pretty tough nut to crack, but we'll get through it anyway! And so, consider again our pair e1 and d2, arrange it in this way d2-9, e1 -2. And in case of our mistake, we will return again to this pair.

Now we can safely write two into the cell d9! And there are seven in the square, the nine can only be on h1. After that, on file 1, the five can only be on i1, which in turn gives the right to put a five on the h9 square.

Figure 4 shows what we got. Now let's consider the next pair, these are d3 and f1. They have candidates 7 and 6. Looking ahead, I will say that the option of arranging d3-7, f1 -6 is erroneous and we will not consider it in the article so as not to waste time.

Figure 5 illustrates our work. What is left for us to do next? Of course, go through the options for setting numbers again! We put a three in the cell g1. As always, we are saving so that we can return. One is put on i3. now in the seventh square we get a pair of h2 and i2, with numbers 2 and 8. This gives us the right to exclude these numbers from candidates along the entire unfilled vertical.

Based on the last thesis, we arrange. a2 is a four, b2 is a three. And after that we can put down the entire first square. c1 - six, a1 - one, b3 - nine, c3 - two.

Figure 6 shows what happened. On i5 we have a hidden loner - number three! And i2 can only contain the number 2! Accordingly, on h2 - 8.

Now let's turn to squares e4 and e7, this is a pair with candidates 4 and 9. Let's place them as e4 four, e7 nine. Now a six is ​​placed on f6, and a nine on f5! Further on c4 we get a hidden loner - the number nine! And we can immediately put down four with 8, and then close the horizontal with: c6 eight.

Related publications