How to solve an optimization problem with n variables using KKT?

61 Views Asked by At

To find the optimal solution of the problem:

\begin{aligned} \min _{z=\left(z_{1}, \ldots, z_{n}\right)^{\top} \in \mathbb{R}^{n}} & \sum_{i=1}^{n} \frac{1}{4}\left(z_{i}-1\right)^{2} \\ \text { s.t. } & \sum_{i=1}^{n} z_{i}=1 \\ & z \geq 0 \end{aligned}

I found the Lagrangian:

$$L(z_i,\lambda_1) = \sum_{i=1}^{n} \frac{1}{4}(z_i -1)^2 - \lambda_1 \left(\left(\sum_{i=1}^{n}z_i\right) -1 \right)$$

And I developed a list of KKT conditions: $$\frac{\partial L}{\partial z_i} = \frac{1}{2}(z_i -1)-\lambda_1 = 0$$ $$\frac{\partial L}{\partial \lambda_1} = 1-\sum_{i=1}^{n}z_i = 0$$ $$\sum_{i=1}^{n}z_i = 1$$ $$z\ge0$$

Applying the constraint $\require{enclose}\enclose{horizontalstrike}{\sum_{i=1}^{n}z_i = 1}$ to the first KKT condition yields the equation $\enclose{horizontalstrike}{1-\lambda_1 =0}$. So, it appears that at a KKT point $\enclose{horizontalstrike}{\lambda_1=1}$.

I'm not sure how to continue the KKT analysis and solve for the elements of an optimal z vector, where $z=\left(z_{1}, \ldots, z_{n}\right)^{\top}$. How can I continue towards the optimal solution from this point?