# Idea: a generalization of the SIR functions

**URL:** <https://igraph.discourse.group/t/idea-a-generalization-of-the-sir-functions/86>\
**Category:** Development\
**Created:** [13 February 2020 19:17 UTC](https://igraph.discourse.group/t/idea-a-generalization-of-the-sir-functions/86 "2020-02-13T19:17:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [13 February 2020 19:17 UTC](https://igraph.discourse.group/t/idea-a-generalization-of-the-sir-functions/86/1 "2020-02-13T19:17:15Z")

</div>

This is just an idea (I won’t be working on it due to other priorities).

igraph has some very basic stochastic SIR modelling functionality.

It would be a cool extension to have a function which runs a similar stochastic model on an arbitrary network, but with an arbitrary number of species (instead of S, I, R) and arbitrary transitions between them, which can also be encoded as a weighted directed network (now we have `S --beta--> I` and `I --gamma--> R`). It should allow retrieving individual node states.

Of course, there should be similar (and much more flexible) tools already. Perhaps this? [https://github.com/biomathman/pycellerator](https://github.com/biomathman/pycellerator) But I expect they don’t work on a network. They probably consider all-to-all interactions.
