Ruud,
Sudocue version 3.1.0.1 seems to detect most Sue de Coq patterns (it's found several which I've missed), but I've found a few which it doesn't. I've slowly began undertaking some of the so-called "Unsolvable" puzzles from sudoku.org.uk (
here). This is the position in Unsolvable #12 after initial basic eliminations.
Start position, Unsolvable #12:
..73..4......4..9..5.....6......76..5...3...1..39.8....2.....7..1..8......46.92..
Code: Select all
·--------------------·------------------------·----------------------·
| 12689 689 7 | 3 12569 1256 | 4 1258 258 |
| 12368 368 1268 | 1578-2 4 1256 | 1578 9 2578 |
| 4 5 1289 | 178-2 1279 12 | 1378 6 2378 |
·--------------------+------------------------+----------------------·
| 1289 489 1289 | 15-24 125 7 | 6 23458 234589 |
| 5 46789 2689 | B24 3 246 | 789 248 1 |
| 1267 467 3 | 9 1256 8 | 57 245 2457 |
·--------------------+------------------------+----------------------·
| 3689 2 5689 | C145 A15 34-15 | 13589 7 345689 |
| 3679 1 569 | C2457 8 234-5 | 359 345 34569 |
| 378 378 4 | 6 A157 9 | 2 1358 358 |
·--------------------·------------------------·----------------------·
Here we have a "classic" Sue de Coq pattern. I term it "classic" because it satisfies a constraint given in the original Sue de Coq post (
here), that all candidate digits in the pattern be found in the line/box intersection set (set C in my notation):
- set C (in box 8/column 4 intersection) = r78c4, digits 12457
set A (in box 8) = r79c5, digits 157
set B (in column 4) = r5c4, digits 24
The pattern results in the eliminations shown in box 8 and column 4. I have Sue de Coq set at fairly high priority (before the ALS XZ rule, and finned swordfish). Sudocue 3.1.0.1 does find the finned swordfish elimination of (1)r3c5 but does not find the Sue de Coq.
I also want to mention another Sue de Coq pattern in this same position, but this one is not classic.
Code: Select all
·---------------------·------------------------·----------------------·
| 12689 689 7 | 3 269-15 1256 | 4 1258 258 |
| 12368 368 1268 | 12578 4 1256 | 1578 9 2578 |
| 4 5 1289 | 1278 279-1 12 | 1378 6 2378 |
·---------------------+------------------------+----------------------·
| 1289 489 1289 | 15-24 C125 7 | 6 23458 234589 |
| 5 6789-4 2689 | A24 3 A246 | 789 28-4 1 |
| 1267 467 3 | 9 C1256 8 | 57 245 2457 |
·---------------------+------------------------+----------------------·
| 3689 2 5689 | 145 B15 1345 | 13589 7 345689 |
| 3679 1 569 | 2457 8 2345 | 359 345 34569 |
| 378 378 4 | 6 7-15 9 | 2 1358 358 |
·---------------------·------------------------·----------------------·
Here we have
- set C (in box 5/column 5 intersection) = r46c5, digits 1256
set A (in box 5) = r5c46, digits 246
set B (in column 5) = r7c5, digits 15
This is not a classic position since digit 4 in set A does not appear in set C. However, it's not difficult to see that only two of the basic Sue de Coq constraints, that sets A and B have no common candidate digits, and that the total cell count = total distinct candidate digit count, are enough to make the usual subset counting argument behind Sue de Coq eliminations. In this case, with respect to the set of five cells in the pattern (A union B union C), each of the digits 1 and 5 have max multiplicity 1 since these candidates all lie in column 5; the remaining digits (2, 4, and 6) in the pattern all lie in box 5 so each of these also has max multiplicity of 1. Since we have only 5 digits which can be used to fill the 5 cells of the pattern, and each of these digits has max multiplicity of 1, in order to fill all cells each digit must appear (exactly once) in the pattern. This gives the usual eliminations in the primary line and box of the Sue de Coq pattern; also, in this case, since the digit 4 candidates in the pattern lie in row 5 only (r5c46), digit 4 can be eliminated in other cells of row 5, as shown.
Sudocue version 3.1.0.1 does not find this, but interestingly enough it does find the ALS XZ rule elimination of (2)r4c4 using the sets A and {B union C}.
So, Ruud, if you decide to investigate the logic for detecting classic Sue de Coq patterns, you might give consideration to extending the logic to find non-classic patterns.
Here's another classic position which Sudocue 3.1.0.1 does not find. It's a six cell pattern which arises in Unsolvable #16 after initial basic eliminations and two naked quads.
Start position, Unsolvable #16:
.9.3.......7...6......24.3.91......8.........4....5.27.5.87..6...1...5.....5.6.9.
Code: Select all
·--------------------------·--------------------·--------------------·
| C12568 9 24-568 | 3 1568 178 | 12478 1478 1245 |
| C12358 234-8 7 | 19 1589 189 | 6 148 12459 |
| C1568 A68 A568 | 1679 2 4 | 178 3 159 |
·--------------------------+--------------------+--------------------·
| 9 1 2356 | 2467 346 237 | 34 45 8 |
| 578-23 2378 2358 | 1249 13489 12389 | 1349 145 6 |
| 4 368 368 | 169 13689 5 | 139 2 7 |
·--------------------------+--------------------+--------------------·
| B23 5 9 | 8 7 123 | 124 6 1234 |
| 678 678 1 | 249 349 239 | 5 78 23 |
| 78-23 23478 2348 | 5 13 6 | 78 9 123 |
·--------------------------·--------------------·--------------------·
- set C (in box 1/column 1 intersection) = r123c1, digits 123568
set A (in box 1) = r3c23, digits 568
set B (in column 1) = r7c1, digits 23
This gives the eliminations shown in box 1 and column 1.