champagne wrote:When the process will be ok, don't forget to describe precisely how the solver works to find the final rank.
Set SolverThe solver was initially designed to explore second order logic. It finds logic by adding one full set at a time to a 'path' of sets. It is free to choose any set without restriction so the 'path' can be any shape. Sets means the primary Sudoku constraints with 81 row, column, cell, and box sets each for a total of 324 sets. There is no T&E. It implements only one logic rule, the Sudoku rule itself, i.e., every set must have exactly one member.
It uses a permutation analyzer to analyze each step or logic block along a path. The same analyzer provides logic simulation while editing or building logic by hand. Given a matrix:
- Code: Select all
Nodes
+------------------------
| 00101011000101011101101
Permutations | 11101000111001010111010
| 00111010101010101101010
An elimination is any column with all 0s and, an assignment is any column with all 1s. The table is built one full set at a time so the solver is aware of the set structure, thereby fully implementing the Sudoku rule. Linksets are "recognized" later thus the solver naturally discovers the use of cover sets, the lack of them as in a broken wing, or the use of multiple covers like in FM/TR. The solver finds anything based on the Sudoku rule, but currently knows nothing about uniqueness.
Permutations are not used for search but only to express a logic equation for the logic, multiple permutations are equivalent to logical or'ing at individual nodes. The advantage is that the solver has 100% of all information about the logic. Below is an X wing that eliminates two candidates:
- Code: Select all
Nodes
+----------
Permutations | 0110 00
| 1001 00
^^-- elimination
This approach is good for making a Sudoku simulator or analyzer, making it easy to hand build logic and ask what-if questions, or do things like assuming nodes are true or false to see the logical consequences.
Speed.Direct comparison is not so easy. The set approach can solve say GN in a few seconds if run as a grid solver, finding a logical solution but not extracting the individual logic for each elimination. I am using register bits all the way, without which I would probably be the same or slower than your times. My guess is the amount of required operations (you vs. me) is roughly similar. Great monsters are usually solved interactively and the user can explore various options or solution paths. The slowest part of the process is having too much fun.
Next Step?The set logic rules, like rank 0 to N, triplets, etc, are derived to explain what comes out of the solver. Now the question would be how to make a solver based on these set logic rules, which have been shown to cover most everything. Such a solver might be very efficient especially with something like tagging if possible. It would be interesting.
Edit: shift "^^-- elimination" to its correct position in the code block