So over the holiday season I created a boggle solver for a 5x5 board. I noticed some of my family members playing weboggle and decided it would be fun to create a tool to be able to win every time. I looked online at different boggle algorithms and other attempts at solving boggle puzzles. What I couldn't find was a C# version and also anything that was done recently. Instead of following the algorithm that almost all of the tools use I created one of my own. I am not sure if it has already been done before, I would assume it has, but from what I can tell the other solvers are not solving puzzles in this way.
The solvers that exist all appear to have a recursive method that looks for combinations of letters on a board and then looks them up in a dictionary file to see if it is a valid word. It repeats this process and has to check if the word has already been found before. This is one of its downfalls, it can waste time finding the same word multiple times in a game, which is not what you want. My method is to do somewhat of the opposite, and to solve the puzzle in a simpler manner. It enumerates a list of valid words and if the beginning character exists in the 5x5 matrix then it loops through the remainder of the characters in the word looking for characters around the previous character found on the matrix that has not been used and is the next character in the word.
It is very simple, the code for the entire solver is about 150 lines, it doesn't require any recursion and I think it can actually be used to solve puzzles faster than the existing algorithms. To make things faster you could always keep the dictionary in memory and when a word is found and it is more popular than the word before it, then it could be moved up the list. Also, if the word is not long enough, say less than 4 characters, then you could simply remove it from the list. This would create a list of words that are long enough, valid, and are ordered from most popular to least popular.
To see the solver in action click here.
Eventually, I will make the entry of the letters faster, probably so that the cursor moves from input box to input box as you type each character.