Navigator
Complementary slackness
Assuming that the strong duality holds, and
x
∗
x^*
x∗ is the primal optimal, and
(
x
∗
,
v
∗
)
(x^*, v^*)
(x∗,v∗) is dual optimal. Then
f
0
(
x
∗
)
=
g
(
x
∗
,
v
∗
)
=
inf
x
∈
D
(
f
0
(
x
)
+
∑
i
=
1
m
λ
i
∗
f
i
(
x
)
+
∑
i
=
1
p
ν
i
∗
h
i
(
x
)
≤
f
0
(
x
∗
)
f_0(x^*)=g(x^*, v^*)=\inf_{x\in D} (f_0(x)+\sum_{i=1}^m\lambda_i^*f_i(x)+\sum_{i=1}^p \nu_i^* h_i(x)\leq f_0(x^*)
f0(x∗)=g(x∗,v∗)=infx∈D(f0(x)+∑i=1mλi∗fi(x)+∑i=1pνi∗hi(x)≤f0(x∗).
when the =
holds, we have
∑
i
=
1
m
λ
i
∗
f
i
(
x
∗
)
=
0
\sum_{i=1}^m \lambda_i^*f_i(x^*)=0
i=1∑mλi∗fi(x∗)=0
KKT conditions
- primal inequal constraints: f i ( x ) ≤ 0 , i = 1 , 2 , … , m f_i(x)\leq 0, i=1, 2, \dots, m fi(x)≤0,i=1,2,…,m.
- primal equal constraints: h i ( x ) = 0 , i = 1 , 2 , … , p h_i(x)=0, i=1, 2, \dots, p hi(x)=0,i=1,2,…,p.
- complementary slackness: λ i f i ( x ) = 0 , i = 1 , 2 , … , m \lambda_if_i(x)=0, i=1,2,\dots, m λifi(x)=0,i=1,2,…,m.
- ∇ f 0 ( x ) + ∑ λ i ∇ f i ( x ) + ν i ∇ h i ( x ) = 0 \nabla f_0(x)+\sum \lambda_i\nabla f_i(x)+\nu_i\nabla h_i(x)=0 ∇f0(x)+∑λi∇fi(x)+νi∇hi(x)=0.
- λ ≥ 0 \lambda \geq 0 λ≥0.
if strong duality holds, and
x
,
λ
,
ν
x, \lambda, \nu
x,λ,ν are optimal. they must satisfy KKT
condition.
KKT for convex problem
If the primal problem is convex, then KKT
is the condition for
x
~
,
λ
~
,
ν
~
\tilde{x}, \tilde{\lambda}, \tilde{\nu}
x~,λ~,ν~ is optimal and strong duality sufficient and necessary condition.
Proof for sufficient condition: From the first two conditions in KKT
,
x
~
\tilde{x}
x~ is primal feasible point.
L
(
x
,
λ
~
,
ν
~
)
L(x, \tilde{\lambda}, \tilde{\nu})
L(x,λ~,ν~) is a convex problem, due to
λ
>
0
\lambda > 0
λ>0.
L
=
f
0
(
x
)
+
∑
i
=
1
m
λ
i
f
i
(
x
)
+
∑
i
=
1
p
ν
i
h
i
(
x
)
g
(
λ
~
,
ν
~
)
=
f
0
(
x
~
)
+
∑
λ
~
i
f
i
(
x
)
+
∑
ν
~
i
h
i
(
x
)
=
f
0
(
x
~
)
\begin{aligned} &L = f_0(x)+\sum_{i=1}^m \lambda_i f_i(x)+\sum_{i=1}^p \nu_i h_i(x)\\ g(\tilde{\lambda}, \tilde{\nu})&=f_0(\tilde{x})+\sum \tilde{\lambda}_i f_i(x)+\sum \tilde{\nu}_ih_i(x)\\ &=f_0(\tilde{x}) \end{aligned}
g(λ~,ν~)L=f0(x)+i=1∑mλifi(x)+i=1∑pνihi(x)=f0(x~)+∑λ~ifi(x)+∑ν~ihi(x)=f0(x~)
Due to
f
0
(
x
)
≥
p
∗
≥
g
(
λ
~
,
ν
~
)
f_0(x)\geq p^*\geq g(\tilde{\lambda}, \tilde{\nu})
f0(x)≥p∗≥g(λ~,ν~), then
x
~
\tilde{x}
x~ is primal optimal,
λ
~
,
ν
~
\tilde{\lambda}, \tilde{\nu}
λ~,ν~ is dual optimal, and
d
∗
=
p
∗
d^*=p^*
d∗=p∗ strong duality.
Demo
min
1
2
x
′
P
x
+
q
′
x
+
t
s
.
t
.
A
x
=
b
\begin{aligned} \min & \frac{1}{2}x'Px+q'x+t\\ s.t. & Ax=b \end{aligned}
mins.t.21x′Px+q′x+tAx=b
where
P
∈
S
+
n
P\in \mathbb{S}_+^n
P∈S+n.
The KKT
condition is as follows:
A
x
∗
=
b
P
x
∗
+
q
+
A
′
ν
∗
=
0
\begin{aligned} &Ax^*=b\\ &Px^*+q+A'\nu^*=0\\ \end{aligned}
Ax∗=bPx∗+q+A′ν∗=0
that is
[
P
A
′
A
0
]
[
x
∗
ν
∗
]
=
[
−
q
b
]
\left[ \begin{matrix} P & A'\\ A & 0 \end{matrix} \right]\left[ \begin{matrix} x^*\\ \nu^* \end{matrix} \right]= \left[ \begin{matrix} -q\\ b \end{matrix} \right]
[PAA′0][x∗ν∗]=[−qb]
Demo2: Water-filling
min
−
∑
i
=
1
n
log
(
x
i
+
α
i
)
s
.
t
.
x
≥
0
,
1
′
x
=
1
\begin{aligned} \min & -\sum_{i=1}^n \log(x_i+\alpha_i)\\ s.t. & x\geq 0, \mathbf{1}'x=1 \end{aligned}
mins.t.−i=1∑nlog(xi+αi)x≥0,1′x=1
KKT
condition is as follows:
x
≥
0
,
1
′
x
=
1
,
λ
i
≥
0
,
λ
i
x
i
=
0
,
i
=
1
,
2
,
…
,
m
−
1
x
i
+
α
i
−
λ
i
+
ν
=
0
\begin{aligned} &x\geq 0, \mathbf{1}'x=1, \lambda_i\geq 0, \lambda_ix_i=0, i=1, 2,\dots, m\\ &-\frac{1}{x_i+\alpha_i}-\lambda_i+\nu=0 \end{aligned}
x≥0,1′x=1,λi≥0,λixi=0,i=1,2,…,m−xi+αi1−λi+ν=0
we have
λ
i
=
−
1
x
i
+
α
i
+
ν
≥
0
ν
≥
1
α
i
+
x
i
x
i
(
ν
−
1
α
i
+
x
i
)
=
0
\begin{aligned} &\lambda_i=-\frac{1}{x_i+\alpha_i}+\nu\geq 0\\ &\nu \geq \frac{1}{\alpha_i+x_i}\\ &x_i(\nu-\frac{1}{\alpha_i+x_i})=0 \end{aligned}
λi=−xi+αi1+ν≥0ν≥αi+xi1xi(ν−αi+xi1)=0
The solution can be obtained by analyzing the following cases:
case 1:
ν
<
1
α
i
\nu < \frac{1}{\alpha_i}
ν<αi1
if
x
i
=
0
x_i=0
xi=0, then
ν
≥
1
α
i
\nu\geq \frac{1}{\alpha_i}
ν≥αi1 is contradicted to
ν
<
1
α
i
\nu<\frac{1}{\alpha_i}
ν<αi1.
x
i
>
0
,
x
i
=
1
ν
−
α
i
x_i>0, x_i=\frac{1}{\nu}-\alpha_i
xi>0,xi=ν1−αi.
case 2:
ν
≥
1
α
i
→
\nu\geq \frac{1}{\alpha_i}\to
ν≥αi1→ contradiction.
As a result,
x
i
=
{
1
ν
−
α
i
α
i
≤
1
ν
0
α
i
>
1
ν
x_i= \left\{ \begin{aligned} &\frac{1}{\nu}-\alpha_i & \alpha_i\leq \frac{1}{\nu}\\ &0 & \alpha_i>\frac{1}{\nu} \end{aligned} \right.
xi=⎩⎪⎨⎪⎧ν1−αi0αi≤ν1αi>ν1
that is,
x
i
=
max
{
0
,
1
ν
−
α
i
}
x_i=\max\{0, \frac{1}{\nu}-\alpha_i\}
xi=max{0,ν1−αi} and
∑
x
i
=
1
\sum x_i=1
∑xi=1.
Reference
B站 许志钦