SiSeSuSo questions/bugs

For fans of Killer Sudoku, Samurai Sudoku and other variants

SiSeSuSo questions/bugs

Postby urhegyi » Mon Feb 01, 2021 4:11 pm

Situation can be reproduced with this simple sudoku:
Code: Select all
#1//B4,N
.51.247894728.9.6..9817.24.21948..3.86.29.4..74..619289847....2.269.8.74.37.4289.

I expect when solving by hand that SiseSuSo will do it the same way with 2xy-wings, but it needs first 2 xy-chains which are harder and then the xy-wings.
Code: Select all
Pointing, Claiming  | (3)b9c7 => (-3)r2c7
XY_Chain r  |  (5=3)r3c9 (3=6)r3c1 (6=3)r1c1 (3=6)r1c4 (6=5)r9c4 [5] => (-5)r9c9
XY_Chain b  |  (5=3)r2c5 (3=6)r1c4 (6=5)r9c4 (5=1)r9c1 (1=5)r8c1 [5] => (-5)r8c5
XY-Wing r  |  (1=5)r2c7 (5=3)r2c5 (3=1)r8c5 [3] => (-1)r8c7
XY-Wing b  |  (1=5)r7c8 (5=3)r8c7 (3=1)r8c5 [3] => (-1)r7c5

Why checks it first for chains instead of wings which are lower rated?
Image
There is a simple xy-wing to start with at R1C4,R2C5,R9C4: R1C4=3--> R2C5=5; R1C4=6--> R9C4=5; R78C5<>5
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby Hajime » Mon Feb 01, 2021 5:45 pm

I will look this into it...
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Re: SiSeSuSo questions/bugs

Postby Hajime » Wed Feb 03, 2021 12:13 pm

urhegyi wrote:There is a simple xy-wing to start with at R1C4,R2C5,R9C4: R1C4=3--> R2C5=5; R1C4=6--> R9C4=5; R78C5<>5

You are right.
The program only eliminates candidates in seeing cells of the same row/col of the XY-chain/wing. It should also test seeing cells in the same box.
R1C4,R2C5,R9C4: two 5-s at the ends of the chain/wing --> r7c5<>5 and r6c5<>5
I will repair this in the next version.
Thanks
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Re: SiSeSuSo questions/bugs

Postby urhegyi » Wed Feb 03, 2021 10:59 pm

Resize the browser ruins the picture produced by your "to html" option. To avoid this a simple fix in your html code:
first five lines
old:
Code: Select all
<!DOCTYPE html>
<html><body>
<style>table, th, td { border-collapse: collapse; text-align: center; table-layout: fixed; width:100%; }
td { }

new:
Code: Select all
<!DOCTYPE html>
<html><body>
<style>table { border-collapse: collapse; table-layout: fixed; text-align: center; }
th { width:100%; padding-bottom:100%; }
td { }
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby Hajime » Thu Feb 04, 2021 2:56 pm

urhegyi wrote:Resize the browser ruins the picture produced by your "to html" option. To avoid this a simple fix in your html code:
first five lines

Looks great, Thanks urhegyi. Will be implemented in the next version of SiSeSuSo.
And for everybody else: you can zoom in/out by holding down the Ctrl-key and scroll the mouse-wheel...
How it looks now: jigsaw asterisk ninja.
Hmmm, dropbox-link does work direct on Windows but not on Android (download and open) :shock:
In code:
Hidden Text: Show
Code: Select all
#9//H16,JSB/T16,JSB/H40,JSB/T40,JSB/B28,A/Z28,A/N4,A/N52,A/N28,A
.............3........2...............8.1......1..........9.................7....
111112222133332442135332244115332444665555544666788599667788589766788889777799999
.............6........8.................4.3........4......5.................2....
222211111244233331442233531444233511445555566995887666985887766988887667999997777
....5.................8......6........4.6.................7........2.............
777799999766788889667788589666788599665555544115332444135332244133332442111112222
....9.................3..........7......2.6...............1........4.............
999997777988887667985887766995887666445555566444233511442233531244233331222211111
.1.4.......2.........5.....2........1.9.68...4...........3.......8.......7.8.....
.....5.7.......6.......6...........1...56.8.2........7.....7.........9.......1.2.
4..2.9..7..8...1.....138....6.9.7.8.....5......5.8.3.............................
.............................8.7.3......6.....2.3.9.1....126.....2...1..9..4.8..5
....9.........................619......3.4......285.........................4....
Basic methods and some Generalized Intersections needed
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Re: SiSeSuSo questions/bugs

Postby urhegyi » Tue Mar 02, 2021 12:53 am

Hajime wrote:
urhegyi wrote:There is a simple xy-wing to start with at R1C4,R2C5,R9C4: R1C4=3--> R2C5=5; R1C4=6--> R9C4=5; R78C5<>5

You are right.
The program only eliminates candidates in seeing cells of the same row/col of the XY-chain/wing. It should also test seeing cells in the same box.
R1C4,R2C5,R9C4: two 5-s at the ends of the chain/wing --> r7c5<>5 and r6c5<>5
I will repair this in the next version.
Thanks

I found another case where a simple xy-wing wasn't found.
Could you check it with your latest version. The latest public one still has this bug.
SiSeSuSo_20210302_014253.png
SiSeSuSo_20210302_014253.png (16.6 KiB) Viewed 971 times

1)IF R9C4 = 2 --> R9C7=6
ELSE IF R9C4=7 --> R8C5=6
--> R8C9<>6=7!
2)IF R9C7 = 2 --> R9C4=7
ELSE IF R9C7 = 6 --> R8C9 = 7
--> R8C5<>7=6!
This all is tested with the February version.
I see now the March version is available.
Will test it later.
Update: Fixed
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby urhegyi » Fri Nov 05, 2021 6:16 pm

Generated sudoku with your November 5 version which seems to have three solutions:
Code: Select all
1...5...94.......1.8.2.1.6.2..5.8..6..71.43..8..6.3..7.6.9.7.1.5.......39...1...2

Code: Select all
Eliminated candidates per Method and per Sudoku

Method   \  Sudoku |   SER |     1
                   |-------|------
Not counted elims  |     0 |    82
Naked Singles      |   0.1 |    26
Hidden Singles     |   0.2 |    56
UR Type 1,2        |   4.5 |     2
Turbot-fish    [4] |   4.2 |     2
                   |-------|------
Eliminated Cand's  |   168 |   168
Sum(SER * Cand's)  |  31.2 |  31.2

Initial Candidates :   168
Maximum SER rating :   4.5 <- Approach
Labour rating      :  31.2 <- Experimental rating
Time needed        : 00:00:00.898
SiSeSuSo Solver and Generator (version 2021-11)

When disable UR:
Code: Select all
+--'---'--+--'--'--+--'--'--+ 
| 1  2   3| 4  5  6| 7  8  9| 
| 4  5   6| 7  8  9| 2  3  1| 
| 7  8   9| 2  3  1| 5  6  4| 
+--'---'--+--'--'--+--'--'--+ 
| 2  3  14| 5  7  8|14  9  6| 
| 6  9   7| 1  2  4| 3  5  8| 
| 8  14  5| 6  9  3|14  2  7| 
+--'---'--+--'--'--+--'--'--+ 
| 3  6   2| 9  4  7| 8  1  5| 
| 5 147 14| 8  6  2| 9 47  3| 
| 9  47  8| 3  1  5| 6 47  2| 
+--'---'--'--'--'--'--'--'--+ 

Same problem with:
Code: Select all
.23...78.4...8...1..92.15....1.7.4..6.......8..5.9.1....29.78..5...6...3.78...64.

When disable UR:
Code: Select all
+--'--'--+--'--'---+--'--'--+ 
| 1  2  3|46  5  46| 7  8  9| 
| 4  5  6| 7  8  9 | 2  3  1| 
| 7  8  9| 2  3  1 | 5  6  4| 
+--'--'--+--'--'---+--'--'--+ 
| 2 39  1|35  7  8 | 4 59  6| 
| 6 49  7| 1  2  45| 3 59  8| 
| 8 34  5|46  9 346| 1  2  7| 
+--'--'--+--'--'---+--'--'--+ 
| 3  6  2| 9  4  7 | 8  1  5| 
| 5  1  4| 8  6  2 | 9  7  3| 
| 9  7  8|35  1  35| 6  4  2| 
+--'--'--'--'--'---'--'--'--+ 
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby Hajime » Sat Nov 06, 2021 11:22 am

urhegyi wrote:Generated sudoku with your November 5 version which seems to have three solutions:
Code: Select all
1...5...94.......1.8.2.1.6.2..5.8..6..71.43..8..6.3..7.6.9.7.1.5.......39...1...2

I think this is UR by definition. http://hodoku.sourceforge.net/en/tech_ur.php#u1
Your puzzles can not be solved without UR, because of the multiple solutions.
Because it is generated with UR method it results in a valid puzzle with one unique solution.

May be I am wrong, but I think it works as intended
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Re: SiSeSuSo questions/bugs

Postby urhegyi » Sat Nov 06, 2021 11:50 am

Hajime wrote:
urhegyi wrote:Generated sudoku with your November 5 version which seems to have three solutions:
Code: Select all
1...5...94.......1.8.2.1.6.2..5.8..6..71.43..8..6.3..7.6.9.7.1.5.......39...1...2

I think this is UR by definition. http://hodoku.sourceforge.net/en/tech_ur.php#u1
Your puzzles can not be solved without UR, because of the multiple solutions.
Because it is generated with UR method it results in a valid puzzle with one unique solution.

May be I am wrong, but I think it works as intended

So generate a puzzle with UR option on.
Solve with UR off.
When it can't solve the grid completely, it results in multiple solutions.(check with backtracking).
The question now is why SISESUSO generates multiple solution puzzles that are by definition invallid, because a valid puzzle needs only to have one solution.

UR is a way of solving that can only be used when backtracking proved that the solution is unique, but can never be the only way that solves a sudoku.
A valid sudoku can always be solved with other methods than UR. This is the logical and preferred way to solve, unless the author of the puzzle provided you with the extra information it can only have one solution, then you can use UR. Mostly it is an easier way, but not necessary, but can always be avoided if you want. So a sudoku with three solutions can't be solved and has to be rejected by the program. There are examples where in case of UR used on a multiple solution puzzle, it selects one solution and an other technique like BUG selects one of the two others.
Last edited by urhegyi on Sat Nov 06, 2021 12:05 pm, edited 1 time in total.
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby yzfwsf » Sat Nov 06, 2021 12:01 pm

Hajime wrote:Your puzzles can not be solved without UR, because of the multiple solutions.

On the contrary, uniqueness techniques cannot be used for puzzles with multiple solutions.
yzfwsf
 
Posts: 845
Joined: 16 April 2019

Re: SiSeSuSo questions/bugs

Postby Hajime » Sat Nov 06, 2021 2:01 pm

OK, I was wrong, but not aware of it. And the implementation is accordingly.
I am open for ideas how to solve this in an elegant way (not using BFBT ).
For the time being: Generate puzzles with UR method unchecked.
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Re: SiSeSuSo questions/bugs

Postby urhegyi » Thu Nov 11, 2021 9:06 am

How do I add extra regions with less then 9 jigsaw pieces in the last November version?
When adding only 4 of them, program is stating there are no digits in jigsaw 5 up to 9.
In previous version it was possible.
Seems so S-Doku is broken to.
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby Hajime » Thu Nov 11, 2021 10:40 am

urhegyi wrote:How do I add extra regions with less then 9 jigsaw pieces in the last November version?
When adding only 4 of them, program is stating there are no digits in jigsaw 5 up to 9.
In previous version it was possible.
Seems so S-Doku is broken to.

I will look into this. Busy preparing a 11b version, also with UR "not applicable" when generating.

Edit 1: Found the difficulty. Before there was only a check if a cell contains no candidates anymore (and not a solution).
I added a second check if a house has no candidate "k" anymore. Each house needs a candidate k or a cell with solution k.
This must not be checked for all houses if only 4 Jigsaw-pieces are present.
Will fix it. Thanks urhegyi.

Edit 2: 2021-11B is released with these 2 bugfixes
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Re: SiSeSuSo questions/bugs

Postby urhegyi » Wed Sep 07, 2022 10:07 am

Tried to solve a very extreme sudoku:
Code: Select all
9.1...8.....2...4..2...5..34...2.6....73.1..98...5.....8....1....5.6.......5.8.74

Program version 02/2022 terminated with error code no more candidates for a given digit in row ...
Seems to continue when retrying with unique rectangles dissabled.
urhegyi
 
Posts: 740
Joined: 13 April 2020

Re: SiSeSuSo questions/bugs

Postby Hajime » Wed Sep 07, 2022 11:57 am

urhegyi wrote:Tried to solve a very extreme sudoku:
Code: Select all
9.1...8.....2...4..2...5..34...2.6....73.1..98...5.....8....1....5.6.......5.8.74

Program version 02/2022 terminated with error code no more candidates for a given digit in row ...
Seems to continue when retrying with unique rectangles dissabled.

SiSeSuSo goes wrong in the Type 2 Unique Rectangle (more brainwave errors in the past with UR's :o )
TYPE 2: 2 cells in row or col must have cardinality 2 and same candidates , other 2 cells have max 1 candidate in common.
http://hodoku.sourceforge.net/en/tech_ur.php#u2

Hidden Text: Show
Code: Select all
Private Sub UR_Type2(p, i1, j1, i2, j2, a, b, c, d) 'a,b,c,d are candidates in bits
        ' a b
        ' c d
        Dim e As Integer = elim_count ' current eliminated candidates
        If a = b AndAlso cardinality(a) = 2 AndAlso cardinality((c Or d) And a) = 2 Then
            Dim cd = (c Or d) Xor a 'other 2 cells have 1 candidate in common
            If cardinality(cd) = 1 Then elim_spectators(p, cd, 8, i2, j1, i2, j2)
        ElseIf a = c AndAlso cardinality(a) = 2 AndAlso cardinality((b Or d) And a) = 2 Then
            Dim bd = (b Or d) Xor a
            If cardinality(bd) = 1 Then elim_spectators(p, bd, 8, i1, j2, i2, j2)
        ElseIf b = d AndAlso cardinality(b) = 2 AndAlso cardinality((a Or c) And b) = 2 Then
            Dim ac = (a Or c) Xor b
            If cardinality(ac) = 1 Then elim_spectators(p, ac, 8, i1, j1, i2, j1)
        ElseIf c = d AndAlso cardinality(c) = 2 AndAlso cardinality((a Or b) And c) = 2 Then
            Dim ab = (a Or b) Xor c
            If cardinality(ab) = 1 Then elim_spectators(p, ab, 8, i1, j1, i1, j2)
        End If
        If elim_count > e Then
            If CB_Logging_On.Checked Then message_logging("Type 2: r" & i1 & i2 & ",c" & j1 & j2)
        End If
    End Sub
 


Found a severe bug in UR method Type 2:
After determining 9 clues the above puzzle results in:
Code: Select all
|  9   35   1 | 467  347  3467| 8   256  26 |     
| 35    7   8 |  2   19   369 | 59   4   16 |     
|  6    2   4 | 189  189   5  | 7   19    3 |     
+-------------+---------------+-------------+     
|  4  1359  39| 789   2    79 | 6  1358 1578|     
| 25    6   7 |  3   48    1  |245  28    9 |     
|  8   139 239|4679   5   4679| 34  123  127|     
+-------------+---------------+-------------+     
| 237   8  239| 479 3479 23479| 1   56   56 |     
|1237   4   5 | 179   6   2379|239 2389  28 |     
| 123  39   6 |  5   139   8  |239   7    4 |
+-------------+---------------+-------------+         
#1//B4
9.1...8...782...4.624..57.34...2.6...673.1..98...5.....8....1...45.6......65.8.74


SiSeSuSo says: Type 2: r17,c89 => (-4)r1c4 (-4)r1c5 (-4)r1c6
2 errors:
1. There is no candidate 5 in r1c9, so the Type 2 definition is broken
2. If a candidate k=2 should be eliminated in row 1 then please do not eliminate 2^k .

Keep method UR unchecked until next release.
User avatar
Hajime
 
Posts: 1348
Joined: 20 April 2018
Location: Fryslân

Next

Return to Sudoku variants