Originally posted by: Eumpfenbach
working this through as a type but hopefully it will be clear.
introduce a new variable y(new). Constrain it as such:
y(new1) + 1 >= y(t) + (1 - y(t+1))
y(new1) <= y(t)
y(new1) <= (1 - y(t+1))
y(new1) is equal to 1 if y(t) = 1 and y(t+1) = 0.
Now create 3 more binary variables y(new2), y(new3), y(new4).
Constrain y(new1) = y(new2) + y(new3) + y(new4)
now
xt+1 + xt+2 + xt+3 = 3 * y(new2)
xt+1 + xt+2 + xt+3 + xt+4 + xt+5 + xt+6 = 6 * y(new3)
xt+1 + xt+2 + xt+3 + xt+4 + xt+5 + xt+6 + xt+7 + xt+8 +, xt+9 = 9 * y(new4)
Might not be the most efficient way to do this, but I think it should work.
#CPLEXOptimizers#DecisionOptimization