dailysudoku.com Forum Index dailysudoku.com
Discussion of Daily Sudoku puzzles
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Generating Process
Goto page 1, 2  Next
 
Post new topic   Reply to topic    dailysudoku.com Forum Index -> General discussion
View previous topic :: View next topic  
Author Message
alanr555



Joined: 01 Aug 2005
Posts: 198
Location: Bideford Devon EX39

PostPosted: Wed Dec 10, 2014 3:29 am    Post subject: Generating Process Reply with quote

I have been tackling puzzles for nearly ten years now. Throughout that
time I have had admiration for those who CREATE the puzzles.

Is there a forum that explains HOW to generate a puzzle?

Clearly 28 cells need to be filled.
Some cells could be inconsistent.
Many combinations would give non-unique solutions.
Puzzles would warrant different gradings for difficulty.

As the "best" puzzles are "hand made", how are such hands
trained to give the best results?

Does one need to be an expert solver in order to be competent
at generation? If so, I may as well quit now!
Back to top
View user's profile Send private message
Pat



Joined: 23 Feb 2010
Posts: 207

PostPosted: Mon Oct 26, 2015 3:25 pm    Post subject: Reply with quote


    few puzzles are hand-made

    we now have plenty of software
    (much of it free)
    to generate puzzles

      rating them is a tougher question

    try the other forum --
    The New Sudoku Players' Forum
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Fri Oct 30, 2015 7:38 pm    Post subject: Reply with quote

How do I create Sudokus ?

The process of creating Sudokus is much closer to farming than it is to engineering.

How do you create a grade 1 / class A carrot?
Answer is: you don't.

All you do is prepare the ground, throw a few seeds in.
Monitor the growth of your crop, maybe water or prune some. Takes time and experience. Need a few tools, too.

Then harvest and take a good look at the carrots:
The bent and ugly ones still are very nutritious, but can only be sold as low quality.
The "good" ones go to the grocery stores and supermarkets.
The exceptionally beautiful ones are sold as "Premium" quality in special markets or stores.

There's your basic Sudoku "creation" process.

The soil, that's a set of programs that "let the sudoku grow": start with a few random clues, add more random clues if too many solutions, remove clues if no solution. The "random" clues are not random at all, they follow a strictly determined pseudo-random generation pattern derived from that one initial "seed" (and yes, it is really called a seed in programming jargon). This is the water and prune phase.

In order to find out if there is a solution, and - if yes - how many, we need a program that "knows" the rules of Sudoku puzzles (e.g. "only one of each number per row") and very efficiently applies these rules to test every possible position that is compatible with the randomly generated clues.

That is called a "brute force" approach, but works surprisingly well thanks to a paper published by Donald Knuth, a professor emeritus at Stanford, called "Dancing Links". Even my five year old business notebook, using javascript in the Safari browser, could find out one to a few hundred solutions to a given Sudoku in mere 3-5 milliseconds. And the algorithm is not hard to code, either.

No, I do not believe that there are ANY hand-crafted sudokus. I also do not believe that there are any hand-crafted carrots. It is so much easier to let them grow by themselves.

When the Sudoku stops growing (i.e. there is exactly one solution), the interesting part starts. Remember: look at the carrots and decide where they go: garbage dump or Premium store. This process is called "grading", or "rating".

Unfortunately, one cannot - by merely looking at a Sudoku - decide whether it is an "easy", "hard" or "impossible" one. Different people use different approaches. Myself, I use an approach that closely follows the way a real person solves a Sudoku: look at the grid, maybe add a little markup here and there, detect patterns like naked pairs or xy-wings. Easy puzzles use only very basic techniques, hard puzzles need a little more, like pairs, for example. Again, to each their own - what some people call advanced, others call intermediary.

Or "impossible": many puzzles, even if they have a garanteed unique solution, cannot be solved by "conventional means". And that is where I draw the line: if I need a computer to solve a Sudoku, why not apply the Dancing Links algorithm? Five milliseconds, far shorter than a heartbeat, and there you have it: the solution. Fun? Seriously, I throw away more puzzles because they are "too hard" than I publish as "very hard" or "advanced" taken together.

What is interesting in those "impossible" ones (at least for me) is how we could find a workable procedure to make a few more patterns available to the human Sudoku solver? There is a good example to illustrate the grading dilemma: the BUG+1 (2,3) ("Bivalue Universal Grave") pattern is usually regarded as rather advanced, although it is one of the easiest pattern to recognize, much easier than a humble XY-wing. Same for the UR (Unique rectangle) type 1. I use those simple URs for shortcuts before I even attempt to find a wing. Still, I do not (yet) dare to publish a puzzle as "very hard" if it needs a UR or BUG+1.

On to the final question: "Does one need to be an expert solver in order to be competent at generation?". Not necessarily. But you have to be a programmer or can afford to hire programmers/designers. It does not take a gourmet to grow carrots. But you must be able to work with the tools. And - it takes a lot of expertise to assess the quality of food or to decide which dishes to serve at different occasions.

And given the fact that MOST people only want the easiest of all Sudokus, the ones they can solve in 5 minutes on a subway train and then throw away, all the people who come looking for "good" puzzles on the internet already have very high expectations. It is for those people that I farm and grade my Sudokus.

Helmut

edit: Pat, I only realized this question was posted almost a year ago when I had already finished my answer. But thanks for bumping it Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
alanr555



Joined: 01 Aug 2005
Posts: 198
Location: Bideford Devon EX39

PostPosted: Mon Nov 02, 2015 8:22 pm    Post subject: Reply with quote

Thank you , Nataraj, for this comprehensive response.
I like the analogy with the carrots. The concept of creating them all
and then deciding which to keep for which purpose was one of my
thoughts - more mundane than arcane - and I am pleased to have
received confirmation that it is the basic approach.

Are there any statistics on how many of say 1000 generated fall
into which categories?
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Tue Nov 03, 2015 2:06 pm    Post subject: Reply with quote

alanr555 wrote:

Are there any statistics on how many of say 1000 generated fall
into which categories?


Not off the top of my head, sorry.

I remember that the critical path is the creation of Very Hards. There's more Advanced than VHs, although I need more VHs than Advanced for my mix.

Then, there's the problem that within the VHs, the xy-wings are just so dominant. Almost every puzzle that is beyond Hard is either impossible or has an xy-wing. I need to produce 50% more puzzles than I need, in order to find at least a few xyz-wing, the odd x-wing and maybe a few combinations of 2 xy or xy and xyz wings, to make it more interesting for the people who solve Sudokus.

After my post about how easy it is to spot BUG+1, I am seriously tempted to add BUG+1 and UR type 1 to the VH arsenal, with additional benefits:

a) the ratio of VH to Advanced would improve to maybe even or slightly more VH than ADV.
b) I could use those BUG+1 puzzles that I have to throw away now.

Good thing that I have almost two more months to decide and to change the grading routines accordingly.

Also, I'll have my computer do a trial run to find those frequencies for the different types. Should not take too long ... Smile

Best regards
Helmut
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Tue Nov 03, 2015 3:18 pm    Post subject: Reply with quote

Frequencies of graded Sudokus in test run

The number of sudokus requested was:
- 61 each for Easy, Mild, Hard
- 44 Very Hard
- 17 Advanced

The "Farm" creates at least 50% more than what is needed, so it stopped when 67 Very Hard were generated.

This is the result:
Code:
3.11.2015 15:05:49 - AUTO on
           EASY  274
           MILD  254
           HARD  376
      VERY HARD   67
       ADVANCED   47
        EXTREME  142

3.11.2015 15:17:51 - AUTO off.
 TOTAL puzzles: 1160


What I do then, is look at the individual VH and ADV: which of the puzzles look interesting (not too many tedious steps, not too few hard steps). Don't want ALL m- or w-wings (sirloin steak every day??? ah, how dull!) or only xy-wings every day (I dimly remember having read comments about all VH puzzles being solved by xy wings on this very site ...)

BTW the statistics above do not include all the positions that were rejected during the "watering and pruning" phase because they produced too many solutions or none at all.

To give you a feeling about how many tries are needed to achieve one (as yet ungraded) sudoku, I include the production history of one VH Sudoku:

Code:
Tue, 03 Nov 2015 14:07:31 GMT
Seed:1246252372 Init: 1
C1: 8 clues, 6 tries, 1/2 ms.
C2: 26 clues, 1 solutions, 22(2/2/2/1/1/2/1/5/6) tries, 15/17 ms.
C3: 26 (+0 extra) clues, 1 solutions, 0/17 ms.
R1: 25 clues, 2 positions. 8/25 ms.


Statistics of steps taken: 5/90/5/4/1/1/0/0/0/0. time:146 ms.


It starts with a random seed.
First phase (germination): 6 tries to build a position of 8 clues
Second phase (growth): add clues until we have a unique solution. 22 tries. Optional (C3) add redundant clues to make the puzzle less tedious.
Third phase(pruning): remove clues to make the puzzle more interesting.
I did not record the tries during that phase.

All in all I'd give a conservative estimate of 25 positions tried for one ungraded sudoku.

The whole process (12 minutes real time) created some 25.000 positions to arrive at 44 "very hard"s. Maybe my carrot example was not fitting well enough - seems more like sprinkling a handful of stardust on magic ground to harvest a few moonstones Wink

By far the longest phase in the whole process is the grading phase: as you can see it needs 119 milliseconds - compared to the mere 25 milliseconds for all the tries before.

But without the grading phase all the rest would we in vain ..

Helmut
Back to top
View user's profile Send private message Send e-mail Visit poster's website
keith



Joined: 19 Sep 2005
Posts: 3355
Location: near Detroit, Michigan, USA

PostPosted: Tue Nov 03, 2015 7:52 pm    Post subject: Reply with quote

Helmut,

An interesting discussion. Your generation process is not what I would have imagined.

How do you do the symmetry of the starting cells?

I imagine a random symmetric starting pattern overlaid on a valid solution to see if it generates a valid puzzle.

That is sort of what the old "patterns game" is all about, no?

Keith
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Wed Nov 04, 2015 10:02 am    Post subject: Reply with quote

Keith,

throughout the whole process, there are many places where the way to go is not obvious at all. When I began to think about generating puzzles myself, I thought about my emotional reaction to different kinds of puzzle layouts and I realized two things:

1 - I like symmetrical puzzles better. Horizontal symmetry is more pleasing to my eyes than vertical symmetry, and I like point symmetry best. So in fact when I generate a clue, it is either the central cell r5c5 or a pair of cells (x,y) and (10-x,10-y). I usually start with pairs, it is only at the very end that I fill the center cell.

2 - Squiggly puzzles look much nicer if bulky shapes are avoided. Dailysudoku's Squigglies used to be outright ugly for that same reason (maybe still are)
So out of all the possible nonominoes, I use only the "nice" ones.

Starting cells:
there is no "overlay" whatsoever. Aside from the restriction that the pattern must be symmetrical (see last paragraph) the whole process is random, but it follows an iterative pattern.

First, I create 9 pairs of cell coordiantes. Those are the starting cells. Fill with random numbers until there is at least one solution. (Phase C1)

Add more pairs. After every random throw, check for valid/invalid position. Too few clues (more than one solution): add more clues. Too many (or "bad") clues (no solution): try other clues for the same new pair or throw a new cell coordinate and try again. (Phase C2)

When the position has fewer then 30 solutions I stop adding random clues but instead select clues for the pairs out of the solution set. That is why Phase C3 is so fast.

Sorry, don't know about the patterns game. I do remember ravel posting puzzzles that said "patterns game" but I did not know what it referred to.

This is what the parameters for generation look like:
Code:
var maxCluesC2   = 28;         // stop adding clues in phase C2, if already too many givens

var maxSolC2   = 30;         // stop search after maxSol solutuions, if fewer solutions are found, end phase C2
var nRandomC1   = 18;         // usually, the first 4 + 6 pairs don't reqire many retries, should be rather random
               // to be on the safe side, try only 9 pairs = 18 givens

C1Strategy   = 0;         // strategies:
               //    1 ...   fill a certain number of clues and test
               //    0 ...   symmetric pattern ricj and r(10-i)c(10-j)
C2Strategy   = 0;         // strategies:
               //    1 ...   add clues at random
               //   0 ...   add clues in symmetric pairs
C3Strategy   = 0;         // strategies:
               //    1 ...   add last solved cell from one solution
               //   0 ...   take cell pair that appears in minimum number of solutions


R1Strategy   = 0;         // strategies:
               //    1 ...   remove at random
               //   0 ...   remove pair (out of random pairs / initial pairs?)
               //    -1 ..   do not reduce at all

if  ( SudokuType==2 )   // for squigglies,
    {
    R1Strategy   = -1;   // skip reduce phase, otherwise puzzles become too hard
    }
    else
    {
    }

During that time I got fed up with re-writing the code all the time so I coded a few alternatives and xx between them by selecting "strategies". The above set has been in place since 2011 (added squigglies then) and seems to work well.

Helmut
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pat



Joined: 23 Feb 2010
Posts: 207

PostPosted: Wed Nov 04, 2015 1:29 pm    Post subject: Reply with quote

nataraj wrote:

    don't know about the patterns game

in the Patterns Game,
each game has its own Layout
    how to generate puzzles for a given Layout,
    that's for each player to decide

here's an example for Layout 260 [ 23 cells given ]
— what rating would you assign it ?
    Code:

     6 . . | 7 . . | 9 . .
     . 4 . | . 5 . | . 1 .
     . . 2 | . . 4 | . . .
    -------+-------+------
     7 . 3 | . . . | . 9 .
     . . . | . 9 . | . . .
     . 9 . | . . . | 8 . 6
    -------+-------+------
     . . . | 3 . . | 1 . .
     . 2 . | . 1 . | . 5 .
     . . 4 | . . 6 | . . 2


    6..7..9...4..5..1...2..4...7.3....9.....9.....9....8.6...3..1...2..1..5...4..6..2
    [ play ]
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Wed Nov 04, 2015 4:12 pm    Post subject: Reply with quote

Hi Pat !

Thanks for the link to the Patterns Game on the New Players Forum. I signed up there only a few days ago and have not had time to look into the various sections. Good to know the Patterns Game still exists.

As to your question, without having solved the puzzle by hand, the rating given by the Sudoku Farm would be a 0: do not consider for publication.

This is what the program finds:
Code:

Top rating=5

Statistics of steps taken: 7/87/3/5/0/1/0/0/0/0. time:212 ms.

rating 3; Subset triple 378 row 9
rating 3; Subset quad 1568 box 4
rating 3; Subset sext 156789 box 7
rating 5; x-wing (9) - 3 advanced moves available.
rating 2; Subset naked pair 24 row 6
rating 2; Subset naked pair 37 row 6
rating 3; Subset quad 2368 box 2
rating 3; Subset quint 12468 box 5
rating 2; Subset naked pair 49 col 9


The single x-wing would suggest a VH rating. There are very interesting "Hard" steps (3 naked pairs, 5 triple and above. quint/sext is often the same as hidden pair), everything looks good so far.

But ... I would not even see these statistics - as I said, the puzzle would be given an overall rating of zero and not be presented for selection. Why?

For VH I limit the number of empty cells during "fill" (when PMs are written down) to <7 per house. If a puzzle requires the user to scribble seven or more numbers into the cell, it is no longer relaxed enough to qualify as VH. All a matter of personal preference, of course, YMMV.
BTW, this corresponds nicely to the picture of the grid after basics: many cells with 4 or more candidates, rather tedious to look for x-wings, skyscraper, kite ... Again, not relaxed enough.

Before I added that max number of empty cells criterion, I ended up with many puzzles that were technically "very hard" or "advanced" but I hated solving them. Felt like work. In a quarry maybe. Pickaxe. Brrr. No fun at all. So I threw them out. Felt good.

Hope this sheds a little light on the "real person"-centric approach i talked about in my first answer to alanr555. If people dont't enjoy solving the puzzles, I don't want to publish them. Again, there are many different tastes.

Helmut
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pat



Joined: 23 Feb 2010
Posts: 207

PostPosted: Wed Nov 04, 2015 4:48 pm    Post subject: re: rating Reply with quote


    thanks!

    but perhaps someone (keith?)
    would try it without "pencilmarks"?
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Wed Nov 04, 2015 8:36 pm    Post subject: Re: re: rating Reply with quote

Pat wrote:

    thanks!

    but perhaps someone (keith?)
    would try it without "pencilmarks"?


Laughing

I pity those who try.

Except the ones who can play five simultaneous chess matches without even using a board...

Happy Hunting Smile
Helmut
Back to top
View user's profile Send private message Send e-mail Visit poster's website
keith



Joined: 19 Sep 2005
Posts: 3355
Location: near Detroit, Michigan, USA

PostPosted: Thu Nov 05, 2015 1:39 am    Post subject: Reply with quote

Helmut,

The patterns game went something like this. Make a puzzle that meets a given stencil for the initial clues. Here is one stencil I remember for Valentine's day:

Code:

 . . . | . . . | . . .
 . . .*| * . * | * . .
 . * . | . * . | . * .
-------+-------+------
 * . . | . . . | . . *
 * . . | . . . | . . *
 . * . | . . . | . * .
-------+-------+------
 . . * | . . . | * . .
 . . . | * . * | . . .
 . . . | . * . | . . .

I forget the exact rules, but the winner got to choose the new stencil for the next round.

Note that Danny Jones always used the same diagonal stencil for his puzzles.

Keith


Last edited by keith on Thu Nov 05, 2015 7:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Thu Nov 05, 2015 8:47 am    Post subject: Reply with quote

sweet, a <3 for Valentine's Day Smile

Now I think I want to experiment with patterns after all. Not for competition, not necessarily for the daily Sudok-o-Rama puzzles, but for a Special Edition maybe. Let's see if I can find the catalogue of patterns that have already been tried in the Patterns Game. From Pat's post I assume that there are at least 260 "layouts"...

Ah, how exciting - so much to do, so little time. Thank you Pat and Keith for setting me on this track.

Cheers
Helmut

Edit 0949 CET: found it. Patterns Game Results.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pat



Joined: 23 Feb 2010
Posts: 207

PostPosted: Thu Nov 05, 2015 9:01 am    Post subject: Reply with quote

nataraj wrote:

    For VH, I limit the number of empty cells during "fill"
    (when PMs are written down)
    to <7 per house

in that case, here's one you may like —
keith wrote:

The patterns game——the winner got to choose the new stencil for the next round.
    Note that Danny Jones always used the same diagonal stencil for his puzzles.

nowadays, anyone may submit a stencil
(without winning or even playing).
    diagonality is recommended
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Thu Nov 05, 2015 12:19 pm    Post subject: Reply with quote

Pat wrote:
diagonality is recommended


Ah, that may be the case in the Patterns Game.

Myself, I'm thinking more like: How can I create a Hanukkah Menorah pattern for Dec.6 or a Christmas Tree for Dec. 24 ? There are only 9 columns so the nine candles would have to be put at different heights. Or make do with 5 candles and 4 spaces ? Yin-Yang Symbol should be nice, too. Stars, of course. A giant number sign (#) maybe, but what about the two stupid rows that have to be filled? Nobody likes that.

See, those are the kind of design problems that I face. Also, the challenge for the Sudoku Farm: create one puzzle for each of the given difficulty levels, all with the same pattern (Maybe add a pair of clues for the easy and mild, let's see...). Then there's the question of special types. I think X-Sudoku is easiest to generate with the same pattern as Classic, Squiggly is nogo - too busy already because of the "box" lines, the pattern would be obscured. Compass - hm, Compass introduces so many additional restrictions that usually there are fewer clues needed.

In the meantime, I've looked at the code - it seems that introducing a pattern into the generation process is straightforward. The calibration will take a little time: how many of the pattern cells to fill initially. I usually roll with 8 initial random cells, that should work for the patterns, too.

Alas, as I said before, there are too many other projects that keep me busy. Might be no earlier than next week that I can report on any progress.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pat



Joined: 23 Feb 2010
Posts: 207

PostPosted: Thu Nov 05, 2015 12:25 pm    Post subject: Reply with quote

nataraj wrote:

A giant number sign (#) maybe,
but what about the two stupid rows that have to be filled? Nobody likes that.


we've done a giant #
— tilted !
Layout 17 (= my very first Layout)
Back to top
View user's profile Send private message
keith



Joined: 19 Sep 2005
Posts: 3355
Location: near Detroit, Michigan, USA

PostPosted: Thu Nov 05, 2015 7:34 pm    Post subject: Reply with quote

nataraj wrote:
sweet, a <3 for Valentine's Day Smile

Now I think I want to experiment with patterns after all. Not for competition, not necessarily for the daily Sudok-o-Rama puzzles, but for a Special Edition maybe. Let's see if I can find the catalogue of patterns that have already been tried in the Patterns Game. From Pat's post I assume that there are at least 260 "layouts"...

Ah, how exciting - so much to do, so little time. Thank you Pat and Keith for setting me on this track.

Cheers
Helmut

Edit 0949 CET: found it. Patterns Game Results.


Helmut,

I have made a special note on my calendar to look at your puzzles next Valentine's Day!

Keith
Back to top
View user's profile Send private message
nataraj



Joined: 03 Aug 2007
Posts: 1048
Location: near Vienna, Austria

PostPosted: Sat Nov 07, 2015 1:58 pm    Post subject: Reply with quote

Patterns Puzzles - interim report

Finally, this being Saturday and all, I got around to work on the patterned puzzles.

During that process I searched for old design documents, and lo and behold, I found one of the earliest notes from August 2010, when the Helper already existed and the Sudok-o-Rama began.

Quote:

Sudoku Creation

WIBNI ...

wouldn't it be nice to be able to create Sudokus ?
like:

-> Button New Puzzle, Select box difficulty

HOW?

randomly create a starting position (with or without pattern?)
test for uniqueness and solvability
use HSH to determine difficulty
maybe use uniqueness test in import function of HSH

use Dancing Links algorithm



Worked like a charm. I opted for randomly created patterns then.
Knowing myself, I knew that I am too lazy to continually look for new and exciting patterns. I knew nothing of the problems that come with patterns. But more about that in a minute ...

So, patterns were there, conceptually, from the start, as were a few other design principles.

It was not very difficult to expand the available puzzle creating strategies to accomodate given patterns.

I added a button to import patterns like the ones on the Pattern game, and for my first test I used the pattern from game 3:

Code:

                    . . . . X X X . .
                    . . . X . . . . .
                    X . X . . X X . .
                    X . X . . . . X .
                    X . . . X . . . X
                    . X . . . . X . X
                    . . X X . . X . X
                    . . . . . X . . .
                    . . X X X . . . .

I really like the shape. It has energy and focus.

Used it to create some puzzles manually. Some results:

One try takes about 200-300ms computer time
There is a valid puzzle every 1-15 tries.
Mild to Hard, even one I'd rate Advanced in the Sudok-o-Rama:



Code:

+-----------+-----------+-----------+
|  .  .  .  |  .  8  2  |  4  .  .  |
|  .  .  .  |  1  .  .  |  .  .  .  |
|  5  .  6  |  .  .  3  |  2  .  .  |
+-----------+-----------+-----------+
|  6  .  7  |  .  .  .  |  .  5  .  |
|  8  .  .  |  .  4  .  |  .  .  2  |
|  .  1  .  |  .  .  .  |  6  .  3  |
+-----------+-----------+-----------+
|  .  .  5  |  3  .  .  |  1  .  6  |
|  .  .  .  |  .  .  7  |  .  .  .  |
|  .  .  4  |  2  5  .  |  .  .  .  |
+-----------+-----------+-----------+


Those are pretty good statistics. A puzzle every 2 seconds, if I let it run unattended, might produce 300 puzzles in 10 minutes. Enough to select a few for publishing.

That was the good news.

Now I looked for something new and - since my wife said that a cat would be nice - I tried this pattern:
Code:

X . . . . . . . X
X X . . . . . X X
X . X . . . X . X
. . . . X . . . .
. X X . . . X X .
. . . . X . . . .
X . . X X X . . X
. X . . . . . X .
. . . X X X . . .

This time, it created a puzzle only after 38 tries. That's almost 10 seconds per puzzle. Not good.

In the end, I settled for this cat:
Code:

X . . . . . . . X
X X . . . . . X X
X . X . . . X . X
X . . . X . . . X
. X X . . . X X .
. . . . X . . . .
X . . X X X . . X
. X . . . . . X .
. . . X X X . . .


Again, it gave me a puzzle every 1-14 tries, with an almost even mix of Mild and Hard. No Easy, no Very Hard.

It seems that there is a trade-off between ease of pattern creation and ease of puzzle creation Smile. That said, I still aim to find a pattern that allows all grades from Easy to Very Hard. We'll see...

All this was done on a test bench, I'll get a better feeling for the numbers once I integrate the pattern into the Sudoku Farm and can afford a couple hundred Easy or Mild for a few nice Hard or Very Hard Smile

Helmut
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pat



Joined: 23 Feb 2010
Posts: 207

PostPosted: Sun Nov 08, 2015 9:08 am    Post subject: Reply with quote

alanr555 wrote:

    Is there a forum that explains HOW to generate a puzzle?

Pat wrote:

    how to generate puzzles for a given Layout,
    that's for each player to decide

some of it has been discussed in "Patterns Game Strategies"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dailysudoku.com Forum Index -> General discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group