I'm implementing an OR logic with Gurobi. Specifically, I have two decision variables $x$ and $y$ and I want $x \neq y$. However, Gurobi doesn't support inequalities. So I tried to use OR logic like $x >= y + \epsilon OR y >= x + \epsilon$.
I've read the documentation of Gurobi and found they have the addGenConstrOr() function. I tried to implement it according to the example usage model.addGenConstrOr((z, [x>=y+\epsilon, y>=x+\epsilon], "orconstr")
. However, the program returned an error gurobipy.Model.addGenConstrOr gurobipy.GurobiError: Invalid data in vars array
. It seems the data in the vars array of this function needs to be binary boolean variables. So my question is how to change this x>=y+\epsilon
into a boolean variable such that I can fit this into the model.addGenConstrOr
function? Or is there any better method to implement the inequality constraint in Gurobi?