-1
$\begingroup$

Using the signed modulo operation:

$(x\ \mathrm{mod}\ 2) = \begin{cases} 0\ \mathrm{if}\ x\ \mathrm{is\ even} \\ 1\ \mathrm{if}\ x > 0\ \mathrm{and}\ x\ \mathrm{is\ odd} \\ -1\ \mathrm{if}\ x < 0\ \mathrm{and}\ x\ \mathrm{is\ odd} \\ \end{cases}$

  • 3
    What exactly is your question?2012-03-28
  • 0
    I think the question is how to enforce the constraint that $x$ and $y$ have the same parity in an integer program. The OP should edit, though.2012-03-28

1 Answers 1