Links

What is Solitaire? There are actually many games called
that way. It usually comes from the fact that you can play it
alone. This one is coming from what in French we call
le morpion. The game is played trying to align 5
crosses drawing a line using 4 existing crosses. Only crosses
which have not yet been used to draw a line in a given
direction (except for the tips), can be used.

The current version of the software ran on a Dual PIII both
running at 1Ghz with 1Gb of RAM and 60Gb IDE HD. It generated
1.8Gb of data in about 6 months running 24h a day and found
many states as shown in a table below, but was stopped at
level 83 (i.e. 83 crosses before to get stuck).
This version is "uni-computer" at this time. It would be
possible, however, to run it on a beowulf if you have one...
Because of the way it is programmed, only one process per
level can run at a time. Thus, if you have some 80 nodes
you could run one process per level 24h a day (instead of
2 for me!).

At this time I have two main ideas to improve (hopefully)
the speed and especially the multi-computer management:

One node should run a server which tells the others
what is done and what needs to be done

The database would be in a single file instead of
a set of files scatered in a set of directories

In v3 I have a play directory including
84 sub-directories (l0000 to l0083)
and each directory includes one state and one move file.
The state tells us which move to try next and the move
is a copy of the current game as it stands.

Below is a table giving you a list of results as computed
by the count shell script (see the v3 bin
directory). The Level column gives the name
of the level. Note that only 4 were fully completed in
about six months (level 0 to 3). Notice the exponential
number of possibilities: 1, 12, 147, 1213! The States
column gives a count of the *.state files. These
include the current state for a specific move (i.e. m000000.state
is the current state of the move m000000.move).
The state file can be DONE in which case the file is
renamed as *.done and isn't counted in the
States column. The Moves and
Finish is the total number of move files and
the total number of move files which where already checked
out. Note that the number of States plus the
number of Finished is equal to the number of
Moves. The Done column is a count
of the number of states generated at this level. This can
be dramatically higher than the number of moves in the
following state since many moves give equivalent results.
For instance, to find out that there are 12 possible starting
points, the computer generated 29 different game. However,
out of these 29, many are symetrically equal.

A little bit of history... I first played this game when I was
13. For some reason, I felt in love with it and liked it so
much that I decided there should be a way to find out all the
solutions. Since then, I made several attempts to do just that.
The very first version would try to compute all the solutions
at once. It very quickly became clear that you needed a way
to stop the process and restart it. This was version II. However,
version II got stuck at level 4. As we can see in version III,
level 4 isn't finished yet! After 62690 moves from level 4 to
level 5, the computer worked on only 65.93% of the moves
defined at level 4. For
this reason I created this newer (better?) version which would
instead be able to compute any move from any level at any time.
It is very easy to run, though, there are potential problems
if you lose power as the computer is saving a state, it's
unlikely to be so bad since files are very small. A new state
will be saved before the *.state file is updated
thus you may endup computing the same move twice. Not so bad,
right?

This code is, to my point of view, fully mature and should work
on your computer under Linux. I successfully compiled it under
RedHat 6.2 and 7.1. Other Unix systems may also accept this
code with only a very few changes.

At this time I'm thinking of doing a version IV which would
allow a large network of computers (without having to run
a beowulf) to run Solitaire in order to accelerate
the computation of the result. I'm, however, not too sure
how to do it yet. So I will only post the analysis here and
you will be welcome to send me comments & suggestions.