Let $\boldsymbol{A}_{(n\times n)}=[a_{ij}]$ be a square matrix such that the sum of each row is 1 and $a_{ij}\ge0$$(i=1,2,\dots,n~\text{and}~j=1,2,\dots,n)$ are unknown. Suppose that $\boldsymbol{b}_{1}=[b_{11}~b_{12}\dots b_{1n}]$ and $\boldsymbol{b}_{2}=[b_{21}~b_{22}\dots b_{2n}]$ are known row vectors of proportions such that $$\boldsymbol{b}_{1}\boldsymbol{A}_{(n\times n)}=\boldsymbol{b}_{2},$$ where $\boldsymbol{b}_{1}\boldsymbol{1}_{n}=1$, $\boldsymbol{b}_{2}\boldsymbol{1}_{n}=1$ and $\boldsymbol{1}^{T}_{n}=[1~1\dots1]$.

I know that there are infinite solutions for $\boldsymbol{A}$. However, my objective is two-folded: **(i)** to optimize $\boldsymbol{A}$ such that **trace**$(\boldsymbol{A})$ is maximized (and each $a_{ij}$ may be expressed in terms of known quantities of the vectors $\boldsymbol{b}_{1}$ and $\boldsymbol{b}_{2}$ if possible) and **(ii)** under which condition(s) a unique $\boldsymbol{A}$ exists?

Thank you!