Google onsite question

Give you an array, all elements in this array are unique. You can only use swap operation. What is the minimum steps you will need to make this array in ascending order? And print path.
eg: array[1, 2, 3, 4] --------->{ } means empty path. We dont need to swap.
array[3, 4, 1, 2] --------->{3412, 1432, 1234} we need to swap 2 times.
I use bfs, can anyone give me other solutions?Thanks a lot