I am new to mathematical programming and I am trying to implement case specific constrains in Gurobi with Python.
I am wondering about how I can implement my constraints in the fastest or most common way.
There are three variables: $$ w_i,w_j \in \mathbb{N}, y_\text{i,j} \in \{0,1\} $$ The indices $i$ and $j$ referes to fiction tasks since this model takes part of a task scheduling problem. Variable $w$ is a weight of the task and $y$ shows if task $i$ precedes $j$. So there are some other constraints to provide some preceding rules.
I need to implement different constraints (let's say $C_1, C_2, C_3$) depending to those variables:
$$
1: (w_i > w_j) \land (y_\text{i,j} \lor y_\text{j,i}) \rightarrow C_1 \\
2: (w_i = w_j) \land (y_\text{i,j} \lor y_\text{j,i}) \rightarrow C_2 \\
3: (w_i < w_j) \land (y_\text{i,j} \lor y_\text{j,i}) \rightarrow C_3
$$
To implement this constraint I need introduce new binary variables to the model (let's say $a_1,a_2,a_3$) wich are only equal $1$, when the refered case is true. Since Gurobi does not implement strict less or greater operators, I need to model a bigM constraints for the variables $a$.
$$ w_i \ge w_j + \epsilon - M(1-a_1) \\ w_i \le w_j + M \times a_1 \\ a_1 \in {0,1} \\ \epsilon << w_i \tag{1} $$
Since there is a constraint that says, that either $y_\text{i,j}$ or $y_\text{j,i}$, but not both, are equal 1, I plan to implement a constraint for each case with a new binary variable $b$ to represent the logical condition: $$ b_1 = a_1 \times (y_\text{i,j} + y_\text{j,i}) $$
Finally, I am able to implement each case with an indicator constraint like $b_x \rightarrow C_x; x\in {1,2,3}$
At first, I am wondering if the second equation of EQ:1 can also expressed with epsilon instead of M as $w_i \le (w_j - \epsilon) \times a_1$.
What is the difference?
Second, Is this the correct way to implement a problem like this or is there a better way?