How to get a g-inverse which does not have any nonzero entry? Find a g-inverse of the following matrix such that it does not contain any zero
        entry.$$\begin{pmatrix}
        1 & 2 & 1 \\0 & 1 & 1\\ 1 &  3 & 2
        \end{pmatrix}.$$
Work done:
I found  a generalized inverse and I try to find the suitable entries to make it nonzero.
for example,
$$G=\begin{bmatrix}
0 & 0 &0\\
1 & -1 & 0\\
-1 & 2 & 0
\end{bmatrix}$$
Now, How to get a g-inverse which does not have any nonzero entry?
By using the sagemath,
I have calculated the g-inverses by varying the entries of $u$ 
in the expression $G+(I-GA)U$ to get the new g-inverses and after some trial and error work, I found 
$$G_1=\left(\begin{array}{rrr}
2 & 2 & 3 \\
-1 & -3 & -3 \\
1 & 4 & 3
\end{array}\right)
$$
is a g-inverse with non-zero entries for the the $u=\left(\begin{array}{rrr}
2 & 2 & 3 \\
1 & 0 & 0 \\
0 & 0 & 1
\end{array}\right)$.
Is there any other possibility to get the g-inverse with all entries are non-zero in a simple manner?(means without trial and error, because it may take so much time for some matrices)
Definition:
A matrix $G$ is said to be generalized inverse of $A$ if 
$$AGA=A$$
 A: Here's one approach, which is not as refined as I would prefer, and doesn't work for some cases, but it's still something.
If $A$ is an invertible matrix, then it has a unique g-inverse which is its usual inverse, and there is no choice in its entries. So suppose $A$ is non-invertible, and has a g-inverse $G$. In fact, we will need a stronger condition for this method to work, which is its shortcoming.
Assume that there there is a (column) vector $u$ in the right null space of $A$ with all entries non-zero (we could also apply a similar procedure using such a vector in the left null space instead of in the right null space). Firstly, observe that for any row vector $v^T$ (of appropriate size), $G + uv^T$ is also a g-inverse of $A$ (and the same holds if $v^T$ is a left null vector of $A$ and $u$ is any column vector of appropriate size).
Without loss of generality, assume that the smallest entry of $u$ by magnitude is $1$. Let $t = \max\limits_{i,j} | g_{ij} |$ be the largest entry of $G$ by magnitude.
Let $H = G + (t + 1)u\mathbf 1^T$, where $\mathbf 1^T$ is the all-ones row vector of appropriate size. Then $H$ is a generalized inverse of $A$, and has $(i,j)$ entry $h_{ij} = g_{ij} + (t + 1)u_i$. Since every entry of $u_i$ has magnitude at least $1$, $|(t + 1)u_i| \ge t + 1$. We know that $g_{ij} \le t$. Therefore, $h_{ij} = g_{ij} + (t + 1) u_i$ is the sum or difference of two non-equal terms, and can therefore never be zero. Thus, $H$ is a g-inverse of $A$ with all entries non-zero.
Note: Obviously, the $t + 1$ above can be replaced by the more general $t + \varepsilon$, for any $\varepsilon > 0$.

For the particular matrices $A$ and $G$ in the question, we have $u = [1 \quad -1 \quad 1]^T$ as a right null vector of $A$ in the required form, and $t = 2$ as the largest entry of $G$. Then,
$$H = G + 3 u \mathbf 1^T = \begin{bmatrix}3 & 3 & 3\\ -2 & -4 & -3\\ 2 & 5 & 3\end{bmatrix}$$
is a g-inverse of $A$ with non-zero entries.
