Let's say I have an objective function
$$f(x_1,x_2, \cdots, x_n)$$
and $N$ constraints $$x_i \ge 0. $$
I am trying to solve it with KKT conditions. Now the objective function becomes
$$f(x_1,x_2, \cdots, x_n)+ \mu_i(g_i(x)).$$
I want to solve it using a C program so I solved the equation manually for both cases where I take $\mu_i =0$ and the other case when $x_i < 0$ then $x_i = 0$.
So let's say I run the algorithm and take all $\mu_i = 0$ initially and get $x_1 < 0$ (the rest all are positive), so I run the algorithm again with $x_1 = 0$. Now assume that I get $x_2 < 0$ (the rest all are positive). Now I updated with $x_2 = 0$ so here I want to know whether I should take $x_1 =0$ also or whether I need to perform all possible combinations with $x_i =0$ and $\mu_i = 0$ to get the final answer.