Welcome
Sudoku Explainer tries to cater for everyone who's interested in Sudoku
puzzles, from gromets up to Western European university professors, but the
focus is on hard (ie beyond a humans ability to solve) puzzles. The Solving
Techniques herein have been described as "old school". That's fine with me.
If you're having trouble reading this then right-click in this hint details
area to copy the HTML to the clipboard, paste it into temp.html and open it
in your browser, which will allow you to enlarge the font. The hints TreeView
(upper right) also has this right-click to copy feature. If the GUI fonts are
too small for you then all I can offer is Windows magnifying glass, it's in
accessibility settings. Sorry I can't be more help. GUI's just s__t me.
Sudoku Explainer shows you how to solve any Sudoku puzzle step by step,
explaining each solving technique as it's applied. It also allows you to get
all the hints (ie solving techniques) that can be applied to a
puzzle, and to apply any of them (singularly or multiply).
Sudoku Explainer solves "the worlds hardest Sudoku puzzle" according to
conceptis.com in 125.610 seconds with all A*E's enabled and unhacked on my i7
(see the Solving techniques section below for my config preferences):
8..........36......7..9.2...5...7.......457.....1...3...1....68..85...1..9....4..
(copy-and-paste this puzzle (Edit menu ~ Paste grid) then press F9 to analyse).
If you just want a bit of help with a puzzle then the first step is punching
it in. Either left-click on the small grey digit (the maybe) so set the cells
value, or with the keyboard: navigate to cell-to-set with the arrow-keys and
then press the value key (1..9).
If you stuff-up then Ctrl-Z goes back one step at a time. Spacebar, delete,
backspace, or 0 (zero) all clear the selected cells value. Ctrl-Y does a redo.
When you've got your whole puzzle punched-in do NOT forget to Ctrl-S for save
BEFORE you start solving it. A reload might be handy. I always forget to save.
Sigh.
If you get stuck press F5 for a hint. To apply that hint and get the next one
just press enter.
Anyway, that's probably enough to get you started. Have fun with it. Come back
and read the advanced stuff when you get bored.
Advanced Stuff
More "advanced" users will want to remove maybes (the cells potential values).
That's those small grey digits in the empty cells. To do that just right-click
on the small grey digit. With the keyboard: select the cell with the arrow
keys and then Ctrl-digit to remove/restore the maybe. You can't restore an
illegal maybe.
You'll notice that Sudoku Explainer enforces the basic rule of Sudoku:
"There will be one-and-only-one instance of each value in each region".
So when you punch a 7 into a cell then all the 7's disappear from the other
cells in it's box (the 3x3 thingummy), row, and col (column).
Sudoku puzzle books are all a bit soft (on an expert scale) so just seeing
the maybes could get you unstuck; but if not then press F5 to find a hint.
Then you can just press enter to apply that hint and get the next one, and
the next, and the next... Sudoku Solvered! Too Bloody Easy!
The following "frequently used" buttons are arranged along the bottom
of the form (I never use them. I do hope they still work):
- Clear hints clears the hints tree and refreshes the Sudoku grid.
- Solve step applies the selected hint (if any) and gets the next
(simplest possible) step in solving the puzzle. Click the [Solve step]
button again to apply the selected hint, and get the next one; or just
double-click on the hint in the hints tree, or click in the hintsTree (to
select it) and press enter. That's how to watch the Sudoku puzzle being
solved: Just Keep Pressing Enter! which takes all the fun out of it really.
Sigh. Except that this program can solve any Sudoku puzzle, even really
really really really hard ones (like conceptis's),
and it's a bit of a challenge to solve all possible Sudoku puzzles,
especially if you want to do it faster than everybody-else.
- Get next hint to get hints again without applying the current one.
Why would you do that? Because there's a button for it, obviously!
- Apply hint to apply the current hint, without getting the next
one. You can select multiple hints in the HintsTree and apply them all with
with this button; or Just Press Enter! Dunno why you'd actually do that,
but it's possible, because there's a button for it, which is nice, isn't it.
- Get all hints which can be applied to the current grid. Hold down
the shift key to get even more hints, but be forewarned, this can take a
a minute or three on my i7. The HintsTree is grouped by category &
hinter, in increasing order of difficulty. You'll need to expand each
category by clicking on it. Be warned that 20,000+ hints may be produced,
so the GUI can struggle a bit, especially when the "Filter hints" CheckBox
is NOT selected. It filters hints using the old "does it remove any NEW
maybes" trick. So if all of a-more-complex-hints actions (cells set &
maybes eliminated) are already covered by a simpler hint then the latter is
suppressed, which keeps the hint-count down, so the GUI doesn't struggle.
- It's also worth noting that the larger Aligned*Exclusion hints can take
several (maybe 5) seconds to DOM-parse because of profligate color tags.
A GUI programmer with HTML/styles knowledge could help here. I wouldn't
have a clue what a style is. I don't have any.
Some other stuff also worth a mention:
- File menu ~ load next Puzzle or just Ctrl-P loads the "next"
puzzle. The meaning of "next" depends on what you've got open. The .mt
files (magic-tour) are a multi-puzzle format, but next on a .txt file
opens the next text-file in the current directory. NOTE that when you
open the next puzzle Sudoku Explainer analyses the puzzle automatically,
which may take a while, depending on the difficulty of the puzzle and which
Solving Techniques you've got enabled.
- File menu ~ Reload (Alt-F-R) or just Ctrl-R reloads the saved
puzzle from disk. I find this really handy. It'll even let you try chaining
manually, if you're over 90, have a decade to kill, and are SERIOUSLY
sexually frustrated but find that you no longer have the manual dexte....
Never mind. Ctrl-R to reload the puzzle. OK?
- Tools menu ~ Reset Potential Values restores the maybes in the
current grid, which is handy if you bugger-it-all-up and want to restore the
grid to a valid state before trying again. But note that reset PV's doesn't
remove cell values, even if they're wrong.
- F6 - Get a clue points you towards the next step. Shift-F6 gives
you a bit more information (it's basically the hint for simpler techniques).
For harder techniques a clue is the help I think I should want when solving
a Sudoku manually because it tells me which technique to apply next,
allowing me to skip all the inapplicable techniques. What I actually use
is the hints, but I'm a programmer, so for me the challenge is writing the
code to produce the hints to solve all Sudoku puzzles, not solving A puzzle,
as I presume it is for most people. Clues are there if you want them.
- F7 - Check validity checks that there are no doubled values; that
each empty cell has at least 1 potential value; that all regions have a
possible location for each unplaced value; and finally that the Sudoku has
a unique (one and only one) solution. This is pretty handy. I'm not really
surprised at the prevalence of blatant (even basic, like 16 clues)
invalidities in published Sudoku puzzles. Morons in a hurry.
- F9 - Analyse tells you how hard the puzzle is, and gives you a
summary of steps which may be used to solve it. Note that this is far from
the only recipe which solves the puzzle, it's just a (not THE)
simplest possible recipe with the enabled Solving Techniques. There may be
other recipes that are shorter whilst not increasing difficulty. I'm not
seeking the shortest simplest path, just the simplest; because that's a lot
simpler. Yeah? A real guru could do better, I'm sure. I'm far too thick to
even contemplate an A* on edges this slow.
- Options ~ Solving techniques... allows you to select which Sudoko
solving techniques are applicable:
- Naked Singles, Hidden Singles and Dynamic Plus
are mandatory, so there CheckBoxes are checked and disabled. You can't
disable the singles, because they're fast and effective. Dynamic Plus is
the catch-all. It only fails to find a hint on "expert" level puzzles.
- Direct* is basically useless. When they're unchecked the hints
are still found by there non-direct equivalents, Direct just runs the
same algorithm twice on each pass, which takes a bit longer.
- Aligned Ally (that's two up from Diagon Ally):
- Aligned Pair is fast,
- Aligned Triple is fast enough,
- Aligned Quad is acceptable (I go unhacked),
- Aligned Pent is acceptable (I go unhacked),
- Aligned Hex is acceptable (I go unhacked),
- Aligned Sept is slow (I still go unhacked),
- Aligned Oct is too slow (I go HACKED here down),
- Aligned Nona and Dec are so ____ing slow that there's an APB
out on them from the School of Algorithmic Incontinence of the
Walgat College of Agriculture and Advanced Barnacle Polishing.
- WARNING: The "correct" Aligned Dec has been known to take 15 seconds
to NOT find a bloody hint, so just use the hacked version. A10E's are as
rare as chickens lips anyways. Any and all suggestions on how to do
Aligned*Exclusion faster will be gratefully accepted. "City life's made
him a bit slow, Redge... It's under the bonnet son."
- Wips & Chainers:
- The Chainers are now so fast (especially compared to the
Aligned*Exclusion debacle) that I really don't know why you'd bother
disabling them, except Nested* if you're impatient with Shift-F5.
I use all Chainers, but I deselect Nested*, except Nested Plus,
which is the ultimate catch-all.
- Unary Chain would be better named "Unary Chains and
Bidirectional Cycles" but that's just too bloody long. Dynamic Chain
finds Unary Chains, but not Bidirectional Cycles, which are "rare".
- Nishio Chain is when a single assumption has contradictory
ramifications (so the assumption must be wrong). I always use them.
- Multiple Chain starts from a cell with two or more
potential values. If you deselect Multiple then Dynamic takes a bit
longer, which tends to work-out faster overall. Go figure! I always
use them.
- Dynamic Chain removes maybes from the grid to track the
consequences of it's assumptions: so it can play "who's your daddy"
with assumptions. Dynamic Chain finds Unary Chains (but not Cycles)
and Multiple Chains. I allways use them.
- Dynamic Plus uses the Four Quick Foxes on top of "standard"
dynamic chaining. It only fails to find a hint on the worlds hardest
puzzles. Normal people can rely on it to ALWAYS find a hint. It's check
box is disabled so you can't disable it (unless you hack the registry).
- Nested Unary is only ever used in anger to analyse the worlds
hardest puzzles. "Normal" people can disable it with confidence.
- Nested Multiple/Dynamic/Plus Chains aren't ever used in
anger. They exist solely for the amusement of us afficionados. If you're
interested you can see them with Shift-F5, but be patient. I normally
run with Nested Unary/Multiple/Dynamic disabled. But I always leave
Nested Plus selected as the ultimate catch-all.
I should also mention the LogicalSolverTester, which solves a MagicTour
(.mt) file containing multiple (upto 9999) puzzles, just to see how quickly we
can do it, and optionally (with Log.MODE=VERBOSE_5_MODE) what hints apply to
each puzzle, which is how I find test-case puzzles.
- All timings are on an ~2900 Mhz intel i7 notebook solving top1465.d5.mt.
- As a baseline, the original Juillerat implementation took 22 minutes.
- In accuracy (default) mode, with all hinters enabled mine took 58 minutes.
- So Sudoku Explainer has a bit of an exclusion alignment problem: so we
disable Direct*, Hidden Quad, Naked Pent, Hidden Pent, and A4+E; to
bring it back to "the original hinters" and it takes 1:33, which is "fast
enough", IMHO.
Try the RecursiveSolverTester if what you're really after is solving
Sudoku puzzles quickly. It's Knuth's (IIRC) recursive algorithm, plus the Four
Quick Foxes, plus my Cell.set(AUTOSOLVE). It did top1465.d5.mt in about a
second, which is tantamount to FTL, IMHO. All I did was tune it up a bit.