I would like to know if exists an algorithm to find the solutions (if any) of the following matrix equation: $$A\otimes B=B\otimes A$$ in which the $N \times N$ matrix $B$ is given and the $A$ ($A\neq0$) is the unknown $N\times N$ matrix. The conditions on B are: $$B\neq 1, B\neq 0$$... Thanks.
$A=cB$ is a solution for any scalar $c$, but these are all the solutions as long as $B\ne0$.
As relevant here, the Kronecker product is just an outer product (since matrix multiplication is not relevant), so you can model the equation as $A (B^T) = B (A^T)$ which again boils down to a number of equations $a_ib_j=a_jb_i$ for all $i$ and $j$. From there it is easy to see that if there are nonzero entries anywhere, the two inputs must be related by a common proportionality constant.