I solved the 144x144triples.txt with the SAT-solver only without applying
any basic methods before and it gave me a unique solution which was identical to the basic method solver. So I really do not believe that there is something going wrong with my code. I additionally give you 4 triplet-minimal examples for 16x16 below (since I now see that the SE rating of Swordfish and X-wing is lower than for hidden triplets I explicitely state that these are not included in the set of used methods here) which all need triplets to be solved and you can check if there is a problem with these with your solver:
- Code: Select all
. 13 10 . . . . 1 . . 12 . . 16 11 5
. . . . 11 5 . 14 . 13 . 9 6 8 7 .
. . 7 12 . . 9 . . . . 16 . . . .
. 14 . . . 12 . . 15 . 3 2 . . 10 .
. . 12 . 4 . . . . . . 14 . . . 11
1 16 . . . 7 . . . 2 15 . . 6 . .
13 . . 15 . . 1 16 12 9 . . 8 14 . .
. . 5 . . 10 6 . . 16 . . . . 4 .
7 . 14 . . 9 10 4 1 . . . . . . .
10 4 6 . 13 . 15 . . . 8 . . . 1 .
. 3 . . . 16 . . . . . . 12 7 . 8
. 5 . 16 . . . 12 13 . . . . . . .
. 7 16 . 8 6 . . . . 1 . . . . .
. 11 . . . . . . . 15 13 . 10 12 8 .
. 10 8 6 9 . 4 . . 7 . 5 . . . .
. . 9 . . . 3 . . 10 . . . 5 . 14
9 13 . . . 3 . . . . . . . 16 . .
2 . . . 11 5 . 14 . . . . 6 8 . .
8 . . 12 . 4 . 13 11 . . 16 . . 15 .
. . . 5 7 . 8 . . 1 3 . . 9 10 .
6 9 12 . . . 13 2 . . . . . . . 11
. . . 11 . . . . 4 . 15 . . . . 10
. 2 . 15 3 11 . 16 12 9 . 6 . . . .
14 8 . 7 12 10 . . . . . 1 . . 4 .
. . . 8 . . . 4 1 . 16 . 3 . 13 .
10 . . . 13 . 15 3 14 . . . . . . .
. . . . . . . . . 4 . 10 . 7 14 8
. 5 1 . . 8 . 12 13 . . 15 . . . 9
. 7 16 14 8 6 . . 2 11 . 3 . 4 . 13
3 . 2 . 16 14 5 7 . . . 4 . 12 . .
. 10 . . 9 . . . . . . . . . . 1
4 . 9 . . . . 11 . . . . . 5 . .
. 13 . . . 3 2 . 7 . . 8 . 16 . .
. 1 . 3 . . . . 10 . . . . 8 7 .
. . . 12 . . 9 . . 14 5 . 1 . . .
. . 11 5 . . 8 6 . . 3 . . . . .
. . . . . 15 13 . . 8 . . 16 . 3 11
1 . . . 5 7 . 8 . . . . . . . 10
13 2 4 15 . 11 . 16 12 . . 6 . . . .
14 . . . 12 . 6 . . . . . . . . 15
. . 14 8 . 9 10 4 1 5 . . . . . .
. . 6 9 13 . . . . . 8 7 5 11 . .
. . . . . . . 5 . . . . 12 7 14 8
. . . 16 . . . 12 . . . . . . 6 .
5 7 16 . . 6 . . . . . . . 4 9 13
. 11 . 1 . 14 . . . 15 . . . 12 8 .
. 10 8 . 9 . 4 15 . . 14 . . . . .
. . 9 13 2 . 3 11 . . . 12 . . . .
. 13 . . . . 2 . . 6 . . 14 . 11 5
. 1 15 3 . 5 16 . 10 . 4 9 . . . .
. . 7 . . . 9 . . 14 5 . . 2 . .
16 . 11 . 7 12 . . . . . . 13 . . .
6 . . . . . . . 5 . . . . 1 . .
. 16 3 . . 7 . . . 2 . 13 . . 12 10
. . 4 15 . . 1 . . . . . 8 . . 7
. . . . 12 10 . . . 16 . . . 13 . 15
7 12 . . . . . 4 . . . 11 . . . 2
. . 6 . . . . . . . . . . 11 1 .
15 3 . . . 16 . 5 6 . 9 10 12 . 14 .
. . . 16 14 8 7 12 . . . . 4 . 6 .
5 . . 14 8 . . 10 2 11 . . . . 9 .
. . . . . 14 . 7 . . . . . 12 . .
. 10 8 6 9 . . . 16 . . 5 11 . . .
4 15 9 . 2 1 . . 8 . 6 12 . . . .
Mike, trying your 408 9x9 examples left 100 unsolved using the basic set including triplets. This motivated me to add basic fish methods for arbitrary size n (n=2: X-Wing, n=3: Swordfish, n=4: Jellyfish, n=5: ??? etc.) to my solver and now only 28/408 stay unsolved with this new method set.
The routines for Hidden n-tuples, Naked n-tuples and Basic fishs of size n are almost identical. They only interchange the terms column, row and candidate.
Hidden n-tuple in row: Fix a row and and find a subset of n candidates in this row such that the union of the column positions of these candidates in this row has order <=n.
Naked n-tuple in row: Fix a row and and find a subset of n column positions in this row such that the union of the candidates at these column positions in this row has order <=n.
Basic fish of order n with rows as basesets: Fix a candidate and find a subset of n rows such that the union of the column positions of the candidate in these rows has order <=n.
To find such a set of n objects I do a recursive search of depth n, so the code also is the same for all n. The search is pretty fast since I use tables like (row,column)->bitvector for candidates, (row,candidate)->bitvector for columns and (column, candidate)->bitvector for rows. Oring and anding these bitvectors does most of the job.