# KKT inequality conditions

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.

• If $x_i = 0$, then $\mu_i \geq 0$ (if strict complementary slackness holds, then $\mu_i > 0$). If $x_i < 0$, then $\mu_i = 0$. Could you please clarify your problem statement to that effect? Jun 25 '19 at 7:08

• Isn’t SQP a first order tailor expansion on the constraints and then using the Lagrangian as the objective function with the step size and direction as the variable with a fixed $x^*$? Jun 25 '19 at 7:58