There are $n$ seats in a row. $p$ people (where $p<n$) can seat anywhere as long as long as they sit at least one seat apart due to personal relationships.
This statement is part of a larger problem related to optimisation. Can you give insights how to write this statement as a constraint? I am struggling to find a way to write it nicely in a constraint form, so I am ready for optimisation.
Insights appreciated
Let $x_i$ for i=1,..,n be a binary variable, which is 1 if seat i is occupied, and 0 if it is not.
$x_i + x_{i+1} \le 1$, for i=1,..,n-1 precludes 2 people sitting next to each other.
$\Sigma_{i=1}^n x_i = p$ if you want to make sure everyone is seated somewhere.
If it is impossible to satisfy both these constraints, the problem will be infeasible. This would happen if $p > \lfloor (n+1)/2 \rfloor$.