Given four sets of **binary** variables $x\_{1..N}$, $y\_{1..N}$, $v\_{1..N}$, and $w\_{1..N}$ such that $\Sigma\_{i=1}^{N} x\_i = \Sigma\_{i=1}^{N} y\_i = \Sigma\_{i=1}^{N} v\_i = \Sigma\_{i=1}^{N} w\_i = 1$, I need to linearize the following constraint:

$\Sigma\_{i=1}^{N} x\_i y\_i \leq \Sigma\_{i=1}^{N} v\_i w\_i$.

All binary variables have value in $\{0, 1\}$. This constraints means that if for an $i \in \{1,.., N\}$, it holds that $x\_i=y\_i=1$, then for a $j \in \{1,.., N\}$, it must hold that $v\_j=w\_j=1$. In other words, if the dot product of vectors $\textbf{x}$ and $\textbf{y}$ is one, then the dot product of vectors $\textbf{v}$ and $\textbf{w}$ must also be 1 (based on the assumption in the first line, all vectors $\textbf{x}$, $\textbf{y}$, $\textbf{v}$, and $\textbf{w}$ are unit vectors in $R^{N}$).

**1. Approach 1**

I know that I can introduce for each $i$, a new variable $\alpha\_i$ to mean that $\alpha\_i = x\_i y\_i$ by the following constraints: 

$\alpha\_i \leq x\_i$

$\alpha\_i \leq y\_i$

$\alpha\_i \ge x\_i + y\_i -1$,

and, in a similar manner, introduce a new variable $\beta\_i$ to mean $\beta\_i = v\_i w\_i$, and, finally, replace the original constraint by the following:

$\Sigma\_{i=1}^{N} \alpha\_i \leq \Sigma\_{i=1}^{N} \beta\_i$.

The problem of this approach is that it considerably slows down my program implemented in cplex. 

I need to use a different approach that is faster than this.

thanks

**2. Approach 2**

One other approach was to introduce only two new **binary** variables $\lambda$ and $\xi$, whose values are in $\{0, 1\}$ and restricted by the following constraints:

$\lambda \ge x\_i+y\_i-1 \;\;\;\;\;\;\;\;\;\;\;\; , \forall i\in \{1,...,N\}$

$\xi \ge v\_i+w\_i-1 \;\;\;\;\;\;\;\;\;\;\;\; , \forall i\in \{1,...,N\}$,

Accordingly, the original constraint is formulated by the following constraint:

$\lambda \leq \xi$.

This approach is extremely faster than the first approach, but it works only for one case, where for an $i \in \{1,..., N\}$, it holds that $x\_i=y\_i=1$, which enforces that it must hold that $v\_j=w\_j=1$ for a $j \in \{1, ..., N\}$. For the other case, where for no $i$, it holds that $x\_i = y\_i = 1$, the value of $\lambda$ is not constrained to by 0, and so it makes problem.