# Can we replace a binary variable with a continuous variable using a quadratic equality constraint?

Is it possible to replace a binary variable $$x$$ with a continuous variable that satisfies the quadratic equality constraint $$x^2 - x=0$$?

The function $$f(x) = x^2 -x$$ is not a convex function. Can this constraint still be helpful in using binary variables in constrained optimization problems?

It will be helpful if you give literature references to problems having binary variables solved using this method.

• The paper on max cut by Goemans and Williamson use the constraint $x^2=1$ to enforce $x\in\{-1,1\}$, which they relax to derive a strong SDP-based relaxation (essentially launching the use of SDP relaxations for combinatorial problems, I think) – David M. Jun 15 '19 at 2:28
• Correction to your statement. $f(x) = x^2 -x$ IS a convex function, but$f(x) = 0$ is NOT a convex CONSTRAINT. Also note that $f(x) \le 0$ is a convex constraint, which ties into the above comment by @David M .That can also be helpful when trying to handle complementarity constraints arising in MPECs using SQP. See for example www3.eng.cam.ac.uk/~dr241/Papers/… . – Mark L. Stone Jun 15 '19 at 10:02
• – Rodrigo de Azevedo Jun 15 '19 at 14:22