I'm implementing the following boggle algorithm:
I want to optimize it because it takes about 2 minutes and a half to find all words. Do you have any ideas on optimization techniques?
I'm implementing the following boggle algorithm:
I want to optimize it because it takes about 2 minutes and a half to find all words. Do you have any ideas on optimization techniques?
You really want to have a look at this question (and answers) here: How to find list of possible words from a letter matrix [Boggle Solver]
There's solutions in Python, Perl, VB.NET and PHP. Most use Tries and optionally prefilter the dictionary using regexes.
I've written some Boggle-solving algorithms by creating letter trees which can be traversed to assemble and verify words. You save loads of space by using a tree-based structure in which words share similar letters, meaning you won't have to keep individual copies of each word.
If you didn't write the program on the website you provided, keep in mind that we won't do your work for you. You have to show us that you've spent considerable time on the problem instead of giving us a program and asking us to optimize it for you. A good first step would be to study the algorithm on the page and fully understand how it works. Or even better, try writing your own Boggle program from scratch to learn which techniques work best for you.