My sudoku generator produces odd sudokus

Programs which generate, solve, and analyze Sudoku puzzles

My sudoku generator produces odd sudokus

Postby lordsaga640 » Fri May 27, 2022 1:00 pm

Hello community,

I've created a small software which generates sudoku. However I'm testing those sudoku against some sudoku analyser and they don't like my sudokus (they din't the sudoku don't have a valid solution), however I can't find a solution for these.
I tested other applications to solve my sudoku and some of them can find a single solution correctly.
My question is: Is my software wrong, or the other softwares are wrong?

Thank you

I've tested the following websites:

The sudoku generated by my application is the following:
Code: Select all
--------------------------
| ?  ?  4  5  6  8  3  2  ? |
| 5  ?  ?  ?  9  ?  ?  ?  ? |
| 8  ?  ?  1  ?  7  ?  6  ? |
| ?  ?  ?  6  ?  ?  ?  ?  ? |
| ?  8  ?  3  ?  5  ?  1  ? |
| ?  6  ?  ?  ?  ?  ?  ?  ? |
| 4  ?  9  7  ?  2  8  3  ? |
| ?  ?  ?  ?  ?  6  5  ?  ? |
| ?  ?  ?  ?  8  ?  ?  ?  ? |
--------------------------


While the solution should be the following one:
Code: Select all
--------------------------
| 1  9  4  5  6  8  3  2  7 |
| 5  7  6  2  9  3  1  4  8 |
| 8  3  2  1  4  7  9  6  5 |
| 2  4  5  6  1  9  7  8  3 |
| 9  8  7  3  2  5  6  1  4 |
| 3  6  1  8  7  4  2  5  9 |
| 4  1  9  7  5  2  8  3  6 |
| 7  2  8  4  3  6  5  9  1 |
| 6  5  3  9  8  1  4  7  2 |
--------------------------
lordsaga640
 
Posts: 1
Joined: 27 May 2022

Postby Pat » Sat May 28, 2022 3:51 am

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



your puzzle has exactly one answer
User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Re: My sudoku generator produces odd sudokus

Postby denis_berthier » Sat May 28, 2022 1:33 pm

Your puzzle can be solved with elementary techniques. Any serious website should find the solution.
Code: Select all
Resolution state after Singles and whips[1]:
   +-------------------+-------------------+-------------------+
   ! 1     79    4     ! 5     6     8     ! 3     2     79    !
   ! 5     37    6     ! 2     9     34    ! 147   478   1478  !
   ! 8     239   23    ! 1     34    7     ! 49    6     5     !
   ! 2379  4     12357 ! 6     127   19    ! 279   5789  23789 !
   ! 279   8     27    ! 3     247   5     ! 6     1     2479  !
   ! 2379  6     12357 ! 8     1247  149   ! 2479  4579  23479 !
   +-------------------+-------------------+-------------------+
   ! 4     1     9     ! 7     5     2     ! 8     3     6     !
   ! 237   23    8     ! 49    13    6     ! 5     479   12479 !
   ! 6     5     237   ! 49    8     13    ! 12479 479   12479 !
   +-------------------+-------------------+-------------------+
131 candidates.

hidden-pairs-in-a-column: c3{n1 n5}{r4 r6} ==> r6c3≠7, r6c3≠3, r6c3≠2, r4c3≠7, r4c3≠3, r4c3≠2
whip[1]: b4n3{r6c1 .} ==> r8c1≠3
finned-x-wing-in-rows: n3{r9 r2}{c6 c3} ==> r3c3≠3
stte
denis_berthier
2010 Supporter
 
Posts: 4214
Joined: 19 June 2007
Location: Paris

Re: My sudoku generator produces odd sudokus

Postby swb01 » Sat May 28, 2022 2:31 pm

Observations on the puzzle.

Code: Select all

FullGrid: 194568327576293148832147965245619783987325614361874259419752836728436591653981472
Clues:   ..456832.5...9....8..1.7.6....6......8.3.5.1..6.......4.97.283......65......8....     27 Clues
    -------------------------------
    | 1  9 (4)|"5""6""8"|(3)(2) 7 |
    |(5) 7  6 | 2 (9) 3 | 1  4  8 |
    |(8) 3  2 |(1) 4 (7)| 9 (6) 5 |
    -------------------------------
    | 2  4  5 |"6" 1  9 | 7  8  3 |
    | 9 (8) 7 |(3) 2 (5)| 6 (1) 4 |
    | 3 (6) 1 | 8  7  4 | 2  5  9 |
    -------------------------------
    |(4) 1 (9)|"7" 5 (2)|(8)"3" 6 |
    | 7  2  8 | 4  3 (6)|(5) 9  1 |
    | 6  5  3 | 9 (8) 1 | 4  7  2 |
    -------------------------------
Not minimal: Any one, and possibly more, of the 6 clues marked with "x" can be removes and the puzzle will still be solved.

Three cases of minimal sub-puzzles with 22 clues:
Clues#1:   ..45..32.5...9....8..1.7.6...........8.3.5.1..6.......4.9..28.......65......8....
    -------------------------------
    | 1  9 (4)|<5> 6  8 |(3)(2) 7 |
    |(5) 7  6 | 2 (9) 3 | 1  4  8 |
    |(8) 3  2 |(1) 4 (7)| 9 (6) 5 |
    -------------------------------
    | 2  4  5 | 6  1  9 | 7  8  3 |
    | 9 (8) 7 |(3) 2 (5)| 6 (1) 4 |
    | 3 (6) 1 | 8  7  4 | 2  5  9 |
    -------------------------------
    |(4) 1 (9)| 7  5 (2)|(8) 3  6 |
    | 7  2  8 | 4  3 (6)|(5) 9  1 |
    | 6  5  3 | 9 (8) 1 | 4  7  2 |
    -------------------------------
Clues#2:   ..4.6.32.5...9....8..1.7.6....6......8.3.5.1..6.......4.9..28.......65......8....
    -------------------------------
    | 1  9 (4)| 5 <6> 8 |(3)(2) 7 |
    |(5) 7  6 | 2 (9) 3 | 1  4  8 |
    |(8) 3  2 |(1) 4 (7)| 9 (6) 5 |
    -------------------------------
    | 2  4  5 | 6  1  9 | 7  8  3 |
    | 9 (8) 7 |(3) 2 (5)| 6 (1) 4 |
    | 3 (6) 1 | 8  7  4 | 2  5  9 |
    -------------------------------
    |(4) 1 (9)| 7  5 (2)|(8) 3  6 |
    | 7  2  8 | 4  3 (6)|(5) 9  1 |
    | 6  5  3 | 9 (8) 1 | 4  7  2 |
    -------------------------------
Clues#3:   ..4...32.5...9....8..1.7.6....6......8.3.5.1..6.......4.9..28.......65......8....
    -------------------------------
    | 1  9 (4)| 5  6  8 |(3)(2) 7 |
    |(5) 7  6 | 2 (9) 3 | 1  4  8 |
    |(8) 3  2 |(1) 4 (7)| 9 (6) 5 |
    -------------------------------
    | 2  4  5 |<6> 1  9 | 7  8  3 |
    | 9 (8) 7 |(3) 2 (5)| 6 (1) 4 |
    | 3 (6) 1 | 8  7  4 | 2  5  9 |
    -------------------------------
    |(4) 1 (9)| 7  5 (2)|(8) 3  6 |
    | 7  2  8 | 4  3 (6)|(5) 9  1 |
    | 6  5  3 | 9 (8) 1 | 4  7  2 |
    -------------------------------
swb01
 
Posts: 47
Joined: 07 March 2021
Location: Potomac, Maryland

Re: My sudoku generator produces odd sudokus

Postby swb01 » Tue May 31, 2022 1:31 pm

Comment retracted.
Last edited by swb01 on Wed Jun 01, 2022 4:23 am, edited 1 time in total.
swb01
 
Posts: 47
Joined: 07 March 2021
Location: Potomac, Maryland

Re: My sudoku generator produces odd sudokus

Postby denis_berthier » Tue May 31, 2022 2:54 pm

swb01 wrote:My solver finds 7 more reductions.

Is there anything unusual in finding more eliminations by applying more rules?
denis_berthier
2010 Supporter
 
Posts: 4214
Joined: 19 June 2007
Location: Paris

Re: My sudoku generator produces odd sudokus

Postby swb01 » Tue May 31, 2022 10:50 pm

Comment retracted.
Last edited by swb01 on Wed Jun 01, 2022 4:24 am, edited 1 time in total.
swb01
 
Posts: 47
Joined: 07 March 2021
Location: Potomac, Maryland

Re: My sudoku generator produces odd sudokus

Postby denis_berthier » Wed Jun 01, 2022 1:41 am

swb01 wrote:My coded logic gets to 124 candidates, which I realize is different from human solving techniques. Does anyone know if there are reduction rules that can reduce this puzzle further?

Apply the rules I've given in my first post.
denis_berthier
2010 Supporter
 
Posts: 4214
Joined: 19 June 2007
Location: Paris

Re: My sudoku generator produces odd sudokus

Postby Chatogaster » Tue Jun 21, 2022 12:33 pm

lordsaga640 wrote:[...] My question is: Is my software wrong, or the other softwares are wrong? [...][/code]


Neither option (law of the excluded middle). Your program generated a valid puzzle (so at least it was right when producing it) and the other 2 "softwares" you referred to find its solution within milliseconds (using trivial pattern-based reasoning only). Just make sure you submit your puzzles in the right format to those other sites when testing them (the puzzles that is, not the sites).

PS: this is what I used to verify that the references you provided have no problem whatsoever with your puzzle:

https://www.stolaf.edu/people/hansonr/sudoku/???456832?5???9????8??1?7?6????6??????8?3?5?1??6???????4?97?283??????65??????8????
https://www.sudokuwiki.org/sudoku.htm?bd=??456832?5???9????8??1?7?6????6??????8?3?5?1??6???????4?97?283??????65??????8????
Chatogaster
 
Posts: 1
Joined: 21 June 2022

Re: My sudoku generator produces odd sudokus

Postby gulshan212 » Fri Jun 23, 2023 8:48 am

Hello, this is Gulshan Negi
Determining whether the issue lies with your software or the other Sudoku analyzers requires further investigation. You can start by reviewing your software's logic, testing with different Sudoku analyzers, comparing against known valid Sudoku puzzles, and seeking feedback from the Sudoku community. By following these steps, you can gain insights into the potential sources of the problem and work towards improving the accuracy and reliability of your software.
Thanks
gulshan212
 
Posts: 12
Joined: 27 January 2023
Location: Haldwani, Uttarakhand


Return to Software