PSS is unusual amongst sudoku solvers. It does not work
at all like a human being; indeed, it does not use any form of logical
deduction or backtracking. You could say that it works by making well-educated
guesses. Here is a functional description of the algorithm:

The puzzle state is represented by 729 probabilities,
one for each possible digit (1 thru 9) in each possible cell (of the 9x9 grid).
Thus, if a character k definitely occupies a cell C then the probability of k in
C is 1.0 and the probability of the other 8 characters in C is 0.0; furthermore,
the probability of k in all other cells belonging to any of the three groups
(the row, column, or region) to which C belongs is 0.0. The game state is
initialized by setting probabilities to 1.0 or 0.0 in this manner as dictated by
the initially occupied ("clue") cells. The remaining unassigned
probabilities are set so that the total probability of each digit in all cells
sums to 9, and the probabilities of the digits in each cell sums to 1.

After the probabilities are initialized, PSS enters a
two step loop which repeats until the puzzle is solved (or fails to be solved).
I call the two processes in the loop "evolution" and "clipping."

The evolution process adjusts the probabilities
incrementally in order to conserve probability within the game state. For
probability to be conserved, the sum of the digit probabilities for each cell
must equal 1.0, and, for each character k the sum of the probabilities of k
within each group must equal 1.0. After initialization (or after clipping), the
probabilities will not satisfy these conservation laws (assuming the problem is
not yet solved). The evolution process perturbs the probabilities, gently
nudging them to converge to a (nearby) state in which the conservation laws are
satisfied.

The clipping process is very simple: The highest
probability (of all 729) is incremented by .5 (and clipped at 1.0).

When any probability becomes either 0.0 or 1.0 it is
locked at that value so PSS can no longer change it. This means that there is no
"backtracking." Once PSS decides that a digit goes (or can not go) in a
cell, it never changes it's mind - there is no trial and error involved in
this algorithm.

Performance on Randomly Generated
Puzzles

When all the probabilities have been locked (to 0.0 or
1.0) the puzzle is solved. However, PSS is not always able to accomplish this
goal. For example, it will fail on inconsistent puzzles that have no
solution. If PSS goes through more than about 100 loop iterations without
solving any new cells, it gives up. In general I find that it solves almost all puzzles intended for human
entertainment, from very easy through very hard. Considering the simplicity of
the algorithm it is rather surprising that PSS
does so well. However, PSS is not perfect - it does fail on a significant number
of so-called
"unsolvable," "fiendish," or "bifurcating" puzzles.

I tested PSS against 3500 randomly generated puzzles
rated for difficulty (with much thanks to Michael Kennet for his excellent public domain sudoku
program); The first test run consisted of 500 puzzles, the second of 1000,
and the third of 2000. Here are the results:

These tests show that PSS solves about 97% - 98% of
randomly generated puzzles; it solves all of the very easy, easy, and medium
puzzles, all but about 1.3% of the hard puzzles, and 60-70% of the
fiendish puzzles.

Performance on Puzzles Considered
Extremely Difficult

Of 1106 "unsolvable" puzzles generously donated to
this effort by Andrew Stuart of sudoku.ork.uk, PSS solved 573 - about 52%.
According to Andrew these puzzles represent 5% of their randomly generated
puzzles, which is consistent with the above statistic: that PSS solves about 97% - 98% of
randomly generated puzzles.

I have also tested PSS against many "ambiguous" puzzles,
which have multiple solutions. PSS is generally able to solve ambiguous puzzles
-- it does well on puzzles with very few clues (from 0 to 16). However I have
not tested PSS against enough ambiguous puzzles to draw any conclusions
regarding them.

How it works (details of the
algorithm)

The algorithm works in a way very similar to simulated
annealing: the evolution process is analogous to annealing - the clipping
process introduces noise. More details may follow later. For now, the curious
may refer to the source code included in the Visual C project below.

Open Question

How can we characterize the 2%-3% of
puzzles that PSS is unable to solve? Why does PSS fail to solve them? Since PSS
solves all but the most difficult puzzles, the answer to this question may shed
some light on why certain puzzles are so very difficult for people to solve.

PSS.EXE runs either in DOS or under a DOS command line
interpreter in Windows.

PSS reads puzzles from standard input. (The easiest way
to use PSS is to put all your puzzles in a file and redirect the file to
standard input.) If there is more than one puzzle in the file, PSS works
on each one in the order they appear in the file.

PSS takes one command line argument, a number N which,
can be positive or negative. if N is positive it must be between 1 and 81, and
it tells PSS how many cells to solve. If N is negative, PSS attempts to solve
the entire puzzle and then reports whether or not it succeeded, but without
showing you the solution. These features are designed to allow PSS to be used as
a "clue generator" to assist human puzzle solvers. If the command line argument
is absent, PSS attempts to solve the entire puzzle, and then reports the
solution (or partial solution if it failed).

Here are some sample PSS commands:

To solve all the puzzles in file puzzles.txt:

C:> PSS < puzzles.txt

To solve 10 (additional) cells in each of the puzzles in
file puzzles.txt:

C:> PSS 10 < puzzles.txt

To find out whether PSS is able to solve the puzzles in
file puzzles.txt (without seeing any solutions):

C:> PSS -1 < puzzles.txt

PSS Puzzle Format

The puzzle input format for PSS is as follows: All
whitespace characters are ignored, digits 1-9 are interpreted as filled cells (clues) and
any other character is interpreted as an (initially) empty cell; cells are
filled in left to right top to bottom order. A total of 81 non-whitespace
characters is required to specify each puzzle

Here is an example of PSS puzzle input that uses
underscore "_" for empty cells (white space is included only for human
readability):

This project includes everything you need to build the
PSS DOS executable, PSS.EXE. Sample puzzle data is also included.

Source code for the Mathlink version is included too,
but to build the Mathlink version you will need the Mathlink include file and
library that come with Mathematica. A Mathematica notebook is included which
demonstrates how to use PSS under Mathematica (including code that generates
animations showing the evolution of the 729 probabilities).

This Mathlink-compatible executable allows PSS to run
under Mathematica. The Mathlink version of PSS is very handy for observing and
analyzing the behavior of the algorithm, generating animations, etc.