I'm using or-tools to solve a CP problem. The solver gives a feasible solution as below . It means:
X1=345, X2=437, ..., X6=1150, X7=716, X8=788...etc.
random_list=[345, 437, 801, 981, 1068, 1150, 716, 788, 860, 982, 1069, 1151, 717, 789, 861, 944, 1026, 1152, 718, 790, 862, 984, 1071, 1153, 719, 791, 863, 985, 1072, 1154, 354, 436, 622, 1073, 1155]
The adjacent elements' gap ranged from -880 to 364.
Actually I would like obtain the sorted variables as below and set the constraints to the gap of the adjacent elements. The gap should be ranged 10 to 50 for example. So is it feasible to set the constrains like this?
order_list=[345, 354, 436, 437, 622, 716, 717, 718, 719, 788, 789, 790, 791, 801, 860, 861, 862, 863, 944, 981, 982, 984, 985, 1026, 1068, 1069, 1071, 1072, 1073, 1150, 1151, 1152, 1153, 1154, 1155]
X1=345, X30=354, X31=436, X2=437,.... # the variables are not in order as definition.
The adjacent elements' gap ranged from 1 to 185.
Thank you.