Reviewing an old post: Understanding denis_berthier Whips

Advanced methods and approaches for solving Sudoku puzzles

Reviewing an old post: Understanding denis_berthier Whips

Postby RichardGoodrich » Mon Jun 23, 2025 2:20 pm

This is an ON-GOING Post - so be patient! Memories (I must be bored while waiting on some answers from this forum!)
[edited Wed June 25, 2025]

Q: What is the difference between theory and practice?
A. In theory they are the same thing.

I will call Denis Berthier (alias denis_berthier on this forum [TNSPF]: DB for the sequel (Started using that term from reading his book: HLS2)

I actually bought that book from Amazon on Oct 31, 2012. Yep, paid full price! Gave it perhaps it's first positive review - 5 stars! Why? Well until then it got poor reviews. Here was my review after struggling to read it for a long time!

5.0 out of 5 stars Seminal Book on solving Sudoku!
Reviewed in the United States on October 30, 2016
Format: PaperbackVerified Purchase
No, it is not an easy book and not one for everyone. However, if you are really into Sudoku and have enough "smarts" and will power to work through the book, it is the ONLY systematic approach to the game available as a "dead tree" book. Denis Berthier has excellent web pages with supplemental material also. He he has a high degree of rigour in his book. Unfortunately it will be mostly folks with good math, computer science, and logic skills that will make the attempt. The BIG thing for me was the realization that chains can be treated as PATTERNS vs INFERENCE rules, and yes it does make a difference. And finally understanding - just recently - how Whips work makes it even more valuable to me. Of course the 4-grid views that transform 3D views of a Sudoku Puzzle into a set of 2-D views is also a pioneering approach. I just wish I could communicate with Denis Berthier as I have gotten into his next book "Pattern-Based Constraint Satisfaction and Logic Puzzles" in which he further develops what he started here. Richard Goodrich


Up until my review, most reviews were very negative! "TOO hard to read" was the main theme. I took that as a challenge - and what a challenge. My philosophy at that point was who wants pablum and I said so! I wanted a book with "content". I had plenty of "easy to read" books.

Well I wore that think out! I recovered it as a hardback. Just recently I fixed that hardback again! [I should make a video of the poor thing!]
I have made my own indexes to it and glued them into the end pages of the book.... The story goes on.

However, I want to review one of my early posts on trying to understand DB's whips . These were NOT in HLS2, but the idea of his Lassoes did take up most of a page (p344 of HLS2). Later DB generalized and subsumed them with his theory of whips. I have friends on this forum that still don't understand them and sometimes I am still NOT sure I do - but am getting there. So I have learned quite a bit since that post [I hope] and want to re-analyze that old post [for fun and grins] and see if I got any new insights?

*************************************************************************************************************************> So Let's review:
Code: Select all
   So as a reminder DB grids:   rcn, rnc, ncr, bns
   NOTE:    ncr was originally cnr
   ncr is simply visually more appealing in creating a "sudoku board"      refer to:  HLS2, p41   

DB called the use of those 4 grids an extended sudoku board. For "short" I called it: sudoku board or just board.

I sometimes found using an alternative grid naming of crn, nrc, cnr, nbs convenient when trying to "form" my own "more clear" trace notation. Mostly I have abandonded it as just too much to keep up with! DB preferred his own notation - which of course - called all kinds of havoc on this forum [and probably still does!]. Being an r&D digital hardware design engineer, I did NOT mind so much! Afterall as a "research" engineer I was always doing that myself! ]DB claims to have invented "nrc" notation (maybe he did for his own purposes). However, [my guess] is that it already existed on sudopedia which I understand was created by Ruud. Actually DB did NOT mean that - Yes he told me so! DB was not implying order with the nrc notation He was just adding the n period! Open hidden section below for more detail

Details on DB's nrc notation
Hidden Text: Show
Perhaps an example:
In my xyz system a reference in the rcn grid would be given this way.
Consider then two cells in row 3, columns 4 and 5 with the values(numbers in this case) 2 & 7

I prefer to reference that: r3c45n27 Some might want to say n27r3c45 to say the n's 2&7 in row 3 columns 4 and 5.
I would look at the order of the letters in that and think this was the nrc grid and the entries were columns 4 & 5 in
at the xy coordinates of x = nums 2 & 7 and y = row 7 Where the rows of this grid are really n's and the cols are r's.

I thought by nrc notation DB was proposing n27r3c45

Part of my confusion was eureka notation where this would be: 27r3c45

I "assume" [once again!] that eureka notation was in the context of just the rcn grid! When the other three grids are added to the system then adding the n becomes important! And in biG's canon I could distinguish the grid by the order of the letters!

Now to make things more clear [hopefully]: If I was not just refering to that as a couple of cells, but as a naked pair, I would do this:
n2:r3c45n27 If I was in the cnr grid I could have a "naked pair" of rows. e.g. n2:c1n3r23 would mean that from the viewpoint of the cnr grid this was rows 2 & 3 as entries cn-cells in column 1, number 3 (as in a xyz graph the x = col and the y = num)

BTW, to be concise I prefer adding the prefixixes n2, n3, n4 to replace the more wordy naked pair | np, naked triple | nt, nake quad | nq[/b]

Similarly hidden equivalents would be h2: h3: h4: as prefixes. Number just make the # of candies involved so much more clear!

More on my biG notation when I finally the "guts" to post it!


I may prefer "rcn" notation because of the other grids. Perhaps more generally we should have called it the "xyz" system as in graphing the x,y,z ?

Where x,y,z became r,c,n as the "normal" notation and n,c,r for grid = ncr and so forth! However it seems EUREKA was there first!

So with this particular post [my theory] was that DB was trying to explain whips and their usefullness! There are certainly other [more compact] ways to trace a solution to this puzzle via subsets and block/line interactions

So, I find it a pain to navigate this forum. But, here goes:

In Nov of 2013: Topic/Thread began here: http://forum.enjoysudoku.com/post231089.html#p231089
Code: Select all
     A specific application of Whips
     by RichardGoodrich » 2013 Nov Wed 06, 2013 9:54 pm

My specific initial post if you want to get there that way [multiple ways!] is: http://forum.enjoysudoku.com/post231089.html#p231089

After various replies, DB finally responded in Mar of 2014. Perhaps in a certain amount of frustration with his "Complete Solution"
http://forum.enjoysudoku.com/post235395.html#p235395

HoDoKu will be my reference Application for the following. And I will use EUREKA notation to explain whips
****************************************************************************************************************************************> So Let's Go
Few things are harder to put up with than the annoyance of a good example. -Mark Twain
biG's morph:: Few things are harder to find than good examples


biG wrote:I am nunbering DB's steps and then giving my substitution in BLUE (showing casing my 'new' notation) Don't just read this! Use HoDoKu to follow each step. Else it really does not make much sense! Sudoku like math is something you do! You don't just read it! This is play together time!

23 clues, 58 unsolved

Current and Final States - SPOILER ALERT
Hidden Text: Show
Code: Select all
.16..5....7.4.9.....98....4.4.....29...54.....2..6.1.8..1....3.......6.5....8....
416325897872419356359876214647138529198542763523967148781654932234791685965283471

c1 = 1  2  3   4  5  6   7  8  9    c1 = 1  2  3   4  5  6   7  8  9
    .---------.---------.---------.     .---------.---------.---------.
 r1 | .  1  6 | .  .  5 | .  .  . |  r1 | 4  1  6 | 3  2  5 | 8  9  7 |
 r2 | .  7  . | 4  .  9 | .  .  . |  r2 | 8  7  2 | 4  1  9 | 3  5  6 |
 r3 | .  .  9 | 8  .  . | .  .  4 |  r3 | 3  5  9 | 8  7  6 | 2  1  4 |
    :---------+---------+---------:     :---------+---------+---------:
 r4 | .  4  . | .  .  . | .  2  9 |  r4 | 6  4  7 | 1  3  8 | 5  2  9 |
 r5 | .  .  . | 5  4  . | .  .  . |  r5 | 1  9  8 | 5  4  2 | 7  6  3 |
 r6 | .  2  . | .  6  . | 1  .  8 |  r6 | 5  2  3 | 9  6  7 | 1  4  8 |
    :---------+---------+---------:     :---------+---------+---------:
 r7 | .  .  1 | .  .  . | .  3  . |  r7 | 7  8  1 | 6  5  4 | 9  3  2 |
 r8 | .  .  . | .  .  . | 6  .  5 |  r8.| 2  3  4 | 7  9  1 | 6  8  5 |
 r9 | .  .  . | .  8  . | .  .  . |  r9 | 9  6  5 | 2  8  3 | 4  7  1 |
    '---------'---------'---------'     '---------'---------'---------'
.----------------------.-----------------------.--------------------.
| 2348     1     6     | 237     237    5      | 23789  789    237  |
| 2358     7     2358  | 4       123    9      | 2358   1568   1236 |
| 235      35    9     | 8       1237   12367  | 2357   1567   4    |
:----------------------+-----------------------+--------------------:
| 135678   4     3578  | 137     137    1378   | 357    2      9    |
| 136789   3689  378   | 5       4      12378  | 37     67     367  |
| 3579     2     357   | 379     6      37     | 1      457    8    |
:----------------------+-----------------------+--------------------:
| 2456789  5689  1     | 2679    2579   2467   | 24789  3      27   |
| 234789   389   23478 | 12379   12379  12347  | 6      14789  5    |
| 2345679  3569  23457 | 123679  8      123467 | 2479   1479   127  |
'----------------------'-----------------------'--------------------'


DB in step 1 wrote:singles ==> r7c5 = 5, r8c5 = 9, r6c4 = 9, r6c8 = 4, r4c7 = 5, r5c6 = 2, r5c1 = 1, r5c2 = 9, r4c1 = 6, r5c3 = 8, r4c6 = 8, r3c6 = 6, r1c1 = 4, r2c1 = 8
1. 755,859,649,684,475,562,511,529,416,538,468,366,114,118


After Singles this is the new state
Hidden Text: Show
Code: Select all
.-------------------.-------------------.------------------.
| 4      1    6     | 237    237   5    | 23789  789  237  |
| 8      7    235   | 4      123   9    | 23     156  1236 |
| 235    35   9     | 8      1237  6    | 237    157  4    |
:-------------------+-------------------+------------------:
| 6      4    37    | 137    137   8    | 5      2    9    |
| 1      9    8     | 5      4     2    | 37     67   367  |
| 357    2    357   | 9      6     37   | 1      4    8    |
:-------------------+-------------------+------------------:
| 279    68   1     | 267    5     47   | 24789  3    27   |
| 237    38   2347  | 1237   9     1347 | 6      178  5    |
| 23579  356  23457 | 12367  8     1347 | 2479   179  127  |
'-------------------'-------------------'------------------'

I am trying to keep notation concise, especially on singles, with just comma separation and no spaces. This implies the rcn grid. Instead of saying r7c5=n5: 755 simplies setting it. By the same token: instead of r7c5-n5: 75-5 removes a 5. I prefer simple one letter symbols like the minus sign for a removal vs the more complicated ≠i (not equal)] symbol (hard to find on my keyboard). I also number my lines so that the next line with begin with 15. So, a bit of mental math indicates 14 singles have been set.

DB in step 2 wrote:whip[1]: c5n2{r1 .} ==> r1c4 ≠ 2
15. 2r123c5 = 2r1c4 - 2r678c2 => r1c4 ≠ n2 (contradiction: No 2's left in block 8)


Now the blue line above is my attempt at Keeping-It-Simple-Sudokie [KISS] eureka notation where the = is a strong link and the - is a weak link. Notice the n is not used before that first 2 as that is understood If I was writing that in my biG notation it would appear as: (r123c5n2, r1c4n2) * (b8s147n2, b8sXn2) > X > 14-2

Where the * is my only link symbol and it is always a weak link. The strong link always appears in the round brackets (which are usually not needed for simpler epressions. The unasserted value always appears first. Then the comma (again not needed on simpler expressions) which is followed by the asserted part of the link. I use the X to express either contradiction or unkown. I could have used ?. In the past I have used the digit 0 to express the same thing. The > is my concise one-letter expression for the implication symbol =>. Also I am assuming that from that you know there is no 2s left in b8 and that r1c4 can't be n2 (thus 14-2) (In the sequel I will give simpler examples of my biG chain notation

Now what is even more telling is that I would have expressed this simpler as just a locking candidate - pointing which I would encode as: p2:b8n2 > 14-2. As a matter of fact if we are playing on with HoDoKu just leave off the > part. HoDoKu knows how to do the removals. You may just want to copy the candidates diagram after a step to show the new state of the puzzle. That of course become a matter of personal prefence as to how often! You are following along on HoDoKu aren't you!

This is just the first of many examples on how whips as a type of chain can be used to express subset or fishy patterns. The problem is that it takes more complicated and/or longer chains to express what could be more easily expressed as a pattern. I can only assume DB used whips here to illustrate their "resolving power" We will see in the sequel how it takes several whips to express such things as a naked triple

****************** Step 3 (I know it is slow, but should speed up soon)

DB in step 3 wrote:whip[1]: c6n1{r9 .} ==> r9c4 ≠ 1
16. c2:b8c6n1( > r89c4-n1) Do you really need that part in round brackets ?


OK, now I am NOT playing along with that whip thing! This is a simple claim. In biG notation I start pointers with either p2: or p3: Claims start with c2 or c3. (I prefer candie to candidates because it is shorter and easier to spell and as John Welch would point out - after all all candidates "can die") Now I could have used just p or c. But, I likethese 2 letter expressions. I use the : symbol as the start of a prefix where the following p is a reference to a pointing vector. Similarly the c is a reference to the claim vector . The 2 or 3 digit that comes next refers to the number of candies in the [claiming or pointing vector

Now I still have NOT explained DB's whip notation. It would be helpful to understand at this point the DIC idea of a chain. I so want to make a perjorative out of that acronym by adding a k for those so-called purists who think this is the ONLY type of chain that should be used! DIC is a Double Implication Chain. Sometimes it is called a reversible chain It would be good to review this on sudopedia, etc. The period in DB's notation is a bit harder to explain! But I will try.

The key idea for chains in general is the idea of removing one or more candies. When creating a full chain it sometimes occurs that a contradiction occurs before closing the chain. Whips are all about short chains that produce contradictions. The DIC idea
also comes into play! And don't misunderstand! The DIC noation is powerful and beautiful! In fact this whole chains and nets thing is so hard to grasp that I will refer us to Andrew Stuarts explanation (with colored diagrams https://www.sudokuwiki.org/Introducing_Chains_and_Links I really need to do a POST on chains/nets for both terminology purposes and action of both chains and nets of all kinds - including forcing!

Many DIC's start with the unasserted target of the removal or else right away the target is eliminated - One and Done! These
are also by DB's definition and my preference also Open Chains. These are NOT loops like in Nice Loops - more complicated and hopefully obsolete. And the end of the DIC has the target value asserted so that the target/s that see (linked to is a bit more professional sounding) to both ends of this DIC can be be removed But what if that DIC does not get to that asserted target. And it really does NOT need to start with the unasserted target value. Best to see some examples. Let's look at this one.

Now it appears at this point DB has abandoned the nrc notation. Perhaps he repented later! c6n1{r9 .} ==> r9c4 ≠ 1
Code: Select all
.-------------------.-------------------.------------------.
| 4      1    6     | 237    237   5    | 23789  789  237  |
| 8      7    235   | 4      123   9    | 23     156  1236 |
| 235    35   9     | 8      1237  6    | 237    157  4    |
:-------------------+-------------------+------------------:
| 6      4    37    | 137    137   8    | 5      2    9    |
| 1      9    8     | 5      4     2    | 37     67   367  |
| 357    2    357   | 9      6     37   | 1      4    8    |
:-------------------+-------------------+------------------:
| 279    68   1     | 267    5     47   | 24789  3    27   |
| 237    38   2347  | 1237   9     1347 | 6      178  5    |
| 23579  356  23457 | 12367  8     1347 | 2479   179  127  |
'-------------------'-------------------'------------------'


Consider c6n1{r9 .}
So in the state of our current grid above: c6 has 1's only in r8 and r9. Also while not indicated in the notation itself - (guess you just got to know the state of the puzzle?), this chain action is happening only in b8. The idea of "grouped" candidates in a chain is also here. So we start out as in chain notation with unasserted values. By DB's notation we are starting with r9c6 but by use of the period . there could be other candies unasserted - indeed in this case we are unasserting r8c1 aslo. And it could have been r7c1 as well - hypotetically. So the period implies these other rows too are grouped and even the asserted part of this chain has multiple candies in c5. There are two there. Only one could be asserted and it does not matter which one. So perhaps the period indicates this also. And the result of this is that r9c4-n1. The problem for me is this is just a bit too concise. I would express this as (b8n2s69, b8n2s47) > r4c4-n1 or simply 44-1

Some object (including DB to using bns notation vs rcn) but rcn notation becomes even longer and more complicated. AND if we are following along in HoDoKu it should not be a problem! You can see that b8n2s47 is by another name is r89c4n2. And context matters too! As the asserted part of the chain this means either just one of r8 or r9. I this was then unasserted part of the chain it would mean both r8c4 and r9c4 are being removed!

Anway - just sticking to the chain idea eureka could express this as: 1r89c6 = 1r89c4 => r4c4 ≠ n1 (I hate that ≠ synbol! - is much easier! OR what I prefer p2:b8c4n2 (read it as pointing vector (of length 2) in (intersection) of b8 and c4)


This is getting so long I should continue in another POST - This is more to learn about these Whips!
Last edited by RichardGoodrich on Wed Jun 25, 2025 5:41 pm, edited 8 times in total.
Big1952
RichardGoodrich
 
Posts: 113
Joined: 12 December 2012
Location: Josephine, TX (north of Dallas, TX)

Re: Reviewing an old post: Understanding denis_berthier Whi

Postby denis_berthier » Tue Jun 24, 2025 3:28 am

Hi Richard
Thanks for your review of [HLS].

A few comments:

RichardGoodrich wrote: So as a reminder DB grids: rcn, rnc, ncr, bns
NOTE: ncr was originally cnr

I have always used nrc is this order and the 4 2D-spaces have always been rc, rn, cn and bn.
For the rc-space, there is an alternative basis bs based on blocks, with precise change of coordinates given in [HLS], but that doesn't change the 4 spaces.

RichardGoodrich wrote: DB claims to have invented "nrc" notation (maybe he did for his own purposes). However, [my guess] is that it already existed on sudopedia which I understand was created by Ruud.

Using letters r, c for columns was quite universal. Using n for digits was inexistent; the notation was 1r2c4 not n1r2c4. Which led to the totally inconsistent Eureka notation in case one had to express "conjugate candidates". I've been enough attacked about the nrc notation to have no doubt about who invented it.
But the nrc notation is just the visible part of the iceberg. It is based on the universal notation of {CSP-Variable, value} pairs.


RichardGoodrich wrote:
DB in step 2 wrote:whip[1]: c5n2{r1 .} ==> r1c4 ≠ 2
15. 2r123c5 = 2r1c4 - 2r678c2 => r1c4 ≠ n2 because: contradiction: No 2's left in block 8

Now the blue line above is my attempt at Keeping-It-Simple-Sudokie [KISS] eureka notation where the = is a strong link and the - is a weak link. Notice the n is not used before that first 2 as that is understood If I was writing that in my biG notation it would appear as: (r123c5n2, r1c4n2) * (b8s147n2, b8sXn2) > X > 14-2
Now what is even more telling is that I would have expressed this simpler as just a locking candidate - pointing

We don't have the same idea of simplicity.
I spent a full chapter of [HLS1] to prove that pointing and claiming are special cases of the universal whip[1] pattern. Whereas pointing and claiming can hardly be generalised to other games, whips[1] can - and they can in ways that make them look totally different of pointing and claiming. You must study the Kakuro CSP in [PBCS2] in order to fully understand how powerful they are. For a simpler example, see Pandiagonal Latin Squares.

I've written it time and again, but I think it needs to be recalled here:
The fundamental idea of a whip[1] is: if a candidate is linked to all the remaining candidates of a CSP-Variable; then it is impossible (and it can be deleted).
I would say this is the most important step in understanding whips. Longer whips are just an extension of this idea. Any contradiction in a whip is due to the final CSP-Variable having no possible value if the target was true.
In Sudoku, whips[1] unify two apparently different patterns (pointing and claiming).
[HLS] has only nrczt-chains and lassoes. It misses the unifying concept of a whip, which appeared only in [BRT].


RichardGoodrich wrote:This is just the first of many examples on how whips as a type of chain can be used to express subset or fishy patterns. The problem is that it takes more complicated and/or longer chains to express what could be more easily expressed as a pattern. I can only assume DB used whips here to illustrate their "resolving power"

Whips[1] can't "express" Subsets. One needs longer whips.
What I've proven is, whips[2] subsume Subsets[2], whips[3] subsume "most" Subsets[3] but not all, whips[4] subsume "most" Subsets[4] but not all.
By Subsets, I mean all 3 kinds, Naked, Hidden and Super-Hidden (Fish). (It can't be otherwise, because whips enjoy super-symmetry.)


RichardGoodrich wrote:Now it appears at this point DB has abandoned the nrc notation. Perhaps he repented later! c6n1{r9 .} ==> r9c4 ≠ 1

This is pure nrc notation!
.
denis_berthier
2010 Supporter
 
Posts: 4510
Joined: 19 June 2007
Location: Paris

Re: Reviewing an old post: Understanding denis_berthier Whi

Postby RichardGoodrich » Tue Jun 24, 2025 6:56 pm

Hey DB,

Thanks for the response! Not ready to go into great detail on every detail of your response. However, I do now realize that what you mean by "nrc" notation is NOT what I thought you meant [I think]. I was thinking you were implying order when you were not. I think now you mean just adding "n" to notation when the eureka notation left it totally out. - [Deleted the rest as just TOO LONG!]
Big1952
RichardGoodrich
 
Posts: 113
Joined: 12 December 2012
Location: Josephine, TX (north of Dallas, TX)


Return to Advanced solving techniques