Let me be more specific: If $A=BC$, where $A$ and $C$ are given [**Laplacian matrices**](https://en.wikipedia.org/wiki/Laplacian_matrix), how to calculate $B$? The graph corresponding to $A$ is a **directed ring**, which is strongly connected and $1\_n$ and $1\_n^T$ are right and left eigenvectors respectively. The graph corresponding to $C$ is a weighted **directed ring**, which is strongly connected but $1\_n^T$ is no longer its left eigenvecor while $1\_n$ is still its right eigenvector.


For example, $A=\left[ \begin{array}{ccc} 1&-1&0\\0&1&-1\\-1&0&1\end{array} \right]$, that is , $A$ is a [circulant](https://en.wikipedia.org/wiki/Circulant_matrix) ,singular, Laplacian matrix. $C=\left[ \begin{array}{ccc} 1&-1/2&-1/2\\-2/3&1&-1/3\\-4/5&-1/5&1\end{array} \right]$ (singular, **non-symmetric** Laplacian matrix). Then how to compute $B$ if $A=BC$. 


Note that $A, B, C$ are all **square matrices**. I **don't** want numerical solutions. There may be many solutions to this problem, so is there a formulated way to find **one** of them (maybe we can restrict $B$ to be Laplacian as well)?



If $A=BC$, where $A$ and $C$ are given Laplacian matrices, how to calculate $B$?
If the system of linear equations is consistent, its solution is $B=AC^+$, where $C^+$ is the [pseudoinverse](https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse) of $C$. Depending on the strictness of your definition of "closed formula", this may already fit the requirements. Otherwise, there are more explicit expressions. I list three alternatives in the following. Divide $A$ and $C$ into blocks
$$
\begin{bmatrix}
A\_{11} & A\_{12}\\
A\_{21} & A\_{22}
\end{bmatrix} 
=\begin{bmatrix}
B\_{11} & B\_{12}\\
B\_{21} & B\_{22}
\end{bmatrix} 
\begin{bmatrix}
C\_{11} & C\_{12}\\
C\_{21} & C\_{22}
\end{bmatrix}.
$$
where the blocks labeled $22$ are $1\times 1$. Note that $C\_{11}$ is invertible, because it is a submatrix of a singular irreducible [M-matrix](https://en.wikipedia.org/wiki/M-matrix).


1. Remove the last column, which is superfluous since it is the opposite of the sum of the previous ones, to obtain the reduced linear system
$$
\begin{bmatrix}
A\_{11}\\
A\_{21}
\end{bmatrix} 
=\begin{bmatrix}
B\_{11} & B\_{12}\\
B\_{21} & B\_{22}
\end{bmatrix} 
\begin{bmatrix}
C\_{11}\\
C\_{21}
\end{bmatrix}. \tag{\*}
$$
Now you can use the formula for the pseudoinverse of a matrix with linearly independent columns
$$
B = \begin{bmatrix}
A\_{11}\\
A\_{21}
\end{bmatrix} 
\begin{bmatrix}
C\_{11}\\
C\_{21}
\end{bmatrix}^+ = 
\begin{bmatrix}
A\_{11}\\
A\_{21}
\end{bmatrix}
\left(\begin{bmatrix}
C\_{11}\\
C\_{21}
\end{bmatrix}^\*\begin{bmatrix}
C\_{11}\\
C\_{21}
\end{bmatrix}\right)^{-1}\begin{bmatrix}
C\_{11}\\
C\_{21}
\end{bmatrix}^\*.
$$
2. Once you have removed the last column, you can choose $B\_{12}$ and $B\_{22}$ arbitrarily and solve for $B\_{11}$, $B\_{21}$ in (\*), which is possible since $C\_{11}$ is invertible.
3. If $u,v$ are norm-1 vectors such that $Cv=0, u^\*C=0$, then another formula for the pseudoinverse is 
$$
C^+ = (C + uv^\*)^{-1}-vu^\*.
$$
You can prove this using the formula for $C^+$ based on the SVD of $C$ -- basically the idea is that we change the last singular value of $C$ from $0$ to 1, then invert, and undo the change.


