MATH6015 / 几何问题

MATH6015 / LECTURE 08

几何问题

投影、距离、椭球、分类与布局

Jingwei Liang · MATH6015 最优化方法
Boyd & Vandenberghe · Chapter 8

Boyd & Vandenberghe · Chapter 81 / 106

本讲内容

导览Boyd & Vandenberghe · Chapter 8, §§8.1–8.82 / 106

MATH6015 / CONVEX OPTIMIZATION

01

前序知识与建模主线

MATH6015 · Lecture 083 / 106

前序知识

本章的统一变量

几何对象本身往往不直接作为变量,而改用 点  x , Gram matrix  G , ellipsoid parameters  ( A , b ) . 距离、角度、体积与位置关系由这些变量表达成凸约束。

前序知识与建模主线课程 Lectures 01A–01C、02–07 回顾;Boyd & Vandenberghe, Chapter 84 / 106

从几何叙述到凸模型

判断标准

固定相对位置、把距离平方写成 affine function、或把“对所有点”改写成 support function,常能消除几何表象中的非线性;离散的先后/上下选择仍保留组合性。

前序知识与建模主线Boyd & Vandenberghe · Chapter 8 overview5 / 106

本章常见凸结构

几何对象 数学表示 典型模型
最近点/集合间距离 inf ‖ x − y ‖ QP, SOCP
角度与距离可实现性 G = A ⊤ A ⪰ 0 SDP
椭球体积 log ⁡ det A − 1 或 log ⁡ det B log-det program
最深点/中心 ball containment、barrier LP, SDP
分类边界 affine in parameters LP, QP, SDP
位置与平面规划 graph edges、relative order LP, SOCP, GP

同一几何目标可能有不同参数化;凸性取决于变量与表示,而不只取决于图形外观。

前序知识与建模主线Boyd & Vandenberghe · Chapter 86 / 106

MATH6015 / CONVEX OPTIMIZATION

02

投影与分离

MATH6015 · Lecture 087 / 106

距离与投影

闭集 C ⊆ R n 上,点 x 0 到 C 的距离为 dist ⁡ ( x 0 , C ) = inf x ∈ C ‖ x 0 − x ‖ . 任一达到最小值的 z ∈ C 称为 projection: P C ( x 0 ) ∈ arg ⁡ min x ∈ C ‖ x − x 0 ‖ .

存在性

有限维空间中, C closed 即保证最短距离达到。

唯一性

C closed convex 且 norm strictly convex 时 projection 唯一;Euclidean norm 是主要情形。

投影与分离Boyd & Vandenberghe · §8.18 / 106

投影的几何图像

Euclidean optimality

若 C closed convex,则 p = P C ( x 0 ) 当且仅当 ( x 0 − p ) ⊤ ( x − p ) ≤ 0 , ∀ x ∈ C . 残差是 C 在 p 处的 normal vector。

投影与分离Boyd & Vandenberghe · §8.1; Euclidean projection geometry9 / 106

教材例 8.1:单位方形边界

令 C = { x ∈ R 2 ∣ ‖ x ‖ ∞ = 1 } , x 0 = 0 。虽然 C 不是凸集,但 projection 可以直接比较。

norm projections
ℓ 1 ( ± 1 , 0 ) , ( 0 , ± 1 )
ℓ 2 ( ± 1 , 0 ) , ( 0 , ± 1 )
ℓ ∞ 整个边界 C

三种距离均为 1 ;norm 的单位球决定“最近”的方向结构。

投影与分离Boyd & Vandenberghe · §8.1, Example 8.110 / 106

教材例 8.2:低秩投影

设 C = { X ∈ R m × n ∣ rank ⁡ X ≤ k } , X 0 = ∑ i = 1 r σ i u i v i ⊤ , σ 1 ≥ ⋯ ≥ σ r > 0. 截断 SVD P C ( X 0 ) = ∑ i = 1 min { k , r } σ i u i v i ⊤ 是 spectral norm 下的 projection;Frobenius norm 下也成立。

该集合非凸;显式 projection 来自奇异值结构,而非一般凸投影理论。

投影与分离Boyd & Vandenberghe · §8.1, Example 8.2; Eckart–Young theorem11 / 106

凸集上的投影问题

若 C = { x ∣ A x = b ,   f i ( x ) ≤ 0 ,   i = 1 , … , m } , 则 projection 由凸问题给出: minimize x ‖ x − x 0 ‖ subject to f i ( x ) ≤ 0 , A x = b .

Euclidean projection on a polyhedron: min A x ≤ b   1 2 ‖ x − x 0 ‖ 2 2 , 是 strongly convex QP,feasible 时解唯一。

KKT 给出 x ⋆ − x 0 + A ⊤ λ ⋆ = 0 , 因此 projection residual 是 active normals 的非负组合。

投影与分离Boyd & Vandenberghe · §8.1.1, problems (8.1)–(8.2)12 / 106

三个显式 Euclidean projections

Hyperplane

C = { x ∣ a ⊤ x = b } : P C ( x 0 ) = x 0 + b − a ⊤ x 0 ‖ a ‖ 2 2 a .

Halfspace

C = { x ∣ a ⊤ x ≤ b } :若已 feasible,保持 x 0 ;否则使用上式投到边界。

Rectangle

C = { x ∣ l ≤ x ≤ u } : [ P C ( x 0 ) ] j = min { u j , max { l j , x 0 j } } .

投影与分离Boyd & Vandenberghe · §8.1.1, Euclidean projection on a polyhedron13 / 106

Proper cone 上的投影

对 proper cone K ,令 x + = P K ( x 0 ) , x − = P K ∗ ( − x 0 ) . KKT 给出 Moreau decomposition: x 0 = x + − x − , x + ⪰ K 0 , x − ⪰ K ∗ 0 , x + ⊤ x − = 0.

K = R + n

[ P K ( x 0 ) ] i = max { x 0 i , 0 } . 负分量逐项截断为零。

K = S + n

若 X 0 = ∑ i λ i q i q i ⊤ ,则 P K ( X 0 ) = ∑ i max { λ i , 0 } q i q i ⊤ .

projection 同时给出 primal cone component 与 orthogonal dual-cone certificate。

投影与分离Boyd & Vandenberghe · §8.1.1, Euclidean projection on a proper cone14 / 106

投影导出分离超平面

令 p = P C ( x 0 ) , x 0 ∉ C 。中垂超平面 ( p − x 0 ) ⊤ ( x − x 0 + p 2 ) = 0 严格分离 x 0 与 C 。

该直接构造依赖 Euclidean geometry;一般 norm 可通过 duality 构造分离方向。

投影与分离Boyd & Vandenberghe · §8.1.2, Figure 8.115 / 106

任意 norm 下的分离证书

将 y = x 0 − x 引入 projection problem,dual 为 maximize λ , μ , ν μ ⊤ x 0 + inf x ( ∑ i λ i f i ( x ) + ν ⊤ ( A x − b ) − μ ⊤ x ) subject to λ ≥ 0 , ‖ μ ‖ ∗ ≤ 1. 若某个 dual feasible point 的目标值为正,则对所有 x ∈ C , μ ⊤ x 0 > μ ⊤ x ; μ 因而定义严格分离超平面。若 projection problem 满足 Slater,positive distance 与这种 certificate 等价。

投影与分离Boyd & Vandenberghe · §8.1.2, dual of projection problem16 / 106

Indicator 与 support function

定义 I C ( x ) = { 0 , x ∈ C , + ∞ , x ∉ C , S C ( z ) = sup x ∈ C z ⊤ x . 投影可写成 minimize x ‖ x − x 0 ‖ + I C ( x ) ;Fenchel dual 化简为 maximize z z ⊤ x 0 − S C ( z ) subject to ‖ z ‖ ∗ ≤ 1. 若最优值为正, z ⊤ x 0 > S C ( z ) ,即 x 0 位于 C 的 support hyperplane 之外。

投影与分离Boyd & Vandenberghe · §8.1.317 / 106

应用例 1:概率向量校正

分类器给出的 raw score 为 z = ( 0.8 , − 0.1 , 0.6 ) ⊤ ;需要投影到 probability simplex Δ 3 = { p ≥ 0 ∣ 1 ⊤ p = 1 } . Euclidean projection 具有 threshold 形式 p i ⋆ = max { z i − τ , 0 } , ∑ i max { z i − τ , 0 } = 1. 本例 τ = 0.2 ,所以 P Δ 3 ( z ) = ( 0.6 , 0 , 0.4 ) ⊤ .

解释

归一化 z / ( 1 ⊤ z ) 会保留负概率;simplex projection 同时满足非负性、总和约束,并使 Euclidean 改动最小。

投影与分离自编示例 · 将未校准分类得分投影到 probability simplex18 / 106

应用例 2:机器人安全位置

移动机器人计划位置 x 0 ,但可行空间由走廊、禁区的线性近似给出: C = { x ∈ R 2 ∣ A x ≤ b } . 控制器每次求解 x + = arg ⁡ min A x ≤ b 1 2 ‖ x − x 0 ‖ 2 2 .

active constraints 的 multipliers 给出把计划点推回安全集的合力方向,也量化每个边界对修正量的贡献。

投影与分离自编示例 · model-predictive safety filter via Euclidean projection19 / 106

实验|从投影点,找到一条分离直线

可交互
x ⋆ = arg min x ∈ C ‖ x − y ‖ 2 2

正在准备交互图…

把 y 拖到集合内部后,投影和分离直线分别会发生什么?

MATH6015 / CONVEX OPTIMIZATION

03

集合间距离

MATH6015 · Lecture 0821 / 106

两个集合的距离

dist ⁡ ( C , D ) = inf { ‖ x − y ‖ ∣ x ∈ C ,   y ∈ D } = dist ⁡ ( 0 , D − C ) .

零距离的含义

若 C ∩ D ≠ ∅ ,距离为零。反向结论需要 infimum attained;例如 sets closed 且其中一个 bounded 时成立。

集合间距离Boyd & Vandenberghe · §8.222 / 106

凸集间最近点

若 C = { x ∣ f i ( x ) ≤ 0 } , D = { y ∣ g j ( y ) ≤ 0 } , 则 ( 8.3 ) minimize x , y ‖ x − y ‖ subject to f i ( x ) ≤ 0 , g j ( y ) ≤ 0 是 convex optimization problem。对 polyhedra A 1 x ≤ b 1 、 A 2 y ≤ b 2 和 Euclidean norm,平方目标得到 QP: min   1 2 ‖ x − y ‖ 2 2 s.t. A 1 x ≤ b 1 ,   A 2 y ≤ b 2 . 两组 active face normals 在最优点沿连接线达到平衡。

集合间距离Boyd & Vandenberghe · §8.2.1, problems (8.3)–(8.4), Figure 8.223 / 106

距离问题的 dual separation

引入 w = x − y 后,对偶方向 z 满足 ‖ z ‖ ∗ ≤ 1 。一般形式为 maximize λ , μ , z inf x ( ∑ i λ i f i ( x ) + z ⊤ x ) + inf y ( ∑ j μ j g j ( y ) − z ⊤ y ) subject to λ ≥ 0 , μ ≥ 0 , ‖ z ‖ ∗ ≤ 1. 正的 dual value 蕴含 z ⊤ x > z ⊤ y , ∀ x ∈ C ,   ∀ y ∈ D , 故 z 定义 strict separating hyperplane。strong duality 时,positive distance 与分离 certificate 相互对应。

集合间距离Boyd & Vandenberghe · §8.2.2, problems (8.5)–(8.6)24 / 106

Polyhedra 的显式分离证书

对 C = { x ∣ A 1 x ≤ b 1 } 、 D = { y ∣ A 2 y ≤ b 2 } ,dual 为 maximize λ , μ , z − b 1 ⊤ λ − b 2 ⊤ μ subject to A 1 ⊤ λ + z = 0 , A 2 ⊤ μ − z = 0 , ‖ z ‖ ∗ ≤ 1 , λ ≥ 0 ,   μ ≥ 0. 对任意 x ∈ C 、 y ∈ D , z ⊤ x − z ⊤ y ≥ − b 1 ⊤ λ − b 2 ⊤ μ . 右端若为正,不仅证明不相交,还给出 normalized separation margin 的下界。

集合间距离Boyd & Vandenberghe · §8.2.2, separating polyhedra25 / 106

Support functions 的紧凑表达

集合间距离的 dual 可写成 maximize z − S C ( − z ) − S D ( z ) subject to ‖ z ‖ ∗ ≤ 1. 若 dual objective 为正,则 S D ( z ) < − S C ( − z ) ⟺ sup y ∈ D z ⊤ y < inf x ∈ C z ⊤ x .

几何意义

S D ( z ) 是 D 沿 z 的最远投影, − S C ( − z ) 是 C 沿 z 的最近投影;两者间隙正是该方向的 separation margin。

集合间距离Boyd & Vandenberghe · §8.2.326 / 106

应用例 3:机械臂碰撞裕量

把两个刚体在当前姿态附近近似为 polyhedra C ( q ) 、 D ;最近点对给出 clearance δ ( q ) = min x ∈ C ( q ) , y ∈ D ‖ x − y ‖ 2 .

δ ( q ) ≥ δ min 是安全要求。最近点方向同时产生 supporting planes,可在线性化 motion planning 中形成 separating constraint。

集合间距离自编示例 · robot collision clearance and separating-plane certificate27 / 106

实验|两个集合什么时候可以严格分开?

可交互
dist ⁡ ( C 1 , C 2 ) = min x ∈ C 1 , y ∈ C 2 ‖ x − y ‖ 2 dist ⁡ ( C 1 , C 2 ) = max { 0 , ‖ c 1 − c 2 ‖ 2 − r 1 − r 2 }

正在准备交互图…

圆盘相切与相交时,严格分离结论有什么区别?

MATH6015 / CONVEX OPTIMIZATION

04

距离、角度与 Gram 矩阵

MATH6015 · Lecture 0829 / 106

Gram matrix 统一几何量

令 A = [ a 1   ⋯   a n ] ,Gram matrix G = A ⊤ A ⪰ 0 , G i j = a i ⊤ a j , G i i = ℓ i 2 . 长度、距离、相关系数与角度全部由 G 表达: d i j 2 = ℓ i 2 + ℓ j 2 − 2 G i j , ρ i j = G i j ℓ i ℓ j , θ i j = arccos ⁡ ρ i j . orthogonal transformation Q A 不改变 G ,因此 G 保存旋转/反射不变量,并消去坐标系自由度。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.130 / 106

Realizability 是一个 LMI

一组内积数据可由某些 vectors 实现,当且仅当 G ∈ S + n . 若 G ⪰ 0 ,可取 A = G 1 / 2 , A ⊤ A = G ; 若 G ≻ 0 且 L L ⊤ = G ,也可取 A = L ⊤ 。

任意两种 realization 相差 orthogonal transformation(允许嵌入到更高维空间)。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.1, realizability31 / 106

角度与距离约束变成 affine constraints

已知 ℓ i 时,角度区间 α ≤ θ i j ≤ β 等价于 ℓ i ℓ j cos ⁡ α   ≥   G i j   ≥   ℓ i ℓ j cos ⁡ β . 距离区间 d min ≤ d i j ≤ d max 等价于 d min 2 ≤ ℓ i 2 + ℓ j 2 − 2 G i j ≤ d max 2 .

优化含义

限制部分 distances/angles 后,未知几何量的极值可由 SDP 求出;factorize 最优 G 即恢复 extreme configuration。

G i j simultaneously controls the included angle and the opposite side through the cosine law.

数值实例

若 ℓ i = 2 、 ℓ j = 3 、 θ i j = 60 ∘ ,则 G i j = ℓ i ℓ j cos ⁡ θ i j = 3 ,并且 d i j 2 = 2 2 + 3 2 − 2 G i j = 7 。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.1, angle and distance constraints32 / 106

条件数与 dual basis

Singular values

σ i ( A ) 2 = λ i ( G ) ,因此 σ 1 ( A ) 2 = λ max ( G ) , σ n ( A ) 2 = λ min ( G ) . 最小化 condition number 可用 bisection 检查 t I ⪯ G ⪯ κ 2 t I .

Dual basis

若 G ≻ 0 ,dual basis 的 Gram matrix 为 G − 1 ,且 ‖ b i ‖ 2 2 = e i ⊤ G − 1 e i , ∑ i ‖ b i ‖ 2 2 = tr ⁡ G − 1 . 这些都是 G 的 convex functions。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.1, singular values, condition number, and dual basis33 / 106

体积也由 Gram matrix 决定

image ellipsoid { A u ∣ ‖ u ‖ 2 ≤ 1 } 的体积为 γ n det ( A ⊤ A ) = γ n det G . simplex conv ⁡ { 0 , a 1 , … , a n } 的体积也与 det G 成正比。因此 maximize G log ⁡ det G 在 convex geometric constraints 下是 convex optimization。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.1, ellipsoid and simplex volume34 / 106

只考虑角度:correlation matrix

若 G = diag ⁡ ( l ) C diag ⁡ ( l ) ,其中 C i j = cos ⁡ θ i j ,则 G ⪰ 0 ⟺ C ⪰ 0 对任意正长度向量 l 成立。因此 angles realizable 当且仅当 C ⪰ 0 , C i i = 1.

常见误区

逐对满足 − 1 ≤ ρ i j ≤ 1 还不够;所有 pairwise correlations 必须共同组成 PSD matrix。PSD 条件编码了不可见的全局一致性。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.235 / 106

教材例 8.3:相关系数边界

已知 0.6 ≤ ρ 12 ≤ 0.9 , 0.8 ≤ ρ 13 ≤ 0.9 , 0.5 ≤ ρ 24 ≤ 0.7 , − 0.8 ≤ ρ 34 ≤ − 0.4 . 用两个 SDP 最小化/最大化 ρ 14 ,subject to C ⪰ 0 、 C i i = 1 及上述 box constraints,得到 − 0.39 ≤ ρ 14 ≤ 0.23 . 教材给出的 extremal correlation matrices 为 [ 1 .60 .87 − .39 .60 1 .33 .50 .87 .33 1 − .55 − .39 .50 − .55 1 ] , [ 1 .71 .80 .23 .71 1 .31 .59 .80 .31 1 − .40 .23 .59 − .40 1 ] . ρ 14 的有效区间明显窄于 [ − 1 , 1 ] ,说明 PSD consistency 传播了局部相关信息。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.2, Example 8.3, equation (8.7)36 / 106

Euclidean distance matrix

只关心 pairwise distances 时,可平移 configuration 令 A 1 = 0 。定义 D i j = d i j 2 , z i = ‖ a i ‖ 2 2 . 存在相应 configuration 当且仅当存在 z ≥ 0 使 ( 8.8 ) G = 1 2 ( z 1 ⊤ + 1 z ⊤ − D ) ⪰ 0. 令 centering matrix J = I − 1 1 ⊤ / n ,则等价于 D = D ⊤ , D i i = 0 , D i j ≥ 0 , J D J ⪯ 0 , 并且 centered Gram matrix 为 G c = − 1 2 J D J ⪰ 0 。

距离、角度与 Gram 矩阵Boyd & Vandenberghe · §8.3.3, equation (8.8)37 / 106

应用例 4:传感器定位

四个 sensors 的部分 squared distances 已知,未知 entries 组成矩阵 D 。可解 minimize D ∑ ( i , j ) ∈ Ω w i j ( D i j − d ^ i j 2 ) 2 subject to D = D ⊤ ,   D i i = 0 ,   D i j ≥ 0 ,   J D J ⪯ 0 , 再 factorize G c = − J D J / 2 恢复坐标。

距离、角度与 Gram 矩阵自编示例 · network localization via Euclidean distance matrix completion38 / 106

应用例 5:修复相关矩阵

样本缺失与独立 pairwise estimation 可能给出 indefinite matrix C ^ = [ 1 .9 .9 .9 1 − .9 .9 − .9 1 ] , λ min ( C ^ ) = − 0.8 . 最近 correlation matrix 由 SDP 得到: minimize C ‖ C − C ^ ‖ F 2 subject to C ⪰ 0 , C i i = 1. 该 projection 恢复 joint realizability;在 portfolio risk、Gaussian model 与 kernel methods 中,PSD 不是数值修饰,而是合法 covariance/Gram matrix 的必要条件。

距离、角度与 Gram 矩阵自编示例 · nearest correlation matrix for inconsistent pairwise estimates39 / 106

MATH6015 / CONVEX OPTIMIZATION

05

极值体积椭球

MATH6015 · Lecture 0840 / 106

外接与内接椭球

Outer approximation

Löwner–John ellipsoid:覆盖 C 的 minimum-volume ellipsoid。

Inner approximation

位于 C 内的 maximum-volume ellipsoid。

二者都对 affine coordinate changes 自然变换。

极值体积椭球Boyd & Vandenberghe · §8.441 / 106

Löwner–John ellipsoid

用 inverse-image parameterization E = { v ∣ ‖ A v + b ‖ 2 ≤ 1 } , A ∈ S + + n . 其 volume 与 det A − 1 成正比。因此 minimum-volume cover 为 ( 8.10 ) minimize A ≻ 0 , b log ⁡ det A − 1 subject to sup v ∈ C ‖ A v + b ‖ 2 ≤ 1. 目标与约束关于 ( A , b ) 均 convex;难点是 containment constraint 中的 convex maximization,只有特殊 C 可 tractably evaluate。

极值体积椭球Boyd & Vandenberghe · §8.4.1, problems (8.9)–(8.10)42 / 106

覆盖有限点集

若 C = { x 1 , … , x m } ,覆盖 C 等价于覆盖 conv ⁡ C : ( 8.11 ) minimize A ≻ 0 , b log ⁡ det A − 1 subject to ‖ A x i + b ‖ 2 ≤ 1 , i = 1 , … , m . 最优解处通常有若干约束 active;对应点位于椭球边界,并通过 KKT 条件共同决定椭球参数。右图只示意覆盖关系,不标示真实 active set。

极值体积椭球Boyd & Vandenberghe · §8.4.1, problem (8.11), Figure 8.343 / 106

覆盖椭球的并集

令 E i = { x ∣ x ⊤ A i x + 2 b i ⊤ x + c i ≤ 0 } , A i ≻ 0. 欲求覆盖 ⋃ i E i 的最小体积椭球。对候选 E = { x ∣ ‖ A x + b ‖ 2 ≤ 1 } ,S-procedure 把 E i ⊆ E 转成存在 τ i ≥ 0 的 matrix inequality。令 Q = A 2 、 b ~ = A b ,可写为 [ Q − τ i A i b ~ − τ i b i 0 ( b ~ − τ i b i ) ⊤ − 1 − τ i c i b ~ ⊤ 0 b ~ − Q ] ⪯ 0 , 并最小化 − 1 2 log ⁡ det Q 。这是 ( Q , b ~ , τ ) 的 convex problem。

极值体积椭球Boyd & Vandenberghe · §8.4.1, minimum-volume ellipsoid covering a union of ellipsoids44 / 106

外接椭球的近似保证

设 E L J 的中心为 x c 。对 bounded convex C ⊂ R n , x c + 1 n ( E L J − x c ) ⊆ C ⊆ E L J . 若 C 关于 x c centrally symmetric,则改进为 x c + 1 n ( E L J − x c ) ⊆ C ⊆ E L J .

紧性

一般集合的 1 / n 在 simplex 上达到;symmetric case 的 1 / n 在 cube 上达到。保证只依赖 dimension,不依赖集合的细节。

极值体积椭球Boyd & Vandenberghe · §8.4.1, efficiency of Löwner–John approximation45 / 106

用 quadratic norm 近似任意 norm

令 C = { x ∣ ‖ x ‖ ≤ 1 } 为某个 norm 的 unit ball,且 E L J = { x ∣ x ⊤ Q x ≤ 1 } , Q ≻ 0. 定义 quadratic norm ‖ x ‖ L J = ( x ⊤ Q x ) 1 / 2 。由于 C centrally symmetric, ‖ x ‖ L J ≤ ‖ x ‖ ≤ n ‖ x ‖ L J ∀ x .

几何上:复杂 unit ball 被一个 ellipsoid 在 dimension-dependent factor 内逼近。

算法上:可用 Q 作为 metric/preconditioner,把非 Euclidean geometry 转换为 quadratic geometry。

极值体积椭球Boyd & Vandenberghe · §8.4.1, approximating a norm by a quadratic norm46 / 106

Maximum-volume inscribed ellipsoid

用 image parameterization E = { B u + d ∣ ‖ u ‖ 2 ≤ 1 } , B ∈ S + + n , volume 与 det B 成正比。最大内接椭球由 ( 8.14 ) maximize B ≻ 0 , d log ⁡ det B subject to B B 2 + d ⊆ C 给出。若 C = { x ∣ a i ⊤ x ≤ b i } ,containment 精确化简为 ( 8.15 ) ‖ B a i ‖ 2 + a i ⊤ d ≤ b i , i = 1 , … , m . 这是 log-det objective 加 SOCP constraints 的 convex problem;active facets 与椭球接触。

改变 B 的 eigenvectors 与 eigenvalues,分别调整椭球方向与半轴。

接触点

若第 i 个 facet active,则最远方向 u i = B a i / ‖ B a i ‖ 2 ,对应接触点 x i c = d + B 2 a i / ‖ B a i ‖ 2 。

极值体积椭球Boyd & Vandenberghe · §8.4.2, problems (8.14)–(8.15)47 / 106

内接于椭球交集

若 C = ⋂ i E i , E i = { x ∣ x ⊤ A i x + 2 b i ⊤ x + c i ≤ 0 } , A i ≻ 0 , 则 E = { B u + d ∣ ‖ u ‖ 2 ≤ 1 } ⊆ E i 可由 S-procedure 写成存在 λ i ≥ 0 使 [ − λ i − d ⊤ A i d − 2 b i ⊤ d − c i ( A i d + b i ) ⊤ B B ( A i d + b i ) λ i I − B A i B ] ⪰ 0. Schur complement 给出对 ( B , d , λ i ) affine 的等价 LMI: [ − λ i − c i + b i ⊤ A i − 1 b i 0 ( d + A i − 1 b i ) ⊤ 0 λ i I B d + A i − 1 b i B A i − 1 ] ⪰ 0. 因此可在这些 LMI 下最小化 − log ⁡ det B 。

近似效率

maximum-volume inner ellipsoid 扩大 n 倍覆盖一般 C ;centrally symmetric 时扩大 n 倍即可。

极值体积椭球Boyd & Vandenberghe · §8.4.2, maximum-volume ellipsoid in an intersection of ellipsoids48 / 106

Affine invariance

若 T nonsingular,则 E L J ( T C ) = T E L J ( C ) , E i n ( T C ) = T E i n ( C ) .

理由是 E ↦ T E 在 covering(或 inscribed)ellipsoids 之间一一对应,且所有 volume 统一乘以 | det T | ,故最优排序不变。

极值体积椭球Boyd & Vandenberghe · §8.4.349 / 106

应用例 6:压缩不确定性集合

工程参数的 10 4 个 feasible samples 为 { x i } 。用 finite-set LJ problem 得到 E = { x ∣ ‖ A x + b ‖ 2 ≤ 1 } 作为 compact uncertainty model。

数据压缩

存储 ( A , b ) 代替全部 samples;volume minimization 抑制过度保守。

下游鲁棒优化

对 linear constraint,ellipsoidal uncertainty 的 worst case 变为一个 norm term,通常得到 SOCP。

若 samples 只是有限观测,coverage 仅对样本集合成立;推广到真实分布仍需要统计置信保证。

极值体积椭球自编示例 · minimum-volume ellipsoid as a compact uncertainty model50 / 106

实验|同一三角形,两种体积最优椭圆

可交互
E ( c , P ) = { x : ( x − c ) T P − 1 ( x − c ) ≤ 1 } c = 1 3 ∑ i = 1 3 v i , P out = 2 3 ∑ i = 1 3 ( v i − c ) ( v i − c ) T P in = 1 4 P out

正在准备交互图…

为什么两椭圆在三角形特例中共心,半轴恰好相差两倍?

MATH6015 / CONVEX OPTIMIZATION

06

中心

MATH6015 · Lecture 0852 / 106

三种中心回答不同问题

Chebyshev center

最大化最小边界距离。

MVE center

最大化可容纳 ellipsoid 的体积。

Analytic center

最大化 inequalities slacks 的乘积。

三者通常不重合;所选中心应对应应用中真正关心的“居中”概念。

中心Boyd & Vandenberghe · §8.5, Figures 8.5–8.7; qualitative redraw53 / 106

Chebyshev center

点 x ∈ C 的 depth 定义为 depth ⁡ ( x , C ) = dist ⁡ ( x , R n ∖ C ) . Chebyshev center 是最深点,也就是 C 内最大 norm ball 的中心: x c h e b ∈ arg ⁡ max x ∈ C depth ⁡ ( x , C ) . 若 C = { x ∣ f i ( x ) ≤ 0 } ,则 ( 8.16 ) maximize x , R R subject to g i ( x , R ) := sup ‖ u ‖ ≤ 1 f i ( x + R u ) ≤ 0 , 其中 g i 是 convex function;计算难点是其中的 convex maximization。

中心Boyd & Vandenberghe · §8.5.1, problem (8.16)54 / 106

Polyhedron 的 Chebyshev center

若 C = { x ∣ a i ⊤ x ≤ b i } ,则 sup ‖ u ‖ ≤ 1 a i ⊤ ( x + R u ) − b i = a i ⊤ x + R ‖ a i ‖ ∗ − b i . 所以最大内接 norm ball 由 LP 给出: maximize x , R R subject to a i ⊤ x + R ‖ a i ‖ ∗ ≤ b i , i = 1 , … , m , R ≥ 0. Euclidean norm 时 ‖ a i ‖ ∗ = ‖ a i ‖ 2 ;先把 normals normalized,就得到“到每条 hyperplane 的距离至少 R ”。

中心Boyd & Vandenberghe · §8.5.1, Chebyshev center of a polyhedron55 / 106

实验|在多面体里,放入最大的圆

可交互
max x , r r s.t. a i T x + r ‖ a i ‖ 2 ≤ b i , i = 1 , … , 5 , r ≥ 0

正在准备交互图…

为什么“圆完全在半空间内”能够写成一个线性不等式?

Ellipsoids 交集的 Chebyshev center

若 C = ⋂ i { x ∣ x ⊤ A i x + 2 b i ⊤ x + c i ≤ 0 } , A i ≻ 0 , 则 Euclidean ball x + R B 2 ⊆ C 可经 S-procedure 与 Schur complement 转为 LMI:存在 λ i 使 [ − λ i − c i + b i ⊤ A i − 1 b i 0 ( x + A i − 1 b i ) ⊤ 0 λ i I R I x + A i − 1 b i R I A i − 1 ] ⪰ 0 , 对所有 i 成立,并 maximize R 。因此原本的“ball contained in every ellipsoid”可由 SDP 精确求解。

中心Boyd & Vandenberghe · §8.5.1, equation (8.17), Euclidean Chebyshev center of ellipsoid intersection57 / 106

Maximum-volume ellipsoid center

x m v e 定义为 C 内 maximum-volume ellipsoid 的中心。对 polyhedron C = { x ∣ a i ⊤ x ≤ b i ,   i = 1 , … , m } , 求解 maximize B ≻ 0 , d log ⁡ det B subject to ‖ B a i ‖ 2 + a i ⊤ d ≤ b i 后, d ⋆ = x m v e 。

与 Chebyshev center 的差异

Chebyshev center 只优化最短半径;MVE center 同时调整所有 principal axes,因此会利用长而窄的方向,并具有 affine invariance。

中心Boyd & Vandenberghe · §8.5.258 / 106

Analytic center

对 f i ( x ) ≤ 0 , i = 1 , … , m , F x = g , analytic center 定义为 logarithmic barrier 的 minimizer: ( 8.18 ) minimize x − ∑ i = 1 m log ⁡ ( − f i ( x ) ) subject to F x = g . 等价地,在 equality constraints 上最大化 slacks 的乘积 ∏ i = 1 m [ − f i ( x ) ] . 需要 strict feasibility;bounded feasible set 通常保证 barrier bounded below。

中心Boyd & Vandenberghe · §8.5.3, problem (8.18)59 / 106

Analytic center 依赖表示

同一集合用不同 inequalities 描述,analytic center 可能改变。例如区间 [ − 1 , 1 ] : x ≤ 1 ,   − x ≤ 1 ⟹ x a c = 0. 若重复约束 x ≤ 1 一次,barrier 变为 − 2 log ⁡ ( 1 − x ) − log ⁡ ( 1 + x ) , 一阶条件给出 x a c = − 1 3 。

仍保持的不变性

analytic center 对 coordinate 的 nonsingular affine change、每个 inequality 的 positive scaling,以及 equality constraints 的等价重参数化不变。

中心Boyd & Vandenberghe · §8.5.3, representation dependence and invariance; one-dimensional illustration60 / 106

Linear inequalities 的 analytic center

对 P = { x ∣ a i ⊤ x ≤ b i } ,求解 ( 8.19 ) minimize x − ∑ i = 1 m log ⁡ ( b i − a i ⊤ x ) . 若令 d i = ( b i − a i ⊤ x a c ) − 1 ,则 barrier Hessian 为 H = ∑ i = 1 m d i 2 a i a i ⊤ . 它定义 Dikin inner ellipsoid 与 outer ellipsoid: E i n = { x ∣ ( x − x a c ) ⊤ H ( x − x a c ) ≤ 1 } , E o u t = { x ∣ ( x − x a c ) ⊤ H ( x − x a c ) ≤ m ( m − 1 ) } , 且 E i n ⊆ P ⊆ E o u t 。

中心Boyd & Vandenberghe · §8.5.3, problem (8.19), inner and outer ellipsoids61 / 106

LMI 的 analytic center

对 spectrahedron C = { x ∣ B − ∑ i = 1 n x i A i ⪰ 0 } , analytic center 定义为 minimize x − log ⁡ det ( B − ∑ i = 1 n x i A i ) .

当 smallest eigenvalue 接近零, − log ⁡ det 发散,阻止 iterates 接触 PSD boundary。

这正是 Lecture 06 中 semidefinite interior-point method 的 barrier;“中心”与 central path 直接连接。

中心Boyd & Vandenberghe · §8.5.3, analytic center of a linear matrix inequality62 / 106

应用例 7:制造公差中心

设计变量 x 满足若干 normalized linear tolerances a i ⊤ x ≤ b i , ‖ a i ‖ 2 = 1. 若生产误差满足 ‖ Δ x ‖ 2 ≤ r ,Chebyshev center 求得最大共同容差: max x , r   r s.t. a i ⊤ x + r ≤ b i .

决策含义

r ⋆ 是所有方向上都可承受的 worst-case manufacturing error;active faces 指出最先限制公差的规格。若误差方向有不同尺度,可改用 maximum-volume ellipsoid center。

中心自编示例 · design centering under manufacturing tolerances63 / 106

MATH6015 / CONVEX OPTIMIZATION

07

分类

MATH6015 · Lecture 0864 / 106

分类的几何定义

给定两组 points { x i } i = 1 N 与 { y j } j = 1 M ,寻找函数 f 使 f ( x i ) > 0 , f ( y j ) < 0.

若 f 对参数 affine,则所有 sample sign constraints 对参数也是 linear。模型是否 convex 取决于参数化,而边界可对输入 x 非线性。

分类Boyd & Vandenberghe · §8.6, Figure 8.8; qualitative redraw65 / 106

Linear discrimination

令 f ( x ) = a ⊤ x − b 。strict separation ( 8.20 ) a ⊤ x i − b > 0 , a ⊤ y j − b < 0 由于对 ( a , b ) homogeneous,等价于 linear feasibility ( 8.21 ) a ⊤ x i − b ≥ 1 , a ⊤ y j − b ≤ − 1.

几何判据

两组 points 可被 affine hyperplane 严格分开,当且仅当 conv ⁡ { x i } ∩ conv ⁡ { y j } = ∅ . 若 convex hulls 相交,交点的两种 convex combinations 形成 alternative certificate。

分类Boyd & Vandenberghe · §8.6.1, equations (8.20)–(8.22)66 / 106

Maximum-margin separation

为排除任意 scaling,约束 ‖ a ‖ 2 ≤ 1 : ( 8.23 ) maximize a , b , t t subject to a ⊤ x i − b ≥ t , a ⊤ y j − b ≤ − t , ‖ a ‖ 2 ≤ 1. 若可严格分离,则最优点 ‖ a ⋆ ‖ 2 = 1 ,而 2 t ⋆ 是 separating slab thickness。

分类Boyd & Vandenberghe · §8.6.1, problem (8.23), Figure 8.967 / 106

Margin 等于 convex hull distance 的一半

maximum-margin problem 的 dual 可解释为 t ⋆ = 1 2 min u ≥ 0 ,   1 ⊤ u = 1 v ≥ 0 ,   1 ⊤ v = 1 ‖ ∑ i u i x i − ∑ j v j y j ‖ 2 . 右侧两点分别属于两组 convex hull;因此 2 t ⋆ = dist ⁡ ( conv ⁡ { x i } , conv ⁡ { y j } ) .

Support vectors

最优 convex combinations 中 positive weights 对应 closest faces;primal classifier 仅由这些靠近 slab 的 points 决定。

分类Boyd & Vandenberghe · §8.6.1, dual of robust linear discrimination68 / 106

不可分数据:LP slack model

引入 u i , v j ≥ 0 : ( 8.24 ) a ⊤ x i − b ≥ 1 − u i , a ⊤ y j − b ≤ − ( 1 − v j ) . 最小化总 violation: ( 8.25 ) minimize a , b , u , v 1 ⊤ u + 1 ⊤ v subject to (8.24) , u , v ≥ 0. 0 < u i < 1 表示 point 仍正确分类但落入 margin slab; u i > 1 表示 misclassification。 ℓ 1 objective 是 misclassification count 的 convex surrogate。

Slack 的数值读法

对正类 score s i = a ⊤ x i − b ,最小可行 slack 为 u i = max { 0 , 1 − s i } : s i = 0.3 给出 u i = 0.7 ; s i = − 0.4 给出 u i = 1.4 ,点已越过 classifier。

分类Boyd & Vandenberghe · §8.6.1, equations (8.24)–(8.25), Figure 8.1069 / 106

Support vector classifier

标准 soft-margin model 为 minimize a , b , u , v ‖ a ‖ 2 + γ ( 1 ⊤ u + 1 ⊤ v ) subject to a ⊤ x i − b ≥ 1 − u i , a ⊤ y j − b ≤ − ( 1 − v j ) , u , v ≥ 0.

‖ a ‖ 2 越小,slab width 2 / ‖ a ‖ 2 越大。

γ 越大,violations 越昂贵,模型更强调 training fit。

与常见 1 2 ‖ a ‖ 2 2 + C ∑ ξ i 形式相比,损失含义相同,但 regularizer 的具体尺度不同。

分类Boyd & Vandenberghe · §8.6.1, support vector classifier, Figure 8.1170 / 106

实验|间隔宽度与违约代价怎样权衡?

可交互
min w 1 2 ‖ w ‖ 2 2 + C ∑ i max { 0 , 1 − y i w T x i }

正在准备交互图…

为什么增大 C 不一定让所有样本都满足间隔要求?

Logistic discrimination

模型 ( 8.26 ) Pr ( z = 1 ∣ u ) = e a ⊤ u − b 1 + e a ⊤ u − b , Pr ( z = 0 ∣ u ) = 1 1 + e a ⊤ u − b 通过 convex maximum likelihood 求 ( a , b ) ;decision boundary 仍是 a ⊤ u = b 。

与 margin model 的区别

SVC 直接优化 geometric margin 与 hinge-like violations;logistic model 优化 probabilistic log-loss,并输出 class probability。若 data strictly separable 且无 regularization,logistic MLE 不存在有限解。

分类Boyd & Vandenberghe · §8.6.1, equations (8.26)–(8.27), Figure 8.12; Remark 8.172 / 106

Quadratic discrimination

令 f ( x ) = x ⊤ P x + q ⊤ x + r . sample sign constraints 对参数 ( P , q , r ) 仍为 linear: x i ⊤ P x i + q ⊤ x i + r ≥ 1 , y j ⊤ P y j + q ⊤ y j + r ≤ − 1. 若要求 P ⪯ − I ,则 positive region 是一个 ellipsoid,可用 SDP 寻找“包含所有 x i 、排除所有 y j ”的 ellipsoidal classifier。

分类Boyd & Vandenberghe · §8.6.2, quadratic discrimination, Figure 8.1373 / 106

Polynomial discrimination

degree at most d 的 polynomial f ( x ) = ∑ | α | ≤ d c α x α 在 sample points 上对 coefficients c α 为 affine。因此固定 d 时,separation 是 LP feasibility。

minimum separating degree 可通过整数 d 上的 bisection/search 求得;模型可能过拟合,实际应用需 regularization 或验证集。

分类Boyd & Vandenberghe · §8.6.2, polynomial discrimination, Figure 8.1474 / 106

应用例 8:质量缺陷筛查

二维 features 为振动幅值与温升,正常样本位于中央、缺陷样本围绕外侧。linear classifier 无法分离。几何上可写成 f ( x ) = r 2 − ( x − c ) ⊤ Q ( x − c ) , Q ≻ 0 一个 ellipsoidal acceptance region。

为保持训练问题 convex,使用一般形式 g ( x ) = x ⊤ P x + q ⊤ x + r 0 ,对系数施加 P ⪯ − I ,并加入 sample slacks;求解 SDP 后再配方恢复 ( Q , c , r ) 。输出边界可解释为可接受工况 envelope。

分类自编示例 · ellipsoidal classifier for condition-monitoring data75 / 106

MATH6015 / CONVEX OPTIMIZATION

08

布局与选址

MATH6015 · Lecture 0876 / 106

Placement 的 graph model

节点 i 的位置为 x i ∈ R k (通常 k = 2 或 3 ),links 为 graph edge set A 。若部分位置固定,其余为变量,则 minimize { x i } ∑ ( i , j ) ∈ A f i j ( x i , x j ) 在所有 f i j jointly convex 时是 convex problem。

布局与选址Boyd & Vandenberghe · §8.777 / 106

Linear facility location

最基本 cost 是 weighted link length: ( 8.28 ) minimize { x i } ∑ i < j w i j ‖ x i − x j ‖ , w i j ≥ 0.

Euclidean norm

直接距离,适合仓库运输、无线节点或能够沿直线连接的系统;模型可写为 SOCP。

Manhattan norm

‖ x i − x j ‖ 1 描述只能水平/垂直布线或街区路网;模型可写为 LP。

w i j 可表示 transport volume、wire multiplicity 或 unit-length cost。

布局与选址Boyd & Vandenberghe · §8.7.1, equation (8.28)78 / 106

教材例 8.4:一个自由点

给定 K 个 fixed points ( u i , v i ) ,选择 ( u , v ) 最小化距离和。

ℓ 1 distance

min u , v ∑ i ( | u − u i | + | v − v i | ) . 任意 coordinate-wise median 是最优解; K 为偶数时可出现一整块 optimal rectangle。

Euclidean distance

min u , v ∑ i ( u − u i ) 2 + ( v − v i ) 2 . 最优点称为 Weber point 或 geometric median,通常需迭代算法求解。

mean、median 与 geometric median 对应不同 loss;不能仅凭“中心”一词互换。

布局与选址Boyd & Vandenberghe · §8.7.1, Example 8.479 / 106

Placement constraints

保持 convexity 的常见约束包括:

  • x i 位于 line、box、ellipsoid 等 convex region;

  • pairwise distance upper bounds;

  • relative position,例如 x i ≤ x j ;

  • linear equalities 描述 alignment。

限制 points x 1 , … , x p 的 bounding box perimeter:引入 u , v , u ≤ x i ≤ v , 2 1 ⊤ ( v − u ) ≤ P max . 这是 linear constraints。

minimum distance constraint ‖ x i − x j ‖ ≥ d 一般非凸;它要求排除一个 convex ball。

布局与选址Boyd & Vandenberghe · §8.7.280 / 106

Nonlinear facility costs

更一般地,若 h : R + → R convex nondecreasing,则 min ∑ i < j w i j h ( ‖ x i − x j ‖ ) 仍为 convex problem。常见选择:

h ( t ) 行为 布局倾向
t linear penalty 允许少量较长 links
t 2 quadratic penalty 更均衡地压缩长 links
t 4 high-order penalty 强烈抑制 maximum link length
deadzone 短距离零成本 小移动不敏感
quadratic-linear 近处平方、远处线性 平滑且降低 outlier influence
布局与选址Boyd & Vandenberghe · §8.7.381 / 106

教材例 8.5:平方距离得到均值

只有一个 free point x 时, min x ∑ i = 1 K ‖ x − x i ‖ 2 2 . 展开并令 gradient 为零: 2 K x − 2 ∑ i = 1 K x i = 0 ⟹ x ⋆ = 1 K ∑ i = 1 K x i .

与例 8.4 对比

ℓ 1 distance sum 给 coordinate median;Euclidean distance sum 给 geometric median;squared Euclidean distance sum 给 arithmetic mean。三者对 outliers 的敏感性逐步增加。

布局与选址Boyd & Vandenberghe · §8.7.3, Example 8.582 / 106

教材例 8.6:penalty 改变布局

教材比较同一 graph 上 ∑ ( i , j ) ∈ A ‖ x i − x j ‖ 2 , ∑ ( i , j ) ∈ A ‖ x i − x j ‖ 2 2 , ∑ ( i , j ) ∈ A ‖ x i − x j ‖ 2 4 .

随着 power 增大,长 link 的 marginal cost 增长更快;free nodes 更分散,maximum length 缩短。

布局与选址Boyd & Vandenberghe · §8.7.3, Example 8.6, Figures 8.15–8.17; schematic redraw83 / 106

Path constraints

path i 0 , … , i p 的长度 L = ∑ k = 1 p ‖ x i k − x i k − 1 ‖ 是 node locations 的 convex function,因此 L ≤ L max 是 convex constraint。

限制 path sum 与逐条限制 edge length 不同:前者允许在路径内部重新分配 delay budget。

布局与选址Boyd & Vandenberghe · §8.7.4, path constraints84 / 106

Minimax delay 与 dynamic programming

在 DAG 中,令 τ k 为从 node k 到任一 sink 的最大总 delay。sink 上 τ k = 0 ;其余节点满足 Bellman recursion ( 8.30 ) τ k = max ( k , j ) ∈ A { ‖ x j − x k ‖ + τ j } . 最大 source–sink delay 是 source nodes 上的 max τ k 。

计算结构

按 reverse topological order 计算 τ ,只需约 | A | 次 edge relaxations,避免枚举可能指数多的 source–sink paths。

布局与选址Boyd & Vandenberghe · §8.7.4, equations (8.29)–(8.30)85 / 106

Minimax delay 的凸 reformulation

引入 upper bounds T k ≥ τ k : minimize { x i } , T , t t subject to T k = 0 , k  sink , T k ≥ ‖ x j − x k ‖ + T j , ( k , j ) ∈ A , T k ≤ t , k  source . 每条 edge 只产生一个 convex inequality;目标压紧所有 upper bounds,因此最优 t 等于真实 maximum path delay。

建模模式

用 epigraph inequalities 取代 max recursion 的 equality,是把 dynamic programming relation 嵌入 convex optimization 的典型方法。

布局与选址Boyd & Vandenberghe · §8.7.4, minimax delay placement86 / 106

应用例 9:应急设施选址

居民点 x i 的需求权重为 w i ; s i > 0 表示到点 i 的 有效行驶或服务速度,因此 ‖ z − x i ‖ 2 / s i 是响应时间。

效率:平均运输成本

min z ∈ C ∑ i w i ‖ z − x i ‖ 2 . 最优点是 weighted geometric median,强调总运输成本。

公平性:最坏响应时间

min z ∈ C max i ‖ z − x i ‖ 2 s i . 最优点是加权 1-center,压低最慢服务点的响应时间。

可行域 C 可加入 land-use polygon、河流一侧或道路附近等 convex approximations;固定 t 时,最坏时间约束等价于 z ∈ ⋂ i B ( x i , t s i ) 。

布局与选址自编示例 · single-facility emergency logistics: median versus minimax center87 / 106

实验|服务点应该设在重心吗?

可交互
min x ∈ R 2 ∑ i w i ‖ x − a i ‖ 2

正在准备交互图…

一个需求点权重很大时,最优设施会不会直接落在该点?

应用例 10:芯片互连布局

modules 的位置 x i = ( x i , y i ) ,netlist 权重 w i j 近似 signal traffic。quadratic placement min ∑ i < j w i j ‖ x i − x j ‖ 2 2 形成 sparse graph Laplacian linear system;再加入 bounding box、region 与 symmetry constraints。

优势

大规模、平滑、可用 sparse linear algebra 快速求解,适合 global placement 初始阶段。

局限

points 没有面积,不能阻止 modules overlap;需要后续 legalization 或进入 floor-planning model。

布局与选址自编示例 · quadratic placement for integrated-circuit netlists89 / 106

实验|固定锚点怎样决定自由节点?

可交互
min x , y ∈ R 2 ‖ x − a ‖ 2 2 + ‖ x − b ‖ 2 2 + ‖ y − c ‖ 2 2 + w ‖ x − y ‖ 2 2

正在准备交互图…

连接强度增大时,两个自由节点为什么会靠拢?

MATH6015 / CONVEX OPTIMIZATION

09

平面规划

MATH6015 · Lecture 0891 / 106

Floor-planning variables

cell C i 用 lower-left corner ( x i , y i ) 、width w i 、height h i 表示;bounding box 为 W × H 。

containment constraints: x i , y i ≥ 0 , ( 8.31 ) x i + w i ≤ W , y i + h i ≤ H . variables 还允许 cells 在 area/aspect constraints 内重新配置。

平面规划Boyd & Vandenberghe · §8.8, equation (8.31), Figure 8.1892 / 106

Non-overlap 是 disjunction

对任意 i ≠ j ,不重叠要求以下四式至少一个成立: ( 8.32 ) x i + w i ≤ x j ⏟ i  left of  j ∨ x j + w j ≤ x i ⏟ j  left of  i ∨ y i + h i ≤ y j ⏟ i  below  j ∨ y j + h j ≤ y i ⏟ j  below  i .

组合性来源

每个 inequality 本身 linear;困难来自“or”。若 relative order 未知,需 discrete variables/search。若预先指定每对 cells 的相对位置,剩余 continuous sizing/placement 可转为 convex optimization。

平面规划Boyd & Vandenberghe · §8.8, equation (8.32)93 / 106

Relative positioning graphs

用 DAG H 表示 left-of, V 表示 below: ( 8.34 ) x i + w i ≤ x j ( i , j ) ∈ H , y i + h i ≤ y j ( i , j ) ∈ V .

transitive relation 的所有 inequalities 不必显式保留;只需 DAG edges。path i → j 自动推出 C i 位于 C j 左侧或下方。

每对 cells 必须在 H 或 V 的某个方向上可达,才能保证 non-overlap。

平面规划Boyd & Vandenberghe · §8.8.1, equations (8.33)–(8.34), Figure 8.1994 / 106

Bounding constraints 也可稀疏化

利用 partial order,只需对 extremal cells 施加外框约束: ( 8.35 ) x i ≥ 0 , i  minimal in  H , x i + w i ≤ W , i  maximal in  H , y i ≥ 0 , i  minimal in  V , y i + h i ≤ H , i  maximal in  V . 其他 cells 的 containment 由 path inequalities 与 extremal constraints 推出。

算法意义

用 transitive reduction 保留必要 edges,可显著减少 linear constraints;这不改变 feasible set,只改变表示规模与数值求解成本。

平面规划Boyd & Vandenberghe · §8.8.1, equation (8.35)95 / 106

Convex floor-planning model

给定 H , V 后,可最小化 bounding-box perimeter: min   2 ( W + H ) subject to relative-position 与 bounding constraints,以及:

  • spacing: x i + w i + ρ ≤ x j ;

  • minimum area: w i h i ≥ A i ;

  • aspect ratio: ℓ i w i ≤ h i ≤ u i w i 。

minimum-area constraint 是 convex,因为 w i ≥ A i / h i , w i , h i > 0 , 或等价地 log ⁡ w i + log ⁡ h i ≥ log ⁡ A i 。

平面规划Boyd & Vandenberghe · §8.8.2, minimum spacing, area, and aspect-ratio constraints96 / 106

Alignment、symmetry 与 similarity

这些设计规则在 relative order 固定后可用 linear equalities: cell  i  center line aligns with cell  j  top: y i + h i / 2 = y j + h j , vertical symmetry: x a x i s − ( x i + w i / 2 ) = x j + w j / 2 − x a x i s , fixed-scale similarity: w i = a w j , h i = a h j .

边界

若 similarity scale a 也是变量, w i = a w j 是 bilinear,不能直接放入本节的 convex formulation;GP parameterization 则可把未知 positive scale 作为 monomial relation 处理。

containment in a polyhedron 与指定 cell 覆盖某个 point 也只需 linear inequalities。

平面规划Boyd & Vandenberghe · §8.8.2, alignment, symmetry, similarity, and containment constraints97 / 106

Cell 间距离约束

center distance 可直接约束: ‖ ( x i + w i / 2 , y i + h i / 2 ) − ( x j + w j / 2 , y j + h j / 2 ) ‖ ≤ D i j . 若限制 sets 的 minimum distance,可引入 p i ∈ C i , p j ∈ C j : p i ∈ C i , p j ∈ C j , ‖ p i − p j ‖ ≤ D i j .

方向要分清

dist ⁡ ( C i , C j ) ≤ D 可由存在一对近点表达,因此 convex;而要求 dist ⁡ ( C i , C j ) ≥ D 是 clearance/non-overlap 型约束,通常非凸,需借助已知 relative positioning 才能线性化。

平面规划Boyd & Vandenberghe · §8.8.2, distance constraints98 / 106

教材例 8.7:五个 cells

教材固定 Figure 8.19 的 relative-position graphs,统一要求 1 5 ≤ w i h i ≤ 5 , 并使用相同 minimum spacing;四组 minimum areas A i 的总和相同,但分配不同。

最优 perimeter 与 aspect ratios 会随 area allocation 改变;相同 total area 不意味着相同 geometry 或 bounding box。

平面规划Boyd & Vandenberghe · §8.8.2, Example 8.7, Figure 8.20; schematic redraw99 / 106

Floor planning via geometric programming

所有 variables positive 时,relative-position inequality x i + w i ≤ x j ⟺ x i + w i x j ≤ 1 是 posynomial inequality; w i h i = A i 是 monomial equality。

GP 能直接处理

最小化 area W H ;固定 cell area;unknown-scale similarity;relative order 与 bounding inequalities。

本 formulation 不便处理

alignment、additive symmetry 与一般 distance constraints 不符合 monomial/posynomial 结构。

convex 与 GP formulations 各自保留不同的设计语言,应根据所需 constraints 选择。

平面规划Boyd & Vandenberghe · §8.8.3100 / 106

应用例 11:数据中心机柜布局

机柜 i 的左下角为 ( x i , y i ) ,宽高为 w i , h i ,中心为 c i = ( x i + w i / 2 ,   y i + h i / 2 ) . 目标综合机房 perimeter 与 cable cost: min   2 α ( W + H ) + ∑ ( i , j ) ∈ A q i j ‖ c i − c j ‖ 1 , 其中 q i j 是机柜间 cable traffic。面积与长宽比满足 w i h i ≥ A i , ℓ i w i ≤ h i ≤ u i w i . ρ i j ≥ 0 表示机柜 i , j 之间所需的通道宽度。例如已知 i 位于 j 左侧时, x i + w i + ρ i j ≤ x j .

模型边界。 给定 relative order 后这是 convex model;若 aisle topology、rack orientation 或 pairwise order 也要选择,则需加入 mixed-integer decisions。

平面规划自编示例 · data-center rack floor planning with cable and aisle costs101 / 106

MATH6015 / CONVEX OPTIMIZATION

10

总结

MATH6015 · Lecture 08102 / 106

Chapter 8 的建模链

几何问题的核心工作是选择 representation:坐标适合位置,Gram matrix 适合不变量,ellipsoid parameters 适合 containment,graph order 适合消除 disjunction。

总结Boyd & Vandenberghe · Chapter 8103 / 106

公式索引

对象 关键公式
Projection P C ( x 0 ) ∈ arg ⁡ min x ∈ C ‖ x − x 0 ‖
Set distance dual max ‖ z ‖ ∗ ≤ 1 − S C ( − z ) − S D ( z )
Gram geometry G = A ⊤ A ⪰ 0 , d i j 2 = G i i + G j j − 2 G i j
Euclidean distance matrix D i i = 0 , D i j ≥ 0 , J D J ⪯ 0
Outer ellipsoid min log ⁡ det A − 1 s.t. sup x ∈ C ‖ A x + b ‖ 2 ≤ 1
Inner ellipsoid max log ⁡ det B s.t. B B 2 + d ⊆ C
Chebyshev center max R s.t. x + R B ⊆ C
Analytic center min − ∑ i log ⁡ ( − f i ( x ) )
Floor planning relative order converts non-overlap disjunctions into linear inequalities
总结Boyd & Vandenberghe · Chapter 8, §§8.1–8.8104 / 106

模型选择

已知信息 变量 首选结构
point coordinates 与 convex regions coordinates norm/QP/SOCP
pairwise angles/distances Gram or EDM SDP
cover/containment geometry ellipsoid parameters log-det + SOCP/SDP
class labels boundary parameters LP/QP/SDP
network links node coordinates separable convex costs
rectangles + fixed order positions and sizes LP/SOCP/GP
rectangles + unknown order continuous + discrete mixed-integer/outer search

先识别 invariant、containment 和 disjunction;它们决定能否得到 convex formulation。

总结Boyd & Vandenberghe · Chapter 8 synthesis105 / 106

本讲回顾

带走的结构

  1. 投影、分离与集合间距离把几何关系转化为凸优化问题和对偶证书。

  2. Gram 矩阵以半正定约束编码内积、距离和角度,适合只给出成对几何信息的问题。

  3. 极值体积椭球、中心与分类模型依靠范数、log-det、SOCP 或 SDP 表示。

  4. 坐标、Gram 矩阵、椭球参数和图上的顺序变量对应不同的几何信息与约束结构。

自测

  1. 若只知道点之间的距离或夹角,应选坐标变量还是 Gram 矩阵?需要加入什么一致性约束?

  2. 能否把一个投影、集合距离或包围问题写成规范的 QP、SOCP 或 SDP 模型?

本讲目录

88 个源讲义内容单元 · 7 个互动页面 · 完整离线可用

返回课程讲义目录

实验详情

图形详情

适合窗口拖动查看局部 · Esc 返回讲义