Let complex matrices $A$ and $B$ have the same sizes. Using the singular value decomposition, we characterize the $g$-inverse $B^{(1)}$ of $B$ such that the distance between a given $g$-inverse of $A$ and the set of all $g$-inverses of the matrix $B$ reaches minimum under the unitarily invariant norm. With this result, we derive additive and multiplicative perturbation bounds of the nearest per...