You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0d34c00
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: lectures/opt_transport.md
+18-29Lines changed: 18 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ jupytext:
4
4
extension: .md
5
5
format_name: myst
6
6
format_version: 0.13
7
-
jupytext_version: 1.10.3
7
+
jupytext_version: 1.14.4
8
8
kernelspec:
9
-
display_name: Python 3
9
+
display_name: Python 3 (ipykernel)
10
10
language: python
11
11
name: python3
12
12
---
@@ -38,13 +38,11 @@ several implementations of linear programming, including, in order,
38
38
2. the [linprog_simplex](https://quanteconpy.readthedocs.io/en/latest/optimize/linprog_simplex.html) solver from QuantEcon and
39
39
3. the simplex-based solvers included in the [Python Optimal Transport](https://pythonot.github.io/) package.
40
40
41
-
42
-
43
-
44
41
```{code-cell} ipython3
45
42
:tags: [hide-output]
43
+
46
44
!pip install --upgrade quantecon
47
-
!pip install --upgrade POT jax jaxlib
45
+
!pip install --upgrade POT
48
46
```
49
47
50
48
Let's start with some imports.
@@ -59,11 +57,6 @@ from scipy.stats import binom, betabinom
59
57
import networkx as nx
60
58
```
61
59
62
-
63
-
64
-
65
-
66
-
67
60
## The Optimal Transport Problem
68
61
69
62
Suppose that $m$ factories produce goods that must be sent to $n$ locations.
@@ -356,7 +349,7 @@ A = np.vstack([A1, A2])
356
349
b = np.hstack([p, q])
357
350
358
351
# Solve the primal problem
359
-
res = linprog(C_vec, A_eq=A, b_eq=b, method='Revised simplex')
352
+
res = linprog(C_vec, A_eq=A, b_eq=b)
360
353
361
354
# Print results
362
355
print("message:", res.message)
@@ -405,15 +398,15 @@ However, we find a different transportation plan.
405
398
Though it is a different plan, it attains the same cost!
0 commit comments