In the case of Quadratic Programming for optimization, the objective function is a quadratic function. One of the techniques for solving quadratic optimization problems is KKT Conditions which is explained with an example in this tutorial.
2. KKT CONDITION
Karush–Kuhn–Tucker conditions or KKT conditions are used for finding solution to non-
linear optimization problems
It is used to solve non-linear problems only. Thus either objective or constraint equation
must be non-linear.
Only concave objective functions with convex constraint equations can be solved by this
method.
4. ANSWER
The solution to the problem stated in the previous page can be solved by the following
methods :
1) Application of Lagrangian Multiplier method of solving differential equations
2) Solve considering all constraints to be active
3)Solve considering all constraints to inactive
4)Solve considering only one among the two constraints to be inactive
5)Solve considering the other constraint to be inactive
5. APPLICATION OF LAGRANGIAN
MULTIPLIER METHOD OF SOLVING
DIFFERENTIAL EQUATIONS
How the equation A has come ?
1) Multiply Lambda 1 and Lambda 2 with the constraint functions(g1 and g2)
2) Add the objective function f with the summation of the product of Lambda 1 with
g1 and Lambda 2 with g2 function
3) Let this equation(developed at Step 2) is equal to L(x1,x2,L1,L2)
EQN A
6. ASSUMING THAT BOTH g1 AND g2
IS ACTIVE
EQN B
HOW EQN B WAS DERIVED ?
1)EQN A was partially differentiated with respect to x1 to find Lx1
2) EQN A was partially differentiated with respect to x2 to find Lx2
3)EQN A was partially differentiated with respect to L1 to find LL1
4) EQN A was partially differentiated with respect to L2 to find LL2
Note :
• While differentiating with x1,x2,L1 and L2 will be constant and similarly
at the time of differentiating with x2, x1,L1 and L2 will be constant and so on.
• In EQN B, the terms which were differentiated to zero is represented by
a coefficient zero
7. MATRIX FORM
All the coefficients in the four
equations of EQN B
All the variables in
the four equations
of EQN B
All the RHS in the
four equations of
EQN B
If you solve the matrix you will get the following
solution :
x1 = 1
x2 = 1
L1=20
L2 = -8
Substituting x1,x2,L1 and L2 in f,g1 and g2 will
give :
f = -18, g1 = 0 and g2 = 0
Although the solution satisfies the constraint but
as per KKT condition L2 can not be less than
zero and as a result these solutions were
found to be infeasible.
8. ASSUMING THAT BOTH g1 AND g2
IS INACTIVE
1) Ignore the constraint functions g1 and g2,i.e.,assume L1 and L2 to be zero; to develop EQN C from EQN A
2) Partially differentiate the EQN C with respect to x1 and x2 to find EQN C1 and C2.
3) Putting x1 and x2 in g1 and g2 will give the value of g1 and g2 to be equal to 8 and 10
4) But as per the problem both g1 and g2 must be less than or equal to zero. So the solutions will be infeasible.
EQN C
EQN C1
EQN C2
9. SOLVE CONSIDERING ONLY ONE
AMONG THE TWO CONSTRAINTS
TO BE INACTIVE : LET g1 BE ACTIVE
1) Ignore the constraint functions g2,i.e.,assume L2 to be zero; to develop EQN D from EQN A
2) Partially differentiate the EQN D with respect to x1,x2 and L1 to find EQN D1,D2 and D3
3) A matrix was also prepared with the cefficient,variables and RHS of the three equations
4) The matrix was solved to find the values of x1,x2 and L1 which is depicted in Eqn.D4.
5)Putting the values of Eqn.D4 in function f ,g1 and g2 will yield the values of these three functions
as -26,0 and -2 respectively which also satisfies the criteria of optimality. So these solutions are feasible.
EQN D
EQN D1
EQN D2
EQN D3
x1 = 3
x2 = -1
L1 = 8 EQN.D4
10. SOLVE CONSIDERING ONLY ONE
AMONG THE TWO CONSTRAINTS
TO BE INACTIVE : LET g2 BE ACTIVE
1) Ignore the constraint functions g1,i.e.,assume L1 to be zero; to develop EQN E from EQN A
2) Partially differentiate the EQN E with respect to x1,x2 and L2 to find EQN E1,E2 and E3
3) A matrix was also prepared with the cefficient,variables and RHS of the three equations
4) The matrix was solved to find the values of x1,x2 and L2 which is depicted in Eqn.E4.
5)Putting the values of Eqn.E4 in function f ,g1 and g2 will yield the values of g1 and g2 respectively
as 2 and 0 respectively. As the g1 is greater than zero the solutions are infeasible(Ref Constraint function)
EQN E
EQN E1
EQN E2
EQN E3
x1 = 5
x2 = -1
L2 = 4 EQN.E4
11. CONCLUSION
Hence, the optimal solution was found at step 3 when g1 be
active.
f = -26 and g1 and g2 will be 0 and -2
f is at minima which is optimal condition here.