Search Window
OPERATION
These are the search controls, which allow you to search for a periodic billiard path in the
selected triangle. The top button allows you to select the kind of
search you do. Here are the 5 possibilities:
- basic This is our all-purpose search, which finds all periodic
billiard paths less than a given length in a triangle.
- subword Using the word window you can
select a finite string of digits called a subword . The
subword search only looks for periodic billard paths which
contain this subword. This featrure is very useful when you have
found several words which seem to be part of an infinite sequence
of words. If you identify a large subword common to the
whole sequence, you can find additional terms in the sequence
very efficiently.
- c:basic This is a version of the basic search routine written
in C. It runs more quickly that the Java based basic search,
but it only works when McBilliards is run as a stand-alone program.
- c: palindrome This routine searches for billiard paths
which start out perpendicular to one of the sides of the triangle.
The words describing these periodic orbits are (very close to)
palindromes. The c: palindrome search is much faster than the
c: basic search. Once again, it only works in the stand-alone
version of McBilliards.
- c: oddsquare This search
routine looks for even words which are the squares of odd words.
This search is also much faster than c:basic.
Once you have selected the kind of search you want, you use the keyboard
to enter in a number N. Finally, you push the seek button
to initiate a search which returns all the combinatorial
types of periodic billiard paths for the given triangle which have
length at most N. The number N is what we call the
search depth and it is initially set to 50. Once
you initiate a search, the seek button changes into
a halt button. If you press the half button
the search terminates immediately. This is a useful way to
keep McBilliards from hanging up a long time.
THE RESULTS OF A SEARCH
When a search finishes, a separate word display window pops up. This
popup window shows a finite number of word icons Each word icon
shows the hexpath of the word and the length of the word. The
hexpath of a word is a closed path contained in the
edges of the hexagonal grid and based on the digits of the word.
The word window documentation explains exactly show
the hexpath is produced. If you click on one of the word icons,
you tell McBilliards to focus in this word. Once you do this, you
can plot the orbit tile associated to the word.
HOW IT WORKS
Here we will describe how a toy version of the basic search algorithm
works. The actual version has many combinatorial and geometric
enhancements. Once we have specified N we do a depth first search
though the tree of even length words in the digits. This looks like
an exponential time search, but the aggressive pruning we use
cuts it down (probably) to polynomial time. To describe
our toy algorithm we first need a few definitions.
- The stability test Is the word S stable ?
This amounts to showing that the hexpath of S is a closed path.
Alternatively, it means that the first and last sides of the
unfolding U(S,*) are parallel for any choice of triangle.
If the answer to the above question is yes, we say that
S passes the stability test .
-
The weak test Does the unfolding U(S,T) contain a straight
line which joins the first and last sides? If the answer to this
question is yes, then we say that (S,T) passes the weak test .
The unfolding
is explained in detain in the documentation for the unfolding
window . If W is a word which contains S as a subword, and
W describes a periodic billiard path in T then (S,T) must pass
the weak test.
-
The strong test Does S describe a periodic billiard
path in T? If the answer is yes we say that (S,T) passes
the strong test.
- 4 extensions A word S' is an extension of S if
it is obtained by appending to S two digits. We also require that
S; does not have repeating digits. For instance, the extensions of
12 are 1212, 1213, 1231, 1232. Every word has 4 extensions.
Now we can describe the toy algorithm. The input is a triangle T
and a maximum depth N. We start with a list of words,
which just has the single word 12. Assuming we are at some
point in the algorithm we let S be the last word on our list.
Here is what we do.
-
We omit S from our list if one of the following occurs:
- S has length N and S fails the stability test.
- S has length N and (S,T) fails the strong test.
- (S,T) fails the weak test.
- We replace S on our list by its 4 extensions if the following
occurs
- S has length less than N and fails the stability test. Moreover
(S,T) passes the weak test.
- S has length less than N and passes the stability test.
(S,T) passes the weak test but not the strong test.
- We omit S from our list and add it to our list of
periodic orbits if (S,T) passes the strong test.
When the algorithm halts, we have found the complete list of
combinatorial types of periodic orbit type having
length at most N. Once again, we stress that the actual
algorithm, due to Pat, is a vast enhancement of the above.