Skip to content

Commit e634c0e

Browse files
authored
Update opt_transport.md
1 parent dbbb4cb commit e634c0e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lectures/opt_transport.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ import networkx as nx
9292
$$
9393
\begin{aligned}
9494
\min_{x_{ij}} \ & \sum_{i=1}^m \sum_{j=1}^n c_{ij} x_{ij} \\
95-
\text{subject to } \ & \sum_{j=1}^n x_{ij} = p_i, & i = 1, 2, \dots, m \\
95+
\text{使得 } \ & \sum_{j=1}^n x_{ij} = p_i, & i = 1, 2, \dots, m \\
9696
& \sum_{i=1}^m x_{ij} = q_j, & j = 1, 2, \dots, n \\
9797
& x_{ij} \ge 0 \\
9898
\end{aligned}
@@ -145,7 +145,6 @@ SciPy 函数 `linprog` 需要接收决策变量的*向量*。
145145
146146
$$
147147
\begin{aligned}
148-
149148
\min_{X} \ & \operatorname{tr} (C' X) \\
150149
\text{subject to } \ & X \ \mathbf{1}_n = p \\
151150
& X' \ \mathbf{1}_m = q \\
@@ -173,7 +172,6 @@ $$
173172
174173
$$
175174
A \otimes B =
176-
177175
\begin{pmatrix}
178176
a_{11}B & a_{12}B & \dots & a_{1s}B \\
179177
a_{21}B & a_{22}B & \dots & a_{2s}B \\
@@ -222,7 +220,7 @@ $$
222220
$$
223221
\begin{aligned}
224222
\min_{z} \ & \operatorname{vec}(C)' z \\
225-
\text{subject to } \ & A z = b \\
223+
\text{使得 } \ & A z = b \\
226224
& z \ge 0 \\
227225
\end{aligned}
228226
$$ (decisionvars)
@@ -295,7 +293,6 @@ p = \begin{pmatrix}
295293
25 \\
296294
115 \\
297295
60 \\
298-
299296
30 \\
300297
70
301298
\end{pmatrix}
@@ -431,7 +428,7 @@ for i in range(len(sol_found)):
431428
print(f" 最小成本 {i}: ", cost[i])
432429
```
433430
434-
**啊哈!**如你所见,在这种情况下,仅仅改变约束的顺序,就会显现出两个实现相同最小成本的最优传输方案。
431+
**啊哈!** 如你所见,在这种情况下,仅仅改变约束的顺序,就会显现出两个实现相同最小成本的最优传输方案。
435432
436433
这就是我们之前计算出的两个方案。
437434
@@ -524,7 +521,7 @@ res.x.reshape((m, n), order='F')
524521
$$
525522
\begin{aligned}
526523
\max_{u_i, v_j} \ & \sum_{i=1}^m p_i u_i + \sum_{j=1}^n q_j v_j \\
527-
\text{subject to } \ & u_i + v_j \le c_{ij}, \ i = 1, 2, \dots, m;\ j = 1, 2, \dots, n \\
524+
\text{使得 } \ & u_i + v_j \le c_{ij}, \ i = 1, 2, \dots, m;\ j = 1, 2, \dots, n \\
528525
\end{aligned}
529526
$$ (dualproblem)
530527

0 commit comments

Comments
 (0)