Originally posted by: xx8615xx2
Suppose that an array has 10 component.
Only four format accepted
0 0 0 0 0 0 0 0 0 0, all 0
0 0 0 0 0 1 0 0 0 0, only one component is 1
0 1 1 0 0 0 0 0 0 0, two components are 1, they are neighbors
1 0 0 0 0 0 0 0 0 1, two components are 1, they are head and tail
in CPLEX
sum( p in ArrayRange) array[p]<=2 only means there are less or equal to two boolean set up 1
how to set up this constrain
#DecisionOptimization#OPLusingCPLEXOptimizer