Let $J = Q^{-1} A Q$ be the Jordan form of $A$, where $Q$ is a similarity transform matrix. Then, how to minimize the condition number $\kappa(Q) = \|Q^{-1}\| \|Q\|$? Is it a convex optimization problem?
At first, let's fix $A$ and $J$. Then, the general version can be solved by searching over all possible permutations of the Jordan blocks, even though it is less efficient.