Originally posted by: kreitzpa
Hi all,
Is it possible to set CPLEX to allow variables to only have the values from a discrete list of real values? For example, set variable m to be allowed to be only a value from the list of elemental masses (1.008,4.0026,6.94,...)?
Or would I need to do something like:
b_1*m == 1.008
b_2*m == 4.0026
.
.
b_118*m == 294
b_1 + b_2 + ... + b_118 == 1
Where m is the variable allowed to be masses and b variables are binary. Then constraining the sum of binary variables to equal 1 means only one binary variable is equal to 1 which forces m to be equal to one of the masses.
Thanks
#CPLEXOptimizers#DecisionOptimization