ClassicalNLP_ConstrainedOptimization
ClassicalNLP_ConstrainedOptimization
Constrained optimization
A function of multiple variables, f(x), is to be optimized subject to one or more equality
constraints of many variables. These equality constraints, g j(x), may or may not be linear.
The problem statement is as follows:
Maximize (or minimize) f(X)
subject to
gj(X) = 0, j = 1, 2, … , m
where X is vector of n variables
with the condition that m n (or else if m > n then the problem becomes an over defined one
and there will be no solution).
18
CE676 Water Resources System
General problem
For a general problem with n variables and m equality constraints, the Lagrange function, L,
will have one Lagrange multiplier j for each constraint g j (X) as
L( x1 , x2 ,..., xn, 1 , 2 ,..., m ) f ( X) 1 g1 ( X) 2 g2 ( X) ... m g m ( X) (1)
L is now a function of n + m unknowns, x1 , x2 ,..., xn, 1 , 2 ,..., m .
Necessary conditions
the necessary conditions to obtain stationary points for the above case are given by
L f m g j
(X) j (X) 0, i 1, 2,..., n j 1, 2,..., m
xi xi j 1 xi
(2)
L
g j (X) 0, j 1, 2,..., m
j
which represent n + m equations in terms of the n + m unknowns, xi and j . The solution to
this set of equations gives us
x1 * 1 *
x * *
2 2
X and * (3)
xn * m *
The vector X corresponds to the relative constrained minimum or maximum of f(X) (subject
to the verification of sufficient conditions).
where
19
CE676 Water Resources System
2 L
Lij ( X*, *), for i 1, 2,..., n j 1, 2,..., m
xi x j
(18)
g p
g pq (X*), where p 1, 2,..., m and q 1, 2,..., n
xq
Similarly, a sufficient condition for f(X) to have a relative minimum (maximum) at X* is that
each root of the polynomial in , defined by equation (4) be positive (negative). If equation
(4), on solving yields roots, some of which are positive and others negative, then the point X*
is neither a maximum nor a minimum.
Example
Minimize
f ( X) 3x12 6 x1 x2 5 x22 7 x1 5 x2
Subject to x1 x2 5
Solution
g1 ( X) x1 x2 5 0
Here the Lagrange function with n = 2 and m = 1
L = 3 x12 6 x1 x2 5 x22 7 x1 5 x2 1 ( x1 x2 5)
L
6 x1 6 x2 7 1 0
x1
1
x1 x2 (7 1 )
6
1
5 (7 1 ) or 1 23
6
L
6 x1 10 x2 5 1 0
x2
1
3 x1 5 x2 (5 1 )
2
1
3( x1 x2 ) 2 x2 (5 1 )
2
1
x2
2
11
and, x1
2
1 11
Hence X* , ; λ* 23
2 2
L11 L12 g11
L L22 g 21 0
21
g g12 0
11
20
CE676 Water Resources System
2L
L11 6
x12 ( X*,λ*)
2L
L12 L21 6
x1x2 ( X*,λ*)
2
L
L22 10
x22 ( X*,λ*)
g1
g11 1
x1 ( X*,λ* )
g1
g12 g 21 1
x2 ( X*,λ* )
21
CE676 Water Resources System
In the previous section, the constrained optimization with multiple variables and equality
constraints was dealt using the method of Lagrange multipliers. To deal with constrained
optimization problems with inequality constraints, the Kuhn-Tucker conditions can be
applied and optimal solutions can be found.
Kuhn-Tucker Conditions
It was previously established that for both an unconstrained optimization problem and an
optimization problem with an equality constraint the first-order conditions are sufficient for a
global optimum when the objective and constraint functions satisfy appropriate
concavity/convexity conditions. The same is true for an optimization problem with inequality
constraints.
The Kuhn-Tucker conditions are both necessary and sufficient to find minima (maxima), if
the objective function is convex (concave) and each constraint is linear or constraint set
forms a convex surface (i.e. the problems belong to a class called the convex programming
problems).
First the given optimization problem should be converted to one of the standard form as
below and then apply the Kuhn Tucker conditions.
Maximize f(X)
s.t. g j(X) bj for j = 1,2,…,p ; where X = [x1 x2 . . . xn]
L( x1 , x2 ,..., xn ,1 , 2 ,..., m ) f ( X) 1 (b1 g1 ( X)) 2 (b2 g 2 ( X)) ... (bm m g m ( X))
Then the Kuhn-Tucker conditions for X* = [x1* x2* . . . xn*] to be a local maximum are
f m (b j g j )
(i) gradient conditions j 0 i 1, 2,..., n
xi j 1 xi
(ii) feasibility conditions g j bj j 1,2,..., m
(iii) complementary slackness j (b j g j ) 0 j 1, 2,..., m
(iv) non-negativity of Lagrange multipliers j 0 j 1, 2,..., m
The solution has to satisfy all the above conditions including the non-negativity of Lagrange
multipliers.
22
CE676 Water Resources System
23