I'm trying to learn quadratic programming and it has always been difficult to me, until I found this video about how to solve a quadratic problem with quadratic programming. Only necessary theory is applied. Video
I tried to summarize the methodic. First build the objective function on the standard form. This is what the professor in the video shows:
$$\bigtriangledown (x^TQx + c^Tx)$$
I have seen objective functions like this too. Let me know if its matter to have the $\frac{1}{2}$ included or not $$\bigtriangledown (\frac{1}{2}x^TQx + c^Tx)$$
Anyway. When the objective function is created, then it need to be subject to constraints. In this case, the professor in the video shows these constraints.
$$Ax\leq b$$ $$x \geq 0$$
He began to create the KKT-conditions based on the objective function and the constraints.
$$\begin{bmatrix} 2Q & A^T & -I_n &0 \\ A& 0& 0& I \end{bmatrix}\begin{bmatrix} x\\ u\\ v\\ s \end{bmatrix}=\begin{bmatrix} -c\\ b \end{bmatrix}$$
Here we know $Q, A, I_n, I, c, b$ and we want to find $x$.
Questions:
1: All I need to do is to find the KKT-conditions and solve it and then find $x$. There is nothing more in Quadratic programming? Just like that? Once we find the vector $x$, then we have found the solution that minimize the objective function and also taking account on the constraints?
2: Do I need to prove that the objective function is convex for every solving? Or is it enough to check if $Q \ge 0$
The reason why I'm asking, is because the video seems to be so simple and easy and I got a bible at home about quadratic programming. It's huge math compare to this above.
Edit:
I made a small test but I cannot confirm if it works. All I can see is that some $x$ values is less than $0$. Notice that I just starting to put in some random values. I don't really have an working example to look at.
% Q and c matrix for objective function
Q = [2 2; 3 4];
c = [1; 2];
% Constraints
A = [1 2; 1 3];
b = [2;2];
% Zeros and identiy matrices
In = eye(size(A',1));
I = eye(size(A,1));
zer0 = zeros(size(A,1));
Azero = zeros(size(A,1), size(A', 2));
Inzero = zeros(size(A,1), size(In, 2));
% Solve Lx = v
L = [2*Q, A', -In, zer0;
A, Azero, Inzero, I];
v = [-c; b];
x = linsolve(L, v)(1:length(Q));
% Compute the value J
J = x'*Q*x + c'*x
% Output:
J = 1.5996
>> x
x =
-0.55481
0.72450