C62 Lecture10and11
C62 Lecture10and11
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 1/25
Problems and solutions
f : Ω → R is (sufficiently) smooth.
f objective; x variables.
Ω feasible set determined by finitely many (equality and/or
inequality) constraints.
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 2/25
Example problem in one dimension
f(x)
x1 x2 x
a b
The feasible region Ω is the interval [a, b].
The point x1 is the global minimizer; x2 is a local
(non-global) minimizer; x = a is a constrained local minimizer.
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 3/25
An example of a nonlinear constrained problem
2
√
min2 (x1 − 2) + (x2 − 0.5(3 − 5))2 subject to
x∈R
−x1 − x2 + 1 ≥ 0, x2 − x21 ≥ 0.
2.5
2 c
2
1.5
c1 Ω
1 contours of f
0.5 x∗
x2
−0.5
−1
−1.5
−2
−1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 3
∗
√ √ x1
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 4/25
Optimality conditions for constrained problems
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 5/25
Optimality conditions for constrained problems
cE (x̂) = 0, cI (x̂) ≥ 0,
λ̂i ≥ 0, λ̂i ci (x̂) = 0, for all i ∈ I.
j∈E ŷj ∇cj (x̂) = JE (x) ŷ and i∈I λ̂i ∇ci (x̂) = JI (x) λ̂.
T T
" "
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 6/25
Optimality conditions for constrained problems ...
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 7/25
An illustration of the KKT conditions
2
√
min2 (x1 − 2) + (x2 − 0.5(3 − 5))2 subject to
x∈R
2.5
c
√ √ 2 c
2
∗
x = 1
2
(−1+ 5, 3 − 5) : $ 1
Ω
1.5
• global solution of (∗), 1 ∗
∇ c1(x )
• KKT point of (∗). 0.5
∗
x
2
∗
x
∇ f(x )
∇f (x ) = (−5 + 5, 0)$ ,
∗ 0
√ −0.5
∇c1 (x ) = (1 − 5, 1)$ ,
∗
∇ c (x∗)
−1 2
−2
−2 −1 0 1 2 3
x
1
√
∇f (x ) = λ∗1 ∇c1 (x∗ )
∗
+ , with
λ∗2 ∇c2 (x∗ ) = = λ∗1 λ∗2 5 − 1 > 0.
: constraints are active at x∗ .
c1 (x∗ ) = c2 (x∗ ) = 0
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 8/25
An illustration of the KKT conditions ...
2
√
min2 (x1 − 2) + (x2 − 0.5(3 − 5))2 subject to
x∈R
x := (0, 0)$ 2
c
c1 Ω 2
is NOT a KKT point of (∗)! 1.5
c1 (x) = 0: active at x. 1
∇ c (0)
c2 (x) = 1: inactive at x.
1
0.5
2
x
=⇒ λ2 = 0 and
0
∇f (x) = λ1 ∇c1 (x),
−0.5 ∇ f(0)
with λ1 ≥ 0. ∇ c (0)
2
−1
⇓ −4 −3 −2 −1 0 1 2 3
x
1
√
Contradiction with ∇f (x) = (−4, 5 − 3)$ and
∇c1 (x) = (0, 1)$ .
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 9/25
Optimality conditions for constrained problems ...
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 10/25
Optimality conditions for constrained problems ...
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 11/25
Optimality conditions for constrained problems ...
JE (x∗ )T = Q R (Q ∈ Rn×m , n ≥ m)
" # " #
QT 0
JE (x∗ )s= 0 means QT s
=0⇔ T s= ⇔ s = Q⊥ d for some d ∈ Rn−m .
Q⊥ d
([Q Q⊥ ] is orthogonal; assuming JE (x∗ ) is full rank rank(JE (x∗ )) = m)
Now ∇f (x∗ )T s = 0 for all such s ⇔ ∇f (x∗ )T Q⊥ = 0 ⇔ ∇f (x∗ ) = Qd˜ for some
d˜ ∈ Rn−m ⇔ ∇f (x∗ ) = (QR)(R−1 d) ˜ = JE (x∗ )T y ∗ .
Optimality conditions for constrained problems ...
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 13/25
Constraint qualifications
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 14/25
Constraint qualifications...
min(x1 ,x2 ) x1 + x2
s.t. x21 + x22 − 2 = 0.
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 15/25
Optimality conditions for constrained problems ...
AE x∗ − bE = 0, AI x∗ − bI ≥ 0,
λ∗ ≥ 0, (λ∗ )T (AI x∗ − bI ) = 0.
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 16/25
Optimality conditions for convex problems
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 17/25
Optimality conditions for convex problems
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 17/25
Optimality conditions for convex problems
"
f (x) ≥ f (x̂) + ŷ $ A(x − x̂) + i∈I λ̂i (∇ci (x̂)$ (x − x̂)) (4).
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 18/25
Example: Optimality conditions for QP problems
H x̂ + c = A# ŷ + Ã# λ̂,
Ax̂ = b, Ãx̂ ≥ b̃,
λ̂ ≥ 0, λ̂# (Ãx̂ − b̃) = 0.
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 20/25
Example: Duality theory for QP problems
H x̂ + c = Ã$ λ̂,
Ãx̂ ≥ b̃,
λ̂ ≥ 0, λ̂$ (Ãx̂ − b̃) = 0.
Dual problem:
maximize(x,λ) − 21 xT Hx + b̃T λ s.t. − Hx + Ã$ λ = c and λ ≥ 0.
Optimal value of primal pb=optimal value of dual pb (provided
they exist).
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 21/25
Optimality conditions for nonconvex problems
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 19/25
Second-order optimality conditions
T T ∗ T
∗ ∗
λi sT ∇ci (x∗ )
"
s ∇f (x ) = s JE (x ) y + i∈A(x∗ )∩I
T ∗
"
= i∈A(x )∩I
∗ λ i s ∇ci (x ) ≥ 0. (6)
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 22/25
Second-order optimality conditions...
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 23/25
Second-order optimality conditions ...
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 24/25
Necessary and sufficient conditions for x∗ : summary
minimise f (x)
x
subject to cE (x) = 0, cI (x) ≥ 0.
minimise x1 + x2
x 1
1 − (x2 + x2 ) = 0, or
1 2 0.5
subject to √ √
1 − ((x + 2)2 + ((x + 2)2 ) = 0
1 2 0
-0.5
minimum λ = 2
maximum λ = − √12 < 0 for red. Thus
-2
" # -2.5
∇2xx L = −λ = 2λI, so
−2
∇2xx L ⪰ 0 and ∇2xx L
0.
Example: Trust-region subproblem
For the TRS,
1
minimise f (x) = g T x + xT Hx
x 2
2 2
subject to ∆ − ∥x∥ ≥ 0.
1
Corrected 16/5/23. This was a ’minor’ typo in that the KKT conditions as stated were correct,
but ∇x ∥x∥2 = 2x so λ ̸= λ̃.
Some simple approaches for solving (CP)
Lectures 10 and 11: Constrained optimization problems and their optimality conditions – p. 25/25