dobrichev wrote:denis_berthier wrote:The algorithm wrt which I raised my questions was inspired by the pure form of Ruud's idea; there are no candidates and therefore no "additional eliminations".
At least initial givens must be taken into consideration at some point. Doing it at "initialization" phase (no matter how it is implemented and whether "additional eliminations" are performed) all templates passing the test(s) become "candidates". I think there is no contradiction with Ruud's idea. The alternative to loop over all 46K templates and each time to test template against initial givens doesn't add value (I think).
I think the answers are in my definitions in a previous post, which I recall here:
(in italics, the place where the givens and previous templates are taken into account)
denis_berthier wrote:
Definition: a template is a set of 9 cells such that no two of them see each other.
Definition: two templates are compatible if they are disjoint (as sets of cells).
Definition: a template for a digit k is a template all the cells of which are assigned value k.
Definition: given a puzzle P, a template T for a digit k is compatible with the clues of P if:
- all the clues for digit k in P are in cells of T,
- all the clues for other digits in P are in cells not in T.
Definition: Sudoku problem: find 9 templates, one for each digit, such that:
- each of them is compatible with the clues,
- they are pairwise compatible.
Basic resolution procedure: depth-first-search (DFS), with maximum depth 9
for i=1 to 9
- choose the next template Ti (in the fixed vector of templates) for number i, compatible with the clues and (for i>1) with the previously chosen Tj's
- if no such template can be found, backtrack to the previous value of i
[add some exit condition]
Output (as usual for DFS):
Depending on the exit condition: either 0, 1, n, or all the solutions
Range of application:
any puzzle, with 0, 1 or more solutions
There are no candidates, nowhere. Indeed, templates play the role candidates would play in the usual DFS search.
This is a completely different view of the Sudoku problem.
I think this is the original idea of Ruud. (When candidates are added in the landscape and rules are mixed in, this idea is lost).
The test wrt clues/givens must be made at each step, as clues may contain any digit.
dobrichev wrote:What "additional eliminations" are?
You used this expression. I don't. I have no eliminations.