chi wrote:What are the minimum conditions that a given puzzle has one and only one solution? How to prove it mathematically? Brutal force by computer does not count.
What you're asking may be interpreted in different ways.
1) Can one express that a puzzle P has a unique solution in pure logic terms? The answer is trivially positive and there are many ways of doing it.
1a) Given a puzzle P expressed as a conjunction of logical conditions EP for the givens, the following formula expresses that any two solutions are identical:
- Code: Select all
EP & ∀r ∀c ∀nrc ∀n’rc [value(nrc, r, c) & value(n’rc, r, c) ⇒ nrc = n’rc ]
For details on the formalism, see my book [HLS1 2007, section III.2.5], available as a pdf on ResearchGate:
https://www.researchgate.net/publication/280301600_The_Hidden_Logic_of_Sudoku1b) You can also write a FOL formula with 2x81 variables g1, g81, s1, s81: solution(g1, ... g81, s1, ... s81) which will have the obvious intended meaning.
Uniqueness is expressed as:
∀s1... ∀s81 ∀s'1... ∀s'81 solution(g1, ... g81, s1, ... s81) and solution(g1, ... g81, s'1, ... s'81) ==> s1=s'1 ... s81=s'81
However, as I wrote many times, such formulæ only express that there is only one solution. You can't add then to Sudoku theory to guarantee that a puzzle will have a unique solution. Said otherwise, they allow to
check uniqueness, not to
guarantee it.
2) Can one express pure logic necessary and sufficient conditions
involving only the givens for a puzzle to have a unique solution?
For the necessary part, some conditions are known - some trivial, some less trivial (as mentioned in previous posts).
For the sufficient part, it's an open question, but very unlikely to have a positive answer, let alone a positive answer that would be simpler than solving the puzzle.
3) Barring any brute force procedure, can one prove uniqueness of a solution?
Brute force (i.e. trying all the possible values for each cell) is a very inefficient method. There are at least two much more efficient procedures:
-
DFS will find all the solutions (if you only want to check uniqueness, you can stop it as soon as you've found 2; this is how all the generators work).
-
T&E(n) will also find all the solutions if n is taken large enough; increasing it progressively ensures all the solutions are found.
DFS and T&E(n) are constructive procedures.