Integer/Binary Programming - Convert nonlinear constraint to linear constraint

341 Views Asked by At

I have a constraint based on matrix multiplication. It involves summation of a product. The product multiplies two entries of a variable matrix named order, and an entry of a constant matrix named guess.

All of the variables and constants are binary. All of the indexes have the same arbitrary range $N$.

($\forall n,m$) result$_{n,m}$ = $\sum_r \sum_s$ (order$_{n,r}$ * guess$_{r,s}$ * order$_{m,s}$)

Is it possible to turn this into ~$N^2$ linear constraints?

1

There are 1 best solutions below

0
On

You can linearize each product of binary variables by introducing a new binary variable and three linear constraints: https://or.stackexchange.com/questions/37/how-to-linearize-the-product-of-two-binary-variables

That is $O(N^4)$ linear constraints. See the references in the linked answer for formulations that use fewer constraints.