EDIT: I\'m not sure that my original question is clear enough. I need an algorithm that will compute the minimal sequence of moves to rearrange an array from one ord
http://en.wikipedia.org/wiki/Longest_increasing_subsequence
Find the longest increasing subsequence (according to the new sort order). Then move each element which is not in that sequence, into its place relative to the elements already in the sequence.
In your example, 'a, b, e' and 'a, c, e' are tied for longest increasing subsequence. The best you can do is choose one of those, and just move the other elements.