I'm working on a convex quadratic separable min-cost flow problem with the following structure:


$P = \{\min \frac{1}{2}x^tQx + qx : Ex = b, 0 \leq x \leq u\}$


But I'm stuck on deriving the KKT conditions to solve the problem. 


Can someone help me with the computation?



KKT conditions for min-cost flow QP
The KKT condition is given by introducing relaxation parameters to the objective (derivative equals 0) so that whenever any element of $x$ is above $0$ or below $u$, parameters can increase to allow the system of equations to satisfy but at the same time cause penalties when x is not optimal.


So we have the following linear system that needs to be solved.
$$
M=\begin{bmatrix}
Q & E^\mathrm{T} & -I & I \\
E & 0 & 0 & 0\\
\end{bmatrix}
\begin{bmatrix}
x \\
\lambda \\
\mu \\
h \\
\end{bmatrix}=\begin{bmatrix}
-q\\
b\\
\end{bmatrix}
$$


The KKT conditions are then the above equation for stationary.
Your listed conditions for primal feasibility.


complementary slackness:


$$\mu\odot x=0$$


$$h\odot(x-u)=0$$


And $\lambda\ge0,\ \mu\ge0,\ h\ge0$ for dual feasibility.


This is my first ever answer on here. Hope I don't make a mistake.


