# Lightgraph + ModelToolkit optimization

**URL:** <https://discourse.julialang.org/t/lightgraph-modeltoolkit-optimization/40696>\
**Category:** New to Julia\
**Created:** [June 3, 2020, 9:20pm UTC](https://discourse.julialang.org/t/lightgraph-modeltoolkit-optimization/40696 "2020-06-03T21:20:23Z")\
**Posts on this page:** 2\
**Page:** 4

<div class="post-metadata">

**Author:** ![Vasily\_Ilin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vasily_ilin/32/7836_2.png) [@Vasily\_Ilin](https://discourse.julialang.org/u/Vasily_Ilin)\
**Post date:** [June 16, 2020, 8:34pm UTC](https://discourse.julialang.org/t/lightgraph-modeltoolkit-optimization/40696/61 "2020-06-16T20:34:57Z")

</div>

Hi, @erlebach. Have a look at this branch: [https://github.com/Vilin97/DiffEqJump.jl/tree/Spatial](https://github.com/Vilin97/DiffEqJump.jl/tree/Spatial).  
If you clone it, activate DiffEqJump (with `]activate .`), and run file `test/spatial/SIR.jl`, it will set up a spatial SIR problem (with diffusion too), solve it and plot the solution. In order to specify the graph to use you need to set `connectivity_list` to be the adjacency list of your graph (this line: [https://github.com/Vilin97/DiffEqJump.jl/blob/Spatial/test/spatial/SIR.jl#L37](https://github.com/Vilin97/DiffEqJump.jl/blob/Spatial/test/spatial/SIR.jl#L37)). Right now the complete graph on three nodes is used by defalt. Note also that you can change the SSA by setting it in here: [https://github.com/Vilin97/DiffEqJump.jl/blob/Spatial/test/spatial/SIR.jl#L32](https://github.com/Vilin97/DiffEqJump.jl/blob/Spatial/test/spatial/SIR.jl#L32) (set to RSSA by default).  
This does not use ModelingToolkit.

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [June 16, 2020, 10:08pm UTC](https://discourse.julialang.org/t/lightgraph-modeltoolkit-optimization/40696/62 "2020-06-16T22:08:49Z")

</div>

Thank you! I will take a look. In the meantime, I have implemented EoN’s (Python library) version of FastSIR, and get twice the speed on a weighted network, with 100,000 nodes and 6 million edges. I do not use SSA any longer, but track the infected and propagate the infections on a graph. I am now looking at the possibilities of multiplex networks.

[Previous page](https://discourse.julialang.org/t/lightgraph-modeltoolkit-optimization/40696.md?page=3)
