I have an initial permutation (eg. $\{A,B,C,D,E,F,G,H~\}$) and a final permutation (eg. $\{A,C,F,D,E,G,B,H~\}$) and I want to find how the final permutation can be created from the initial one using minimum number of moves. In my situation a move is removing a character and inserting it to another position.
For example (let the indices of characters start from zero):
$$\{A,B,C,D,E~\} \xrightarrow[\text{B $\rightarrow$ 4}]{} \{A,C,D,E,B~\}$$
It is obvious, that if we wanted to create permutation $\{A,C,D,E,B~\}$ from $\{A,B,C,D,E~\}$, it would be possible to do it also by other moves:
$$\{A,B,C,D,E~\} \xrightarrow[\text{C $\rightarrow$ 1}]{} \{A,C,B,D,E~\} \xrightarrow[\text{D $\rightarrow$ 2}]{} \{A,C,D,B,E~\} \xrightarrow[\text{E $\rightarrow$ 3}]{} \{A,C,D,B,E~\}$$
But I want to find an optimal way (with minimum number of moves). Is there an algorithm to find the moves? Or at least any methods which solve similar problems?
Thank you for help :)