Efficiently finding the minimum number of transpositions needed to sort a list
Unfortunately, the problem is NP-hard in general, according to Amir, Hartman, Kapah, Levy and Porat (see http://epubs.siam.org/doi/abs/10.1137/080712969), even if each symbol appears at most three times. I didn't find a mention of a constant factor approximation algorithm, or of something reasonably fast to tackle the problem. Are there any additional restrictions you can think of in your case?

EDIT: the authors also give a 3/2-approximation algorithm, but I don't know if it's good enough for your purposes.