Project vector on a space defined by inequalities

161 Views Asked by At

Let say I have a vector $d^T = [-1,3]$. I want to find the vector that is as close as possible to the vector d given the following linear inequalities:

$x \geq 0$

$-x+y \leq 2 $

I don't have a very large basis in linear algebra, but I believe this is called projecting a vector. However, while projecting it is often projected to a reduced space. In my case, I want to project it to a constrained space (I believe).

I found this quora post that seems to describe the vector I am interested in. However, the post has linear equality constraints. When I introduced slack variables to my inequality constraints and applied the method in the post, the vector was not correct.

How can I calculate the vector which is as close to d while satisfying the inequalities?