Projection on a polyhedron

Recall that a polyhedron is an intersection of a finite number of half-spaces. A polyhedron mathbf{P} can be written as

 mathbf{P} = left{ x ~:~ Ax le b right},

where A in mathbf{R}^{m times n} and b in mathbf{R}^m, and the symbol le refers to the component-wise inequality between vectors.

The Euclidean projection (or projection for short) of the origin on the polyhedron mathbf{P} is the (unique) solution to the optimization problem

 min_{x in mathbf{P}} : |x|_2.

Without loss of generality, we can square the objective and solve the problem

 min_{x} : x^Tx ~:~ Ax le b.

The above is a QP.