I have the following constraint requirements.

2.x1-x2 = 0 OR x1 - 2.x2 = 0

x1,x2 are positive integers less than a given value, say 10 for the question

How do I implement this? Basically its looking for integers on the line x1 = 2.x2, or x1 = 1/2.x2

The solution is clearly not a convex hull. I presume there must be some formulation using a binary variable.

Is there a general approach to implementing constraint1 OR constraint2?