Originally posted by: 88Simon88
Hello everybody,
In the below formulation, X is binary, what is the best method to make it linear?
Istip = (1 - Xsti) * (aps * Is(t-1)i(p-1) + bps * Is(t-1)ip + cps * Is(t-1)i(p+1))
1- Indicator constraint
forall (s in scenario, t in 2..T, i in cell)
{
(X[s][t][i] == 0) == (I[s][t][i][p] == a[p][s] * I[s][t-1][i][p-1] + a[p][s] * I[s][t-1][i][p] + a[p][s] * I[s][t-1][i][p+1]);
(X[s][t][i] == 1) == (I[s][t][i][p] == 0);
}
2- Big M
forall (s in scenario, t in 2..T, i in cell, p in 2..P-1)
{
I[s][t][i][p] <= (a[p][s] * I[s][t-1][i][p-1] + b[p][s] * I[s][t-1][i][p] + c[p][s] * I[s][t-1][i][p+1]) + X[s][t][i] * BigM;
I[s][t][i][p] >= (a[p][s] * I[s][t-1][i][p-1] + b[p][s] * I[s][t-1][i][p] + c[p][s] * I[s][t-1][i][p+1]) - X[s][t][i] * BigM;
I[s][t][i][p] <= (1 - X[s][t][i]) * BigM;
}
What is your suggestion? Have the codes written correctly?
Thanks in advance for your help.
#CPLEXOptimizers#DecisionOptimization