0、笔记介绍
本系列笔记参考视频:中科大凸优化
1、本课程可以称作优化/数学规划(Optimization/Mathemetical Programming)
优化:从一个可行解的集合中,寻找最优的元素
从定义中可以看出,优化有三处需要注意的地方:1、有可行解的集合 2、寻找 3、最优
优化的数学表示为:
{
m
i
n
i
m
i
z
e
f
0
(
x
)
s
u
b
j
e
c
t
t
o
f
i
(
x
)
≤
b
i
,
i
=
1
,
2
,
.
.
.
.
m
(
任
何
等
式
都
可
以
描
述
成
两
个
不
等
式
,
即
A
=
B
⇔
A
≤
B
&
&
−
A
≤
−
B
)
\left\{ \begin{matrix} minimize \space f_0 (x) \\ subject \space to \space\space f_i(x) \leq b_i,i=1,2,....m \\ (任何等式都可以描述成两个不等式,即A=B \Leftrightarrow A \leq B \space\&\&\space -A \leq -B) \end{matrix} \right.
⎩⎨⎧minimize f0(x)subject to fi(x)≤bi,i=1,2,....m(任何等式都可以描述成两个不等式,即A=B⇔A≤B && −A≤−B)
其中:
{
x
=
[
x
1
,
x
2
,
.
.
.
,
x
n
]
T
f
0
:
R
n
→
R
o
b
j
e
c
t
i
v
e
f
u
n
c
t
i
o
n
f
i
:
R
n
→
R
i
n
e
q
u
a
l
i
t
y
c
o
n
s
t
r
a
i
n
t
\left\{ \begin{matrix} x=[x_1,x_2,...,x_n]^T \\ f_0 : R^n \rightarrow R \space\space\space\space objective \space function\\ f_i : R^n \rightarrow R \space\space\space\space inequality \space constraint \end{matrix} \right.
⎩⎨⎧x=[x1,x2,...,xn]Tf0:Rn→R objective functionfi:Rn→R inequality constraint
我们找到的最优解为:
X
∗
o
p
t
i
m
a
l
⇔
∀
z
,
z
∈
{
f
i
(
z
)
≤
b
i
,
i
=
1
,
2
,
.
.
.
,
m
}
,
f
0
(
z
)
≥
f
0
(
X
∗
)
X^* \space optimal \space \Leftrightarrow \space \forall \space z,z \in \lbrace f_i(z) \leq b_i,i=1,2,...,m \rbrace , f_0(z) \geq f_0 (X^*)
X∗ optimal ⇔ ∀ z,z∈{fi(z)≤bi,i=1,2,...,m},f0(z)≥f0(X∗)
2、优化举例
E x 1 : Ex1: Ex1:
{
c
o
n
s
t
r
a
i
n
t
:
x
≤
a
,
−
x
≤
−
a
f
e
a
s
i
b
l
e
s
e
t
:
[
−
a
.
a
]
\left\{ \begin{matrix} constraint:x\leq a,-x \leq -a \\ feasible \space set:\space [-a.a] \end{matrix} \right.
{constraint:x≤a,−x≤−afeasible set: [−a.a]
E
x
2
:
Ex2:
Ex2:最优解并不只有一个,可能存在一个最优解集合
E x 3 : Ex3: Ex3:数据拟合问题
{
拟
合
曲
线
y
=
a
x
2
+
b
x
+
c
m
i
n
ε
1
2
+
ε
2
2
+
.
.
.
+
ε
n
2
ε
i
=
y
i
−
(
a
x
2
+
b
x
+
c
)
\left\{ \begin{matrix} 拟合曲线 \space\space y=ax^2+bx+c \\ min \space\space {\varepsilon^2_1}+{\varepsilon^2_2}+...+{\varepsilon^2_n} \\ {\varepsilon}_i=y_i-(ax^2+bx+c) \end{matrix} \right.
⎩⎨⎧拟合曲线 y=ax2+bx+cmin ε12+ε22+...+εn2εi=yi−(ax2+bx+c)
E
x
4
:
Ex4:
Ex4:线性二次调节器
L
Q
R
LQR
LQR
X
k
=
A
X
k
−
1
+
B
u
k
min
u
k
J
=
∑
i
=
1
n
(
X
k
T
Q
X
k
+
U
k
T
R
U
k
)
X_k=AX_{k-1}+Bu_k \\ {\underset {u_k}{\operatorname {min} }} \space\space J=\sum_{i=1}^n(X^T_k Q X_k+U^T_k R U_k)
Xk=AXk−1+Bukukmin J=i=1∑n(XkTQXk+UkTRUk)
E
x
5
:
Ex5:
Ex5:多用户能量控制问题
P
i
:
用
户
能
量
0
≤
P
≤
b
i
用
户
之
间
通
信
会
对
其
它
用
户
产
生
干
扰
(
这
里
不
计
较
单
位
问
题
)
信
干
燥
比
S
I
M
R
i
=
P
i
σ
i
2
+
∑
i
=
1
n
α
j
i
P
j
f
i
正
比
于
log
(
1
+
P
i
σ
i
2
+
∑
i
=
1
n
α
j
i
P
j
)
P_i:用户能量 \space\space\space\space 0 \leq P \leq b_i \\ 用户之间通信会对其它用户产生干扰(这里不计较单位问题)\\ 信干燥比SIMR_i = \frac{P_i}{{\sigma^2_i+\sum_{i=1}^n} {\alpha_{ji}P_j}} \\ f_i \space\space正比于\space\space \log(1+{\frac{P_i}{\sigma^2_i+\sum_{i=1}^n {\alpha_{ji}P_j}}})
Pi:用户能量 0≤P≤bi用户之间通信会对其它用户产生干扰(这里不计较单位问题)信干燥比SIMRi=σi2+∑i=1nαjiPjPifi 正比于 log(1+σi2+∑i=1nαjiPjPi)
E
x
6
:
Ex6:
Ex6:图像处理
T
V
TV
TV范数
E x 7 : Ex7: Ex7:超大规模集成电路
门电路 { g 1 , g 2 , . . . , g N } \{g_1,g_2,...,g_N\} {g1,g2,...,gN}
将门电路连成有向图P
{
t
i
,
.
.
.
,
t
m
}
\{t_i,...,t_m\}
{ti,...,tm}每个
t
i
t_i
ti表示一种连接方式
{
m
a
x
P
(
x
)
s
.
t
.
x
∈
{
t
i
,
.
.
.
,
t
M
}
\left\{ \begin{matrix} max \space P(x) \\ s.t. \space x \in \{t_i,...,t_M\} \end{matrix} \right.
{max P(x)s.t. x∈{ti,...,tM}
E
x
8
:
Ex8:
Ex8:最短路径问题
无向图
{
V
,
E
}
\{V,E\}
{V,E}
m
i
n
∑
i
,
j
∈
E
W
i
j
X
i
j
x
i
j
=
0
o
r
1
⇒
x
i
j
≥
0
其
中
:
∑
j
x
i
j
−
∑
j
x
j
i
=
{
1
,
i
=
S
−
1
,
i
=
d
0
,
o
t
h
e
r
w
i
s
e
min \sum_{i,j \in E}W_{ij}X{ij} \space\space\space\space x_{ij}=0 \space or \space 1 \Rightarrow x_{ij} \geq 0\\ 其中:\sum_{j} x_{ij} - \sum_{j}x_{ji}=\left\{ \begin{matrix} 1,\space\space\space\space i=S \\ -1,\space\space\space\space i=d \\ \space\space\space\space0, \space\space\space\space otherwise \end{matrix} \right.
mini,j∈E∑WijXij xij=0 or 1⇒xij≥0其中:j∑xij−j∑xji=⎩⎨⎧1, i=S−1, i=d 0, otherwise
3、优化问题的分类
线性规划/非线性规划
f i ( α x + β y ) = α f i ( x ) + β f i ( y ) ∀ i = 0 , 1 , . . . , m f_i(\alpha x+ \beta y)=\alpha f_i(x)+\beta f_i(y) \space\space\space\space \forall \space i=0,1,...,m fi(αx+βy)=αfi(x)+βfi(y) ∀ i=0,1,...,m
线性规划问题的特点是最优解在顶点或边上
凸规划/非凸规划
f i ( α x + β y ) ≤ α f i ( x ) + β f i ( y ) ∀ i = 0 , 1 , . . . , m f_i(\alpha x+ \beta y) \leq \alpha f_i(x)+\beta f_i(y) \space\space\space\space \forall \space i=0,1,...,m fi(αx+βy)≤αfi(x)+βfi(y) ∀ i=0,1,...,m