I have a series of matrix equations that look like:
$$x^TA_ky=b_k$$
with $k = 1, 2, .. n$
and $A_k, b_k$ known double precision matrices, $x$ and $y$ unknown.
Besides,
$$x, y$$
are vectors with each component -1 or 1.
(i) Is there any good method to solve x and y directly?
(ii) If not, what if we relax the integer constraints, and then "round" the x and y to -1 and 1? would it be bad because of the rounding?
(iii) If this is still difficult, I think it may be a good idea to try something like:
$$min\sum_{k=1}^n |x^TA_ky-b_k|^2 + \lambda||x||_2^2 + \mu ||y||_2^2$$ so that the magnitude of x and y are not too "wild".
Can anyone give some suggestions for these kinds of problems? Thanks!
Here is how we can develop a MIP model. We prefer to use binary variable, so let's introduce:
$$p_i, q_i \in \{0,1\}$$
We can interpret:
$$\begin{align} & x_i = 2p_i -1\\ & y_i = 2q_i-1\end{align}$$
I.e. we can map this to $x_i, y_i \in \{-1,+1\}$. We can then write:
$$ \sum_{i,j} x_i y_j a_{i,j}^k = \sum_{i,j} \left(1-2 (p_i \text{ xor } q_i)\right) a_{i,j}^k = b^k $$
This is a bit complicated. It says if $p_i=q_j$ (or equivalently if $x_i=y_j$) then the value of $(1-2 (p_i \text{ xor } q_i))$ becomes $+1$ else it will be $-1$.
This can be linearized as: $$\begin{align} & w_{i,j} \le p_i + q_j \\ & w_{i,j} \ge p_i - q_j \\ & w_{i,j} \ge q_j - p_i \\ & w_{i,j} \le 2 - p_i - q_j \\ & \sum_{i,j} \left(1-2 w_{i,j} \right) a_{i,j}^k = b^k \\ & p_i, q_j, w_{i,j} \in \{0,1\} \end{align}$$
Add a dummy objective and you have your MIP model.
PS. Not many MIP models have an XOR operation. This is interesting. See link for more info about the linearization.
PS2. A small example showing this works: