I'm trying to linearize the following constarints, however, Iam not sure if it's correct? Both of the make sense and seems incorrect at the same time! Could anyone help me to identify what I'm missing??
Assume that, we have one known fact that the min and max value for the variable $u_i$ is $L$ and $H$. So, with that we are interesteed to satisfy the following:
$ x_{i,j} = 1 \implies u_j = u_i + \sum_t y_i^t - \sum_t w_i^t$
My try:
I separate equal sign to two inequalities:
$ x_{i,j} = 1 \implies u_j \le u_i + \sum_t y_i^t - \sum_t w_i^t$ and $ x_{i,j} = 1 \implies u_j \ge u_i + \sum_t y_i^t - \sum_t w_i^t$
Then
$ u_j \le u_i + \sum_t y_i^t - \sum_t w_i^t + L(1- x_{i,j} ) $
$ u_j \ge u_i + \sum_t y_i^t - \sum_t w_i^t - H (1- x_{i,j} ) $
Or should I say:
$ u_j \le u_i + \sum_t y_i^t - \sum_t w_i^t + H(1- x_{i,j} ) $
$ u_j \ge u_i + \sum_t y_i^t - \sum_t w_i^t + L (1- x_{i,j} ) $
You want to enforce \begin{align} x_{i,j} = 1 &\implies u_j \le u_i + \sum_t y_i^t - \sum_t w_i^t\\ x_{i,j} = 1 &\implies u_j \ge u_i + \sum_t y_i^t - \sum_t w_i^t \end{align} Introduce constants $M_1$ and $M_2$ (to be determined), and impose $$M_1(1-x_{i,j}) \le u_j - u_i - \sum_t y_i^t + \sum_t w_i^t \le M_2(1-x_{i,j}).\tag1\label1$$ Let $T=\sum_t 1$. You want $M_1$ and $M_2$ to be lower and upper bounds, respectively, on the middle expression of \eqref{1} when $x_{i,j}=0$. So take $M_1=L-H-T+0$ and $M_2=H-L-0+T$.