Sei sulla pagina 1di 2

2.3.

2 Cross-Checks
The cross-checks of a square imply the set of all playable letters that can be inserted in a column
wise between existing words on the board to form a new word as shown in the below example [5].

For example: CABLE {G, N, R}

GOAL

{A, S, T, M, H}

In the above example CABLE by checking the cross-checks we can keep the words perpendicularly as
downwards like from A we can keep the words like AA, AS, AT, AM and AH. From the letter E we can
keep the letters by connecting to another word in downward direction as EGG, ENG and ERG.

2.3.3 Algorithms
There are three types of algorithms which are best related to our project. There are as follows:

Trie.

DAWG.

GADDAG.

1.Trie
All the words in the dictionary are represented in form of a tree. The edges of tree are labelled with
letters. All the words that begin with the same letters share a common path and the ending letter in
that word is called as terminal node. They are represented in double circles as shown in the below
example. Some of the examples like CAR, CARS, CATS, DOG, DOGS, etc, will show in below figure 2.2.

ARS

CT

OGS

Figure 2.2: structure of trie in Lexicon


As shown in the above figure 2.2, referring to the words CARS and CATS, the letters “CA” is shared
between these two words, the letters R-S forms a terminal node and the letters T-S forms another
terminal.

The capacity of the dictionary used here is 94,240. These 94,240 words are divided into 117,150
nodes and 179,618 edges to form a trie. The memory size of a trie occupies half a megabyte space
on a normal computer [6].

2.DAWG
DAWG is abbreviated as Directed Acyclic Word Graph. Appel and Jacobson first introduced a fast
move generation algorithm. This algorithm is implemented in the computer end for the games which
are played human against computer like Chess, Scrabble, etc. This algorithm is a fast move generator.
This algorithm is integrated with a huge dictionary and plays against a human by placing the words
which as high scores compared to the human words. The dictionary words in DAWG are represented
in graph structure. Let us take some examples in DAWG dictionary as CAT, CATS, CAN, CANS, DOG,
DOGS and DONE are shown in below figure 2.3.

AT

CNS

DGE

ON

Figure 2.3: structure of DAWG in Lexicon

In the above figure 2.3 the dictionary words of DAWG are represented in graph structure.
Equivalence sub trees in a trie are merged to form a DAWG. In this way the number of nodes is
reduced from 117,150 to 19,853 minimizing the memory space. DAWG can be represented as a raw
word list of only 175 Kbytes where as lexicon is represented in 780 Kbytes. This compact size allows
us to use it on any modest computer [6].

Backtracking
We perform this operation in two parts.

When a human place a word on the board, the computer checks the left anchor for this word and fills
it if a word extension exists.

Potrebbero piacerti anche