This puzzle is called Swap. Let's find out why!
Suppose you are given a random $\rm N\times N$ matrix (grid) 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$ swaps (in this case, after every $3$ swaps), the entire matrix rotates $90^\circ$ clockwise. Hah! That might be annoying.
Reach the solution in the least amount of swaps, from the configuration presented in the sandbox above.
Good luck! :D
P.S. This puzzle is solvable, and this puzzle is not related, albeit the title is very similar.
P.P.S. I will award a $+50$ rep bounty to whoever attempts — and solves! — a $5\times 5$ case (the elements ranging from $1$ to $25$ and quite randomly placed, and the matrix rotating $90^\circ$ clockwise every $5$ swaps).
Edit
Is there anything I might add that could improve the difficulty of this puzzle? Don't go too deep into this particular question, though — I prefer that we don't veer from the actual question itself; i.e. the puzzle.