# Implement geometric constraint using DOCplex

currently I'm working on a wind farm layout optimization problem. I found an appropriate model in literature (Fischetti et al.) and now I'm trying to reproduce it using the Python API of cplex with DOCPlex. The model looks like the following:

\begin{align} \text{max} \ z = \sum_{i \in V} (P_i x_i - w_i) \end{align}

s.t.

\begin{align} N_ {min} \le \sum_{i \in V} x_i \le N_{max} \\\\ x_i + x_j \le 1 \qquad (i,j) \in E_I \tag{eqn of interest}\\\\ \sum_{j \in V} I_{i,j} x_j \le w_i + M_i (1-x_i) \quad i \in V \\\\ w_i \in \{0,1\} \quad i \in V \\\\ w_i \ge 0 \quad i \in V \end{align}

with the corresponding set $$E_I$$: $$$$\{(i,j): i,j \in V, dist(i,j) < D_{min}, i \neq j\}$$$$

From my understanding, this constraint ensures the mininum distance $$D_{min}$$ is achieved by comparing the current iterator $$i$$ with all already set locations $$x_j$$ in the distance of $$D_{min}$$. If there would be a match, the eqn $$x_i + x_j$$ would be at least 2 (if the binary at $$i$$ would be set), violating the constraint. I am currently failing to add this constraint to my model in DOCcplex. If anyone could help my, by giving me a hint I would be glad.