ch02 - 线性规划course.sdu.edu.cn/g2s/ewebeditor/uploadfile/... · 2015-12-23 · 13...
TRANSCRIPT
![Page 1: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/1.jpg)
1
第 2章 线性规划
![Page 2: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/2.jpg)
2
第 2章的主要内容
线性规划问题
可行区域与基本可行解
单纯形算法
初始可行解和两阶段法
对偶理论和对偶单纯形法
灵敏度分析
计算软件
![Page 3: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/3.jpg)
3
案例分析
![Page 4: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/4.jpg)
4
2.1 线性规划问题
![Page 5: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/5.jpg)
5
本节内容
1. 线性规划实例
1. 生产计划问题
2. 运输问题
2. 线性规划模型
1. 一般形式
2. 规范形式
3. 标准形式
![Page 6: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/6.jpg)
6
4. 形式转换
5. 概念
生产计划问题
某工厂用三种原料生产三种产品,给定三种原料的
可用量,试制订总利润 大的生产计划。
![Page 7: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/7.jpg)
7
单位产品所需
原料数量(公
斤)
产品 Q1
产品 Q2
产品 Q3
原料可用
量(公斤/日)
原料 P1 2 3 0 1500
原料 P2 0 2 4 800
原料 P3 3 2 5 2000
单位产品的利
润(千元) 3 5 4
![Page 8: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/8.jpg)
8
问题分析
可控因素:每天生产三种产品的数量,分别设为 x1, x2, x3。
目标:每天的生产利润 大。利润函数 3x1 + 5x2 + 4x3。
限制条件: 每天原料的需求量不超过可用量:
原料 1: 150032 21 xx
原料 2: 80042 32 xx
原料 3: 2000523 321 xxx
![Page 9: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/9.jpg)
9
蕴含约束:产量为非负数 0,, 321 xxx
线性规划(LP)模型
max 321 453 xxx s.t.
150032 21 xx 80042 32 xx
2000523 321 xxx 0,, 321 xxx
![Page 10: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/10.jpg)
10
计算结果
OBJECTIVE FUNCTION VALUE 2675.000
VARIABLE VALUE REDUCED COST
X1 375.000000 0.000000
X2 250.000000 0.000000
X3 75.000000 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
1) 0.000000 1.050000
![Page 11: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/11.jpg)
11
2) 0.000000 0.625000
3) 0.000000 0.300000
运输问题(Hitchcock问题)
实例:(1)一个制造厂要把若干单位的同一种产品从
两个仓库 2,1; iAi 发送到零售点 4,3,2,1; jB j 。
(2)仓库 iA 能供应的产品数量为 2,1; iai ,零售点
jB 所需要的产品的数量为 4,3,2,1; jbj 。
![Page 12: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/12.jpg)
12
(3)假设总供给量
2
1iia和总需求量
4
1jjb相等,且已
知从仓库 iA 运一个单位产品往 jB 的运价为 ijc 。
询问:应如何组织运输才能使总运费 小?
问题分析
可控因素:从仓库 iA 运往 jB 的产品数量设为 xij, 1
i 2, 1 j 4。
![Page 13: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/13.jpg)
13
目标:总运费 小。费用函数
2
1
4
1i jijij xc
约束条件:从每个仓库运出总量不超过其可用总量,
运入每个零售点的数量不低于其需求量。
由于总供给量等于总需求量,所以都是等号。即 2,1;4321 iaxxxx iiiii
4,3,2,1;21 jbxx jjj
蕴含约束:数量非负 4,3,2,1,2,1;0 jix ij
![Page 14: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/14.jpg)
14
运输问题的 LP
4,3,2,1=,2,1=,04,3,2,1=,=+
2,1=,=+++s.t.
min
21
4321
2
1=
4
1=
jixjbxxiaxxxx
xc
ij
jjj
iiiii
i jijij
≥
∑∑
说明:当变量为整数变量、ai和 bj都等于 1 时,运
输问题即变为二分图上的 小权重匹配问题,称为
Assignment(指派)问题。
![Page 15: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/15.jpg)
15
可证明, 小权重匹配问题和 大权重匹配问题是
等价的。
![Page 16: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/16.jpg)
16
LP的一般形式
![Page 17: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/17.jpg)
17
LP中各项的名称
njx j ,...,2,1; 为待定的决策变量,
),,,( 21 ncccc 为价值向量(或费用向量),
njc j ,...,2,1; 为价值系数(或费用系数),
),...,,( 21 mbbbb 为右端向量,
![Page 18: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/18.jpg)
18
矩阵
mnmm
n
n
aaa
aaaaaa
A
21
22221
11211
为系数矩阵。
LP的规范型和标准型
规范型(Canonical Form)
![Page 19: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/19.jpg)
19
0s.t.min
xbAx
xc
标准型(Standard Form)
0s.t.min
xbAx
xc
![Page 20: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/20.jpg)
20
基本概念
可 行 解 : 满 足 所 有 约 束 条 件 的 向 量 ),,( 21 nxxxx 。
可行域:所有的可行解的全体 0, xbAxxD 。
优解:在可行域中目标函数值 大(或 小)的
可行解。
优值: 优解的目标函数值** xcz ,其中 x*为
一个 优解。
![Page 21: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/21.jpg)
21
模型转换
LP的三种形式实际上是相互等价的,因为它们之间
可以进行相互转换。下面介绍转换的方法。
(1)去掉无限制变量
令无限制变量 jjj xxx ,其中
jj xx , 为非负变量。
(2)目标转换
求 大可以等价成求负的 小:
xcxc min max
![Page 22: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/22.jpg)
22
(3)等式约束变不等式约束
ininii bxaxaxa 2211
ininii bxaxaxa 2211
ininii bxaxaxa 2211 (4)不等式约束变等式约束
ininii bxaxaxa 2211
0,2211 iiininii sbsxaxaxa 其中 si 称为松弛变量(Slack Variable)。
![Page 23: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/23.jpg)
23
ininii bxaxaxa 2211
0,2211 iiininii sbsxaxaxa
其中 si 称为剩余变量(Surplus Variable)。
(5)不等式约束变不等式约束
ininii bxaxaxa 2211
ininii bxaxaxa 2211 或
ininii bxaxaxa 2211
![Page 24: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/24.jpg)
24
ininii bxaxaxa 2211
例 2.1.3 将 LP由一般型转为标准型
无限制2
1
21
21
21
21
05
2222s.t.
max
xx
xxxxxxxx
![Page 25: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/25.jpg)
s.t.min
1(
(2(2
(
31
1
1
31
ixx
xxxx
xx
25
0,7 )
))
)
4
43
43
4
ixx
xxxx
x
0
2
6
5
x
x
52
7
x
![Page 26: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/26.jpg)
26
2.2 可行区域与基本可行解
![Page 27: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/27.jpg)
27
本节内容
图解法
可行域的几何结构
基本可行解与基本定理
图解法
对于只有两个变量的线性规划问题可以用图解法
求解:
![Page 28: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/28.jpg)
28
1. 变量用直角坐标系中的点表示。 2. 约束条件用坐标系中的半空间或直线表示。 3. 可行区域是若干半空间的交,即一个凸多面体。 4. 目标函数用一组等值线表示,沿着增加或减少的方向
移动,与可行域 后的交点就是 优解。
![Page 29: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/29.jpg)
29
例 2.2.1 解线性规划
05
2222
s.t.
max
1
21
21
21
21
xxx
xxxx
xxz
![Page 30: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/30.jpg)
30
![Page 31: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/31.jpg)
31
图解法说明
如果等值线与某个约束对应的函数直线平行,则该
函数直线上的所有可行解都是 优解。
22 21 xx 22 21 xx
优解
521 xx
![Page 32: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/32.jpg)
32
线性规划是否有解的几种情形
可能出现的情况:
1. 可行域是空集(D = ),称问题无解或不可行。
2. 可行域 D ,但目标函数在可行域上无界,此时
称该问题无界(无 优解,有可行解)。
3. 可行域 D ,且目标函数在可行域上有界(有有
限的 优值),此时称该问题有 优解。
优解存在且唯一,则一定在顶点上达到。
![Page 33: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/33.jpg)
33
优解存在且不唯一,一定存在顶点是 优解。
问题:
如何找到顶点?
如何从一个顶点转移到另一个顶点?
可行域的几何结构
基本假设
凸集
可行域的凸性
![Page 34: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/34.jpg)
34
凸组合和凸集
凸组合:设 S Rn是 n 维欧氏空间的点集,x, y S
为 S 中的两个点,数 [0, 1]。则 x + (1 )y称为 x
与 y 的一个凸组合。
凸集:设 S Rn是 n 维欧氏空间的点集,若对任意
的 x, y S和任意的 [0, 1],都有 x + (1 )y S,
就称 S是一个凸集。
![Page 35: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/35.jpg)
35
凸组合(以 n = 2为例)
点 a 与 b 的一个凸组合构成 a 与 b 之间的一条线段。
设
1
1
yx
a,
2
2
yx
b。设 a 与 b 的凸组合为向量
yx
。由凸组合的定义,可知:
21
21
11
yyyxxx
。
![Page 36: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/36.jpg)
36
由每个方程解,可得:21
2
xxxx
,以及
21
2
xxxx
。
因此,21
2
21
2
yyyy
xxxx
,即21
21
2
2
xxyy
xxyy
。
![Page 37: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/37.jpg)
37
![Page 38: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/38.jpg)
38
线性规划的可行域是凸集
定理 2.2.1 线性规划的可行域 D = {x Rn | Ax = b, x
0}是凸集。
证明:
按定义证明。
任取 x, y D, [0, 1]。令 w = x + (1 )y。
由于 x 0, y 0, 0,故 w 0。 (1)
Aw = Ax + (1 )Ay
![Page 39: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/39.jpg)
39
= b + (1 )b = b。 (2)
(1), (2) w D。■
任意多个凸集的交还是凸集
定理 2.2.2 任意多个凸集的交还是凸集。
(证明留作练习。)
![Page 40: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/40.jpg)
40
术语
超平面: }{ bxaRxH n
半空间: }{ bxaRxH n ; }{ bxaRxH n
多面凸集(Polyhedron):
}1,;1,{ qpipbxapibxaRxS iiiin
多面体(Polytope):非空有界的多面凸集。
说明:“有界”指存在一个球,使得多面体是这个
![Page 41: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/41.jpg)
41
球的一个子集。因此,有界表明多面体的边界是闭合的,
而多面凸集可能存在在某一个方向上边界无界的情形。
顶点:设 S为凸集,x S,如果对任意 y, z S和 0
< < 1,都有 x y + (1 )z,则称 x 为 S 的顶点。
基本可行解及线性规划基本定理
基本可行解(bfs)的定义
线性规划的两个基本定理
使用代数的方法解 LP,需要解决的问题
![Page 42: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/42.jpg)
42
基本假设
考虑线性规划的标准形式:
0 s.t.
min
xbAx
xc
其中nmmn RARbRcx ,,, ,并且假定:
(1)可行域 }0,{ xbAxRxD n不空,
(2)系数矩阵 A是行满秩的,r(A) = m,否则的话可
以去掉多余约束。因此,可知 m n。
![Page 43: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/43.jpg)
43
(3)若 m = n,则线性方程组有唯一解,从而解 LP 变
为解线性方程组的问题。因此,一般地,可假设 m < n。
基本可行解(bfs)的定义
定义 2.2.5:设 B 是秩为 m 的约束矩阵 A 的一个 m
阶满秩子方阵,则称 B 为一个基;B 中的列向量称为基
向量(共 m个,线性无关)。
选定 A的一个基 B之后,A可相应的记为A = (B N)。
![Page 44: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/44.jpg)
44
变量 x中与基向量对应的 m个分量称为基变量,其
余的变量为非基变量。
一般地,可记
N
B
xx
x,其中 xB包含所有的基变量,
xN包含所有的非基变量。
令 xB = B–1b,xB = 0(所有的非基变量取值为 0),可
得一个“解”
0
1bBx
,称为相应于 B的基本解。
![Page 45: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/45.jpg)
45
注意:基本解 x 不一定是可行的。x 显然满足约束
Ax = b: bbBB
bBNBAx
00
11
;但 x 不一定
满足约束 x 0。因此,只要 B–1b 0,x 就是可行的。
当 B1b 0 时,称基本解 x 为基本可行解(basic
feasible solution),这时对应的基矩阵 B为可行基。
![Page 46: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/46.jpg)
46
退化与非退化
如果 bfs x其所有的基变量都是正的( 01 bB ),
则称该基可行解为非退化的,否则称为退化的。
如果一个线性规划的所有基可行解都是非退化的,
则该规划称为非退化的,否则称为退化的。
例子
问题
![Page 47: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/47.jpg)
47
0,515 2 22 2s.t.
min
521
421
321
21
ixixxx
xxxxxx
xx
系数矩阵
![Page 48: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/48.jpg)
48
100110102100112
A
(1)基矩阵(123)
011021112
B,
![Page 49: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/49.jpg)
49
11131
310
32
310
1B
,
914
1bB。 T00914x ,
bfs。
![Page 50: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/50.jpg)
50
(2)基矩阵(124)
011121012
B,
111320
31
310
31
1B
,
941
1bB。 T09041x ,bfs。
![Page 51: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/51.jpg)
51
(3)基矩阵(125)
111021012
B,
111
032
31
031
32
1B
,
922
1bB。 T90022 x ,不可行。
![Page 52: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/52.jpg)
52
(4)基矩阵(134)
001101012
B,
110201100
1B,
3125
1bB。 T031205 x ,不可行。
(5)基矩阵(135)
101001012
B,
110021010
1B,
![Page 53: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/53.jpg)
53
362
1bB。 T30602x ,bfs。
(6)基矩阵(145)
101011002
B,
1021
0121
0021
1B
,
![Page 54: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/54.jpg)
54
631
1bB。 T63001x ,不可行。
(7)基矩阵(234)
001102011
B,
210101
1001B
,
123
51bB
。 T012350 x ,不可行。
![Page 55: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/55.jpg)
55
(8)基矩阵(235)
101002011
B,
1210
0211
0210
1B
,
631
1bB。
T60310 x ,不可行。
![Page 56: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/56.jpg)
56
(9)基矩阵(245)
101012001
B,
101012001
1B,
362
1bB。 T36020x ,bfs。
(10)基矩阵(345)
100010001
B,
100010001
1B,
![Page 57: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/57.jpg)
57
522
1bB。 T52200x ,bfs。
![Page 58: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/58.jpg)
58
![Page 59: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/59.jpg)
59
定理:bfs的刻画
定理 2.2.3 设 x 为可行解。则,x 是 bfs x的正分
量所对应的 A 中的列线性无关。
证明:
设 x 的前 k个分量为正分量。即,
x = (x1, x2, …, xk, 0, …, 0)T, xj > 0, 1 j k。
对应的列:A1, A2, ..., Ak
() 由于 x是 bfs,只有基变量可能取正值。因此 x1, ...,
![Page 60: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/60.jpg)
60
xk均为基变量。
因此,A1, A2, ..., Ak是 xB的基 B的组成部分,必线性无
关。
() 由于 A1, A2, ..., Ak线性无关,且 r(A) = m,可知 k
m。
下面分两种情况(k = m 和 k < m)将 A 划分为(B N)。
若 k = m,则令 B = (A1 A2 ... Ak),B是 m阶满秩方阵。
令 N = (Ak+1 Ak+2 ... An)。于是 A = (B N)。
若 k < m,则由于 r(A) = m,必定可从 A中余下的 n – k
![Page 61: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/61.jpg)
61
列中挑选出 m – k 列,设为 Ak+1, ..., Am,使得 A1, ..., Ak,
Ak+1, ..., Am线性无关。令 B = (A1 ... Ak Ak+1 ... Am),N =
(Am+1 ... An),于是 A = (B N)。
令 xB = (x1 x2 ... xm)T, xN = (0 ... 0)
T,则
N
B
xx
x。
由于 x可行,因此
BNBN
B BxNxBxxx
NBAxb
,于是 xB = B1b。
![Page 62: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/62.jpg)
62
因此
0
1bBx
,即,x 是 bfs。■
推论 若(0 0 ... 0)T可行,则其为 bfs。
定理:bfs一一对应于可行域的顶点
定理 2.2.4 x是 bfs x是可行域 D的顶点。
证明:
设 x的前 k个分量取正值,其对应的列分别为A1, A2, …,
![Page 63: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/63.jpg)
63
Ak。即,x = (x1 x2 … xk 0 … 0)T
A1 A2 … Ak
()由定理 2.2.3,只需要证明 A1, A2, …, Ak线性无关。
反证。假设 A1, A2, …, Ak线性相关,则存在非零向量 =
(1 2 …k 0 … 0)T,使得j = 1..k j Aj = 0。
由 x 是可行解,可知j = 1..k xj Aj = b。
因此, > 0,有j = 1..k (xj j) Aj = b。
令 x1 = xj + j,x2 = xj j,则有 Ax1 = b 及 Ax2 = b。
因为1 j k,xj 0,因此当 > 0 取到充分小的时候,
![Page 64: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/64.jpg)
64
就有 x1 0以及 x2 0。
这表明 x1 D,x2 D(可行)。
由于 0,x1 x2。
由 x1和 x2的构造,x = 1/2 x1 + 1/2 x2。这表明 x可以
写成两个不相等的可行解的凸组合,与 x 是 D 的顶点
矛盾。
()只需要证 bfs x不能写成两个不相等的可行解的凸
组合。
反证。假设x1 D,x2 D,x1 x2, (0, 1),使得 x
![Page 65: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/65.jpg)
65
= x1 + (1 – )x2。
当 j k + 1 时,因为 xj = 0,x1j 0,x2j 0,故有 x1j = x2j
= 0。
由 Ax1 = b,Ax2 = b,可知 A(x1 – x2) = 0。
因此,j = 1..k (x1j – x
2j) Aj = 0。
又因为 x1 x2,x1j – x2j不全为 0。因此,A1, …, Ak线性
相关。
由定理 2.2.3可知,x不是 bfs,矛盾。 ■
![Page 66: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/66.jpg)
定定理 2.2.44证明中的选取
66
:
![Page 67: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/67.jpg)
67
一种选取方法如下所示。
选一个充分小的 > 0,使得j, |j| xj。
任取一个 j,考虑 xj + j。
若j 0,则 xj + j 0。
若j < 0,则 xj + j = xj |j| 0。
任取一个 j,考虑 xj j。
若j 0,则 xj j 0。
若j > 0,则 xj j = xj |j| 0。
![Page 68: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/68.jpg)
68
线性规划基本定理(一)
定理 2.2.5 LP若有可行解,则至少有一个基本可行
解。
证明:
设 x 是 LP 的任意一个可行解。
若 x = (0 0 … 0)T,则由定理 2.2.3之推论,x为 bfs,得
证。
否则,设 x 的非零分量为前 k 个,其对应的列分别为
![Page 69: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/69.jpg)
69
A1, A2, …, Ak。即,x = (x1 x2 … xk 0 … 0)T
A1 A2 … Ak
若 A1, A2, …, Ak线性无关,则由定理 2.2.3,x为 bfs,
得证。
否则(A1, A2, …, Ak线性相关),存在非零向量 = (1
2 …k 0 … 0)T,使得j = 1..k j Aj = 0。
由于1 j k,xj > 0,可取适当小的正数,使得
xj j 0, 1 j k 且上述诸式(2k个)中至少有一个取等号。
![Page 70: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/70.jpg)
70
由于 A(x ) = Ax A = Ax = b,可知 x + 和 x
均为 LP的可行解。
于是在 x + 和 x 中就有一个解是 LP的可行解,
且其非零分量的数目比 x至少少一个。
在这个解上继续上述证明过程,得到一系列的非零分
量数目逐步减少的可行解。
后总可以在一个全 0 或非零分量对应的列向量线性
无关的可行解上结束,这样的解必为 bfs。证毕。
![Page 71: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/71.jpg)
71
线性规划基本定理(二)
定理 2.2.6 一个 LP,若其目标函数在可行域 D上有
界,则一定存在一个 bfs是 优解。
证明:
因为可行域非空且目标函数有界,故 LP 存在 优解。
设 x*是 LP 的一个 优解。
若 x*为全 0或非零分量对应的列向量线性无关,则 x*
是 bfs,定理得证。
![Page 72: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/72.jpg)
72
否则,可按定理 2.2.5证明之方法构造两个可行解 x* +
和 x* ,且其中至少有一个解其非零分量的个
数比 x*少。
由于 x*为 优解,因此
cTx* cT(x* + ) = cTx* + cT cT 0,
cTx* cT(x* ) = cTx* cT cT 0,
因此 cT = 0,从而 cT(x* ) = cTx*。
这表明 x* + 和 x* 都是 优解。
从 x* + 和 x* 的非零分量数目少的那个解上,
![Page 73: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/73.jpg)
73
继续上述证明过程,得到一系列的非零分量数目逐步
减少的 优解。
后总可以在一个全 0 或非零分量对应的列向量线性
无关的 优解上结束。这样的 优解必为 bfs。证毕。
要点
基本可行解不一定都是 优解, 优解不一定都是基
本可行解。
![Page 74: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/74.jpg)
74
如果有两个基本可行解是 优解,则它们的凸组合也
是 优解。
如果 优解不唯一,则会有多个基本可行解是 优解,
它们必然在同一个面上。
bfs个数有限,可以在 bfs中寻找 优解。
剩余的问题是如何判断一个 bfs是 优解?
如果不是,则如何从一个 bfs转到另一个 bfs?
![Page 75: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/75.jpg)
75
2.3 单纯形算法
![Page 76: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/76.jpg)
76
本节内容
理论方法
算法步骤
单纯形表
算例
![Page 77: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/77.jpg)
77
典式
观察标准型的 LP 0s.t.min T
xbAx
xc
。
假设 B = (AB(1), AB(2), ..., AB(m))是一个约束矩阵 A的一
个基(满秩矩阵)。不失一般性,可假设 B 正好由 A 的
前 m个列向量组成,即 B(i) = i,i。
![Page 78: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/78.jpg)
78
将向量 x 按照 B 分块为
N
B
xx
。在等式约束 Ax = b
两端左乘 B1,则等式约束变为: bBNxBx NB11 (典
式),即 NB NxBbBx 11 。
检验数向量
于是,目标函数可写为
NNBB xcxcxc = NNNB xcNxBbBc )( 11
![Page 79: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/79.jpg)
79
= NNBB xcNBcbBc )( 11 。
记 NBN cNBc 1T ,令 0T B ,即
T1TTTT 0 NBNB cNBc ,
称为检验数向量。
于是,目标函数可进一步写为
xcT = NNBB xcNBcbBc )( 11 = xbBcB
1。
![Page 80: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/80.jpg)
80
LP相对于基 B的等价形式
于是原规划 0s.t.min T
xbAx
xc
等价于
0s.t.min
11
1
xbBNxBx
xbBc
NB
B
,这是在单纯形算法中使用
的形式。
![Page 81: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/81.jpg)
81
检验数向量的计算: T1TTTT 0 NBNB cNBc
T1TT1TNBBB cNBccBBc
TT1T1TNBBB ccNBcBBc
T1T cNBBcB
T1T cABcB 。
完整的单纯形表
下面将 LP 组织在称为单纯形表的表格中。
![Page 82: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/82.jpg)
82
引入一个新的变量 z,令 z = cBTB–1b – Tx,即 z + Tx
= cBTB–1b,将目标函数转换到约束中。原 LP 就是 小化
z,即:
0
s.t.min
11
1
xbBNxBx
bBcxzz
NB
B
。
将该 LP的约束矩阵组织在表格中,就得到完整的单
纯形表。
![Page 83: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/83.jpg)
83
z 1x … rx … mx 1mx … kx … nx
z 1 0 … 0 … 0 1m … k … n bcB
1x 0 1 … 0 … 0 1,1 ma … ka1 … na1 1b
rx 0 0 … 1 … 0 1, mra … rka … rna rb
mx 0 0 … 0 … 1 1, mma … mka … mna mb
![Page 84: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/84.jpg)
84
目标函数值
注意到 0
00
TTT
B
Nx
x ,因此 LP 的目标函数值
z = cTx = cBTB–1b – Tx = cB
TB–1b。即,单纯形表右上角的
bBcB1就是当前解 x 的目标函数值。
单纯形算法的基本思想
假设对于当前选取的基 B,满足 xB = B–1b 0。则现
![Page 85: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/85.jpg)
85
在就有了一个初始的 bfs。但这个 bfs 不一定是 优的。
单纯形算法,使用一个简单的规则来判定当前 bfs 是否
优的,并且在不是 优的情形下,通过转换当前的基,
更换到一个相邻的更优的(目标函数值更小的)bfs。当
当前 bfs的邻居 bfs都不比它更优时,当前的 bfs就是
优的,此时单纯形算法结束并输出 优解。
代数化的单纯形算法示例
在给出具体的(表格化的)单纯形算法之前,先通
![Page 86: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/86.jpg)
86
过一个例子看一下代数化的单纯形算法。
例 2.2.1的 LP的标准型为:
0,515 2 22 2s.t.
min
521
421
321
21
ixixxx
xxxxxx
xx
将第一行约束乘以1,并将目标函数转化成一个新
的约束,就得到
![Page 87: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/87.jpg)
87
0,515 2 2 2 2 0 s.t.
min
521
421
321
21
ixixxx
xxxxxx
xxzz
选取
100010001
543 AAAB,
522
5
4
3
xxx
xB,
![Page 88: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/88.jpg)
88
就得到一个初始的 bfs x = [0 0 2 2 5]T。
迭代 1
回忆第 0 行为
z + Tx = cBTB–1b
即
z + 0xB + NTxN = cB
TB–1b
若j,都有j 0,则增加任何一个非基变量都不能
改进(减少)当前的 z(因为 z = cBTB–1b – 0xB – N
TxN)。
由此,得到 优性准则:若所有j 0,则当前 bfs就是
![Page 89: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/89.jpg)
89
优的。
现在,第 0行相当于
z = 0 + x1 – x2 注意到 x1和 x2均为非基变量,它们的值均为 0。要
减少目标函数值 z,可减少 x1或增加 x2。由于所有变量
(不含 z)均为非负变量,因此只能增加 x2。由于可以
通过增加 x2来减少 z,因此当前 bfs不是 优的。
那么 x2可以增加多少呢?
固定 x1 = 0。则有
![Page 90: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/90.jpg)
90
第 1 行:x3 = 2 – x2 0 x2 2/1 = 2
第 2 行:x4 = 2 + 2x2 0 x2无上界
第 3 行:x5 = 5 – x2 0 x2 5/1 = 5
因此,x2 能够增加到 2,而不违反所有的功能约束
和变量约束。由此,可得到增加非基变量的 小比值测
试方法:要增加的非基变量可以增加到的值为
miaab
ikik
i ,...,2,1,0|min。
x2 增加到 2 时,成为新的基变量;相应地,x3 变
![Page 91: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/91.jpg)
91
为 0,成为新的非基变量。
原 bfs:非基变量 x1 = 0,x2 = 0;
基变量 x3 = 2,x4 = 2,x5 = 5。
新 bfs:非基变量 x1 = 0,x3 = 0;
基变量 x2 = 2,x4 = ?,x5 = ?
为求出新的基变量 x4和 x5的值,只需要解下列线性
方程组:
![Page 92: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/92.jpg)
92
5 2 2 2 2 0
521
421
321
21
xxxxxx
xxxxxz
由于包含未知量的第 2 行和第 3 行含有变量 x2,而
其值不为 0,因此只需要做一次高斯消元即可:将第 2
行、第 3 行,以及目标函数值所在的第 0 行的 x2消去。
![Page 93: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/93.jpg)
93
3 3 6 2 3 2 2 2
531
431
321
31
xxxxxx
xxxxxz
迭代 2
优性测试
由于并不是所有j 都 0,因此无法判定当前 bfs
为 优解。
由于 z = –2 – x1 + x3,可以通过增加 x1来减少 z。
![Page 94: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/94.jpg)
94
小比值测试
固定 x3 = 0。
第 1 行:x2 = 2 + 2x1 0 x1无上界
第 2 行:x4 = 6 + 3x1 0 x1无上界
第 3 行:x5 = 3 – 3x1 0 x1 3/3 = 1
因此,x1需要增加到 1,相应地,x5变为 0。
原 bfs:非基变量 x1 = 0,x3 = 0;
基变量 x2 = 2,x4 = 6,x5 = 3。
新 bfs:非基变量 x3 = 0,x5 = 0;
![Page 95: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/95.jpg)
95
基变量 x1 = 1,x2 = ?,x4 = ?
131
31
9
432
31
331
32
531
543
532
53
xxx
xxx
xxx
xxz
迭代 3
优性测试
![Page 96: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/96.jpg)
96
现在,所有j都 0,当前 bfs为 优解。
下面,我们给出一般性的单纯形算法,并对其进行
理论分析。
单纯形算法 – Simplex
1. 找一个初始可行基 B。
2. 求出典式和检验数向量。
3. 令 },...,2,1max{arg njk j 。
![Page 97: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/97.jpg)
97
4. 如果0k 则当前 bfs就是 优解,停止。
5. 如果 0kA ,则问题无界,停止。
6. 令
miaabr ik
ik
i ,...,2,1,0|minarg。
7. 以 Ak替代 B中的第 r列(即,B(r) k),得到一个
新的基 B,转第 2 步。
![Page 98: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/98.jpg)
98
实际使用的单纯形表
当手工运行单纯形算法时,可在表格上方便地完成。
单纯形算法在不断地换基的过程中,变量 z 所对应的列
的各元素均不会改变(变量 z不在向量 x 中),因此可将
表格中变量 z 的列去掉,得到实际使用的单纯形表:
![Page 99: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/99.jpg)
99
1x … rx … mx 1mx … kx … nx
0 … 0 … 0 1m … k … n bcB
1x 1 … 0 … 0 1,1 ma … ka1 … na1 1b
rx 0 … 1 … 0 1, mra … rka … rna rb
mx 0 … 0 … 1 1, mma … mka … mna mb
![Page 100: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/100.jpg)
100
总结:获得初始单纯形表
(1)将 LP 转为标准型。
(2)构造表格:
x1 x2 x3 xn
cT 0
A b (3)选取 A 中的若干列为基,用初等行变换将这些列
变为单位阵,检验数行一同参与变换。得到初始单纯形
![Page 101: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/101.jpg)
101
表:
x1 x2 x3 xn
cBTB1A cT cB
TB1b
xB B1A B1b
旋转操作 ‐ xk进基,xr出基
通过矩阵行初等变换,将 rka 变为 1,将第 k 列其余各
元素变为 0。 换基时,对典式进行的行初等变换也适用于第 0 行。
![Page 102: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/102.jpg)
102
这样可以在单纯形表上用统一的格式计算出对应于新
基 B 的各元素 ija 、检验数 j 和目标函数值 0z 。 1x … rx … mx 1mx … kx … nx
0 … 0 … 0 1m … k … n bcB
1x 1 … 0 … 0 1,1 ma … ka1 … na1 1b
rx 0 … 1 … 0 1, mra … rka … rna rb
mx 0 … 0 … 1 1, mma … mka … mna mb
![Page 103: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/103.jpg)
103
旋转操作之后
1x … rx … mx 1mx … kx … nx
0 … r … 0 1ˆ
m … 0 … n bcBˆ
1x 1 … ra1ˆ … 0 1,1ˆ ma … 0 … na1ˆ 1b
kx 0 … rra … 0 1,ˆ mra … 1 … rna rb
mx 0 … mra … 0 1,ˆ mma … 0 … mna mb
![Page 104: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/104.jpg)
104
旋转操作之后单纯形表上各元素的值
(1)第 r 行元素都除以了 rka :rk
rjrj a
aa ˆ
,rk
rr a
bb ˆ。
(2)其余各行受变换的影响,各元素的值均发生了变
化。新的第 i(i r)行 = 原第 i行 + 第 r 行 ika 。
(2.1)第 0行: k
rk
rjjj a
a ˆ
, k
rk
rBB a
bbcbc TT ˆ。
(2.2)除第 0 行和第 r 行外的其余各行(i 0, r):
![Page 105: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/105.jpg)
105
ikrk
rjijij a
aa
aa ˆ,
ikrk
rii a
abbb ˆ
。
例 2.2.1
0,515 2 22 2s.t.
min
521
421
321
21
ixixxx
xxxxxx
xx
![Page 106: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/106.jpg)
106
x1 x2 x3 x4 x5
1 1 0 0 0 0
x3 2 1 1 0 0 2
x4 1 2 0 1 0 2
x5 1 1 0 0 1 5
将第 1行乘以1,即得到初始的单纯形表。
x1 x2 x3 x4 x5
1 1 0 0 0 0
x3 2 1 1 0 0 2
![Page 107: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/107.jpg)
107
x4 1 2 0 1 0 2
x5 1 1 0 0 1 5
验证:
cT = (1 1 0 0 0),
100010001
B,
522
b。
xB = (x3 x4 x5)T = B–1b = (2 2 5)T,xN = (x1 x2)T = (0 0)T。
检验数 TT1T1TT 000 ccABcABcB -- 。
![Page 108: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/108.jpg)
108
目标函数值 0
522
0001
bBcz T
B。
100110102100112
100110102100112
100010001
1AB
。
迭代 1:
![Page 109: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/109.jpg)
109
由于2 = 1 > 0,所以该基可行解不是 优解,同时
系数矩阵该列有大于 0 的元素,所以取 x2为入基变量。
计算 r = argmin{2/1, 5/1} = 1,所以取第 1 个约束对
应的基变量 x3为出基变量。
在上表中把 x2对应的列变成单位向量,系数矩阵第
1 行对应的元素为 1,则可以得到新的基可行解的单纯
形表:
x1 x2 x3 x4 x5
1 0 1 0 0 2
![Page 110: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/110.jpg)
110
x2 2 1 1 0 0 2
x4 3 0 2 1 0 6
x5 3 0 1 0 1 3
迭代 2:
由于1 = 1 > 0,所以该基可行解不是 优解,同时
系数矩阵第 k = 1 列有大于 0的元素,所以取 x1为进基
变量。
计算 r = argmin{3/3} = 3,所以取第 3个约束对应的
基变量 x5为出基变量。
![Page 111: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/111.jpg)
111
在上表中把系数矩阵第 3行第 1列对应的元素为 1,
x1对应的第 1 列变成单位向量,则得到新的单纯形表:
x1 x2 x3 x4 x5
0 0 2/3 0 1/3 3
x2 0 1 1/3 0 2/3 4
x4 0 0 1 1 1 9
x1 1 0 1/3 0 1/3 1
由于检验数都小于等于 0,所以该基可行解是 优
解,对应的 优解为(1, 4, 0, 9, 0)T, 优值为3。
![Page 112: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/112.jpg)
112
![Page 113: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/113.jpg)
113
例 2.3.1
求解问题
5,...,2,1 ;021322
s.t.
2 min
532
432
321
32
jxxxxxxxxxx
xxz
j
初始单纯形表:
![Page 114: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/114.jpg)
114
以 x1、x4和 x5为基变量就可以得到初始基可行解
(2, 0, 0, 1, 2)T,其对应的单纯形表为:
x1 x2 x3 x4 x5
0 1 2 0 0 0
x1 1 2 1 0 0 2
x4 0 1 3 1 0 1
x5 0 1 1 0 1 2
迭代 1:
由于 012 ,所以该基可行解不是 优解,同时
![Page 115: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/115.jpg)
115
系数矩阵该列有大于 0 的元素,所以取 x2为入基变量。
计算 1},min{ 12
11 ,所以取第 2个约束对应的基
变量 x4为出基变量,就可以得到一个新的基可行解。
在上表中把 x2对应的列变成单位向量,系数矩阵第
2 行对应的元素为 1,则可以得到该基可行解的单纯形
表:
x1 x2 x3 x4 x5
0 0 1 1 0 1
x1 1 0 5 2 0 2
![Page 116: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/116.jpg)
116
x2 0 1 3 1 0 1
x5 0 0 2 1 1 2
迭代 2:
由于 013 ,所以该基可行解不是 优解,同时
系数矩阵该列有大于 0 的元素,所以取 x3为入基变量。
计算 = 1/2,所以取第 3 个约束对应的基变量 x5为
出基变量,就可以得到一个新的基可行解。
在上表中把 x3对应的列变成单位向量,系数矩阵第
3 行对应的元素为 1,则可以得到该基可行解的单纯形
![Page 117: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/117.jpg)
117
表:
x1 x2 x3 x4 x5
0 0 0 1/2 1/2 3/2
x1 1 0 0 1/2 5/2 13/2
x2 0 1 0 1/2 3/2 5/2
x5 0 0 1 1/2 1/2 1/2
由于检验数都小于等于 0,所以该基可行解就是
优解,对应的 优解为
0,0,
21,
25,
213
, 优值为 23
。
![Page 118: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/118.jpg)
118
几点说明
1. 单纯形算法在实际应用中非常有效,被广泛采用,
但其运行时间在 坏情况下不是多项式的。
2. 现在还有待解决的问题是如何选择初始基,以及
出现退化的时候如何处理。
![Page 119: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/119.jpg)
119
例 2.3.2
51 021
21
21
25
23
21
213
25
21 s.t.
2min
543
542
541
32
ix
xxx
xxx
xxx
xxz
i
x1 x2 x3 x4 x5
![Page 120: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/120.jpg)
120
0 1 2 0 0 0
x1 1 0 0 1/2 5/2 13/2
x2 0 1 0 1/2 3/2 5/2
x3 0 0 1 1/2 1/2 1/2
选择约束矩阵 A 的前 3 列为基,使用行初等变换得到
初始单纯形表。 x1 x2 x3 x4 x5
0 0 0 3/2 5/2 7/2
![Page 121: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/121.jpg)
121
x1 1 0 0 1/2 5/2 13/2
x2 0 1 0 1/2 3/2 5/2
x3 0 0 1 1/2 1/2 1/2
由于 4 > 0, 04 A ,因此原 LP 无界。
理论方法
设 x 为 LP 的一个 bfs。特别地,取上面推导中的基
B为 x 的基,则有如下定理成立。
定理 2.3.1( 优性准则)如果检验数向量 0 ,
![Page 122: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/122.jpg)
122
则基可行解 x 为原问题的 优解。
定理 2.3.2 如果检验数向量 的第 k个分量 0k ,
而和k对应的列向量 01 kk ABA ,则原问题无界。
定理 2.3.3 对于非退化的基本可行解 x ,若检验数
向量 的第 k 个分量 0k ,而向量 kAB 1至少有一个
正分量,则可以找到一个新的基本可行解 x 使得
xcxc ˆ 。
![Page 123: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/123.jpg)
123
定理 2.3.1 – 判定当前 bfs为最优
定理 2.3.1 若检验数向量 0 ,则对应的 bfs x 为
优解。
证明:
令 B为 x 的基,LP写为相对于 B的典式。
于是, x 的目标函数值为 bBcxc B1TT 。
而任给一个可行解 x,因为 0T , 0x ,其目标函
数值 bBcxbBcxc BB1TT1TT 。
![Page 124: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/124.jpg)
124
定理 2.3.2 – 判定 LP无界
定理 2.3.2 如果向量 的第 k 个分量 0k ,而向
量 01 kk ABA ,则原问题无界。
证明:
不失一般性,假设基 B由 A的前 m列组成。
由于 0TB ,故 m + 1 k n。
令 kk e
Ad
0 ,在此 ek为第 k 个分量为 1,其余分
![Page 125: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/125.jpg)
125
量都为 0 的 n 维向量。则 d 0 且
00
1
kkkk AAeNB
ABNBAd
。
设 > 0为任一正数。考察向量 dx 。
由于 bAdxAdxA 以及 0 dx ,因此
dx 是一个可行解。
kk
NB eAB
ccxcdxc0
1TT
![Page 126: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/126.jpg)
126
= kkB cABcxc 1T
= kxc (因为
T1T cABcB )
因为 k > 0,当 时, dxc 。□
例
对于例 2.3.2的单纯形表,有 k = 4,
![Page 127: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/127.jpg)
127
002/12/52/13
x
,
012/12/12/1
01000
002/12/12/1
0 kk e
Ad
。
![Page 128: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/128.jpg)
128
0
2/2/12/2/52/2/13
dx
。
![Page 129: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/129.jpg)
129
0
2/2/12/2/52/2/13
00210T
dxc
23
271
21
25
。
![Page 130: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/130.jpg)
130
定理 2.3.3 – 找下一个更好的 bfs
定理 2.3.3 对于非退化的基本可行解 x ,若向量
的第 k个分量 0k ,而向量 kA 至少有一个正分量,则
可以找到一个新的基本可行解 x 使得 xcxc ˆ 。
证明:
只需要将 x 找出来。
不失一般性,假设 B由 A的前 m列组成,而 m + 1 k
n。
![Page 131: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/131.jpg)
131
令 kk e
Ad
0 。ek为第 k 个分量为 1,其余分量全
为 0 的向量。则有:
00
1
kkkk AAeNB
ABNBAd
。
令 rk
rik
ik
i
abmia
ab
1 ,0|min。由于
0b
x是
非退化的,可知 0b ,因此 0 。
令 dxx ˆ 。则 bAdxAxA ˆ 。
![Page 132: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/132.jpg)
132
由定义,
kk
kk e
Abe
Abdxx
000ˆ
。
(1) 1 i m,若 ika 0,则 0ˆ ikii abx 。
(2) 1 i m,若 ika > 0,则
0ˆ ikik
iiik
rk
rii a
abba
abbx
。且,0ˆ rk
rk
rrr a
abbx
。
![Page 133: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/133.jpg)
133
x1 … xr … xm xm+1 … xk … xn
1 … 0 … m m+1 … k … n z
1x ... … 0 ... ... … … ... … … 1b
rx ... … 1 … ... … … rka … … rb
mx ... … 0 … ... … … ... … … mb
![Page 134: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/134.jpg)
134
x1 … xr … xm xm+1 … xk … xn
1 … r … m m+1 … 0 … n krk
r
abz
1x ... … ... ... ... … … 0 … … ikrk
ri a
abb
kx ... … rka1
… ... … … 1 … … rk
r
ab
mx ... … ... … ... … … 0 … … mkrk
rm a
abb
![Page 135: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/135.jpg)
135
(3) m + 1 i n,i k, 0ˆ ix 。
(4) 0ˆ kx 。
(1),(2),(3),(4) 0ˆ x ,因此 x是一个可行解。
下面证 x是基本可行解。由定理 2.2.3,只需证 x的正
分量所对应的 A中的列向量线性无关。
由上述分析,x的正分量只可能出现在 1x , …, 1ˆ rx , kx ,
1ˆ rx , …, mx 中。因此,若能证明列向量 A1, ..., Ar 1, Ak,
Ar + 1, ..., Am线性无关,则 x为 bfs。
![Page 136: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/136.jpg)
136
反证。假设它们线性相关。由于 A1, A2, …, Am本来是
线性无关的(它们是 x 的基),这表明 Ak可由 A1, ..., Ar
1, Ar + 1, ..., Am线性表出。
则存在 m 1个数 yi,i = 1, ..., m, i r,使得
rimi
iik AyA,1 。
又由 kk ABA 1 ,可知
![Page 137: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/137.jpg)
137
m
iiik
k
k
mkk Aaa
aAAABA
12
1
1 ,, 。
上述两式后式减前式,得: 0
,1
rimi
iiikrrk AyaAa。
由于 0rka ,因此 A1, ..., Am线性相关,与它们是 x 的
基矛盾。
由定理 2.3.2 之证明, kxcxc ˆ 。由于 0 ,
0k ,目标函数值 xcxc ˆ 。□
![Page 138: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/138.jpg)
138
例 1
对于例 2.2.1的第 1张单纯形表, T52200x ,
k = 2, = 2。
121
10
00010
121
00
22 eAd
,
![Page 139: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/139.jpg)
139
36020
242
20
52200
ˆ dxx
。
例 2
对于例 2.2.1的第 2张单纯形表, T36020x ,
k = 2, = 2。
![Page 140: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/140.jpg)
140
33021
00001
33020
22 eAd
,
![Page 141: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/141.jpg)
141
09041
33021
36020
ˆ dxx
。
![Page 142: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/142.jpg)
142
2.4 两阶段单纯形算法
![Page 143: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/143.jpg)
143
两阶段法
两阶段法解决如何找到单纯形算法的第一个基本可
行解(即初始解)的问题。
该方法的第一个阶段找一个初始解,第二阶段运行
基本的单纯形算法,故称为“两阶段法”。
![Page 144: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/144.jpg)
144
辅助问题
设原问题为
0s.t.
min
xbAx
xcz
。不妨假设 0b 。
考虑如下问题(辅助问题)
![Page 145: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/145.jpg)
145
0 ,0s.t.
min1
a
a
mn
nii
xxbxAx
xg
,
其中
),...,,( 21 mnnna xxxx 。
基本思想
引理 记原 LP的可行域为D,辅助 LP的可行域为D’。
则有: 0 * gD 。
![Page 146: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/146.jpg)
146
证明:
() D 0,, xbAxx 。令
0x
x,则 Ax + 0 =
b,x’ 0,因此 x’ D’。
由 g(x’) = 0,又因为 g(.) 0,可知 g* = 0。
()不妨令使 g* = 0的解为
axx~~
。由于0~
~
axx
g,
可知 0~ ax 。因此, ~ bxA ,即 Dx ~。
![Page 147: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/147.jpg)
147
求辅助 LP的最优解得到原 LP的 bfs
1. 如果原 LP 有可行解,则辅助 LP 的 优值为 0,
反之亦然。
2.由于 b 0,所以以
),...,,( 21 mnnna xxxx 为
基变量,就可以得到辅助 LP 的初始基可行解 ),0( b 。
3.由于辅助 LP 有可行解,且 g(.) 0,即目标函数
有下界,所以辅助 LP一定有 优解。
![Page 148: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/148.jpg)
148
求辅助 LP的三种情况
使用单纯形法,解辅助 LP,得其 优基可行解
)~,~( axx 。
(1)g* = 0且所有人工变量均为非基变量,则此时
x~ 是原 LP的基可行解。
由于 优值为 0,可知 0~ ax ,所以 x~ 是原 LP的可
行解。
由于 )~,~( axx 是辅助 LP 的基可行解,所以其非零分
![Page 149: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/149.jpg)
149
量(均在 x~ 中)对应系数矩阵的列向量线性无关,所以
x~ 是原 LP的基可行解。
(2)g* = 0但某些人工变量为基变量。
(3)g* > 0,则原 LP 没有可行解。
g* = 0,但存在人工变量为基变量
设第一阶段的 优单纯形表如下: x1 … xs … xn xn+1 … xB(r) … xn+m
1 … s … n n+1 … B(r) … n+m 0
![Page 150: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/150.jpg)
150
xB(1) ... … ... ... ... … … 0 … … 1b
xB(r) ... … rsa … ... … … 1 … … rb
xB(m) ... … ... … ... … … 0 … … mb
设人工变量 xB(r)是一个基变量(n + 1 B(r) n + m)。
考察第 r行原变量所对应的前 n个元素,即 rnr aa ,,1 。
有两种情况:(1)它们不全为 0。(2)它们全为 0。
![Page 151: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/151.jpg)
151
两种情况(1)
(1) 1ra , .., rna 不全为 0。
不妨设 rsa 0。以 rsa 为转轴元进行一次旋转变换,使
人工变量 xB(r)出基,原变量 xs进基,则在基变量中减
少了一个人工变量。
注 1:xs自然为非基变量。反证。假设 xs为基变量,
则 sA 列为单位矩阵的一列。由于 xB(r)为基变量, sA 不
能与 )(rBA 相同,因此 sA 列包含的 1 不在第 r 行,即
![Page 152: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/152.jpg)
152
0rsa ,矛盾。
注 2:此时不要求 rsa > 0。并且,在变换之前人工变量
xB(r)为基变量,由于 g* = 0,因此 rb = 0,于是 = 0,因
此该旋转变换不会改变 优解值,即旋转之后的解仍
然是 优解。
两种情况(2)
(2) 1ra , .., rna 全为 0。
![Page 153: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/153.jpg)
153
这表明
mnm
n
aa
aaA
1
111
中第 r行为全 0,即 mAr 。
因此 mArAr ,即第 r 个约束方程是多余的,将
其删去即可。人工变量 xB(r)自然出基,当前的基余下
的列构成新的基。
重复以上过程(1)(2),直到基变量中没有人工变
量,则获得了原 LP 的一个基可行解。
![Page 154: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/154.jpg)
154
两阶段单纯形算法
1 原问题化为标准型。行变换,使 b 0。
2 添加人工变量,得到辅助问题。
3 使用人工变量作为初始的基,构造辅助问题的初始
单纯形表。在该表中同时也包含原问题的检验数行。
4 使用单纯形算法求解辅助问题。(第一阶段)
5 若求得辅助问题 优解值 g* > 0,则原问题无可行解,
结束。
![Page 155: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/155.jpg)
155
6 (否则g* = 0。)若某些人工变量为基变量,则调整,
直到没有人工变量为基变量。
7 去掉当前单纯形表上的辅助问题的检验数行和人工
变量对应的列,得到原问题的单纯形表。此时已有
一个初始的基可行解。
8 (第二阶段)运行单纯形算法,解原问题。 后或
判断得原问题无界,或求到 优解。
![Page 156: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/156.jpg)
156
例 2.4.1
求解
jxxxxx
xxxx
xxz
j ;01 22 6
s.t.
215 min
5321
4321
31
。
首先引入人工变量,考虑辅助 LP
![Page 157: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/157.jpg)
157
jxxxxxx
xxxxx
xxz
j ;01 22 6
s.t.
min
75321
64321
76
。
第 1 阶段:
将约束矩阵、右端向量、原 LP 的价值向量、辅助
LP的价值向量组织在单纯形表中:
x1 x2 x3 x4 x5 x6 x7
z ‐5 0 ‐21 0 0 0 0 0
![Page 158: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/158.jpg)
158
g 0 0 0 0 0 ‐1 ‐1 0
x6 1 ‐1 6 ‐1 0 1 0 2
x7 1 1 2 0 ‐1 0 1 1
以人工变量 x6、x7为基变量,通过行变换将 x6、x7对应的检验数消为 0,得到新的单纯形表。
x1 x2 x3 x4 x5 x6 x7
z 5 0 21 0 0 0 0 0
g 2 0 8 1 1 0 0 3
x6 1 1 6 1 0 1 0 2
![Page 159: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/159.jpg)
159
x7 1 1 2 0 1 0 1 1
下面运行第一阶段的单纯形算法,求辅助问题的
优解。此时注意的是两行检验数都参与旋转变换。
x1 x2 x3 x4 x5 x6 x7
z 3/2 ‐7/2 0 ‐7/2 0 21/6 0 7
g 2/3 4/3 0 1/3 1 4/3 0 1/3
x3 1/6 1/6 1 1/6 0 1/6 0 1/3
x7 2/3 4/3 0 1/3 1 1/3 1 1/3
x1 x2 x3 x4 x5 x6 x7
![Page 160: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/160.jpg)
160
z 1/4 0 0 21/8
21/8
21/8 21/8 63/8
g 0 0 0 0 0 1 1 0
x3 1/4 0 1 1/8 1/8 1/8 1/8 3/8
x2 1/2 1 0 1/4 3/4 1/4 3/4 1/4
第 1 阶段结束,得到辅助问题的 优基可行解 x* = (0,
1/4, 3/8, 0, 0, 0, 0)T,且人工变量 x6、x7都不在基中。
第 2阶段
在单纯形表中去掉辅助 LP 的检验数行和人工变量对
![Page 161: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/161.jpg)
161
应的列,开始第 2 阶段的单纯形算法。
x1 x2 x3 x4 x5
z 1/4 0 0 21/8
21/8
63/8
x3 1/4 0 1 1/8 1/8 3/8
x2 1/2 1 0 1/4 3/4 1/4
x1 x2 x3 x4 x5
z 0 1/2 0 11/4
9/4 31/4
x3 0 1/2 1 1/4 1/4 1/4
x1 1 2 0 1/2 3/2 1/2
![Page 162: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/162.jpg)
162
求到 优解 x* = (1/2, 0, 1/4, 0, 0)T, 优解值为 31/4。
例,最短路问题
e1
e2 e5
e4 e3 s
a
t
b
1
2 2
3
1
![Page 163: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/163.jpg)
163
在边 ei上定义变量 xi,表示在该边上(沿边的方向)
的流量;
除 s、t 外,其余每个顶点上都流守恒,即进入的流量
和流出的流量相等。
离开 s的流量为 1,进入 t 的流量为 1。
短路问题的 LP:
![Page 164: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/164.jpg)
164
ixxxt
xxxbxxxa
xxsxxxxxz
i
01)(
0)(0)(1)(s.t.
322 min
54
532
431
21
54321
解(1),第 1 阶段:
当所有 n 个顶点都流守恒时,其中一个顶点的流守恒
约束可以去掉。因此,将顶点 t 的行去掉。
![Page 165: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/165.jpg)
165
由于约束矩阵第 4 列、第 5 列已经是单位矩阵的列,
因此只增加一个人工变量。
得辅助问题的 LP(标准型)如下:
x1 x2 x3 x4 x5 x6
z 1 2 2 3 1 0 0
g 0 0 0 0 0 1 0
x6 1 1 0 0 0 1 1
x4 1 0 1 1 0 0 0
x5 0 1 1 0 1 0 0
![Page 166: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/166.jpg)
166
将基变量的列的检验数消为 0:
x1 x2 x3 x4 x5 x6
z 4 3 0 0 0 0 0
g 1 1 0 0 0 0 1
x6 1 1 0 0 0 1 1
x4 1 0 1 1 0 0 0
x5 0 1 1 0 1 0 0
x1 x2 x3 x4 x5 x6
z 0 1 0 0 0 4 4
![Page 167: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/167.jpg)
167
g 0 0 0 0 0 1 0
x1 1 1 0 0 0 1 1
x4 0 1 1 1 0 1 1
x5 0 1 1 0 1 0 0
第 1 阶段求到辅助 LP的 优解,解值为 0,且没有人
工变量是基变量。
删除辅助问题的检验数行和人工变量列,开始第 2 阶
段。
解(1),第 2 阶段:
![Page 168: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/168.jpg)
168
x1 x2 x3 x4 x5
z 0 1 0 0 0 4
x1 1 1 0 0 0 1
x4 0 1 1 1 0 1
x5 0 1 1 0 1 0
x1 x2 x3 x4 x5
z 1 0 0 0 0 3
x2 1 1 0 0 0 1
x4 1 0 1 1 0 0
x5 1 0 1 0 1 1
![Page 169: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/169.jpg)
169
求到原问题的 优解, 短 s‐t路为(e2, e5),长度为
3。
解(2),第 1 阶段:
不删除多余的行,将顶点 t 的行乘以1,使其右端项
变为 1。
增加 4个人工变量。得辅助问题的 LP(标准型)如下:
x1 x2 x3 x4 x5 x6 x7 x8 x9
z 1 2 2 3 1 0 0 0 0 0
g 0 0 0 0 0 1 1 1 1 0
![Page 170: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/170.jpg)
170
x6 1 1 0 0 0 1 0 0 0 1
x7 1 0 1 1 0 0 1 0 0 0
x8 0 1 1 0 1 0 0 1 0 0
x9 0 0 0 1 1 0 0 0 1 1
将基变量对应的检验数消为 0:
x1 x2 x3 x4 x5 x6 x7 x8 x9
z 1 2 2 3 1 0 0 0 0 0
g 0 0 0 2 2 0 0 0 0 2
x6 1 1 0 0 0 1 0 0 0 1
x7 1 0 1 1 0 0 1 0 0 0
![Page 171: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/171.jpg)
171
x8 0 1 1 0 1 0 0 1 0 0
x9 0 0 0 1 1 0 0 0 1 1
x1 x2 x3 x4 x5 x6 x7 x8 x9
z 4 2 1 0 1 0 3 0 0 0
g 2 0 2 0 2 0 2 0 0 2
x6 1 1 0 0 0 1 0 0 0 1
x4 1 0 1 1 0 0 1 0 0 0
x8 0 1 1 0 1 0 0 1 0 0
x9 1 0 1 0 1 0 1 0 1 1
x1 x2 x3 x4 x5 x6 x7 x8 x9
![Page 172: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/172.jpg)
172
z 0 2 1 0 1 4 3 0 0 4
g 0 2 2 0 2 2 2 0 0 0
x1 1 1 0 0 0 1 0 0 0 1
x4 0 1 1 1 0 1 1 0 0 1
x8 0 1 1 0 1 0 0 1 0 0
x9 0 1 1 0 1 1 1 0 1 0
(选择出基变量时应用了 Bland法则。)
x1 x2 x3 x4 x5 x6 x7 x8 x9
z 0 1 0 0 0 4 3 1 0 4
![Page 173: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/173.jpg)
173
g 0 0 0 0 0 2 2 2 0 0
x1 1 1 0 0 0 1 0 0 0 1
x4 0 1 1 1 0 1 1 0 0 1
x5 0 1 1 0 1 0 0 1 0 0
x9 0 0 0 0 0 1 1 1 1 0
求到辅助问题的 优解,g* = 0。
人工变量 x9是基变量,但其所对应的行的前 n 列为全
0,因此将 x9的行和列去掉。
剩下的表格中没有人工变量是基变量,因此将辅助 LP
的检验数行和人工变量列全都删除,开始第 2 阶段。
![Page 174: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/174.jpg)
174
解(2),第 2 阶段,与解(1)相同:
x1 x2 x3 x4 x5
z 0 1 0 0 0 4
x1 1 1 0 0 0 1
x4 0 1 1 1 0 1
x5 0 1 1 0 1 0
x1 x2 x3 x4 x5
z 1 0 0 0 0 3
x2 1 1 0 0 0 1
![Page 175: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/175.jpg)
175
x4 1 0 1 1 0 0
x5 1 0 1 0 1 1
求到原问题的 优解, 短 s‐t路为(e2, e5),长度为
3。
退化问题的处理
一个基可行解,若存在基变量为 0,则称该 bfs为退化
的。
一个 LP 问题,若存在退化的 bfs,则称该问题为退化
![Page 176: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/176.jpg)
176
的。
对于退化的 LP 问题,在应用单纯形算法时,有可能会
出现0
rk
r
ab
的情形,从而进行迭代时不能使当前
解值减小。
若连续出现不能使 优值减小的迭代,则就有可能退
回到原来出现过的基,从而出现称为“循环”的情况。
![Page 177: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/177.jpg)
177
Bland反循环法则
Bland反循环法则(1977):
(1)选择进基变量 xk时,选择所有j > 0中下标
小的那一个,即 0|min jjk (选择编号 小的列进
基);
(2)选择出基变量 xB(r)时,若有多个 jk
j
ab
同时达到
小,则选择下标 B(j) 小的那一个,即
![Page 178: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/178.jpg)
178
miaabjjBrB ik
ik
i 1,0minarg)(min)((选择
编号小的列出基)。
![Page 179: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/179.jpg)
179
2.5 对偶理论
![Page 180: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/180.jpg)
180
本节内容
对偶规划
对偶理论
对偶单纯形算法
![Page 181: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/181.jpg)
181
一般型的 LP和它的标准型
,...,10,...,2,10
,...,1,...,2,1s.t.
)(min
T
T
T
nqjxqjx
mpibxapibxa
Pxc
j
j
ii
ii
--> 0ˆˆˆs.t.
)ˆ(ˆˆmin T
xbxA
Pxc
![Page 182: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/182.jpg)
182
A x1 xq x+q+1 xq+1 x+n xn xs1 xsmp
1 a11 a1q a1,q+1 a1,q+1 a1n a1n 0 0
0
p ap1 apq ap,q+1 ap,q+1 apn apn 0 0
p+1 ap+1,1 ap+1,q ap+1,q+1 ap+1,q+1 ap+1,n ap+1,n 1 0
1
m am1 amq am,q+1 am,q+1 amn amn 0 1
导出对偶规划
设*x 是单纯形算法在 LP )ˆ(P 上求到的 优 bfs,B 是
![Page 183: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/183.jpg)
183
*x 的基矩阵, 是*x 的检验数向量。由单纯形算法,必
有 0ˆˆˆˆ T1Tˆ
T cABcB 。即, cBcA Bˆˆˆˆ T1T
ˆT
。
因此 T1ˆ
ˆˆ~ Bcy B 是如下 LP 的一个可行解:
0ˆˆs.t.
)ˆ(maxT
T
ycyA
Dyb
LP )ˆ(D 称为 LP )ˆ(P 的对偶规划。
![Page 184: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/184.jpg)
184
TA y1 yp yp+1 ym
x1 a11 ap1 ap+1,1 am1
xq a1q apq ap+1,q amq
x+q+1 a1q+1 ap,q+1 ap+1,q+1 am,q+1
xq+1 a1q+1 ap,q+1 ap+1,q+1 am,q+1
x+n a1n apn ap+1,n amn
xn a1n apn ap+1,n amn
xs1 0 0 1 0
0 1
xsmp 0 0 0 1
![Page 185: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/185.jpg)
185
由表格的 x1行到 xq行,我们得到:
A1Ty c1 …
AqTy cq
由表格的 x+q + 1、xq + 1行到 x+n、xn行,我们得到: Aq+1
Ty cq+1 Aq+1
Ty cq+1 Aq+1Ty = cq+1
… An
Ty cn An
Ty cn AnTy = cn
![Page 186: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/186.jpg)
186
由表格的 xs1行到 xsm – p行,我们得到: yp+1 0 yp+1 0
… ym 0 ym 0
![Page 187: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/187.jpg)
187
LP和它的对偶
,...,10,...,2,10
0,...,10s.t.,...,2,1s.t.)( max )( min
T
T
T
T
TT
jjj
jjj
iii
iii
cyAnqjxcyAqjx
ympibxaypibxa
DybPxc
一般型 和它的 对偶
![Page 188: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/188.jpg)
188
00s.t.s.t.maxmin
T
TT
yxcyAbAx
ybxc
规范型 和它的 对偶
00s.t.s.t.maxmin
T
TT
yxcyAbAx
ybxc
标准型 和它的 对偶
![Page 189: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/189.jpg)
189
最短路问题
e1,1
e2,2 e5,1
e4,3
e3,2 v1
v2
v4
v3
![Page 190: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/190.jpg)
190
ixxxv
xxxvxxxv
xxvxxxxxz
i
01)(
0)(0)(1)(s.t.
322 min
544
5323
4312
211
54321
短路问题 LP 的对偶:
x1 x2 x3 x4 x51 2 2 3 1
![Page 191: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/191.jpg)
191
1 1 0 0 0 1 y1–1 0 1 1 0 0 y20 –1 –1 0 1 0 y30 0 0 0 –1 –1 y4
![Page 192: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/192.jpg)
192
jyyyeyyeyyeyyeyye
yyz
j
无限制
1)(3)(2)(2)(1)(s.t.
max
435
424
323
312
211
41
![Page 193: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/193.jpg)
193
顶点覆盖问题
实例:无向图 G = (V, E)。 目标:找出 V 的一个最小尺寸的顶点子集 V’,使得
V’包含 E 中每一条边的至少一个顶点(称为“覆盖”这条边)。
原始规划: VvxEvuxx
x
v
vu
Vvv
,0),(,1s.t.
min
![Page 194: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/194.jpg)
194
对偶规划:Eey
Vvy
y
e
vee
Eee
,0
,1s.t.
max
)(
![Page 195: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/195.jpg)
195
![Page 196: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/196.jpg)
196
0111111s.t.
min
76
75
74
63
52
41
7654321
ixxxxxxxxxxxxx
xxxxxxx
i
x*T = (0, 0, 0, 1, 1, 1, 0)。
![Page 197: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/197.jpg)
197
写出对偶规划:
x1 x2 x3 x4 x5 x6 x7
c 1 1 1 1 1 1 1
e1 1 0 0 1 0 0 0 1 y1
e2 0 1 0 0 1 0 0 1 y2
e3 0 0 1 0 0 1 0 1 y3
e4 0 0 0 1 0 0 1 1 y4
e5 0 0 0 0 1 0 1 1 y5
e6 0 0 0 0 0 1 1 1 y6
![Page 198: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/198.jpg)
198
v1 v2 v3 v4 v5 v6 v7
![Page 199: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/199.jpg)
199
01111111s.t.
max
654
63
52
41
3
2
1
654321
jyyyyyyyyyyyyy
yyyyyy
j
![Page 200: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/200.jpg)
200
y*T = (1, 1, 1, 0, 0, 0)。
对偶理论(一)
定理 2.5.1‐1(弱对偶定理)
设 x 和 y 分别是原规划和对偶规划的可行解,则 cTx
bTy。
定理 2.5.1‐2(强对偶定理)
设 x 和 y 分别是原规划和对偶规划的 优解,则 cTx
= bTy。
![Page 201: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/201.jpg)
201
定理 2.5.1‐3 (强对偶定理的逆)
设 x 和 y 分别是原规划和对偶规划的可行解。若 cTx
= bTy,则 x和 y 分别是原规划和对偶规划的 优解。
定理 2.5.2 LP 问题的对偶的对偶是原始的 LP 问题。
弱对偶定理
定理 2.5.1‐1 设 x 和 y 分别为原始 LP 和对偶 LP 的
可行解,则 cTx bTy。
证:
![Page 202: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/202.jpg)
202
不失一般性,设原始 LP 为标准型,因此 x 0。
由于 x为原始 LP的可行解,因此 Ax = b。即,bT = xTAT。
两边乘以 y,得到:bTy = xTATy。
由于 y为对偶 LP的可行解,因此 ATy c。
再由 x 0,可得 bTy xTc = cTx。
强对偶定理
定理 2.5.1‐2 设 x*和 y*分别为原始 LP和对偶 LP的
优解,则 cTx* = bTy*。
![Page 203: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/203.jpg)
203
证:
不妨设 x*为单纯形算法求到的一个 优 bfs,B 为 x*
的基矩阵。
令 BT cBy )(~ 1 。由于 x*的检验数向量有 0T1T cABcB ,
因此 y~是对偶 LP 的一个可行解。
由于 *TT*T1T1TT~ xccxcbBcBbyb BBBB ,二者目
标函数值相等。
由弱对偶定理,可知对对偶 LP的任意可行解 y,都有*TT xcyb 。因此 y~是对偶 LP 的一个 优解。定理得证。
![Page 204: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/204.jpg)
204
最短路问题
e1,1
e2,2 e5,1
e4,3
e3,2 v1
v2
v4
v3
![Page 205: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/205.jpg)
205
ixxxv
xxxvxxxv
xxvxxxxxz
i
01)(
0)(0)(1)(s.t.
322 min
544
5323
4312
211
54321
一个 优解为 x*T = (0, 1, 0, 0, 1)。
![Page 206: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/206.jpg)
206
基矩阵
101010001
542 AAAB。
短路 LP 的对偶:
![Page 207: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/207.jpg)
207
jyyyeyyeyyeyyeyye
yyz
j
无限制
1)(3)(2)(2)(1)(s.t.
max
435
424
323
312
211
41
![Page 208: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/208.jpg)
208
优解 133
101010001
1321TT
Bcy B
。
由于 x5 = 1 > 0,由互补松弛性可知约束(5)取等式,
从而 y4 = 0。
强对偶定理的逆也成立
定理 2.5.1‐3 设 x 和 y 分别为原始 LP 和对偶 LP 的
可行解。若 cTx = bTy,则 x和 y分别为原始 LP和对偶 LP
![Page 209: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/209.jpg)
209
的 优解。
证:
对原始 LP 的任意可行解 x,和对偶 LP 可行解 y,由
弱对偶定理,都有 ybxc TT 。
现有原始 LP的可行解 x 满足 cTx = bTy,因此 x为原始
LP的 优解。
对对偶 LP 的任意可行解 y,和原始 LP 可行解 x,由
弱对偶定理,都有 xcyb TT 。
现有对偶 LP的可行解 y 满足 bTy = cTx,因此 y为对偶
![Page 210: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/210.jpg)
210
LP的 优解。
原始 LP的对偶的对偶,还是原始 LP
(定理 2.5.2)
:对偶是。
:等价于。
0 s.t.
min T
xbAx
xc
无限制ycyA
yb
s.t.
maxT
T
0,,s.t.
min
s
s
yyycyyAyA
ybyb
![Page 211: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/211.jpg)
211
无限制x
bb
xIA
A
xc
0 s.t.
max
0s.t.
max
xbAxbAx
xc
0s.t.
max
xbAx
bAxxc
0s.t.
min
xbAx
xc
。
![Page 212: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/212.jpg)
212
例 2.5.1 ‐ 对偶的对偶
5,...,2,1;01226
s.t.
215min
5321
4321
31
jxxxxxxxxx
xx
j
无限制21
2
1
21
21
21
21
,00
21260
5
..
2max
ts
00
21260
5
..
2max
2
1
21
21
21
21
ts
3,2,1;01226
..
215min
321
321
31
jxxxxxxx
ts
xx
j
5,...,2,1;01226
s.t.
215min
5321
4321
31
jxxxxxxxxx
xx
j
。
![Page 213: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/213.jpg)
213
对偶理论(二)
定理 2.5.3 原始规划和对偶规划可解性之间的关系
定理 2.5.4 互补松紧性
原始 LP及其对偶 LP的可解性之间的关系
定理 2.5.3 给定一个原规划和对偶规划,则下面三
种情况必有其一:
1.都有 优解;
![Page 214: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/214.jpg)
214
2.都无可行解;
3.一个无界另一个不可行。
原始 \ 对偶 有 优解 问题无界 无可行解 有 优解 ① × × 问题无界 × × ③ 无可行解 × ③ ②
证:
当原始 LP 有 优解时,设单纯形算法求到的 优 bfs
为 x*,基为 B。由定理 2.5.1‐2之证明,yT = cBTB1是
![Page 215: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/215.jpg)
215
对偶 LP的一个 优解。因此,(1, 1)成立,(1, 2)不能
成立,(1, 3)不能成立。
由对称性可知,(2, 1)和(3, 1)也不能成立。
当原始 LP 无界时,对偶 LP 不可能也是无界。反证。
假设原始 LP 无界,对偶 LP 也无界,从而它们都存在
可行解。故可假设 x、y 分别是原始 LP 和对偶 LP 的可
行解。由弱对偶定理可知,cTx bTy。这立即表明原始
LP和对偶 LP都是有界的,矛盾。因此(2, 2)不能成立。
已经证明,当原始 LP无界时,对偶 LP 不能有 优解,
![Page 216: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/216.jpg)
216
也不能无界。即,对偶 LP不能有可行解。因此,对偶
LP必无可行解,即,(2, 3)能够成立。
由对称性可知,(3,2)也能够成立。
可举例说明,(3, 3)也能够成立。
无限制21
21
21
1
,1
(LP)1s.t.min
xxxxxx
x
0,
0(DP)1s.t.
max
21
21
21
21
yyyyyyyy
![Page 217: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/217.jpg)
217
定理 2.5.4
定理 2.5.4 若 x 和 y 分别是原规划和对偶规划的可
行解,则 x和 y分别是原规划和对偶规划的 优解的充
要条件是
1 i m, yi(aiTx bi) = 0,及
1 j n, (cj AjTy)xj = 0。
证:
![Page 218: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/218.jpg)
218
定义
m
iiii bxayu
1
T )(,
n
jjjj xyAcv
1
T )(。
变量 yi和约束 ii bxa T或 ii bxa T
对应。
由于 x和 y分别是原始 LP和对偶 LP的可行解,因此,
若 yi 0,则有 ii bxa T;若 yi 无限制,则有 ii bxa T
。
因此 0)(, T iii bxayi ,且有 u 0。
同理 0)(, T jjj xyAcj ,且有 v 0。
由 u 和 v 的定义,
![Page 219: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/219.jpg)
219
n
jj
Tjj
m
ii
Tii xyAcbxayvu
11)()(
m
i
n
ji
m
iijj
TTn
jjiji yaxxcybxay
1 1 11
ybxc TT 。
因此,(1)式成立 u = 0, v = 0 u + v = 0 cTx = bTy
x和 y 分别是原始 LP 和对偶 LP 的 优解。
反过来也成立:x 和 y 分别是原始 LP 和对偶 LP 的
优解。 cTx = bTy u + v = 0 u = 0, v = 0 (1)式成
![Page 220: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/220.jpg)
220
立。
互补松紧性
推论(互补松紧性,complementary slackness)
设 x 和 y 分别为原始 LP 和对偶 LP 的 优解。则:
(1)若一个变量严格大于 0,则其对应的约束取等式。
(2)若一个约束以严格不等式成立,则其对应的变量
等于 0。
证明:由于 x和 y分别为原始 LP和对偶 LP的 优解,
![Page 221: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/221.jpg)
221
由定理 2.5.4,有
0)( ,10)( ,1
T
T
jjj
iii
xyAcnjbxaymi
。
这立即表明 iii bxay T0 , 0T iii ybxa ;
jjj cyAx T0 , 0T jjj xcyA 。
对偶单纯形算法的基本思想
回忆单纯形算法。从一个 bfs出发,不断变换基矩阵,
直到当前 bfs x的检验数向量 T = cBTB1A cT 0时,
![Page 222: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/222.jpg)
222
则求到了原始 LP的 优解。
由于 cBTB1A cT 0,yT = cB
TB1是对偶 LP 的一个可行
解。
因此,单纯形算法可解释为,从原始 LP的可行解出发,
保持原始 LP 的可行性,向着对偶 LP 可行解的方向迭
代。这样的单纯形算法称为原始单纯形算法。
同样的想法,可从对偶 LP 的可行解出发,保持对偶
LP 的可行性,向原始 LP 可行解的方向迭代。这样的
单纯形算法称为对偶单纯形算法。
![Page 223: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/223.jpg)
223
对偶单纯形算法
1 找一个原始 LP 的基本解(但是不可行)和对偶 LP
的一个可行解( 0),组成初始单纯形表。
2 },...,2,1|min{arg mibr i 。
3 若 0rb ,则当前解就是原始 LP 的 优解,停止。
4 若 0,1 rjanj ,则原始问题无可行解,停止。
![Page 224: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/224.jpg)
224
5
njaa
k rjrj
j ,...,2,1,0|minarg
。
6 以 rka 为转轴元做一次旋转变换(以 kA 替代 Br(即
AB(r))得到一个新的基 B),转第 2步。
出基变量 xB(r)的选取
要减少原始解的不可行性,选择这样一个行 r 做为旋
转行,它对应的 0rb (因为原始 LP要求 x 0)。因
![Page 225: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/225.jpg)
225
此有 },...,2,1|min{arg mibr i 。
通过旋转变换,希望增加目标函数值,且保持对偶解
的可行性。当到达了第一个原始基本可行解时,就求
到了原始 LP的 优解。
假设 rka 为转轴元。则旋转变换后,目标函数值为
krk
r
abzz ˆ
,新的检验数为 krk
rjjj a
a ˆ
。
![Page 226: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/226.jpg)
226
进基变量 xk的选取
因为 0k , 0rb ,要增加 z值,则要求转轴元 0rka 。
要 保 持 对 偶 解 的 可 行 性 , 则 要 求
0 ,1 rjrk
kj a
anj
。
若 0rja ,因为 0k , 0rka ,则已有0 rj
rk
kj a
a
。
![Page 227: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/227.jpg)
227
现假设 0rja 。要保证0 rj
rk
kj a
a
,即 rjrk
kj a
a
,
即 rk
k
rj
j
aa
。因此,
njaa
k rjrj
j ,...,2,1,0|minarg
。
![Page 228: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/228.jpg)
228
换基
x1 … xB(r) … xm xm+1 … xk … xn
1 … 0 … m m+1 … k … n z
xB(1) ... … 0 ... ... … … ... … … 1b
xB(r) ... … 1 … ... … … rka … … rb
xB(m) ... … 0 … ... … … ... … … mb
![Page 229: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/229.jpg)
229
获得初始单纯形表
(与单纯形算法相同)
(1)将 LP 转为标准型。
(2)构造表格:
x1 x2 x3 xn
cT 0
A b (3)选取 A 中的若干列为基,用初等行变换将这些列
![Page 230: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/230.jpg)
230
变为单位阵,检验数行一同参与变换。得到初始单纯形
表:
x1 x2 x3 xn
cBTB1A cT cB
TB1b
xB B1A B1b
例 2.5.4
例:解下列规划
![Page 231: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/231.jpg)
231
0,,24
13s.t.
min
321
321
321
321
xxxxxx
xxxxxx
。
解:
首先化为标准形式
![Page 232: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/232.jpg)
232
0,,,,24
13s.t.
min
54321
5321
4321
321
xxxxxxxxx
xxxxxxx
x1 x2 x3 x4 x5
z 1 1 1 0 0 0
x4 3 1 1 1 0 1
x5 1 4 1 0 1 2
此时原始 LP 有一个基本解,对偶 LP 有一个可行解
![Page 233: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/233.jpg)
233
(因为检验数向量( 0),因此用对偶单纯形法求解。
x1 x2 x3 x4 x5
z 1 1 1 0 0 0
x4 3 1 1 1 0 1
x5 1 4 1 0 1 2
x1 x2 x3 x4 x5
z 5/4 0 3/4 0 1/4 1/2
x4 13/4 0 3/4 1 1/4 1/2
![Page 234: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/234.jpg)
234
x2 1/4 1 1/4 0 1/4 1/2
x1 x2 x3 x4 x5
z 0 0 6/13 5/13 2/13 9/13
x1 1 0 3/13 4/13
1/13 2/13
x2 0 1 4/13 1/13
3/13
7/13
此时右端项 0b ,求到原始 LP的 优解。
![Page 235: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/235.jpg)
235
例 2.4.1(2)
用对偶单纯形算法重解例 2.4.1:
ixxxxxxxxx
xx
i
01226s.t.
215 min
5321
4321
31
解:
列出预备单纯形表:
![Page 236: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/236.jpg)
236
x1 x2 x3 x4 x5
z 5 0 21 0 0 0
1 1 6 1 0 2
1 1 2 0 1 1
以 B = (A4, A5)为基,得到初始单纯形表(典式):
x1 x2 x3 x4 x5
z 5 0 21 0 0 0
1 1 6 1 0 2
1 1 2 0 1 1
![Page 237: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/237.jpg)
237
此时 0,对偶 LP可行; 0b ,原始 LP 不可行。
使用对偶单纯形算法求解。第一次旋转后:
x1 x2 x3 x4 x5
z 3/2 7/2 0 7/2 0 7
x3 1/6 1/6 1 1/6 0 1/3
x5 2/3 4/3 0 1/3 1 1/3
x1 x2 x3 x4 x5
Z 0 1/2 0 11/4 9/4 31/4
![Page 238: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/238.jpg)
238
x3 0 1/2 1 1/4 1/4 1/4
x1 1 2 0 1/2 3/2 1/2
此时 0b ,原始 LP 可行,得到 优解。
![Page 239: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/239.jpg)
239
2.8 线性规划算法的复杂性
![Page 240: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/240.jpg)
240
线性规划软件
CPLEX Lindo / Lingo Matlab
Microsoft Excel
使用 CPLEX命令行解 LP
1. 在 Windows 命令行输入 cplex,出现 CPLEX 提示符
![Page 241: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/241.jpg)
241
“CPLEX>”,进入 CPLEX状态。
2. 输入 enter 命令,输入要优化的问题实例。
![Page 242: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/242.jpg)
242
![Page 243: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/243.jpg)
243
3. 输入 optimize命令,开始求解问题。
4. 输入 display命令,显示求到的解。
![Page 244: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/244.jpg)
244
5. 输入 quit,退出 CPLEX。
使用 MATLAB求解线性规划
MATLAB求解如下形式的线性规划:
![Page 245: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/245.jpg)
245
Mm
eqeq
xxxBxA
BAxxf
s.t.min T
使用的函数为:
[x, f_opt] = linprog(f, A, B, Aeq, Beq, xm, xM, x0)
[x, f_opt, exit_flag, output] = linprog(f, A, B, Aeq, Beq, xm, xM, x0)
输入参数说明:
![Page 246: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/246.jpg)
246
若某个输入矩阵空缺,应使用空矩阵[]代替。
若某个输入参数开始及之后的所有参数空缺,则
这些参数可省略不写。
输出参数说明:
x – 找到的解;
f_opt – 计算得到的解值;
exit_flag – 返回标志;
output – 计算信息。
例:使用 MATLAB求解如下线性规划。
![Page 247: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/247.jpg)
247
0111111s.t.
min
74
63
52
41
31
21
7654321
ixxxxxxxxxxxxx
xxxxxxx
i
依次输入如下命令:
![Page 248: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/248.jpg)
248
f = [1 1 1 1 1 1 1]' A = [‐1 ‐1 0 0 0 0 0; ‐1 0 ‐1 0 0 0 0; ‐1 0 0 ‐1 0 0 0; 0 ‐1 0 0 ‐1 0 0; 0 0 ‐1 0 0 ‐1 0; 0 0 0 ‐1 0 0 ‐1]
B = [‐1; ‐1; ‐1; ‐1; ‐1; ‐1] xm = [0 0 0 0 0 0 0]
[x, f_opt, exit_flag, output] = linprog(f, A, B, [], [], xm)
则运行结果为:
![Page 249: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/249.jpg)
249
![Page 250: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/250.jpg)
250
线性规划算法的复杂性
单纯形算法的时间复杂度
解线性规划的多项式时间算法
单纯形算法的平滑分析
单纯形算法不是多项式时间的
Theorem [KM82]
For every d > 1 there is an LP with 2d equations, 3d
![Page 251: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/251.jpg)
251
variables, and integer coefficients with absolute value
bounded by 4, such that simplex may take 2d – 1
iterations to find the optimum.
例子:
![Page 252: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/252.jpg)
252
![Page 253: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/253.jpg)
253
![Page 254: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/254.jpg)
254
解 LP的多项式时间算法
椭球法
L. G. Khachian. A polynomial algorithm for linear
programming. Doklady Akad. Nauk USSR,
244(5):1093‐1096, 1979.
内点法
N. Karmarkar. A new polynomial‐time algorithm for
linear programming. Combinatorica, 4(4):373‐395,
![Page 255: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/255.jpg)
255
1984.
最坏情形分析和平滑分析
坏情形分析(Worst‐case analysis)
分析算法在 坏情形下的时间复杂度。
缺点: 坏情形不代表“整体”情形。
平均情形分析(Average‐case analysis)
假定算法的输入满足一定概率分布,分析在此种
假定下算法的期望运行时间。
![Page 256: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/256.jpg)
256
缺点:很难确定实际输入满足什么样的概率分布。
平滑分析(Smoothed analysis)
对算法的 坏情形输入施加一个随机的扰动,分
析算法在此种情形下的期望运行时间。
继承了 坏情形分析和平均情形分析两者的优
点。
单纯形算法的平滑分析
Spielman 和滕尚华首次提出了“平滑分析”的概念,
![Page 257: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/257.jpg)
257
并对单纯形算法进行了平滑分析。
Daniel A. Spielman, Shang‐Hua Teng. Smoothed
analysis of algorithms: Why the simplex algorithm
usually takes polynomial time. Journal of the ACM,
51(3):385‐463, 2004.
S 和 T 证明了单纯形算法的平滑时间复杂度是多项
式的。
从而在理论上回答了为什么单纯形算法的 坏
时间复杂度是指数的,但该算法在实际中却表现
![Page 258: ch02 - 线性规划course.sdu.edu.cn/G2S/eWebEditor/uploadfile/... · 2015-12-23 · 13 目标:总运费最小。费用函数 2 1 4 ij1 c ij x ij 约束条件:从每个仓库运出总量不超过其可用总量,](https://reader030.vdocuments.net/reader030/viewer/2022040101/5e6e375188d2fc2ae11edea6/html5/thumbnails/258.jpg)
258
非常好这样一个问题。
因为以上工作,Spielman 和 Teng 获得了 2008 年
Gödel奖和 2009年的 Fulkerson奖。Spielman 因为平
滑分析的工作获得了 2010年的 Nevanlinna奖。