Decoding Hodoku Chain Notes

This post comments on the first part of the Hodoku “Chains and Loops” page. It reveals the premise dependent view of chains to be based on computer coding, and unsuited for human solving advice. It explains Hodoku’s chain notations as a paraphrase of the code for chain following.

Bernhard Hobiger begins the Hodoku Chains page with a general introductory section applying to all forms of alternating inference chains. Too bad this important page begins with, “What is a Chain?”, a series of mistaken pronouncements that confuse Sudoku computer solving with human solving. It begins with

“A chain is simply a stream of implications that lead from a premise [e.g. candidate x in cell y is not set] to a result.”

If you are a computer, this is true.

Hodoku XY wingHobiger’s first chain example is the XY-wing.

Sysudokies represent the 57-wing eliminating 2r2c6 in black as an XY-chain, which it is. As if to emphasize that, this chain can be extended to an AIC ANL knocking out another candidate.

Hodoku explains the chain first as an XY-wing, saying, with my annotations:

XY wing“Cell r1c3 (the pivot) contains candidates 5 [X] and 7 [Y]. Cell r1c6 shares row 1 with (sees) the pivot and contains candidates 5 [X] and 2 [Z], cell r2c1 shares box NW with (sees) the pivot and contains candidates 7 [Y] and 2 [Z]. Cell r2c6 (victim) sees both pincers (r1c6 and r2c1). It cannot contain 2 (Z).”

Once you get past cells seeing each other – which they don’t – this matches the rule for an XY wing. It would help to include a schematic in  Hodoku here, and to prove the rule somewhere.

But to Hobiger, this wasn’t enough. Hodoku adds this: 5r1c3 =>2r1c6; 7r1c3 => 2r2c1. Guided by my previous post, we can immediately recognize this to be XY-wing detection code, a simplification of XYZ-wing detection code.

By preceding this with “The logic is simple:”, Hobiger is claiming that playing computer this way is easier than just recognizing the wing and its toxic set and noticing that 2r2c6 sees both wing cells. Considering how often this logic fails to uncover a wing, this claim is extremely misleading.

But somehow, this wasn’t enough. Hodoku adds his paraphrase of chain following code:


Well, not exactly. I think the programmer has to actually tell the computer about the bv slinks, so the more accurate paraphrase might read:

(r2c1<>2) => (r2c1=7) => (r1c3<>7) => (r1c3=5) => (r1c6<>5) => (r1c6=2)

This is known to students of Sudoku as the way you prove that one of the matching slink terminals of an AIC is true. Once you are convinced of this fundamental fact, you construct chains, re-use them at will, and never follow the alternating inference node by node again.

But Hobiger seems unconvinced by the XY-wing rule (theorem) or the “AIC end” rule (theorem). He leaves that impression when, while applications of chains as links abound in Sudoku, Hodoku can include the statement quoted above, and can explain complex chains by writing out chain following notations.  It’s the common failing of being too close to your work.

In computer code, you write a routine to follow an inference chain, given a premise derived from the technique at hand. This premise is not arbitrarily chosen, like the one’s Hodoku seems to be recommending when he omits the purpose of the code he is paraphrasing.

The routine may explore many branches of the chain before returning a result. The chain itself is not saved, only the result. Later, to search for something else, the same chain may be followed again and again.

This is the only way a computer code can deal with the logical reality of a chain, by always repeating it exactly from the same starting point. To a computer, a chain is the corresponding chain-following routine, not an object that we picture on the grid.

Human Sudoku solvers are not so limited. They regard chains as objects. They don’t require a simple premise to trigger their “follow chain” routine. They can assemble a chain from dissimilar parts and from any promising starting point. They can construct a chain to satisfy a higher purpose, without having to check out every possible branch. And to humans, following the same chain again and again is insanely inefficient.

Hodoku grp AIC 4 471wingHere is an example from Hodoku, illustrating the higher purpose of the premise leading humans to find chains. It was presented on Hodoku to illustrate a grouped AIC chain, but it would never have gotten that far in sysudokie territory. A 471-wing is found on the sysudokie XYZ-map, but in a configuration with no possible unit-wink victims. But 1r2c5 and 1r9c8 see two wing 1’s. A chain from 1r9c8 to 1r4c2 fails, but 1r2c5 has a grouped 1-chain view of 1r9c9, and has to vacate the premises. The Hodoku premise would have been “1r2c5 is true”.

Scan back over the last few posts, to see chains used extensively in URs, XYZ-wings, ALS-XZs and color wraps. In Hodoku Techniques, however, chains are limited to direct eliminations and confirmations. They do not function as winks and slinks in other methods.

Except for one other purpose. Bernhard manages to make another error of fact in the innocent looking statement above, and immediately amplifies the damage. He says that the purpose of a chain is to prove or disprove a simple logical premise that a candidate is true (“set” in Hodoku speak) or false. He does not refer to any purpose of the premise in the current task , misleading many to conclude that you just make it up. Then he deliberately throws logic under the bus, with “If a chain does not produce a contradiction, it proves nothing.”

I’d like to excuse Hobiger by saying that he only forgot to explain what he meant by “contradiction”. But Bernhard makes that impossible, advising that if the chain does not produce a contradiction, try the opposite premise. Now it’s just “pick a candidate and try a value”. We try to convince beginners not to forego the true pleasure of Sudoku by doing that, and here is a computer solving expert carelessly promoting it.

The general lesson is, be especially wary of what computer programmers advise you to do. They may be coding and you’re not a computer. That explains the Hodoku notes on XYZ-wings, and it explains many of the other chain following notations in Hodoku. I’ll not be parsing any more of them . Instead, I will try to identify the logic by which a human solver is motivated to find the chain in the excellent Hodoku examples.

Not all Sudoku programmer/writers suffer from this occupational hazard. Andrew Stuart, on his very informative site, and in The Logic of Sudoku, is a notable exception. Bob Hanson, in his explanation of Student Assistant, sought to refine human solving methods.

OK, we got past “What is a Chain?” The next post examines the Hodoku chain mechanics and examples on chain links and nodes

About Sudent

I'm John Welch, a retired engineering professor, father of 3 wonderful daughters and granddad to 7 fabulous grandchildren. Sudoku analysis and illustration is a great hobby and a healthy mental challenge.
This entry was posted in Expert Reviews, Hobiger and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s