_
Assuming
easiest implies "solvable with singles only", then I use a rating based on my solver's steps to solve a puzzle.
My
n_singles() routine examines a grid and finds all Naked Singles present. It then lists them and performs the associated eliminations as
one step. My
h_singles() routine performs likewise for Hidden Singles. Let's consider your puzzle.
- Code: Select all
+-----------------------+
| 1 . . | . 2 . | 9 . . |
| 8 . 7 | . . 5 | 2 . 1 |
| 9 2 . | 3 8 . | 5 7 . |
|-------+-------+-------|
| 2 9 3 | 8 7 . | 1 . . |
| 5 8 . | 2 . . | . . . |
| 6 . . | . . . | . . . |
|-------+-------+-------|
| 3 . . | . . 7 | . . 9 |
| . . . | . . . | . . . |
| 7 . . | 9 1 . | . 3 . |
+-----------------------+
start Givens:
Naked Single = 1 r1c1,r2c9,r4c7,r9c5
Naked Single = 2 r1c5,r2c7,r3c2,r4c1,r5c4
Naked Single = 3 r3c4,r4c3,r7c1,r9c8
Naked Single = 5 r2c6,r3c7,r5c1
Naked Single = 6 r6c1
Naked Single = 7 r2c3,r3c8,r4c5,r7c6,r9c1
Naked Single = 8 r2c1,r3c5,r4c4,r5c2
Naked Single = 9 r1c7,r3c1,r4c2,r7c9,r9c4
end Givens:
At runtime, my
process() routine can be directed to emulate:
- Code: Select all
while (1)
{
if ( n_singles() ) continue;
if ( h_singles() ) continue;
break;
}
This results in 21 steps to solve the puzzle.
- Code: Select all
Naked Single = 4 r8c1
Finished Step: 1
Hidden Single = 1 r3c6,r6c4
Hidden Single = 3 r1c9,r2c2
Hidden Single = 7 r1c4,r6c2
Hidden Single = 9 r2c5,r8c3
Finished Step: 2
Naked Single = 4 r6c3
Finished Step: 3
Naked Single = 1 r5c3
Naked Single = 6 r3c3
Finished Step: 4
Naked Single = 4 r3c9
Naked Single = 5 r1c3
Finished Step: 5
Naked Single = 4 r1c2
Naked Single = 6 r2c8
Finished Step: 6
Naked Single = 4 r2c4
Naked Single = 6 r1c6
Naked Single = 8 r1c8
Finished Step: 7
Naked Single = 4 r4c6
Finished Step: 8
Naked Single = 5 r4c8
Finished Step: 9
Naked Single = 6 r4c9
Finished Step: 10
Naked Single = 7 r5c9
Finished Step: 11
Hidden Single = 4 r7c5,r9c7
Hidden Single = 5 r6c5
Hidden Single = 6 r5c5
Hidden Single = 7 r8c7
Finished Step: 12
Naked Single = 3 r5c7,r8c5
Finished Step: 13
Naked Single = 8 r6c7
Naked Single = 9 r5c6
Finished Step: 14
Naked Single = 2 r6c9
Naked Single = 3 r6c6
Naked Single = 4 r5c8
Naked Single = 6 r7c7
Finished Step: 15
Naked Single = 5 r7c4
Naked Single = 9 r6c8
Finished Step: 16
Naked Single = 1 r7c2
Naked Single = 6 r8c4
Finished Step: 17
Naked Single = 2 r7c8
Naked Single = 5 r8c2
Finished Step: 18
Naked Single = 1 r8c8
Naked Single = 6 r9c2
Naked Single = 8 r7c3,r8c9
Finished Step: 19
Naked Single = 2 r8c6,r9c3
Naked Single = 5 r9c9
Finished Step: 20
Naked Single = 8 r9c6
Finished Step: 21
At runtime, my
process() routine can also be directed to emulate:
- Code: Select all
while (1)
{
if ( h_singles() ) continue;
if ( n_singles() ) continue;
break;
}
This results in 14 steps to solve the puzzle.
- Code: Select all
Hidden Single = 1 r3c6,r6c4
Hidden Single = 3 r1c9,r2c2
Hidden Single = 7 r1c4,r6c2
Hidden Single = 9 r2c5,r8c3
Finished Step: 1
Hidden Single = 1 r5c3
Hidden Single = 5 r6c5
Hidden Single = 8 r1c8
Finished Step: 2
Naked Single = 4 r6c3,r8c1
Finished Step: 3
Hidden Single = 4 r1c2,r3c9
Finished Step: 4
Hidden Single = 4 r2c4
Hidden Single = 5 r1c3
Finished Step: 5
Naked Single = 6 r1c6,r2c8,r3c3
Finished Step: 6
Hidden Single = 6 r4c9,r5c5
Finished Step: 7
Hidden Single = 5 r4c8
Finished Step: 8
Naked Single = 3 r8c5
Naked Single = 4 r4c6,r7c5
Naked Single = 7 r5c9
Finished Step: 9
Hidden Single = 4 r5c8,r9c7
Hidden Single = 7 r8c7
Finished Step: 10
Hidden Single = 6 r7c7,r9c2
Hidden Single = 9 r5c6,r6c8
Finished Step: 11
Hidden Single = 2 r6c9
Hidden Single = 5 r9c9
Hidden Single = 6 r8c4
Hidden Single = 8 r6c7,r7c3
Finished Step: 12
Hidden Single = 2 r7c8
Hidden Single = 5 r8c2
Hidden Single = 8 r9c6
Finished Step: 13
Naked Single = 1 r7c2,r8c8
Naked Single = 2 r8c6,r9c3
Naked Single = 3 r5c7,r6c6
Naked Single = 5 r7c4
Naked Single = 8 r8c9
Finished Step: 14
Leading to a combined rating of (21+14) =
35 step_singles for your puzzle.