1

problem statement : enter image description here

any hint on how to proceed .

shrey
  • 143

1 Answers1

0

The or-conditions make it difficult to do algebra. We can introduce the variables $b_1, b_2, \dots b_n$, where each variable can have the value 0 or 1. An other thing that might make the problem more clear is if we write the conditions in such a way that the right hand side indicates a difference between $x$ values. The conditions can be written as:

$$ \begin{eqnarray} x_{i+1} - x_i &=& a_{i+1} - b_{i+1} \quad \text{for } i = 1 \dots n-1\\ x_n - x_1 &=& b_1 - a_1 \end{eqnarray} $$

Now since $\sum_{i=1}^{n-1} (x_{i+1} - x_i) = x_n - x_1$, we can replace the second condition with $\sum_{i=1}^{n-1} (a_{i+1} - b_{i+1}) = b_1 - a_1$, which we can rewrite to $\sum_{i=1}^n a_i = \sum_{i=1}^n b_i$. We can incorparate the first condition in the minimization formula. So we can rewrite the problem as: $$ \min_{\displaystyle x_1 \in \mathbb{Z}, b \in \{0,1\}^n}\ \ \sum_{i=1}^n \left | x_1 + \sum_{j=2}^i (a_j - b_j) \right| \quad\text{s.t.}\quad \sum_{i=1}^n a_i = \sum_{i=1}^n b_i $$ Now this still seems like a difficult problem to me. But let's say we found a way to find the optimal values for $b_i$. Then the problem would be reduced to: $$ \min_{\displaystyle x_1 \in \mathbb{Z}}\ \ \sum_{i=1}^n \left | x_1 + c_i \right| \quad\text{where}\quad c_i \in \mathbb{Z} $$ We can minimize this by taking $x_1 = -\operatorname{median}(c)$. To take the median we sort the values $c_i$ and then take the middle number. Or, if $n$ is even, one of the two middle numbers or a value between them.

Maybe you can use this. If not, I might later add more.

Paul
  • 2,795