I have created the following puzzle for the Puzzling Stack Exchange and I need to know if the aim of this puzzle is possible to achieve, hence why I have firstly posted it here. I hope it is not off-topic.
This puzzle is called Swap. Let's find out why!
Suppose you are given a random $\rm N\times N$ matrix with all the integers from $1$ to $\rm N^2$ each belonging in every grid square (a.k.a. cells). The integers are the elements of the matrix. The elements are ordered randomly. Let $\rm N = 3$ for the following case:
$$\begin{array}{|r|c|} \hline \verb|9|&\verb|8| &\verb|4| \\ \hline \verb|7|&\verb|6| &\verb|2| \\ \hline \verb|1|&\verb|3| &\verb|5| \\ \hline \end{array}$$
The aim of the puzzle is to reach the following configuration from the matrix above via swaps:
$$\begin{array}{|r|c|} \hline \verb|1|&\verb|2| &\verb|3| \\ \hline \verb|4|&\verb|5| &\verb|6| \\ \hline \verb|7|&\verb|8| &\verb|9| \\ \hline \end{array}$$
Swaps are movements defined by switching two orthogonally adjacent cells and exchanging their positions in the matrix (intuitively).
But, like always, there's a catch!
After every $\rm N^2$ swaps (in this case, after every $9$ swaps), the entire matrix rotates $90^\circ$ clockwise. Hah! That might be annoying.
Aim: Reach the solution in the least amount of swaps from the configuration in the sandbox.
Is the aim of this puzzle achievable, or not? I am very confident it is, but I need a proof (maybe somewhat implicit so I can figure out myself; i.e. hints are appreciated).
Apologies if this is off-topic, but a similar question of mine on this site seemed to kick off well. I hope you understand the puzzle, but more importantly, I hope not to take too much time off your hands if you are willing to answer this question and/or attempt the puzzle yourself. Again, let's find out!
Thank you in advance.
P.S. This puzzle is not related, albeit the title is very similar; but this concerns only PSE users, I suppose.