Originally posted by: SystemAdmin
Basically, what you want is an operation not supported by mathematical programming in general, not just CPLEX. It is perfectly fine if you are writing a constraint programming model (such as with CP Optimizer). You can do what you have in mind in a mixed integer program, but it will take a large number of additional constraints and binary variables. Basically, you end up with a binary variable for each combination of a slot in y and a possible value for that slot ("is y[i] equal to j?") and a constraint on x for each index i and each pair of possible values of y[i] and y[i+1].
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
#CPLEXOptimizers#DecisionOptimization