Skip to content

Commit 8199165

Browse files
committed
Update README.
1 parent 5eed225 commit 8199165

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# OptimalTransportNetworks.jl
2-
**Optimal Transport Networks in Spatial Equilibrium - in Julia and MATLAB**
2+
**Optimal Transport Networks in Spatial Equilibrium - in Julia**
33

4-
Modern Julia ([JuMP](https://github.com/jump-dev/JuMP.jl)) translation of the MATLAB OptimalTransportNetworkToolbox (v1.0.4b) implementing the quantitative spatial economic model of:
4+
Modern Julia ([JuMP](https://github.com/jump-dev/JuMP.jl)) translation of the [MATLAB OptimalTransportNetworkToolbox (v1.0.4b)](https://github.com/SebKrantz/OptimalTransportNetworkToolbox) implementing the quantitative spatial economic model of:
55

66
Fajgelbaum, P. D., & Schaal, E. (2020). Optimal transport networks in spatial equilibrium. *Econometrica, 88*(4), 1411-1452.
77

8-
The model/software uses duality principles to optimize over the space of networks, nesting an optimal flows problem and a neoclasical general-equilibrium trade model into a global network design problem to derive the optimal (welfare maximizing) transport network (extension) from any primitive set of economic fundamantals [population per location, productivity per location for each of *N* traded goods, endowment of a non-traded good, and (optionally) a pre-existing transport network]. For more information about the model see [this folder](https://github.com/SebKrantz/OptimalTransportNetworks.jl/tree/main/misc/paper_materials).
8+
The model/software uses duality principles to optimize over the space of networks, nesting an optimal flows problem and a neoclasical general-equilibrium trade model into a global network design problem to derive the optimal (welfare maximizing) transport network (extension) from any primitive set of economic fundamantals [population per location, productivity per location for each of *N* traded goods, endowment of a non-traded good, and (optionally) a pre-existing transport network].
9+
10+
For more information about the model see [this folder](https://github.com/SebKrantz/OptimalTransportNetworks.jl/tree/main/misc/paper_materials) and the [MATLAB User Guide](https://raw.githubusercontent.com/SebKrantz/OptimalTransportNetworkToolbox/main/docs/User%20Guide.pdf).
911

1012
The model is the first of its kind and a pathbreaking contribution towards the welfare maximizing planning of transport infrastructure. Its creation has been funded by the European Union through an [ERC Research Grant](https://cordis.europa.eu/project/id/804095). The author of this Julia library has no personal connections to the authors, but has used their Matlab library for research purposes and belives that it deserves an accessible open-source implementation. Community efforts to further improve the code are welcome. In particular, there is a probabilistic extenstion to solving the model using MCMC methods which may be more suitable for large networks, implemented in:
1113

@@ -27,21 +29,22 @@ This plot shows the optimal network after 200 iterations, keeping population fix
2729

2830
* The Julia implementation does not provide hard-coded Gradients, Jacobians, and Hessians as the MATLAB implementation does for some model cases, but relies solely on JuMP's automatic differentiation. This has proven ineffective for dual solutions to the model where the objective is quite complex. Thus, at present, duality does not help to speed up computations in Julia, and accordingly the default is `duality = false`. I expect this to change in when [support for detecting nonlinear subexpressions](https://github.com/jump-dev/JuMP.jl/issues/3738) will be added to JuMP.
2931

30-
* Related, I expect symbolic autodifferentiation via [MathOptSymbolicAD.jl](https://github.com/lanl-ansi/MathOptSymbolicAD.jl) to provide significant performance improvements. Presently this cannot be used on these models because logical or comparison operators are not supported. See [this issue](https://github.com/lanl-ansi/MathOptSymbolicAD.jl/issues/31). Once support is added, the symbolic backend can be activated using:
32+
* Symbolic autodifferentiation via [MathOptSymbolicAD.jl](https://github.com/lanl-ansi/MathOptSymbolicAD.jl) can provide significant performance improvements. The symbolic backend can be activated using:
3133

32-
```julia
33-
import MathOptInterface as MOI
34-
import MathOptSymbolicAD
34+
```julia
35+
import MathOptInterface as MOI
36+
import MathOptSymbolicAD
3537

36-
param[:model_attr] = Dict(:backend => (MOI.AutomaticDifferentiationBackend(),
37-
MathOptSymbolicAD.DefaultBackend()))
38-
# Or: MathOptSymbolicAD.ThreadedBackend()
39-
```
38+
param[:model_attr] = Dict(:backend => (MOI.AutomaticDifferentiationBackend(),
39+
MathOptSymbolicAD.DefaultBackend()))
40+
# Or: MathOptSymbolicAD.ThreadedBackend()
41+
```
4042

4143
* It is recommended to use Coin-HSL linear solvers for [Ipopt](https://github.com/jump-dev/Ipopt.jl) to speed up computations. In my opinion the simplest way to use them is to get a (free for academics) license and download the binaries [here](https://licences.stfc.ac.uk/product/coin-hsl), extract them somewhere, and then set the `hsllib` (place here the path to where you extracted `libhsl.dylib`, it may also be called `libcoinhsl.dylib`, in which case you may have to rename it to `libhsl.dylib`) and `linear_solver` options as follows:
4244

43-
```julia
44-
param[:optimizer_attr] = Dict(:hsllib => "/usr/local/lib/libhsl.dylib", # Adjust path
45-
:linear_solver => "ma57") # Use ma57, ma86 or ma97
46-
```
47-
The [Ipopt.jl README](https://github.com/jump-dev/Ipopt.jl?tab=readme-ov-file#linear-solvers) suggests to use the larger LibHSL package for which there exists a Julia module and proceed similarly. In addition, users may try an [optimized BLAS](https://github.com/jump-dev/Ipopt.jl?tab=readme-ov-file#blas-and-lapack) and see if it yields significant performance gains (and let me know if it does).
45+
```julia
46+
param[:optimizer_attr] = Dict(:hsllib => "/usr/local/lib/libhsl.dylib", # Adjust path
47+
:linear_solver => "ma57") # Use ma57, ma86 or ma97
48+
```
49+
50+
The [Ipopt.jl README](https://github.com/jump-dev/Ipopt.jl?tab=readme-ov-file#linear-solvers) suggests to use the larger LibHSL package for which there exists a Julia module and proceed similarly. In addition, users may try an [optimized BLAS](https://github.com/jump-dev/Ipopt.jl?tab=readme-ov-file#blas-and-lapack) and see if it yields significant performance gains (and let me know if it does).

0 commit comments

Comments
 (0)