Post Reply 
Sudoku solver
03-20-2019, 03:12 PM
Post: #14
RE: Sudoku solver
I erased that director but I can show some data structures. I was hoping to use 9x9 binary integer arrays for meta-data and for the board. I could have just made a long 81-long array (or even numbers s00 to s88 or s11 to s19 and unroll all loops; that would be fast but tedious). Then the access would have used ROW- and ROW+ and COL- and COL+ to access rows and columns. To access squares, I used i,j i+2,j+2 SUB to get things and i,j REPL to put things back. Unfortunately, arrays do not support either integers or binary integers and REPL does not work with reals.

In Fortran (if I get interested enough to program on the PC), I would use integer types where the logical operators are defined as masks. In either case, I used the numbers 2,4,8,16,32,64,128,256,512 to represent numbers allowed (or denied; one can complement to get the other). Array (or list) logical operations let one remove possibilities by marking (or erasing) rows, column, and squares. It would be possible (in one of the languages I invented but didn't completely implement) would have objects (I called them "maps") that would be the union of the rows, columns, and squares "seen" by each entry. Few languages allow such structures to be implemented efficiently.

I didn't use the brute force stuff (so far) as I wanted to check puzzles against various strategies suggested in the literature. The idea is to call a puzzle difficult if it needs several advanced strategies and insane if it requires a search. In practice, the 9x9 system is small; the "hardness" of Sudoku relates to what happens with 16x16,25x25, etc., puzzles.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sudoku solver - Pekis - 03-07-2019, 02:16 PM
RE: Sudoku solver - Simone Cerica - 03-07-2019, 03:01 PM
RE: Sudoku solver - Pekis - 03-07-2019, 03:55 PM
RE: Sudoku solver - David Hayden - 03-19-2019, 06:38 PM
RE: Sudoku solver - David Hayden - 03-24-2019, 03:11 PM
RE: Sudoku solver - John Keith - 03-07-2019, 04:58 PM
RE: Sudoku solver - Pekis - 03-07-2019, 06:52 PM
RE: Sudoku solver - Pekis - 03-07-2019, 07:28 PM
RE: Sudoku solver - Valentin Albillo - 03-07-2019, 10:47 PM
RE: Sudoku solver - Raymond Del Tondo - 03-08-2019, 10:02 PM
RE: Sudoku solver - ttw - 03-08-2019, 10:17 PM
RE: Sudoku solver - Raymond Del Tondo - 03-09-2019, 07:49 AM
RE: Sudoku solver - Claudio L. - 03-20-2019, 03:03 AM
RE: Sudoku solver - Bill Duncan - 03-09-2019, 02:11 AM
RE: Sudoku solver - ttw - 03-20-2019 03:12 PM
RE: Sudoku solver - 3298 - 03-20-2019, 08:58 PM
RE: Sudoku solver - ttw - 03-27-2019, 01:32 PM
RE: Sudoku solver - ttw - 03-21-2019, 12:29 AM
RE: Sudoku solver - 3298 - 03-21-2019, 09:17 AM



User(s) browsing this thread: 1 Guest(s)