Navigator
SOCP
二阶锥规划(second-order conic programming
)的问题标准形式为
v S O C P = min c T x s . t . A x = b x ∈ K \begin{aligned} v_{SOCP}=\min & c^Tx\\ s.t. & Ax=b\\ &x\in\mathcal{K} \end{aligned} vSOCP=mins.t.cTxAx=bx∈K
二阶锥的对偶锥(SOCD
)还是本身
v S O C D = max b T y s . t . A T y + s = c s ∈ K y ∈ R m \begin{aligned} v_{SOCD}=\max &b^Ty\\ s.t. & A^Ty+s=c\\ &s\in \mathcal{K}\\ &y\in\mathbb{R}^m \end{aligned} vSOCD=maxs.t.bTyATy+s=cs∈Ky∈Rm
二阶锥对偶定理
- 如果SOCP为
unbounded
,那么SOCD为infeasible
. - 若SOCP和SOCD分别存在可行解 x ∗ x^* x∗和 ( s ∗ , y ∗ ) (s^*, y^*) (s∗,y∗)满足 ( x ∗ ) T s ∗ = c T x ∗ − b T y ∗ = 0 (x^*)^Ts^*=c^Tx^*-b^Ty^*=0 (x∗)Ts∗=cTx∗−bTy∗=0,则 x ∗ x^* x∗和 ( s ∗ , y ∗ ) (s^*, y^*) (s∗,y∗)分别为SOCP和SOCD的最优解。
以Torricelli
点问题为例,建立模型为
min t 1 + t 2 + t 3 s . t . [ ( x 1 − a 1 ) 2 + ( x 2 − a 2 ) 2 ] 1 / 2 ≤ t 1 [ ( x 1 − b 1 ) 2 + ( x 2 − b 2 ) 2 ] 1 / 2 ≤ t 2 [ ( x 1 − c 1 ) 2 + ( x 2 − c 2 ) 2 ] 1 / 2 ≤ t 3 x 1 , x 2 , t 1 , t 2 , t 3 ∈ R \begin{aligned} \min &t_1+t_2+t_3\\ s.t.& [(x_1-a_1)^2+(x_2-a_2)^2]^{1/2}\leq t_1\\ &[(x_1-b_1)^2+(x_2-b_2)^2]^{1/2}\leq t_2\\ &[(x_1-c_1)^2+(x_2-c_2)^2]^{1/2}\leq t_3\\ &x_1, x_2, t_1, t_2, t_3\in\mathbb{R} \end{aligned} mins.t.t1+t2+t3[(x1−a1)2+(x2−a2)2]1/2≤t1[(x1−b1)2+(x2−b2)2]1/2≤t2[(x1−c1)2+(x2−c2)2]1/2≤t3x1,x2,t1,t2,t3∈R
表示为SOCP模型为
min t 1 + t 2 + t 3 s . t . ( x 1 , x 2 , t 1 ) T ≥ L 3 ( a 1 , a 2 , 0 ) T ( x 1 , x 2 , t 2 ) T ≥ L 3 ( b 1 , b 2 , 0 ) T ( x 1 , x 2 , t 3 ) T ≥ L 3 ( c 1 , c 2 , 0 ) T x 1 , x 2 , t 1 , t 2 , t 3 ∈ R \begin{aligned} \min &t_1+t_2+t_3\\ s.t. &(x_1, x_2, t_1)^T\geq_{\mathcal{L}^3}(a_1, a_2, 0)^T\\ &(x_1, x_2, t_2)^T\geq_{\mathcal{L}^3}(b_1, b_2, 0)^T\\ &(x_1, x_2, t_3)^T\geq_{\mathcal{L}^3}(c_1, c_2, 0)^T\\ &x_1, x_2, t_1, t_2, t_3\in\mathbb{R} \end{aligned} mins.t.t1+t2+t3(x1,x2,t1)T≥L3(a1,a2,0)T(x1,x2,t2)T≥L3(b1,b2,0)T(x1,x2,t3)T≥L3(c1,c2,0)Tx1,x2,t1,t2,t3∈R
二次凸函数 g ( x ) = x T A x + b T x + c , A ∈ S + n g(x)=x^TAx+b^Tx+c, A\in\mathcal{S}_+^n g(x)=xTAx+bTx+c,A∈S+n的epigraph
为
{ ( x t ) ∣ x T A x + b T x + c ≤ t } \{ (\begin{matrix} x\\ t \end{matrix}) \mid x^TAx+b^Tx+c\leq t \} {
(xt)∣xTAx+bTx+c≤t}
分解矩阵 A = B T B A=B^TB A=BTB,得到
x T A x + b T x + c ≤ t → x T A x ≤ t − b T x − c x^TAx+b^Tx+c\leq t\to x^TAx\leq t-b^Tx-c xTAx+bTx+c≤t→xTAx≤t−bTx−c
表示为二阶锥形式为
( B x ) T B x + ( t − b T x − c − 1 ) 2 4 ≤ t − b T x − c + 1 2 \sqrt{(Bx)^TBx+\frac{(t-b^Tx-c-1)^2}{4}}\leq \frac{t-b^Tx-c+1}{2} (Bx)TBx+4(t−bTx−c−1)2≤2t−bTx−c+1
QCQP
凸二次约束二次规划(convex quadratically constrained quadratic programming
)问题表示为
min 1 2 x T Q 0 x + q 0 T x s . t . 1 2 x T Q i x + q i T x ≤ c i i = 1 , 2 , … , m x ∈ R \begin{aligned} \min & \frac{1}{2}x^TQ_0x+q_0^Tx\\ s.t. & \frac{1}{2}x^TQ_ix+q_i^Tx\leq c_i\quad i=1,2,\dots, m\\ &x\in\mathbb{R} \end{aligned} mins.t.21xTQ0x+q0Tx21xTQix+qiTx≤cii=1,2,…,mx∈R
模型等价于
min t s . t . 1 2 x T Q 0 x ≤ t − q 0 T x 1 2 x T Q i x ≤ c i − q i T x i = 1 , 2 , … , m x ∈ R n \begin{aligned} \min &t\\ s.t. &\frac{1}{2}x^TQ_0x\leq t-q_0^Tx\\ &\frac{1}{2}x^TQ_ix\leq c_i-q_i^Tx\quad i=1,2,\dots, m\\ &x\in\mathbb{R}^n \end{aligned} mins.t.t21xTQ0x≤t−q0Tx21xTQix≤ci−qiTxi=1,2,…,mx∈Rn
通过分解 Q = P i T P i Q=P_i^TP_i Q=PiTPi可以转为SOCP模型
Robust linear programming
对于线性规划问题
min c T x s . t . A x ≥ b x ∈ R + n \begin{aligned} \min & c^Tx\\ s.t. & Ax\geq b\\ &x\in\mathbb{R}_+^n \end{aligned} mins.t.cTxAx≥bx∈R+n
由于环境的不确定性, c , A , b c,A,b c,A,b的系数无法准确获得,但是可以估计出系数变动的范围,设 A T = ( A 1 , A 2 , … , A m ) , b = ( b 1 , b 2 , … , b m ) T A^T=(A_1, A_2, \dots, A_m), b=(b_1, b_2, \dots, b_m)^T AT=(A1,A2,…,Am),b=(b1,b2,…,bm)T,其中 A i ∈ R A_i\in\mathbb{R} Ai∈R为 A A A的第 i i i行元素,假设
U = { A , b , c ∣ c = c ∗ + P 0 u 0 , ( A i b i ) = ( A i ∗ b i ∗ ) + P i u i , i = 1 , 2 , … , m } \mathcal{U}=\{A, b, c\mid c=c^*+P_0u_0, ( \begin{matrix} A_i\\ b_i \end{matrix} )= ( \begin{matrix} A_i^*\\ b_i^* \end{matrix} )+P_iu_i, i=1,2,\dots, m \} U={
A,b,c∣c=c∗+P0u0,(Aibi)=(Ai∗bi∗)+Piui,i=1,2,…,m}
建立Robust Optimization
模型为
min ( c , A , b ) ∈ U t s . t . c T x ≤ t A x ≥ b x ∈ R + n \begin{aligned} \min_{(c, A, b)\in\mathcal{U}}&t\\ s.t. &c^Tx\leq t\\ &Ax\geq b\\ &x\in\mathbb{R}_+^n \end{aligned} (c,A,b)∈Umins.t.tcTx≤tAx≥bx∈R+n
转为SOCP形式
min t s . t . ∥ P 0 T x ∥ + c ∗ T x ≤ t ∥ P i T ( x − 1 ) ∥ − ( A i ∗ ) T x ≤ − b i ∗ i = 1 , 2 , … , m x ∈ R + n t ∈ R \begin{aligned} \min &t \\ s.t. & \lVert P_0^Tx\rVert+c^{*T}x\leq t\\ &\lVert P_i^T ( \begin{matrix} x\\ -1 \end{matrix} ) \rVert-(A_i^*)^Tx\leq -b_i^*\quad i=1,2,\dots, m\\ &x\in\mathbb{R}_+^n\quad t\in\mathbb{R} \end{aligned} mins.t.t∥P0Tx∥+c∗Tx≤t∥PiT(x−1)∥−(Ai∗)Tx≤−bi∗i=1,2,…,mx∈R+nt∈R
SDP
半定规划(semi-definite programming, SDP
)的标准模型为
min C ⋅ X s . t . A ⋅ X = b X ∈ S + n \begin{aligned} \min &C\cdot X\\ s.t.& \mathcal{A}\cdot X=b\\ &X\in\mathcal{S}_+^n \end{aligned} mins.t.C⋅XA⋅X=bX∈S+n
其中, C C C是一个 n n n阶实对称方阵, A = ( A 1 , A 2 , … , A m ) T \mathcal{A}=(A_1, A_2, \dots, A_m)^T A=(A1,A2,…,Am)T且其中每一个 A i A_i Ai为 n n n阶实对称方阵, A ⋅ X \mathcal{A}\cdot X A⋅X定义为
A ⋅ X = ( A 1 ⋅ X A 2 ⋅ X ⋮ A m ⋅ X ) \mathcal{A}\cdot X= \left( \begin{matrix} A_1\cdot X\\ A_2\cdot X\\ \vdots\\ A_m\cdot X \end{matrix} \right) A⋅X=⎝⎜⎜⎜⎛A1⋅XA2⋅X⋮Am⋅X⎠⎟⎟⎟⎞
可以得到对偶模型SDD
为
max b T y s . t . A ∗ y + S = C S ∈ S + n y ∈ R m \begin{aligned} \max & b^Ty\\ s.t. & \mathcal{A}^*y+S=C\\ &S\in\mathcal{S}_+^n\\ &y\in\mathbb{R}^m \end{aligned} maxs.t.bTyA∗y+S=CS∈S+ny∈Rm
记 A ∗ = ( A 1 , A 2 , … , A m ) , A ∗ y = ∑ i = 1 m y i A i \mathcal{A}^*=(A_1, A_2, \dots, A_m), \mathcal{A}^*y=\sum_{i=1}^my_iA_i A∗=(A1,A2,…,Am),A∗y=∑i=1myiAi。
SDP可以用内点算法求解,一个二阶锥可以表示为如下半定矩阵的形式
x ∈ L n ⇔ ( x n I n − 1 x 1 : n − 1 x 1 : n − 1 T x n ) ∈ S + n x\in\mathcal{L}^n\Leftrightarrow \left( \begin{matrix} x_nI_{n-1} & x_{1:n-1}\\ x_{1:n-1}^T & x_n \end{matrix} \right)\in \mathcal{S}_+^n x∈Ln⇔(xnIn−1x1:n−1Tx1:n−1xn)∈S+n
CVX Demo
求解如下SDP问题
min C ⋅ X s . t . A ⋅ X ≥ b x 11 = 1 X = ( x i j ) ∈ S + n \begin{aligned} \min & C\cdot X\\ s.t. & A\cdot X\geq b\\ &x_{11}=1\\ &X=(x_{ij})\in\mathcal{S}_+^n \end{aligned} mins.t.C⋅XA⋅X≥bx11=1X=(xij)∈S+n
%% solve SDP
n = 6;
A = ones(n, n);
C = eye(n);
b = 2;
cvx_begin
variable X(n, n) symmetric;
minimize(trace(C*X));
subject to
trace(A*X)>=b;
X(1, 1)==1;
X == semidefinite(n);
cvx_end