• Gurobi Staff

After setting the parameter SolutionNumber to the $$i$$-th best solution, the value of each variable can be accessed by querying the attribute Xn and not X (this attribute always reports the variable values in the current solution). In the last part of your code when checking whether a variable is assigned to value 1 or not, you need to check:

if x[i, j].Xn > 0.5:

I ran your code and I was able to see different values assigned to variables $$x$$.

Best regards,

Maliheh

Thank you so much Maliheh, now it is working in a proper way