I have a Cplex model with several constraints and a solution pool. One of my constraint is :
R_alt=[i for i in R if i not in SetAlt]
model.add_constraints((model.sum(x[i, j] for j in R2 ) == 2 for i in R_alt),"6C" )
model.add_constraints((x[i, n1-4] ==x[i, n1-2] for i in R_alt ),"7C" )
SetAlt is a set of 2 values that will be removed from R_alt before making the constraint. I need these 2 values to be picked randomly by the cplex for each solution. In other words, I need cplex to change the model on this constraint during solution pool generation.
For example if I have 6C on R_alt=[0,1,2,3,6,7,8] in one solution, I get R_alt=[0,2,3,4,5,6,8] in another solution.
Before, I was using python random for picking this SetAlt but the problem was that I had the same SetAlt in all solutions.