I'm trying to implement the big M approach to a simple problem but I'm struggling a lot to define the values of big M in the model's constraints.
Thing turn out that if I pick a small value as M, the constraints become invalid, while a big value M could help contains the problem but with other equational constraints generate numerical accuracy issues like the following in Gurobipy and finally IIS
x[i] <= 0
value(x[i]) = 1.34252346e-07
So, Is there a way to test a suitable M value to constrain one's model?
As far as I know there does not exist an exact way to determine the value of big M. It depends on the values of data used in your specific problem. You should try to determine the lowest possible value that is going to keep constraint satisfied