Let $A=\begin{pmatrix} 1 &2 & 1 &0\\ -2 & 1 & 0 &1 \\ 0 &0 &1 &2 \\ 0 &0 & -2 & 1 \end{pmatrix}$. Then the characteristic polynomial of $A$ is $\chi (x)=(x^2-2x+5)^2$.
I want to find the minimal polynomial of $A$. How can I find this? Are there some formulaic algorithm?(That is, if some algorithm for this question exists, this algorithm can be applied to other matrices?)