How Anagram Solvers Work
The complete technical explanation — frequency maps, time complexity, wildcard handling, and why browser-based solvers outperform server-based alternatives.
Step 1: Frequency Map Construction
When you enter letters, the algorithm immediately converts them into a character frequency map. LISTEN becomes {L:1, I:1, S:1, T:1, E:1, N:1}. This O(n) operation (where n = number of input letters) creates a lookup structure that enables constant-time letter checking. This single step is why letter order never matters — the map captures only counts, not sequence.
Step 2: Database Scan
The algorithm iterates through all 270,000 words in the database. For each word, it checks whether that word's letter requirements fit within the available frequency map. For SILENT, the check is: does the map have S≥1, I≥1, L≥1, E≥1, N≥1, T≥1? It does — so SILENT is a valid result. For STELLAR, the check fails at L≥2 (only one L available). This per-word check is O(k) where k is word length.
Step 3: Wildcard Handling
Wildcards (?) use deferred matching. First, the algorithm deducts all required non-wildcard letters from the frequency map. If any word letters cannot be satisfied by available letters, wildcards are used to cover those gaps. One wildcard can cover any one missing letter. Two wildcards cover any two missing letters. The algorithm tries all 26 letter possibilities for each wildcard position — still completing the full scan in under 200ms.
Exact vs Subset Mode
Subset mode: Results can use any combination of input letters. The frequency map serves as an upper bound — a result word can use fewer letters than available. This is the default for Scrabble rack solving. Exact mode: Results must use every input letter exactly once. The algorithm adds a secondary check: result word length must equal input letter count, and the frequency maps must match exactly. Used for Jumble puzzles and anagram finding.