# \[ANN\] NetworkJumpProcesses.jl - An interface to define JumpProcesses on Graphs

**URL:** https://discourse.julialang.org/t/ann-networkjumpprocesses-jl-an-interface-to-define-jumpprocesses-on-graphs/111529
**Category:** Package Announcements
**Tags:** package, announcement, graphs, network
**Created:** [March 12, 2024, 4:28pm UTC](https://discourse.julialang.org/t/ann-networkjumpprocesses-jl-an-interface-to-define-jumpprocesses-on-graphs/111529 "2024-03-12T16:28:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![TimVWese](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/timvwese/32/46686_2.png) [@TimVWese](https://discourse.julialang.org/u/TimVWese)
#### Post date: [March 12, 2024, 4:28pm UTC](https://discourse.julialang.org/t/ann-networkjumpprocesses-jl-an-interface-to-define-jumpprocesses-on-graphs/111529/1 "2024-03-12T16:28:36Z")

</div>

I have created [NetworkJumpProcesses.jl](https://github.com/TimVWese/NetworkJumpProcesses.jl) in order to combine the functionalities of [JumpProcesses.jl](https://github.com/SciML/JumpProcesses.jl) and [Graphs.jl](https://github.com/JuliaGraphs/Graphs.j), in a similar fashion to [NetworkDynamics.jl](https://github.com/PIK-ICoNe/NetworkDynamics.jl).

The idea is to define some jumps (discrete state, continuous time, stochastic variables) for the vertices and for edges of an arbitrary `Graph`, and the package functionality returns a [`JumpSet`](https://docs.sciml.ai/JumpProcesses/stable/api/#JumpProcesses.JumpSet) which can be solved with `JumpProcesses.jl` and `DifferentialEquations.jl`.

The important functions are:

1. `network_jump_set`: creates the `JumpSet` given a `Graph`, the jumps defined for vertices (`vertex_reactions`), and the jumps defined for edges, (`edge_reactions`). These last two can be each a vector of jumps, in which case all vertices or edges behave according to to the same reactions. An other option is that one or both is a vector of vectors. In this case the outer vector should have the same number of elements as vertices (`vertex_reactions`) or edges (`edge_reactions`) in the graph.
2. `dependency_graph, vartojumps, jumptovars`: these create the [dependency graphs necessary for some aggregators](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#Jump-Aggregators-Requiring-Dependency-Graphs).

As in `JumpProcesses.jl`, the jumps are defined by a `rate` and `affect!` function.  
The `rate` returns a single number, while `affect!` modifies the arguments directly.  
In the case of a vertex the input arguments for both are

- `v`: state of the vertex itself
- `nhgbs`: state of the neighbours
- `p`: model parameter values
- `t`: current timestep  
In case of an edge the arguments are `(vs, vd, p, t)` where `vs` resp. `vd` are the source and destination vertex states.

To this point, I mainly implemented functionality for my own research, thus many limitations remain.  
Some of the most important ones are:

- Directed graphs are not supported
- ContinuousJumps are not supported
- No states can be associated with edges
- The dependency graphs do only depend on the structure of the network, and not on the reactions themselves
- …

While I want to keep developing the package, I do not want to put work in anything that nobody is going to use. So, if you have any interest, [read the documentation](https://timvwese.github.io/NetworkJumpProcesses.jl/), [try some examples](https://github.com/TimVWese/NetworkJumpProcesses.jl/tree/main/examples) or contact me. Also, this this is all quiet new for me, so if you have any constructive feedback or pointers, I’m glad to hear it.
