Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

Choosing clues to show

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Setting sudoku
View previous topic :: View next topic  
Author Message
anon

Joined: 18 Jun 2006
Posts: 2
:

Items
PostPosted: Sun Jun 18, 2006 10:44 am    Post subject: Choosing clues to show Reply with quote

Hi, I'm trying to make a logic based symmetrical sudoku puzzle generator.
So far I have methods for singles doubles and naked triples.

However, the problem is that practically all puzzles I get are solvable by singles only, and I see the other methods effectively used only in failed attempts to solve the puzzle.

I guess it must be something with the method I'm using to open givens for the solver. My method is to count the number of cells where a candidate will be eliminated for a given pair of clues (without repetitions), and I choose from among the cells that will result in most eliminations.

(In the end the program tries to solve the puzzle without a pair of givens in the same order as they were added, and removes this pair if the puzzle is still solvable.)

Unfortunately, this also seems to eliminate the need for any advanced solving methods. Is there a better way? E.g, should I try to find a pair of cells that would have made a naked triple (or what ever is the most advanced techique for the user selected difficulty) succesful that failed last time?

(I have written a sudoku program before, and I had the same problem there - all the puzzles were just as easy to solve, only the "hard" ones took more time to create. There I chose a pair of givens that had the greatest number of candidates between them.)
Back to top
View user's profile Send private message
Ruud
Site Admin
Joined: 17 Sep 2005
Posts: 708
:
Location: Netherlands

Items
PostPosted: Sun Jun 18, 2006 1:19 pm    Post subject: Reply with quote

Hi,

Even when you change your method, you will have this problem, because it is simply a statistical thing.

When I randomly create sudokus, this is the result:

75% easy
12% super hard
8% hard
5% moderate

So, to generate a moderate sudoku, on average you must create 20 to find one. Within those 20, there are 4 that make your solver choke.

My generator has no bias, except that all puzzles are generated symmetrically minimal. This makes the overall difficulty a little bit higher.

Ruud
_________________
Meet me at sudocue.net
Back to top
View user's profile Send private message Visit poster's website
daj95376

Joined: 05 Feb 2006
Posts: 349
:

Items
PostPosted: Sun Jun 18, 2006 3:41 pm    Post subject: Reply with quote

I have a very convoluted set of logic in my puzzle generator that I implemented with the hopes of creating very hard to fiendish puzzles. Although I've been modestly successful -- mostly just hard -- I would not advise trying this because the total execution time probably takes as long or longer for a hard puzzle as doing what Ruud described above.

Good luck!
Back to top
View user's profile Send private message
anon

Joined: 18 Jun 2006
Posts: 2
:

Items
PostPosted: Mon Jun 19, 2006 9:32 pm    Post subject: Reply with quote

Thanks for the answers.

I simplified the method for choosing the givens (as it doesn't matter much), and I'm now getting 2-7 puzzles with naked and/or hidden pairs out of 100 puzzles generated (none with a triple so far). So I guess I'll just make and rate a bunch of puzzles and choose from among those.

The good thing I discovered: most of the evil ones at websudoku.com don't have anything else but a few hidden pairs either most of the time .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Setting sudoku All times are GMT
Page 1 of 1

 
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
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron