## g-whips and g-braids

Advanced methods and approaches for solving Sudoku puzzles

### g-whips and g-braids

hinged- whips and braids (together with other extended kinds of whips and braids) were first defined in 2008, Oct 17, in the "fully supersymmetric" thread, page 14. (http://forum.enjoysudoku.com/fully-supersymmetric-chains-t5591-195.html)

The precise definition of the T&E procedure, the T&E vs braid theorems, and various classification results for braids of various kinds can be found in the "Abominable T&E" thread (http://forum.enjoysudoku.com/abominable-trial-and-error-and-lovely-braids-t6390.html)

In this thread, I want to develop the case of hinged- whips and braids, which I also called formerly whips(BI) and braids(BI), or also grouped- whips and braids. Now, I'll simply call them g-whips and g-braids (this notion of "grouped" corresponds to the use of the word "group" in AICs, not to the use of "group" as meaning "subset"). They are the simplest extension of whips and braids, allowing to deal with hinges.

More precisely, we take a very simple family of patterns: FP = {segment-candidates}
In the same way as candidates are the right linking objects in whips and braids, segment-candidates are the right linking objects in g-whips and g-braids.

A segment candidate, typically written n1r1c123, is a set of 2 or 3 candidates n1 present in the cells r1c1, r1c2, r1c3 (if there is only one candidate n1 in these 3 cells, then we just have to consider a mere candidate).
Segment-candidates are nrc-linked to only few candidates. Let me recall the definition: Segment-candidate n1r1c123 is nrc-linked to candidate nrc iff n1=n and
- either r = r1 and c <> c1, c2 and c3
- or r <> r1 and rc and r1c123 are in the same block.

Remember also that in extended whips or braids, left linking candidates remain candidates, they don't have to be generalized.

It is a side effect of my new version of SudoRules that it is now easy to program g-whips.
In this thread, I plan to give a few examples and results. (You can already find an example in the second post of the "more on whips, braids, T&E ..." thread)
Last edited by denis_berthier on Sun Mar 27, 2011 11:26 am, edited 1 time in total.
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### GW-rating vs W-rating

Associated with g-whips, one can define a GW rating of a puzzle P: it is the length of the longest g-whip necessary to solve P.
Of course, as g-whips are an extension of whips, we must have GW(P) <= W(P) for any puzzle P.

The first natural question is: how does this rating differ from the W-rating associated with ordinary whips? And the answer is: surprisingly little.

Based on 21371 puzzles generated by the controlled bias generator, I found only 49 cases with GW(P) < W(P). This is a proportion of 2.3/1,000. In most of these cases, the difference was 1. In 3 cases, the difference was 2. In 1 case, the difference was 5. I haven't yet explored the reason for this large difference.

Of course, having a lower rating is not the only advantage of adding g-whips.
g-whips allow to solve puzzles that can't be solved with whips (or braids). Notice however that such puzzles will be very exceptional, as "almost all" randomly generated puzzles can be solved with whips (for details, see the "more on whips..." thread).
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### An example of a puzzle solved by g-whips but not by whips

I'll consider here Arto Inkala's "AI broken brick" (SER = 9.6):
4...6..7.......6...3...2..17....85...1.4......2.95..........7.5..91...3...3.4..8.

Code: Select all
`+-------+-------+-------+ | 4 . . | . 6 . | . 7 . | | . . . | . . . | 6 . . | | . 3 . | . . 2 | . . 1 | +-------+-------+-------+ | 7 . . | . . 8 | 5 . . | | . 1 . | 4 . . | . . . | | . 2 . | 9 5 . | . . . | +-------+-------+-------+ | . . . | . . . | 7 . 5 | | . . 9 | 1 . . | . 3 . | | . . 3 | . 4 . | . 8 . | +-------+-------+-------+ `

Using the T&E(FP) procedure, it is easy to check that this puzzle is not in T&E(NS+HS) (and it has therefore no chance of being solvable by braids, let alone by whips). But it is in T&E(NS+HS+BI) and it can therefore be solved by g-braids. Let's try to do better and solve it with g-whips:

Code: Select all
`*****  SudoRules version 15b.1.8-GW  *****4...6..7.......6...3...2..17....85...1.4......2.95..........7.5..91...3...3.4..8.23 givens and 219 candidateshidden-single-in-a-column ==> r2c6 = 4interaction column c3 with block b1 ==> r2c2 <> 7whip[4]  b4n5{r5c3 r5c1} - b4n9{r5c1 r4c2} - r2c2{n9 n8} - r1c2{n8 .} ==> r3c3 <> 5whip[4]  b4n5{r5c3 r5c1} - b4n9{r5c1 r4c2} - r2c2{n9 n8} - r1c2{n8 .} ==> r2c3 <> 5whip[4]  b4n5{r5c3 r5c1} - b4n9{r5c1 r4c2} - r2c2{n9 n8} - r1c2{n8 .} ==> r1c3 <> 5hidden-single-in-a-column ==> r5c3 = 5whip[9]  r6n7{c9 c6} - b5n1{r6c6 r4c5} - r4n3{c5 c4} - b5n6{r4c4 r5c6} - r8c6{n6 n5} - r9c6{n5 n9} - r7n9{c6 c8} - r5c8{n9 n2} - r4n2{c8 .} ==> r6c9 <> 3whip[10]  b1n6{r3c1 r3c3} - r4c3{n6 n4} - r6c3{n4 n8} - r6c1{n8 n3} - b4n6{r6c1 r4c2} - c4n6{r4 r7} - b9n6{r7c8 r8c9} - c9n4{r8 r6} - r6c7{n4 n1} - r9n1{c7 .} ==> r9c1 <> 6whip[13]  b1n6{r3c1 r3c3} - r4c3{n6 n4} - r6c3{n4 n8} - r6c1{n8 n3} - b4n6{r6c1 r4c2} - c4n6{r4 r9} - r8n6{c6 c9} - c9n4{r8 r6} - r6c7{n4 n1} - c6n1{r6 r1} - r1c3{n1 n2} - r7c3{n2 n1} - r9n1{c1 .} ==> r7c1 <> 6whip[13]  c6n5{r8 r1} - r1n1{c6 c3} - r2n1{c1 c5} - b5n1{r4c5 r6c6} - c7n1{r6 r9} - r9c1{n1 n2} - b1n2{r2c1 r2c3} - b1n7{r2c3 r3c3} - b1n6{r3c3 r3c1} - r3n5{c1 c8} - r2c8{n5 n9} - c1n9{r2 r5} - c7n9{r5 .} ==> r9c4 <> 5interaction column c4 with block b2 ==> r1c6 <> 5whip[15]  r4c3{n6 n4} - r6c3{n4 n8} - r3c3{n8 n7} - b1n6{r3c3 r3c1} - b4n6{r5c1 r4c2} - c4n6{r4 r9} - r8n6{c6 c9} - c9n4{r8 r6} - r6n7{c9 c6} - r8c6{n7 n5} - r9c6{n5 n9} - r7n9{c6 c8} - b9n1{r7c8 r9c7} - r6n1{c7 c8} - r6n6{c8 .} ==> r7c3 <> 6g-whip[15]  c7n1{r9 r6} - c6n1{r6 r1} - c5n1{r2 r4} - c8n1{r4 r7} - b9n9{r7c8 r9c9} - c6n9{r9 r7} - c6n3{r7 r456} - r4n3{c4 c9} - b3n3{r2c9 r1c7} - r1n9{c7 c2} - r4n9{c2 c8} - r2n9{c8 c5} - b2n3{r2c5 r2c4} - r2n7{c4 c3} - c3n1{r2 .} ==> r9c7 <> 2g-whip[18]  r4n1{c8 c5} - b2n1{r2c5 r1c6} - c6n9{r1 r789} - r7n9{c5 c6} - c6n3{r7 r456} - r4n3{c4 c9} - r4n2{c9 c4} - r5c5{n2 n7} - b6n7{r5c9 r6c9} - c9n4{r6 r8} - r8c7{n4 n2} - r8c5{n2 n8} - r3c5{n8 n9} - r2c5{n9 n3} - r1n3{c6 c7} - c7n9{r1 r9} - r9n1{c7 c1} - r9n2{c1 .} ==> r4c8 <> 9whip[5]  r4n9{c9 c2} - r1n9{c2 c6} - c6n1{r1 r6} - c7n1{r6 r9} - r9n9{c7 .} ==> r2c9 <> 9g-whip[10]  c5n1{r2 r4} - c6n1{r6 r1} - b2n3{r1c6 r123c4} - r4n3{c4 c9} - r4n9{c9 c2} - r2c2{n9 n5} - r1c2{n5 n8} - r1n9{c2 c789} - r2c8{n9 n2} - r2c9{n2 .} ==> r2c5 <> 8g-whip[14]  b9n1{r9c7 r7c8} - r4n1{c8 c5} - b2n1{r2c5 r1c6} - c6n9{r1 r7} - c6n3{r7 r456} - r4n3{c4 c9} - r4n9{c9 c2} - c2n4{r4 r789} - r7n4{c3 c2} - r7n6{c2 c4} - r4c4{n6 n2} - r9c4{n2 n7} - r9c6{n7 n5} - r8c6{n5 .} ==> r9c7 <> 9naked-single ==> r9c7 = 1whip[5]  c6n5{r8 r9} - r9n9{c6 c9} - r4n9{c9 c2} - r1c2{n9 n8} - r2c2{n8 .} ==> r8c2 <> 5whip[7]  r4n9{c2 c9} - b9n9{r9c9 r7c8} - r2n9{c8 c5} - c5n1{r2 r4} - r4n3{c5 c4} - b2n3{r1c4 r1c6} - b2n1{r1c6 .} ==> r1c2 <> 9whip[5]  r1c2{n8 n5} - r2c2{n5 n9} - b4n9{r4c2 r5c1} - b4n3{r5c1 r6c1} - b4n8{r6c1 .} ==> r1c3 <> 8whip[5]  r1c2{n8 n5} - r2c2{n5 n9} - b4n9{r4c2 r5c1} - b4n3{r5c1 r6c1} - b4n8{r6c1 .} ==> r2c3 <> 8whip[5]  r1c2{n8 n5} - r2c2{n5 n9} - b4n9{r4c2 r5c1} - b4n3{r5c1 r6c1} - b4n8{r6c1 .} ==> r3c3 <> 8whip[8]  r1c2{n5 n8} - r2c2{n8 n9} - b4n9{r4c2 r5c1} - b4n3{r5c1 r6c1} - b4n8{r6c1 r6c3} - r6c7{n8 n4} - b3n4{r3c7 r3c8} - b3n5{r3c8 .} ==> r2c1 <> 5whip[9]  r1c2{n8 n5} - r2c2{n5 n9} - b4n9{r4c2 r5c1} - b4n3{r5c1 r6c1} - b4n8{r6c1 r6c3} - r6c7{n8 n4} - r3c7{n4 n9} - c8n9{r3 r7} - c5n9{r7 .} ==> r3c1 <> 8whip[10]  b7n5{r9c1 r9c2} - r1c2{n5 n8} - r2c2{n8 n9} - r4n9{c2 c9} - b9n9{r9c9 r7c8} - c5n9{r7 r3} - c6n9{r1 r9} - r9n7{c6 c4} - r3n7{c4 c3} - b1n6{r3c3 .} ==> r3c1 <> 5interaction column c1 with block b7 ==> r9c2 <> 5whip[3]  c2n6{r7 r4} - c2n9{r4 r2} - r3c1{n9 .} ==> r8c1 <> 6interaction block b7 with column c2 ==> r4c2 <> 6whip[5]  b1n8{r2c1 r1c2} - b3n8{r1c9 r3c7} - b3n4{r3c7 r3c8} - b3n5{r3c8 r2c8} - c2n5{r2 .} ==> r2c4 <> 8whip[8]  r3c1{n9 n6} - r3c3{n6 n7} - r3c5{n7 n8} - b8n8{r8c5 r7c4} - c3n8{r7 r6} - r6c1{n8 n3} - r6c7{n3 n4} - b3n4{r3c7 .} ==> r3c8 <> 9whip[10]  r1c2{n8 n5} - r2c2{n5 n9} - b4n9{r4c2 r5c1} - b4n3{r5c1 r6c1} - b4n8{r6c1 r6c3} - r6c7{n8 n4} - r8n4{c7 c9} - r8n6{c9 c6} - c4n6{r9 r4} - b4n6{r4c3 .} ==> r8c2 <> 8whip[9]  r3c1{n9 n6} - r3c3{n6 n7} - r3c5{n7 n8} - r8n8{c5 c1} - r6c1{n8 n3} - r5c1{n3 n9} - b1n9{r2c1 r2c2} - c8n9{r2 r7} - c5n9{r7 .} ==> r3c7 <> 9whip[8]  r8c7{n2 n4} - r3c7{n4 n8} - c5n8{r3 r7} - c3n8{r7 r6} - b6n8{r6c9 r5c9} - b6n7{r5c9 r6c9} - c9n4{r6 r4} - r6n4{c8 .} ==> r8c5 <> 2whip[9]  r1c2{n8 n5} - r1c4{n5 n3} - r2n3{c5 c9} - r4n3{c9 c5} - c5n1{r4 r2} - r1c6{n1 n9} - r1c7{n9 n2} - r8c7{n2 n4} - r3c7{n4 .} ==> r1c9 <> 8whip[9]  b3n3{r1c7 r2c9} - r4n3{c9 c5} - r4n1{c5 c8} - r6n1{c8 c6} - r1c6{n1 n9} - r1c9{n9 n2} - r4n2{c9 c4} - b8n2{r9c4 r7c5} - b8n9{r7c5 .} ==> r1c4 <> 3whip[2]  r1c2{n8 n5} - r1c4{n5 .} ==> r1c7 <> 8whip[4]  r1c4{n5 n8} - r3n8{c5 c7} - b3n4{r3c7 r3c8} - b3n5{r3c8 .} ==> r2c4 <> 5whip[8]  c7n9{r1 r5} - c1n9{r5 r3} - b1n6{r3c1 r3c3} - r4c3{n6 n4} - r6c3{n4 n8} - c7n8{r6 r3} - b3n4{r3c7 r3c8} - b3n5{r3c8 .} ==> r2c8 <> 9interaction block b3 with row r1 ==> r1c6 <> 9interaction column c6 with block b8 ==> r7c5 <> 9whip[4]  r1c3{n2 n1} - r2c3{n1 n7} - r2c4{n7 n3} - r1c6{n3 .} ==> r2c1 <> 2interaction column c1 with block b7 ==> r7c3 <> 2whip[5]  r6n1{c8 c6} - r1c6{n1 n3} - r2n3{c5 c9} - b3n8{r2c9 r3c7} - b3n4{r3c7 .} ==> r6c8 <> 4whip[7]  r6c8{n6 n1} - c6n1{r6 r1} - c5n1{r2 r4} - r4n3{c5 c4} - c6n3{r6 r7} - r7n9{c6 c8} - b9n6{r7c8 .} ==> r4c9 <> 6whip[8]  r8c7{n2 n4} - r8c9{n4 n6} - r8c2{n6 n7} - r9c2{n7 n6} - r9c4{n6 n7} - r2c4{n7 n3} - r2c9{n3 n8} - r3c7{n8 .} ==> r9c9 <> 2whip[8]  c2n5{r2 r1} - b1n8{r1c2 r2c1} - c1n9{r2 r5} - c8n9{r5 r7} - r9n9{c9 c6} - r9n5{c6 c1} - r8c1{n5 n2} - b9n2{r8c7 .} ==> r2c2 <> 9hidden-single-in-a-column ==> r4c2 = 9interaction column c2 with block b7 ==> r7c3 <> 4whip[2]  r1c2{n8 n5} - r2c2{n5 .} ==> r7c2 <> 8interaction column c2 with block b1 ==> r2c1 <> 8whip[5]  r8c5{n8 n7} - r3c5{n7 n9} - c1n9{r3 r2} - c1n1{r2 r7} - r7c3{n1 .} ==> r7c5 <> 8whip[4]  b8n9{r7c6 r9c6} - r9n5{c6 c1} - r9n2{c1 c4} - r7c5{n2 .} ==> r7c6 <> 3g-whip[2]  r4n3{c9 c456} - c6n3{r5 .} ==> r1c9 <> 3whip[3]  b4n3{r5c1 r6c1} - c7n3{r6 r1} - c6n3{r1 .} ==> r5c5 <> 3whip[3]  b4n3{r5c1 r6c1} - c7n3{r6 r1} - c6n3{r1 .} ==> r5c9 <> 3whip[3]  c9n8{r6 r2} - b3n3{r2c9 r1c7} - c7n9{r1 .} ==> r5c7 <> 8whip[3]  c4n8{r3 r7} - c3n8{r7 r6} - c7n8{r6 .} ==> r3c5 <> 8hidden-single-in-a-column ==> r8c5 = 8whip[2]  b2n5{r3c4 r1c4} - c4n8{r1 .} ==> r3c4 <> 7whip[2]  r7n1{c1 c3} - r7n8{c3 .} ==> r7c1 <> 2whip[3]  r9c2{n6 n7} - b8n7{r9c6 r8c6} - b8n5{r8c6 .} ==> r9c6 <> 6whip[4]  r9c9{n9 n6} - r9c2{n6 n7} - r9c4{n7 n2} - r7n2{c5 .} ==> r7c8 <> 9singlesGRID 0 SOLVED. GW = 18, MOST COMPLEX RULE = G-Whip[18]451863972982714653637592841796328514315476298824951367148639725279185436563247189`
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### A puzzle with ratings: W=7, WS = 3 and GW = 2

In the 2nd post of this thread, I mentioned the rare case of a puzzle P with very different W and GW ratings: GW(P) = W(P) - 5. One might think that this can happen only for hard puzzles, but this example shows that it can happen also with relatively simple ones.
More precisely, we have SER(P) = 3.8, GW(P) = 2 and W(P) = 7.
The puzzle is the following:

Code: Select all
`+-------+-------+-------+ | 1 . . | . . 6 | . . 9 | | . . . | . . . | . . . | | . 8 . | 1 . . | 5 6 . | +-------+-------+-------+ | . 3 . | 6 . . | 8 . 1 | | . . . | . . . | . . 7 | | . . . | . . 8 | 2 4 6 | +-------+-------+-------+ | . 4 . | 9 . . | . 2 . | | 5 6 . | 8 4 1 | . . . | | . . 7 | . . 3 | . . . | +-------+-------+-------+ `

If we accept g-whips, then there is a very short resolution path:

***** SudoRules version 15b.1.8-GW *****
1....6..9..........8.1..56..3.6..8.1........7.....8246.4.9...2.56.841.....7..3...
26 givens and 206 candidates
naked-single ==> r8c9 = 3
hidden-single-in-a-row ==> r8c3 = 2
interaction column c9 with block b9 ==> r9c8 <> 5
interaction row r8 with block b9 ==> r9c8 <> 9, r9c7 <> 9, r7c7 <> 7
interaction row r6 with block b5 ==> r5c4 <> 3, r5c5 <> 3
whip[2] b4n6{r5c1 r5c3} - b4n8{r5c3 .} ==> r5c1 <> 4
whip[2] b4n6{r5c1 r5c3} - b4n8{r5c3 .} ==> r5c1 <> 2
whip[2] b4n8{r5c1 r5c3} - b4n6{r5c3 .} ==> r5c1 <> 9
whip[2] b4n6{r5c3 r5c1} - b4n8{r5c1 .} ==> r5c3 <> 5
whip[2] b4n6{r5c3 r5c1} - b4n8{r5c1 .} ==> r5c3 <> 4
interaction row r5 with block b5 ==> r4c6 <> 4
whip[2] b4n6{r5c3 r5c1} - b4n8{r5c1 .} ==> r5c3 <> 1
whip[2] b4n8{r5c3 r5c1} - b4n6{r5c1 .} ==> r5c3 <> 9
;;; A
g-whip[2] r3n7{c1 c456} - c4n7{r2 .} ==> r6c1 <> 7
singles
GRID 0 SOLVED. GW = 2, MOST COMPLEX RULE = G-Whip[2]
123456789
456789132
789132564
234697851
618524397
975318246
341975628
562841973
897263415

(remember that interactions = whip[1])

If we use only whips, the resolution path is much longer:
***** SudoRules version 15b.1.8-W *****
same path down to A
whip[3] c4n7{r1 r6} - c2n7{r6 r2} - r3n7{c1 .} ==> r1c5 <> 7
whip[3] c2n7{r1 r6} - c4n7{r6 r1} - r3n7{c6 .} ==> r2c1 <> 7
whip[3] c4n7{r2 r6} - c2n7{r6 r1} - r3n7{c1 .} ==> r2c5 <> 7
whip[3] c4n7{r2 r6} - c2n7{r6 r1} - r3n7{c1 .} ==> r2c6 <> 7
whip[3] r5n2{c6 c2} - r1n2{c2 c4} - b8n2{r9c4 .} ==> r4c5 <> 2
whip[3] b4n7{r6c2 r4c1} - r3n7{c1 c6} - b8n7{r7c6 .} ==> r6c5 <> 7
whip[3] r9c2{n1 n9} - r9c1{n9 n8} - r9c8{n8 .} ==> r9c7 <> 1
whip[3] r9c8{n8 n1} - r9c2{n1 n9} - r9c1{n9 .} ==> r9c9 <> 8
whip[5] r4n2{c1 c6} - r4n7{c6 c5} - b8n7{r7c5 r7c6} - r3n7{c6 c1} - r6c1{n7 .} ==> r4c1 <> 9
whip[5] r4c8{n9 n5} - r4c5{n5 n7} - b8n7{r7c5 r7c6} - r3n7{c6 c1} - r6c1{n7 .} ==> r4c3 <> 9
whip[3] r9c2{n9 n1} - c3n1{r7 r6} - c3n9{r6 .} ==> r2c2 <> 9
whip[6] b3n1{r2c7 r2c8} - r9c8{n1 n8} - r9c1{n8 n9} - r6c1{n9 n7} - b1n7{r3c1 r1c2} - c4n7{r1 .} ==> r2c7 <> 7
whip[7] c3n6{r2 r5} - c1n6{r5 r2} - c1n4{r2 r4} - c1n2{r4 r3} - b3n2{r3c9 r2c9} - c9n8{r2 r7} - c3n8{r7 .} ==> r2c3 <> 4
whip[7] r3n3{c1 c5} - c3n3{r3 r7} - b7n1{r7c3 r9c2} - b7n9{r9c2 r9c1} - r6c1{n9 n7} - r3n7{c1 c6} - c4n7{r1 .} ==> r2c1 <> 3
whip[7] r1n2{c5 c2} - c1n2{r2 r4} - c6n2{r4 r5} - r2n2{c6 c9} - r3c9{n2 n4} - c6n4{r3 r2} - c1n4{r2 .} ==> r3c5 <> 2
whip[7] r4n2{c1 c6} - r4n7{c6 c5} - b8n7{r7c5 r7c6} - r3n7{c6 c1} - c1n2{r3 r2} - r1c2{n2 n5} - r2c2{n5 .} ==> r4c1 <> 4
hidden-single-in-a-block ==> r4c3 = 4
whip[4] b5n4{r5c6 r5c4} - r1n4{c4 c7} - c7n7{r1 r8} - c7n9{r8 .} ==> r5c6 <> 9
whip[4] r3c3{n9 n3} - r3c5{n3 n7} - c4n7{r1 r6} - r6c1{n7 .} ==> r3c1 <> 9
whip[5] b3n7{r1c7 r2c8} - c8n1{r2 r9} - r7c7{n1 n6} - r9c7{n6 n4} - r1n4{c7 .} ==> r1c4 <> 7
;;; now we get the crucial elimination with a whip[2]:
whip[2] c4n7{r6 r2} - r3n7{c6 .} ==> r6c1 <> 7
singles to the end
GRID 0 SOLVED. W = 7, MOST COMPLEX RULE = Whip[7]

Interestingly, this puzzle can also be solved with subset rules, but it has to go one level deeper than with g-whips

***** SudoRules version 15b.1.8-WS *****
1....6..9..........8.1..56..3.6..8.1........7.....8246.4.9...2.56.841.....7..3...
26 givens and 206 candidates
naked-single ==> r8c9 = 3
hidden-single-in-a-row ==> r8c3 = 2
interaction column c9 with block b9 ==> r9c8 <> 5
interaction row r8 with block b9 ==> r9c8 <> 9, r9c7 <> 9
interaction row r8 with block b9 ==> r7c7 <> 7
interaction row r6 with block b5 ==> r5c4 <> 3, r5c5 <> 3
hidden-pairs-in-a-row r5{n6 n8}{c1 c3} ==> r5c3 <> 9, r5c3 <> 5, r5c3 <> 4, r5c3 <> 1, r5c1 <> 9, r5c1 <> 4
interaction row r5 with block b5 ==> r4c6 <> 4
hidden-pairs-in-a-row r5{n6 n8}{c1 c3} ==> r5c1 <> 2
;;; same situation as A (all the whips[2] in the W or GW resolution paths correspond to hidden pairs)
naked-triplets-in-a-row r9{c1 c2 c8}{n8 n9 n1} ==> r9c9 <> 8, r9c7 <> 1
swordfish-in-rows n7{r3 r4 r7}{c6 c1 c5} ==> r6c5 <> 7
The crucial elimination is now obtained with a swordfish:
swordfish-in-rows n7{r3 r4 r7}{c6 c1 c5} ==> r6c1 <> 7
singles to the end
GRID 0 SOLVED. WS = 3, MOST COMPLEX RULE = SHT
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### basic interactions and g-naked singles

I have shown long ago that basic interactions (row/block and column/block) are equivalent to whips[1].

In the same vein, once we consider segment-candidates, we have the following, very intuitive, interpretation:
a basic interaction can be seen as the assertion of a segment-candidate (by a g-hidden-single rule) , followed by an elementary constraints propagation (by a g-ECP rule) for this segment-candidate.

I don't think it has any practical consequence.

[05/06/20011, corrected a typo: g-hidden-single instead of g-naked-single]
Last edited by denis_berthier on Fri May 06, 2011 6:05 am, edited 1 time in total.
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### Re: g-whips and g-braids

Not new

setbb.com/sudoku/viewtopic.php?t=1960

(but in a more technical explanation), in fact, I rediscovered Afmob findings when I was programming g-braids long time ago.
Mauricio

Posts: 1175
Joined: 22 March 2006

### Re: g-whips and g-braids

Mauricio wrote:Not new
setbb.com/sudoku/viewtopic.php?t=1960
(but in a more technical explanation)

Yep, good.
But I could play the same game: not new; minirows and minicols have been known for at least 2 eternities.
As for the idea of granting segment-candidates as such (not only segments, i.e. minirows and minicols) the status of first class objects, as I do above, I think many other people may have had it long ago.
My synthetic presentation above, which needs no "technical explanation", is only an epsilon in my work. I let everyone judge for himself if there is anything new in it.

Mauricio wrote: when I was programming g-braids long time ago.

Oh, so that was the real goal of your post: claiming that you programmed g-braids "long time ago" !
I'm generally not very receptive to such claims relying on no evidence.
What a pity you never communicated anything about this ! In all this long time, haven't you found any puzzle whose resolution path with g-braids would have been worth mentioning, such as those in this thread or in my other new one ?
How strange that, given this very old program of yours, you had to use xsudo to find some missing g-whip (unfortunately for you, not the first one) in my first implementation of g-whips, only one month ago: http://forum.enjoysudoku.com/more-on-whips-braids-t-e-t30230.html

BTW, have you also programmed "long time ago" any more complex extended whips or braids, whips(FP) or braids(FP) ?
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### Re: g-whips and g-braids

denis_berthier wrote:How strange that, given this very old program of yours, you had to use xsudo to find some missing g-whip (unfortunately for you, not the first one) in my first implementation of g-whips, only one month ago: http://forum.enjoysudoku.com/more-on-whips-braids-t-e-t30230.html

Using a published program would have been my preference too. IMO it gives one's claim of a bug a bit more clout.
ronk
2012 Supporter

Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

### Re: g-whips and g-braids

ronk wrote:
denis_berthier wrote:How strange that, given this very old program of yours, you had to use xsudo to find some missing g-whip (unfortunately for you, not the first one) in my first implementation of g-whips, only one month ago: http://forum.enjoysudoku.com/more-on-whips-braids-t-e-t30230.html

Using a published program would have been my preference too. IMO it gives one's claim of a bug a bit more clout.

But it doesn't give much credit to Mauricio's claim about his implementing g-braids long ago, especially if he doesn't rely on it for analysing my solutions and if he doesn't find the right missing one.
Anyway, I was grateful to Mauricio for finding a missing g-whip in my first, quick implementation, whichever method he used to find it. I didn't take it as a clout. On the contrary, it is always useful for me when people dedicate some of their time to check my work (or re-implement my concepts).
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### Re: g-whips and g-braids

denis_berthier wrote:Oh, so that was the real goal of your post: claiming that you programmed g-braids "long time ago" !
I'm generally not very receptive to such claims relying on no evidence.
What a pity you never communicated anything about this ! In all this long time, haven't you found any puzzle whose resolution path with g-braids would have been worth mentioning, such as those in this thread or in my other new one ?

ABarker beat us all, Xsudo a g-whip solver at least one year old.

Your interest and my interest abou having a braid or whips solver are different. I am not interested in calculating the power of whips or braids over random puzzles, the kind of question I am interested is
1. What is the lowest braid rating of a puzzle not solvable by pure braids (answer is 3, 001002003000010040200400500006007008050000020900300400008001005090060000100900700
)
2. What is the lowest pure braid rating of a puzzle not solvable by pure whips or whips (answer is <=6, 000001002010030040005400600003500700040000020100008009002900100030060007600007090 ER=9.1
)
3. What is the longest whip rating of the first step of the solution of a puzzle (answer is >=32, the first whip of the following puzzle has length 32, 000001002010030040005600000007100004030008000100040900000002007080000030900800600
)
4. Something to do with puzzles solvable with discontinuous nice loops.

Besides, in february, when it was clear that you had a gwhips solver, I sent you a PM, and received no answer.
denis_berthier wrote:How strange that, given this very old program of yours, you had to use xsudo to find some missing g-whip (unfortunately for you, not the first one) in my first implementation of g-whips, only one month ago: http://forum.enjoysudoku.com/more-on-whips-braids-t-e-t30230.html

BTW, have you also programmed "long time ago" any more complex extended whips or braids, whips(FP) or braids(FP) ?

How exactly do you propose that I analyze your g-whips solutions with my g-braids solver? Being the inventor on those things, you must know they are not the same, I will not spend my time checking if the braids given by my solver are whips, it is better to use a g-whip solver, as Xsudo (the last version is one year old, it is a shame ABarker retired with the great crash, as did Ano1), and the only thing I did is a)to check if a given whip whas correct, and b) to check if no shorter whip was available.

Besides, the solutions you give seem to give the steps of the same length in some unkown order (ie, it presents "whip[h] ... ==> rj1 ck1 <> l1" before "whip[h] ... ==> rj2 ck2 <> l2", with no indication of the reason of the preference of the first whip over the second, when the two are available), I suggest you present them in lexicographical order, r1c1<>1 before r1c1<>2, etc.

Last question, no.
Mauricio

Posts: 1175
Joined: 22 March 2006

### Re: g-whips and g-braids

Mauricio wrote:ABarker beat us all, Xsudo a g-whip solver at least one year old.

If xsudo was a g-whip solver, how do you explain that, in your first post here http://forum.enjoysudoku.com/more-on-whips-braids-t-e-t30230.html, about this puzzle: .............1.....123.456...........23...78..47.6.12...........318.764..58...23., you mentioned a g-whip I had missed in my first, too quick, implementation, but you didn't find a previous one I had also missed ?
I asked you several times to post the real xsudo output, but you never did it.

Mauricio wrote:Besides, in february, when it was clear that you had a gwhips solver, I sent you a PM, and received no answer.

Wrong. You already received an answer more than 2 years ago. PM is for private questions. This is a public forum; if you want an answer to technical questions, you ask them in public. This will avoid ambiguities about the technical information you get from me.
Moreover, in your PM, you said you had a g-braid rater but you weren't able to display the g-braids resolution path - which means you didn't have a g-braid solver, contrary to what you are now claiming (unless "less than 2 months ago" means "a long time" for you). You'll understand that such contradictions don't incite me to revise my PM policy.

Mauricio wrote:the only thing I did is a)to check if a given whip whas correct, and b) to check if no shorter whip was available.

not whip, but g-whip
conclusion: if xsudo was a g-whip solver, it would have failed to find the first shorter g-whip!

Mauricio wrote:Besides, the solutions you give seem to give the steps of the same length in some unkown order [...] I suggest you present them in lexicographical order

All patterns of same type and same length have the same priority. When there are two available, the order in which they are applied is random FAPP. There is no logical reason to choose lexicographic order or any other predefined order. I'll certainly not change anything about this.

My interest is not limited to analysing random collections. I've also studied exceptional puzzles, with the same kind of questions as you're mentioning.
As for your examples, can you say where they come from?
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### Re: g-whips and g-braids

denis_berthier wrote:As for your examples, can you say where they come from?
Personal collections, some of them generated for patterns game #124.
Mauricio

Posts: 1175
Joined: 22 March 2006

### Re: g-whips and g-braids

Mauricio wrote:What is the lowest braid rating of a puzzle not solvable by pure braids (answer is 3, 001002003000010040200400500006007008050000020900300400008001005090060000100900700

Nice puzzle, not in T&E(NS+HS, 1) (and therefore not solvable by braids alone), but in T&E(NS+HS+BI, 1)

1) Standard solution with swordfish:

***** SudoRules version 15b.1.12-B-S *****
001002003000010040200400500006007008050000020900300400008001005090060000100900700
24 givens, 214 candidates, 1289 nrc-links
swordfish-in-columns n4{c3 c6 c9}{r9 r5 r8} ==> r9c5 <> 4, r9c2 <> 4, r8c1 <> 4, r5c5 <> 4, r5c1 <> 4
swordfish-in-columns n9{c3 c6 c9}{r3 r2 r5} ==> r5c7 <> 9, r5c5 <> 9
singles
GRID 0 SOLVED. B-S = 3, MOST COMPLEX RULE = SHT

2) Solution with g-whips: 2 g-whips[2] are enough to wipe out the 2 candidates blocking the way to the solution

***** SudoRules version 15b.1.12-GW *****
001002003000010040200400500006007008050000020900300400008001005090060000100900700
24 givens, 214 candidates, 1289 nrc-links
g-whip[2]: c3n4{r5 r789} - r7n4{c2 .} ==> r5c5 <> 4
g-whip[2]: r1n9{c5 c789} - c9n9{r3 .} ==> r5c5 <> 9
singles
GRID 0 SOLVED. GW = 2, MOST COMPLEX RULE = G-Whip[2]
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### g-whips and generalized fish

g-whips and generalized fish

As almost all the puzzles can be solved with whips, finding puzzles that cannot but that are nevertheless not too hard is not obvious. One way is to search the literature for cases of subsets (especially Fish, that have attracted more interest than Naked or Hidden) and to check those that are not subsumed by whips. This is what I had tried in some of the previous examples. While doing so, I found the following puzzle (in the Ultimate Fish Guide, I think - but I can't find it again there), SER 9.2. Here is the PM as I copied it from there (obtained from the clues after the obvious elementary constraints propagation, no other rule applied):

Code: Select all
`+-------------------------+---------------------+--------------------+ | 123456789  34689  12379 | 23579    29    379  | 13689   3689   39  | | 23589      389    239   | 2359     6     1    | 389     4      7   | | 13679      369    1379  | 379      4     8    | 1369    5      2   | +-------------------------+---------------------+--------------------+ | 23689      3689   239   | 1346789  189   3679 | 234579  379    359 | | 389        1      5     | 34789    89    2    | 3479    379    6   | | 2369       7      4     | 369      5     369  | 239     1      8   | +-------------------------+---------------------+--------------------+ | 13479      349    1379  | 12689    1289  69   | 356789  36789  359 | | 139        2      8     | 169      7     5    | 369     369    4   | | 79         5      6     | 89       3     4    | 789     2      1   | +-------------------------+---------------------+--------------------+ `

I also noted that it can be solved using only a mix of Franken, Finned and Mutant Fish of maximum size 5, but I didn't keep the details. As SudoRules has only normal and Finned Fish, I can't reproduce it (and I still have too little time for Sudoku to program the other kinds).
Does anyone remember this example?
BTW, I tried to solve it using Hodoku, with the whole aquarium activated (and nothing else), but apart from the first 3 fish, it didn't find the solution *(see edit). I therefore wonder if there is indeed a solution with only super Fish or if I somehow mixed up my notes.

Anyway, the purpose of this post is to show that all the Fish appearing in its solution are subsumed by g-whips of length <= 5. This would not be true for whips (it can only be solved by whips of maximal length 9; I don't give the whip resolution path here; it has nothing noticeable).
No doubt Fish experts will easily find their favorite pets in the first series of g-whips below.

Code: Select all
`*****  SudoRules version 15b.1.12-GW  *****00000000000006104700004805200000000001500200607405001800000000002807500405603402128 givens, 201 candidates and 1425 nrc-linksg-whip[3]: b2n9{r1c5 r123c4} - r9n9{c4 c7} - b3n9{r1c7 .} ==> r1c1 <> 9g-whip[3]: b4n9{r4c3 r456c1} - r9n9{c1 c7} - r8n9{c7 .} ==> r4c4 <> 9g-whip[3]: b4n3{r5c1 r4c123} - c9n3{r4 r7} - r8n3{c8 .} ==> r1c1 <> 3g-whip[3]: b8n9{r7c6 r789c4} - r2n9{c4 c123} - r3n9{c3 .} ==> r7c7 <> 9whip[4]: b2n3{r3c4 r1c6} - c9n3{r1 r7} - b7n3{r7c3 r8c1} - b4n3{r4c1 .} ==> r4c4 <> 3g-whip[4]: b4n9{r6c1 r4c123} - c9n9{r4 r1} - c6n9{r1 r6} - c5n9{r4 .} ==> r7c1 <> 9g-whip[4]: b7n9{r8c1 r7c123} - c9n9{r7 r1} - c6n9{r1 r6} - c5n9{r4 .} ==> r4c1 <> 9g-whip[4]: b2n9{r1c5 r123c4} - b8n9{r8c4 r7c456} - c2n9{r7 r4} - c9n9{r4 .} ==> r1c3 <> 9g-whip[4]: b2n9{r1c5 r123c4} - b8n9{r8c4 r7c456} - c3n9{r7 r4} - c9n9{r4 .} ==> r1c2 <> 9g-whip[4]: b4n9{r4c3 r456c1} - b7n9{r8c1 r7c123} - c6n9{r7 r1} - c9n9{r1 .} ==> r4c5 <> 9g-whip[4]: b4n9{r4c3 r456c1} - b7n9{r8c1 r7c123} - c5n9{r7 r1} - c9n9{r1 .} ==> r4c6 <> 9g-whip[4]: b3n9{r3c7 r1c789} - b2n9{r1c5 r123c4} - r9n9{c4 c1} - b4n9{r5c1 .} ==> r4c7 <> 9g-whip[4]: b2n9{r3c4 r1c456} - b3n9{r1c8 r123c7} - r6n9{c7 c1} - r9n9{c1 .} ==> r5c4 <> 9g-whip[4]: b7n9{r7c3 r789c1} - b4n9{r5c1 r4c123} - c9n9{r4 r1} - b2n9{r1c4 .} ==> r7c4 <> 9g-whip[4]: b8n9{r8c4 r7c456} - c9n9{r7 r4} - c3n9{r4 r123} - c2n9{r3 .} ==> r1c4 <> 9g-whip[5]: b2n9{r1c6 r123c4} - r9n9{c4 c1} - r8n9{c1 c8} - c9n9{r7 r4} - b4n9{r4c2 .} ==> r1c7 <> 9g-whip[5]: b4n9{r4c3 r456c1} - b7n9{r8c1 r7c123} - c9n9{r7 r1} - c6n9{r1 r6} - c5n9{r5 .} ==> r4c8 <> 9whip[3]: r5n4{c7 c4} - r5n7{c4 c8} - r4c8{n7 .} ==> r5c7 <> 3whip[4]: r4c8{n3 n7} - r5n7{c8 c4} - r5n3{c4 c1} - b7n3{r8c1 .} ==> r7c8 <> 3whip[5]: b5n4{r4c4 r5c4} - b5n7{r5c4 r4c6} - r4c8{n7 n3} - r5n3{c8 c1} - b4n8{r5c1 .} ==> r4c4 <> 8whip[5]: c6n7{r1 r4} - r4c8{n7 n3} - c9n3{r4 r7} - r8n3{c8 c1} - b4n3{r4c1 .} ==> r1c6 <> 3whip[1]: c6n3{r6 .} ==> r6c4 <> 3, r5c4 <> 3whip[4]: r6c4{n9 n6} - b8n6{r8c4 r7c6} - c6n9{r7 r1} - b3n9{r1c9 .} ==> r6c7 <> 9whip[5]: r4c5{n1 n8} - r5c5{n8 n9} - b6n9{r5c7 r4c9} - b6n5{r4c9 r4c7} - r4n4{c7 .} ==> r4c4 <> 1hidden-single-in-a-block ==> r4c5 = 1whip[1]: r4n8{c1 .} ==> r5c1 <> 8whip[4]: b7n3{r7c3 r8c1} - r5c1{n3 n9} - b6n9{r5c8 r4c9} - r1c9{n9 .} ==> r7c9 <> 3whip[5]: b1n4{r1c2 r1c1} - b1n5{r1c1 r2c1} - c1n8{r2 r4} - c1n2{r4 r6} - b4n6{r6c1 .} ==> r1c2 <> 6whip[5]: b1n5{r2c1 r1c1} - c1n8{r1 r4} - c1n2{r4 r6} - r6c7{n2 n3} - r5n3{c8 .} ==> r2c1 <> 3whip[5]: b6n4{r5c7 r4c7} - c7n5{r4 r7} - r7c9{n5 n9} - c8n9{r8 r1} - c5n9{r1 .} ==> r5c7 <> 9g-whip[3]: b7n9{r7c3 r789c1} - b4n9{r5c1 r4c123} - b6n9{r4c9 .} ==> r7c8 <> 9whip[5]: b6n9{r4c9 r5c8} - c5n9{r5 r7} - c6n9{r7 r6} - b5n3{r6c6 r4c6} - c9n3{r4 .} ==> r1c9 <> 9naked-single ==> r1c9 = 3whip[3]: c9n9{r7 r4} - r5n9{c8 c1} - b7n9{r9c1 .} ==> r7c5 <> 9whip[3]: r6c4{n9 n6} - b8n6{r8c4 r7c6} - b8n9{r7c6 .} ==> r3c4 <> 9whip[3]: r6c4{n9 n6} - b8n6{r8c4 r7c6} - b8n9{r7c6 .} ==> r2c4 <> 9whip[1]: b2n9{r1c5 .} ==> r1c8 <> 9whip[1]: b3n9{r3c7 .} ==> r9c7 <> 9, r8c7 <> 9whip[3]: r9n9{c4 c1} - r5n9{c1 c8} - r8n9{c8 .} ==> r6c4 <> 9singles ==> r6c4 = 6, r7c6 = 6whip[2]: r9c7{n7 n8} - r7c8{n8 .} ==> r7c7 <> 7whip[2]: r9c7{n8 n7} - r7c8{n7 .} ==> r7c7 <> 8whip[2]: r4c8{n3 n7} - r4c6{n7 .} ==> r4c1 <> 3, r4c2 <> 3, r4c3 <> 3whip[1]: b4n3{r6c1 .} ==> r3c1 <> 3, r7c1 <> 3, r8c1 <> 3whip[1]: r8n3{c8 .} ==> r7c7 <> 3singles ==> r7c7 = 5, r7c9 = 9, r4c9 = 5, r5c8 = 9, r5c1 = 3, r5c5 = 8, r7c5 = 2, r1c5 = 9, r1c6 = 7, r3c4 = 3, r4c6 = 3, r6c6 = 9, r6c1 = 2, r4c3 = 9, r6c7 = 3, r8c7 = 6, r8c8 = 3, r4c8 = 7, r5c7 = 4, r4c7 = 2, r5c4 = 7, r7c8 = 8, r9c7 = 7, r9c1 = 9, r8c1 = 1, r8c4 = 9, r9c4 = 8, r1c8 = 6, r7c4 = 1, r4c4 = 4whip[3]: r2c1{n8 n5} - r1c1{n5 n4} - r1c2{n4 .} ==> r2c2 <> 8whip[4]: r2c7{n8 n9} - r2c2{n9 n3} - r7c2{n3 n4} - r1c2{n4 .} ==> r2c1 <> 8singles to the endGRID 0 SOLVED. GW = 5, MOST COMPLEX RULE = G-Whip[5]`

* Edit:
Activating the XYZ-Wings and Kraken Fish in Hodoku, it finds the solution (as expected, with max size 5 - the Franken Squirmag):

Code: Select all
`Finned Swordfish: 3 c239 r147 fr2c2 fr2c3 fr3c2 fr3c3 => r1c1<>3Finned Swordfish: 9 r239 c147 fr2c2 fr2c3 fr3c2 fr3c3 => r1c1<>9Finned Swordfish: 9 c569 r147 fr5c5 fr6c6 => r4c4<>9Franken Squirmbag: 9 c23569 r147b15 => r1c23478,r2347c1,r4c5678,r567c4,r7c78<>9XYZ-Wing: 7/6/3 in r4c68,r6c4 => r4c4<>3XYZ-Wing: 9/3/6 in r6c46,r7c6 => r4c6<>6Naked Pair: 3,7 in r4c68 => r4c12379<>3, r4c47<>7Locked Candidates Type 1 (Pointing): 3 in b4 => r2378c1<>3Locked Candidates Type 1 (Pointing): 3 in b7 => r7c789<>3Hidden Single: r1c9=3Locked Candidates Type 1 (Pointing): 3 in b2 => r56c4<>3Naked Single: r6c4=6Hidden Single: r7c6=6Locked Candidates Type 1 (Pointing): 9 in b3 => r5689c7<>9Locked Candidates Type 2 (Claiming): 9 in r1 => r23c4<>9Locked Candidates Type 2 (Claiming): 9 in c4 => r7c5<>9Naked Pair: 7,8 in r7c8,r9c7 => r7c7<>7, r7c7<>8Singles: r7c7=5, r7c9=9, r4c9=5, r5c8=9, r5c5=8, r5c1=3, r4c5=1, r4c4=4, r5c4=7, r5c7=4, r3c4=3, r4c6=3, r6c6=9, r1c6=7, r6c1=2, r6c7=3, r4c3=9, r4c7=2, r4c8=7, r7c5=2, r1c5=9, r7c8=8, r1c8=6, r8c8=3, r7c4=1, r8c4=9, r9c4=8, r8c1=1, r8c7=6, r9c7=7, r9c1=9Naked Triple: 4,5,8 in r1c12,r2c1 => r2c2<>8Kraken Fish Type 2:  => r1c1<>4  Finned Franken X-Wing: 1 r13 c7b3 fr1c3 fr3c3  r1c3 =2= r1c4 =5= r1c1  r3c3 =7= r3c1 -7- r7c1 -4- r1c1Singles to the end`
denis_berthier
2010 Supporter

Posts: 3676
Joined: 19 June 2007
Location: Paris

### Re: g-whips and g-braids

I saw this puzzle somewhere given as a great example of POM analysis. Following basics, POM first finds two 3's at 1,1 and 4,4, and then no less than 20 9's. After this the puzzle solves easily.
pjb
2014 Supporter

Posts: 2472
Joined: 11 September 2011
Location: Sydney, Australia

Next