C# Program for Solving / Generating Sudokus, Sudoku Blog

Programs which generate, solve, and analyze Sudoku puzzles

Re: Big Sudokus

Postby m_b_metcalf » Thu Apr 02, 2015 9:35 am

bloggeroliver wrote: today I just want to advertise some big, challenging Sudokus I created with my program. You can find them on this link: http://sudokusoftheday.blogspot.de/p/big-sudokus.html

Oliver,
I looked at your first puzzle, a 16x16, reproduced here:
Code: Select all
  1 16  4  . 11  9  .  .  .  6 14  2 12  5  . 13
 11  .  . 13  4 12 14  .  . 10  9  3  .  2  1  .
  .  .  .  2  6  1  .  .  .  8 12  5 16  . 11  9
  . 12  8  . 16 10  .  2  1  . 11 13  .  3  .  6
 13 11  2  .  .  7  .  1  . 15  6  9  4  . 10  3
  8  . 12  .  . 16  2  . 11  .  .  7  9 15 14  .
  .  .  7  3 15  .  6  .  .  4  5  . 13  1  2  .
 14  1  .  .  3 11  4  .  .  . 13 10  8  6  .  .
  4 13  .  6  8  3  . 12  . 14 10  1  .  . 15  .
  5  . 11  8  9  4  . 10  6  .  .  .  .  .  3 14
 12  3  . 14  .  .  1 16  .  .  .  4 11  8  6 10
  9  7  .  1  2  6 15 14 13  3  8 11  5  . 16  .
  3  .  .  .  7 14 16  6  .  5  1  8  . 11  .  4
 10  4  5  . 12 15  9  8  . 11  2  .  6 14 13  1
  2  . 14 16  1  .  3 11  7 13  .  6  . 12  8 15
  .  .  . 11 13  .  .  4 12  9 15 14  3  7  5 16
No. of givens = 166

It is very easy, solvable with singles only. All but three of the clues are, individually, redundant. Removing a subset of these gives, for example, the very hard (SE rating ~9), minimal puzzle below. Now, that's a real challenge!

Regards,

Mike Metcalf

Code: Select all
  1  .  4  . 11  9  .  .  .  6 14  . 12  5  . 13
  .  .  . 13  4 12 14  .  . 10  9  3  .  2  1  .
  .  .  .  .  6  .  .  .  .  .  .  5 16  . 11  .
  . 12  8  . 16 10  .  .  .  . 11  .  .  3  .  6
 13 11  2  .  .  7  .  1  . 15  6  9  4  . 10  3
  8  . 12  .  . 16  2  . 11  .  .  .  9  .  .  .
  .  .  7  3  .  .  6  .  .  4  5  .  .  1  2  .
  .  1  .  .  . 11  .  .  .  . 13 10  8  6  .  .
  . 13  .  .  8  .  .  .  . 14 10  1  .  . 15  .
  5  .  .  8  .  4  . 10  6  .  .  .  .  .  3  .
  .  3  . 14  .  .  1  .  .  .  .  4 11  .  .  .
  9  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .
  3  .  .  .  . 14 16  6  .  5  1  .  .  .  .  .
  .  4  .  . 12 15  .  .  .  .  .  .  .  .  .  .
  2  .  . 16  .  .  3  .  . 13  .  .  .  .  .  .
  .  .  .  .  .  .  .  . 12  .  .  .  .  .  .  .
No. of givens = 92
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13577
Joined: 15 May 2006
Location: Berlin

Re: C# Program for Solving / Generating Sudokus, Sudoku Blog

Postby bloggeroliver » Thu Apr 02, 2015 3:21 pm

Very interesting, there seems to be an expert Sudoku solver / generator.
And yes that's true, as described in the post (or at least on my blog) I programmed 4 difficulities, the first only consists of singles. The "big" Sudokus I created are all of the 1st difficulty, but I could make them harder. I just thought in this size already this is difficult enough (and time consuming).
bloggeroliver
 
Posts: 17
Joined: 24 October 2014

Re: C# Program for Solving / Generating Sudokus, Sudoku Blog

Postby m_b_metcalf » Thu Apr 02, 2015 4:09 pm

bloggeroliver wrote:Very interesting, there seems to be an expert Sudoku solver / generator


You might like to look at, for instance, http://forum.enjoysudoku.com/giant-sudoku-s-16x16-25x25-36x36-100x100-t6578.html and http://sudokugeant.cabanova.fr/. At some point, blue published some really diabolical 16x16s, I think on the now lost Programmers' Forum. An example is below.

Regards,

Mike Metcalf

Code: Select all
 .  4  .  9  .  2  .  .  .  .  .  6  . 13  . 10
11  . 10  . 13  .  .  .  4  .  .  . 14  . 15  .
 .  3  .  5  .  .  .  1  .  7  .  .  .  4  . 12
 6  .  1  .  .  .  8  . 15  .  9  .  .  .  5  .
 . 12  .  .  .  6  .  8  .  1  . 15  .  .  .  5
 4  .  .  . 11  . 12  .  3  .  7  .  2  .  .  .
 .  .  .  3  . 10  .  7  . 14  .  4  .  1  .  .
 .  .  8  . 15  .  4  . 12  .  5  .  7  . 11  .
 .  .  . 16  . 12  .  6  .  9  . 11  .  2  .  .
 9  .  .  .  1  . 13  .  2  . 14  . 16  .  .  .
 . 11  .  .  . 14  .  3  . 10  .  5  .  .  .  7
12  .  4  .  .  .  5  .  7  .  1  .  .  .  6  .
 . 13  .  8  .  .  . 10  .  3  .  .  . 11  . 16
 5  . 15  .  6  .  .  .  9  .  .  .  1  .  8  .
 .  9  .  2  .  8  .  .  .  .  .  7  .  6  . 14
 1  .  6  . 12  . 14  .  .  . 13  .  9  .  7  .   extremely hard, from blue
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13577
Joined: 15 May 2006
Location: Berlin

re: 4x4

Postby Pat » Mon Apr 06, 2015 8:54 am

bloggeroliver wrote:

    4 difficulities,
    the first only consists of singles.
    The "big" Sudokus I created are all of the 1st difficulty,
    but I could make them harder.
    I just thought in this size
    this is difficult enough

this is difficult enough for me —
Medium (going just a little beyond "singles")
from blue (2011.Apr)

    Code: Select all

    . B 6 G | . . . . | . C . . | . F . .
    . . . E | 2 7 . . | 9 . . . | C 8 . 1
    . . . . | 9 . . . | 3 2 . 8 | 7 B 5 .
    . . . . | . 3 6 . | E . A . | 4 . 2 .
    --------+---------+---------+--------
    3 . . B | . . . . | . 6 . 7 | . . . .
    . 6 . 2 | A . . . | . . . . | . E C .
    G . . C | . . . . | F . 5 D | . . . 8
    D . . . | . . . . | 8 . . . | G . . 5
    --------+---------+---------+--------
    . . D 9 | 6 . 2 . | A F . 1 | . . . .
    . . 5 . | . B . . | . . 4 2 | F . 8 .
    B A . 3 | . . . . | . . . . | . . . .
    . G . . | . . E . | . . . . | 9 . . B
    --------+---------+---------+--------
    . 3 . . | . A . . | . . . . | B . 7 .
    . . 1 6 | G C 4 . | 5 . E F | . . . 3
    . . . 7 | B 2 . . | . D 9 . | . . 4 C
    . 2 . . | F . . 3 | . . 8 G | . . E .

User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Re: C# Program for Solving / Generating Sudokus, Sudoku Blog

Postby bloggeroliver » Mon Apr 06, 2015 11:34 pm

Thanks again for your interesting replies - I have to say I really have a high opinion of this forum.
But yes, the big Sudokus would be way to hard for me without my program - I never used to solve Sudokus before programming them, but now I am slowly starting trying my online solver.

One last time (I think) I would like to use this as an advertisement board, I (mostly) finished now an online solver which can solve arbitrary Sudokus automatically - it's possibly to solve step by step with explanations. Of course I'd like to know how understandable etc it is. Would be happy if you give it a try: http://sudokusoftheday.blogspot.de/p/online-solver.html
bloggeroliver
 
Posts: 17
Joined: 24 October 2014

Re: C# Program for Solving / Generating Sudokus, Sudoku Blog

Postby ixsetf » Sun Apr 12, 2015 10:15 pm

Hello, bloggeroliver. I have tried your solver and it seems very functional. The one issue I had is for some puzzles the following error message pops up:

"Fatal error: Maximum execution time of 12 seconds exceeded in /users/bloggeroliver/www/Sudokus/solver.php on line 192"
ixsetf
 
Posts: 50
Joined: 11 May 2014

Re: C# Program for Solving / Generating Sudokus, Sudoku Blog

Postby bloggeroliver » Wed Apr 15, 2015 9:03 pm

Thanks again for your compliment!
And uuh yes, that's true, I have to work on that. I don't really know why PHP is so slow, C# does it in no time, I thought I had made it quick enough though but seems there are some Sudokus where the guessing takes too much time.
bloggeroliver
 
Posts: 17
Joined: 24 October 2014

Re: Big Sudokus

Postby enxio27 » Fri Jan 12, 2018 4:19 am

m_b_metcalf wrote: I looked at your first puzzle, a 16x16, reproduced here:
Code: Select all
  1 16  4  . 11  9  .  .  .  6 14  2 12  5  . 13
 11  .  . 13  4 12 14  .  . 10  9  3  .  2  1  .
  .  .  .  2  6  1  .  .  .  8 12  5 16  . 11  9
  . 12  8  . 16 10  .  2  1  . 11 13  .  3  .  6
 13 11  2  .  .  7  .  1  . 15  6  9  4  . 10  3
  8  . 12  .  . 16  2  . 11  .  .  7  9 15 14  .
  .  .  7  3 15  .  6  .  .  4  5  . 13  1  2  .
 14  1  .  .  3 11  4  .  .  . 13 10  8  6  .  .
  4 13  .  6  8  3  . 12  . 14 10  1  .  . 15  .
  5  . 11  8  9  4  . 10  6  .  .  .  .  .  3 14
 12  3  . 14  .  .  1 16  .  .  .  4 11  8  6 10
  9  7  .  1  2  6 15 14 13  3  8 11  5  . 16  .
  3  .  .  .  7 14 16  6  .  5  1  8  . 11  .  4
 10  4  5  . 12 15  9  8  . 11  2  .  6 14 13  1
  2  . 14 16  1  .  3 11  7 13  .  6  . 12  8 15
  .  .  . 11 13  .  .  4 12  9 15 14  3  7  5 16
No. of givens = 166


I would like to recommend that you use letters rather than numbers for puzzles up to 25x25. Once a puzzle gets into double digits, it's too easy to make a mistake. Since sudoku is all about logic rather than about math, there is no reason that letters can't be used instead, and makes for a much more readable puzzle.
User avatar
enxio27
 
Posts: 532
Joined: 13 November 2007

Re: Big Sudokus

Postby m_b_metcalf » Fri Jan 12, 2018 9:21 am

enxio27 wrote:I would like to recommend that you use letters rather than numbers for puzzles up to 25x25. Once a puzzle gets into double digits, it's too easy to make a mistake. Since sudoku is all about logic rather than about math, there is no reason that letters can't be used instead, and makes for a much more readable puzzle.

Well, there's also hexadecimal for 16x16:
Code: Select all
  5  4  .  7  .  0  .  .  .  .  9  .  1  .  D  F
  .  .  E  .  5  7  4  .  .  8  2  F  .  9  .  .
  .  .  .  9  .  .  .  F  B  .  .  .  4  .  .  .
  .  D  0  .  .  .  6  B  4  5  .  .  .  8  3  .
  .  .  .  .  .  .  .  5  7  .  .  .  .  .  .  .
  B  3  .  .  .  8  .  .  .  .  6  .  .  .  A  D
  .  .  D  .  .  .  .  1  3  .  .  .  .  2  .  .
  .  2  7  A  D  3  E  6  5  F  1  B  8  0  C  .
  .  8  6  0  9  4  D  E  1  C  5  3  B  7  F  .
  .  .  5  .  .  .  .  7  E  .  .  .  .  4  .  .
  7  F  .  .  .  5  .  .  .  .  8  .  .  .  E  9
  .  .  .  .  .  .  .  3  6  .  .  .  .  .  .  .
  .  5  3  .  .  .  0  9  8  E  .  .  .  6  1  .
  .  .  .  6  .  .  .  4  F  .  .  .  0  .  .  .
  .  .  B  .  8  1  C  .  .  6  7  2  .  3  .  .
  0  A  .  1  .  B  .  .  .  .  C  .  7  .  4  8      Hard

It's easier to stick to numbers as it's completely extensible, but any representation is easily programmable.

Regards,

Mike Metcalf

P.S. Do we see you back in the Patterns Game soon?
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13577
Joined: 15 May 2006
Location: Berlin

Re: Big Sudokus

Postby enxio27 » Fri Jan 12, 2018 4:36 pm

m_b_metcalf wrote:
enxio27 wrote:I would like to recommend that you use letters rather than numbers for puzzles up to 25x25. Once a puzzle gets into double digits, it's too easy to make a mistake. Since sudoku is all about logic rather than about math, there is no reason that letters can't be used instead, and makes for a much more readable puzzle.

Well, there's also hexadecimal for 16x16:

Meh. I've seen that, too, but not a fan. I myself have no interest in puzzles with grids larger than 16x16. For those who do, I admit that at some level you have use both letters and numbers, including multi-digit numbers.

P.S. Do we see you back in the Patterns Game soon?

Hopefully! I've been pretty swamped with stuff at home and at work since early December, but I'm hoping that I can see my way clear soon to get back into the game.
User avatar
enxio27
 
Posts: 532
Joined: 13 November 2007

Previous

Return to Software