algorithmwordsearch

What exactly are "anchors" in this scrabble algorithm?


I'm trying to implement this algorithm: http://www.cs.cmu.edu/afs/cs/academic/class/15451-s06/www/lectures/scrabble.pdf but I just cannot figure out what exactly those anchor squares are (first mentioned in 3.1.2 and then in 3.3).

I know candidates for them are all empty squares adjacent to those already on the board but no idea which exactly should I choose.

Also, I don't know why all squares in left-parts have trivial cross-checks (meaning that every letter may be put there) and anchors always have nontrivial cross-checks. What about this situation:

_._._._
_._.x.A
_._._._

_ is empty square, x is anchor, A is some letter already on the board - why in this situation I need to check x for cross-checks when it obviously doesn't need it?


Solution

  • According to the rules of Scrabble, your word has to connect to -- or be anchored at -- an existing word on the board. Now when we look at one line at a time there are three types of anchors:

    If we place a letter on an anchor adjacent to a letter in the line above or below, we have to form a valid word with those letters as well, thus putting an additional constraint on the letters allowed for that anchor. When using anchors adjacent to a letter in the current line (and only to those), the letters that we can place on that tile are constrained only by the word we are going to form in the current line, so no checks other than the actual word-forming-algorithm are needed.

    That means, in your example there would actually by no additional constraints for letters on tile x. Just find a prefix extending from x to the left, forming a valid word (or a longer prefix) with the letter A.

    You may also want to check out the Udacity Course "Design of Computer Programs", where they discuss a Scrabble-solving algorithm in Unit 6.