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   

Sudoku file formats
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Software
View previous topic :: View next topic  
Author Message
PSBlake

Joined: 18 Jan 2006
Posts: 8
:

Items
PostPosted: Sat Jan 28, 2006 5:10 am    Post subject: Reply with quote

gsf wrote:

so to decode you would need a dictionary of 5,472,730,538 canonical puzzles
or a function that produces a canonical puzzle given its label


This is always the tradeoff in computer science: Space or speed. Do you want a smaller app, or a quicker one? In this case, I'm examining the intellectual challenge of a smaller app. In fact, the smallest.

gsf wrote:
but that would only give you a puzzle equivalent to the original
to get the exact original you would also need the row/col permutations
and the cell label permutation


I'm missing the distinction here: Are you saying that (in simpler terms) for a 2x2 sudoku:

Code:

10
01


is not distinct from:

Code:

01
10


Because the 2 groupings are of the same shape?

I wasn't aware of this, if it is the case.

If it is, by my reasoning (of which I am by no means certain) then for any 9x9 Sudoku, there should be 9! (362880) essentially identical Sudoku differing in numbers, but sharing identically shaped groupings. That means I need 19 bits to represent them. I've already got 9 spare bits from the previous algorithm. Rounded to the nearest byte makes 2 bytes, making my representation 16 bytes, with some non-contiguous data fields. Messy, but small.

As for competing with existing compression formats, I'm beating them.
Back to top
View user's profile Send private message
gsf

Joined: 18 Aug 2005
Posts: 411
:
Location: NJ USA

Items
PostPosted: Sat Jan 28, 2006 2:46 pm    Post subject: Reply with quote

PSBlake wrote:
gsf wrote:

so to decode you would need a dictionary of 5,472,730,538 canonical puzzles
or a function that produces a canonical puzzle given its label


This is always the tradeoff in computer science: Space or speed. Do you want a smaller app, or a quicker one? In this case, I'm examining the intellectual challenge of a smaller app. In fact, the smallest.

gsf wrote:
but that would only give you a puzzle equivalent to the original
to get the exact original you would also need the row/col permutations
and the cell label permutation


I'm missing the distinction here: Are you saying that (in simpler terms) for a 2x2 sudoku:

Code:

10
01


is not distinct from:

Code:

01
10


Because the 2 groupings are of the same shape?

I wasn't aware of this, if it is the case.

If it is, by my reasoning (of which I am by no means certain) then for any 9x9 Sudoku, there should be 9! (362880) essentially identical Sudoku differing in numbers, but sharing identically shaped groupings.

read up on sudoku counting
there are 6670903752021072936960 completed grids
but only 5472730538 up to isomorphism
encoding a grid in the 5472730538 only gets a member of a class of possibly >1 grids
along with that encoding must be encoded the row/col cell-value permutations
that transform the class member to the original grid that was to be encoded
Back to top
View user's profile Send private message Visit poster's website
gypsy fly

Joined: 06 Mar 2006
Posts: 18
:
Location: Portland OR USA

Items
PostPosted: Tue Mar 14, 2006 9:43 pm    Post subject: Reply with quote

I can see that this discussion is several months old. Nevertheless, I'll bump it up. Here's a txt format that I decided to implement for a sudoku worksheet program.

This is a 9x9. The first character defines data type. C for citing the source, D for difficulty, Period (.) for puzzle in column sequence with each new line being the rows.

After the second "." separator is a relative boolean string for change/no change (i.e. 0 means a given, 1 is player input). The player saves versions with a "Save As" and any valid naming convension of their choice.

CThe Oregonian 03/10
D5
.000409670.111010001
.000076900.111100011
.000000003.111111110
.000001740.111110001
.640000018.001111100
.021600000.100011111
.100000000.011111111
.004320000.110001111
.062904000.100010111

A partially completed puzzle is saved thusly:

CThe Oregonian 03/10
D5
.218439675.111010001
.400076902.111100011
.006002403.111111110
.000201746.111110001
.640000128.001111100
.021640009.100011111
.100060294.011111111
.004320061.110001111
.062914007.100010111

I'm going to add more data type as the need arises.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Software All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
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