shmuli9 / WebBoggle

Boggle Solver (with web display....)

Home Page:http://webboggle.eu-west-2.elasticbeanstalk.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time

shmuli9 opened this issue · comments

Running the algo as it stands is mad long.

Some stats at present:

Cells searched 1 Whole board (16)
Word length
Limited to 4 letter words ~1s ~30s
Limited to 7 letter words ~30s ~9 minutes (~540s)

Its clear, that running this at unlimited length on the whole board is gonna take an age, (i think, runtime will increase with factorial of word length), so something needs to be done.

The aim is to use a linked list dictionary to prune dead branches.

The basic idea being, if the start of the branch is xyza, you can probably (check a dictionary) eliminate that branch from the search.
I'd also imagine that the longer a branch is, the more likely it can be ignored (how many 15 letter words can you think of?), which back of the napkin (in my head), would SIGNIFICANTLY reduce the search space. At least halve it, probably more, which will, of course reduce time needed.

What I need to do:

  1. Create the linked list dict from the wordlist ( a, true -> p -> p, true -> l -> e, true sorta thing)
  2. Alter the core algo to check words using the new dictionary to both check for words (same as before, but now done by checking if letter has true associated with it, indicating a complete word) but also to not proceed in the recursion if current letter has no children ( indicating that no words start with current substring)