I have an integer linear programming problem where i want to maximize over $\{0,1\}^n$, so i have the problem $$\max_{x \in \mathbb{R}^n}c^Tx, \text{ subject to } x_i \in \{0,1\} \text{ for all } i = 1,\dots, n.$$ I now want to introduce a constraint to make sure that the ones in the vector have specific distances $d_1,\dots, d_n$. This means, I want a constraint that assures that when $x_i = 1$, then $x_{i\pm j} = 0$ for all $j = 1, 2,\dots,d_i$. With this I want to make sure that the elements which are chosen (the ones) are not too close to eachother. I already found that when $d_i = 1$, I could formulate the constraint $0.5x_{i-1} + x_i + 0.5x_{i+1} \leq 1$. But already for $d_i = 2$ I was lost.
Does someone have an idea on how to do this? That would be awesome!