title: "Anagram solver" based on statistics rather than a dictionary/table?
body: <p>My problem is conceptually similar to solving anagrams, except I can't just use a dictionary lookup. I am trying to find plausible words rather than real words.</p>
  
  <p>I have created an N-gram model (for now, N=2) based on the letters in a bunch of text. Now, given a random sequence of letters, I would like to permute them into the most likely sequence according to the transition probabilities. I thought I would need the <a href="http://en.wikipedia.org/wiki/Viterbi_algorithm" rel="nofollow noreferrer">Viterbi algorithm</a> when I started this, but as I look deeper, the Viterbi algorithm optimizes a sequence of hidden random variables based on the observed output. I am trying to optimize the output sequence.</p>
  
  <p>Is there a well-known algorithm for this that I can read about? Or am I on the right track with Viterbi and I'm just not seeing how to apply it? </p>
  
  <p>Update</p>
  
  <p>I have added a bounty to ask for more insight into this problem. (Analysis explaining why an efficient approach isn't possible, other heuristics/approximations besides simulated annealing, etc.)</p>