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   

A theory for setting quickly a puzzle

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

Joined: 07 Feb 2006
Posts: 2
:

Items
PostPosted: Tue Feb 07, 2006 12:03 pm    Post subject: A theory for setting quickly a puzzle Reply with quote

Hi all!

I'm newbie here & with Sudoku also (I've never played it yet Smile ), but I wish to make it in Java for my mobile just for fun. At first I thought it'll be an easy work to make a riddle with some interval sets, but for now I've realized that it's much more complex than I thought Embarassed After I'd another think I got the following theory, and I'm intrested in your opinion about it.

So, first step is to get a matrix of 9x9 with a trivial setting like this:

1 2 3 | 4 5 6 | 7 8 9
4 5 6 | 7 8 9 | 1 2 3
7 8 9 | 1 2 3 | 4 5 6
-----------------------
2 3 4 | 5 6 7 | 8 9 1
..... and so on.

The next step is to multiply it with a random number within the range [1,8] (with modulo 9), then add 1 to it. The result'll be a simple sudoku puzzle I hope (I've learnt about the Zm modulo classes, but I'm not sure if all of the order of the elements are 9 Confused , so hopefully they'll produce the full modulo class of 9 ... I've to check it).

The final step is to multiply the matrix with a random generated transformator matrix (as I know the matrix multiplication is associative). E.g. if I want to reflect the matrix diagonally, I would use a matrix like:

0 ... 0 0 1
0 ... 0 1 0
...
1 0 ... 0

So what do you think? I know it won't produce all of the possible riddles, but I think it can produce more than enough.
Back to top
View user's profile Send private message
evert

Joined: 30 Aug 2005
Posts: 68
:
Location: Amsterdam

Items
PostPosted: Tue Feb 07, 2006 1:06 pm    Post subject: Reply with quote

Your 2nd step does not work if you choose 3 or 6.
Furthermore the effect of your 2nd step is a permutation of 1-9. Indeed a valid sudoku remains valid after permutation of the digits.

In fact you want to use operations in order to generate all your valid sudoku grids from one particular valid sudoku grid.
However if two grids can be transformed into each other through these operations they are considered to be somehow structurally equivalent.
Generating essentially different grids is sometimes considered more challenging and more fun.
Back to top
View user's profile Send private message Send e-mail
roante

Joined: 07 Feb 2006
Posts: 2
:

Items
PostPosted: Tue Feb 07, 2006 1:22 pm    Post subject: Reply with quote

evert wrote:
Your 2nd step does not work if you choose 3 or 6.

How unfortunate! I haven't spot it...

evert wrote:
Indeed a valid sudoku remains valid after permutation of the digits.


Now this is a very valuable information for me, as well as the link you have given!!! Thx a lot, I'm going to get a closer view on them!

evert wrote:

... However if two grids can be transformed into each other through these operations they are considered to be somehow structurally equivalent.
Generating essentially different grids is sometimes considered more challenging and more fun.


Now these things are far more complex than I could solve with my puny skill, but I'll try to Wink
Back to top
View user's profile Send private message
evert

Joined: 30 Aug 2005
Posts: 68
:
Location: Amsterdam

Items
PostPosted: Tue Feb 07, 2006 2:18 pm    Post subject: Reply with quote

roante wrote:
Now these things are far more complex than I could solve with my puny skill, but I'll try to Wink

Not neccessarily.
On this forum there are many topics about generating grids.
Look around a bit here.
Back to top
View user's profile Send private message Send e-mail
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