Minimize $\|A-XB\|_F$ subject to $Xv=0$ Assume we are given two matrices $A, B \in \mathbb R^{n \times m}$ and a vector $v \in \mathbb R^n$. Let $\|\cdot\|_F$ be the Frobenius norm of a matrix. How can we solve the following optimization problem in $X \in \mathbb R^{n \times n}$?
$$\begin{array}{ll} \text{minimize} & \|A-XB\|_F\\ \text{subject to} & Xv=0\end{array}$$
Can this problem be converted to a constrained least squares problem with the optimization variable being a vector instead of a matrix? If so, does this way work?
Are there some references about solving such constrained linear least Frobenius norm problems?
Thanks!

suppose $A = (a_{ij})$, $B = (b_{ij})$, then $A - XB = (a_{ij} - \sum_{k}X_{ik}b_{kj})$
if you take the matrix $X$ as a $1\times n^2$vector arranged according to the rows from top to bottom.
$\hat{X} = (x_{1,1},x_{1,2},\cdots,x_{n,n-1},x_{n,n}) = (X_1,X_2,\cdots,X_n)$, where $X_k$ is the $k$th row of $X$.
Thus the square of $F$ norm is
$\mathrm{tr}(A-XB)(A-XB)' = \mathrm{tr}(AA' - XBA'-AB'X'+XBB'X') = \mathrm{tr}(AA') -2\mathrm{tr}(XBA') + \mathrm{tr}(XBB'X') = \mathrm{tr}(AA') - 2\sum_k \langle X_k,(AB')_k\rangle + \sum_k X_k(BB')X_k'$
where $(AB')_k$ is the $k$th row of $AB'$.
Thus the norm is
$\mathrm{tr}(AA') - 2 \langle \hat{X},M'\rangle + \hat{X}\left((BB')\otimes I_n\right) \hat{X}'$
where $M = ((AB')_1,(AB')_2,\cdots,(AB')_n)$, arrange the rows in one row.
The constraint condition is
$Xv = 0$, then that is $\langle X_k, v'_k\rangle = 0$
