Tuesday 3 May 2011

Sudoku Puzzle Notation

SP Notation

Sudoku solutions can be shown step-by-step. Sudoku Puzzle Notation or SP Notation depicts the starting puzzle and each step to solve the puzzle.

Starting Puzzle 
The starting puzzle is represented by 9 zero-padded numbers: a 9-digit number for each row. Zeros represent blank cells and the digits 1 to 9 represent filled cells.  Figure 1 is an example.

Figure 1 
123456000
456000123
000123456
312000978
000978312
978312000
000564897
564897000
897000564


 Step-By-Step Solution
There are 3 types of steps: fill, observation and elimination. The fill step indicates which cell is filled by which number and the reason for it. The observation step is a prelude to an elimination step and it indicates the digit or digits that may fill in a cell or multiple cells. The elimination step indicates the digit that may be eliminated as a candidate for a cell or multiple cells and the reason for elimination.

Cell Numbering                                                                                
The cells are identified by a column letter and a row number, beginning from the upper left corner. In the example on Figure 2, cell A1 is filled by “1”, cells A3, B3, C3 are blank, and cells G1, H1 and I1 are also blank.
Figure 2

A
B
C
D
E
F
G
H
I
1
2
3
4
5
6



2
4
5
6



1
2
3
3



1
2
3
4
5
6
4
3
1
2



9
7
8
5



9
7
8
3
1
2
6
9
7
8
3
1
2



7



5
6
4
8
9
7
8
5
6
4
8
9
7



9
8
9
7



5
6
4


Step Logic
There are 4 possible reasons for filling in a cell or for eliminating a candidate digit from a cell.
1.       (B) – there is only one cell in the 3x3 block where the digit may be placed
2.       (C) – there is only one cell in the column where the digit may be placed
3.       (R) – there is only one cell in the row where the digit may be placed
4.       (N) – there is only one digit that may be placed in the cell

Fill Step
The fill step has the format <cell>=<digit> <reason(s)>. An example of a fill step using Figure 2 is: 

A3=7 BCNR.

There are 4 reasons for filling cell A3 with “7”: B, C, N and R.
  • The top-left block has 3 blanks: on columns A3, B3 and C3. Columns B and C already have the digit “7”, therefore “7” can only be placed on A3 in this block (reason B).
  • Column A has 3 blanks: on rows 3, 5 and 7. Rows 5 and 7 already have the digit “7”, therefore “7” can only be placed on A3 along column A (reason C).
  • Row 3 has 3 blanks: on columns A, B and C. Columns B and C already have the digit “7”, therefore “7” can only be placed on A3 along row 3 (reason R).
  • Cell A3 is in a block with the digits 1, 2, 3, 4, 5 and 6 and in column A with the digits 8 and 9. Only “7” can be placed in cell A3 without repeating a digit in the block, column or row (reason N).

Puzzle Difficulty
Sudoku puzzles that are rated as easy to moderate can be solved by fill steps alone. An easy puzzle will have fill steps that have multiple reasons. The moderate puzzles would have some fill steps that have only one reason, which makes it more challenging. The difficult puzzles would have more single-reason steps and may also require elimination steps.

Jammed Puzzles
A jammed puzzle has a fill step that keeps it from being solved. See how quickly you can unjam the following moderate puzzles.


Apple







1
3

1


3


8

3
7

1








2

6
1
3


3
1



9

6



3
1

8


6
8
3
5
7
1
2
9
4



4
8
3
7
6
1
1
4
7



3
5
8

000000013
010030080
370100000
000206130
031000906
000310800
683571294
000483761
147000358

Banana



5
8


1
4
4



2


5

5



4





1
5
8

4



7
4



2
5

1



1

5
4


1


4
5

7
3
2

5
4
2


1


2
3
7
9
1
8
6
4
5

000580014
400020050
500040000
015804000
740002501
000105400
100450732
054200100
237918645



Cherry




3


1
2

2
3
6






4

2

7

3
6
4
1
6
7
2
3



8
9
2
5


3
7

7
3
5



6
2

2
8

9


1
4
3



3

2
5


3
5




2



000030012
023600000
040207036
416723000
892500370
735000620
280900143
000302500
350000200

2 comments:

  1. Well, I use something similar. I just do not care for the K9 notation. I prefer the rXCy=nZ or NRC formation. nZrXcY (upper case are variables)
    I have been trying to decide do I need to show all "reasons" or simply specify which one I chose where generally I would have n = naked trump everything of course. And b=block would trump line notations. This would be more of a I took that path kind of thing?

    ReplyDelete
  2. Showing only a single reason would suffice to show a solution. You are right -- it would give an insight on the path that you took.

    I included all the reasons to show all the possible paths. If I did not, I would have a lot of comments here (on other possibilities)... which might not be a bad thing...

    ReplyDelete