Algorithm to write a dictionary using thousands of words to find all anagrams for a given string with O(1) complexity
You may get some inspiration from the articles The world's fastest scrabble program by Andrew W. Appel and A Faster Scrabble Move Generation
Algorithm by Steven A. Gordon.
Both algorithms rely on a clever use of finite automata.

See also this question on Stackoverflow.