IDEAS home Printed from https://ideas.repec.org/a/plo/pcbi00/1004579.html
   My bibliography  Save this article

Temporal Gillespie Algorithm: Fast Simulation of Contagion Processes on Time-Varying Networks

Author

Listed:
  • Christian L Vestergaard
  • Mathieu Génois

Abstract

Stochastic simulations are one of the cornerstones of the analysis of dynamical processes on complex networks, and are often the only accessible way to explore their behavior. The development of fast algorithms is paramount to allow large-scale simulations. The Gillespie algorithm can be used for fast simulation of stochastic processes, and variants of it have been applied to simulate dynamical processes on static networks. However, its adaptation to temporal networks remains non-trivial. We here present a temporal Gillespie algorithm that solves this problem. Our method is applicable to general Poisson (constant-rate) processes on temporal networks, stochastically exact, and up to multiple orders of magnitude faster than traditional simulation schemes based on rejection sampling. We also show how it can be extended to simulate non-Markovian processes. The algorithm is easily applicable in practice, and as an illustration we detail how to simulate both Poissonian and non-Markovian models of epidemic spreading. Namely, we provide pseudocode and its implementation in C++ for simulating the paradigmatic Susceptible-Infected-Susceptible and Susceptible-Infected-Recovered models and a Susceptible-Infected-Recovered model with non-constant recovery rates. For empirical networks, the temporal Gillespie algorithm is here typically from 10 to 100 times faster than rejection sampling.Author Summary: When studying how e.g. diseases spread in a population, intermittent contacts taking place between individuals—through which the infection spreads—are best described by a time-varying network. This object captures both their complex structure and dynamics, which crucially affect spreading in the population. The dynamical process in question is then usually studied by simulating it on the time-varying network representing the population. Such simulations are usually time-consuming, especially when they require exploration of different parameter values. We here show how to adapt an algorithm originally proposed in 1976 to simulate chemical reactions—the Gillespie algorithm—to speed up such simulations. Instead of checking at each time-step if each possible reaction takes place, as traditional rejection sampling algorithms do, the Gillespie algorithm determines what reaction takes place next and at what time. This offers a substantial speed gain by doing away with the many rejected trials of the traditional methods, with the added benefit of giving stochastically exact results. In practice this new temporal Gillespie algorithm is tens to hundreds of times faster than the current state-of-the-art, opening up for thorough characterization of spreading phenomena and fast large-scale applications such as the simulation of city- or world-wide epidemics.

Suggested Citation

  • Christian L Vestergaard & Mathieu Génois, 2015. "Temporal Gillespie Algorithm: Fast Simulation of Contagion Processes on Time-Varying Networks," PLOS Computational Biology, Public Library of Science, vol. 11(10), pages 1-28, October.
  • Handle: RePEc:plo:pcbi00:1004579
    DOI: 10.1371/journal.pcbi.1004579
    as

    Download full text from publisher

    File URL: https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004579
    Download Restriction: no

    File URL: https://journals.plos.org/ploscompbiol/article/file?id=10.1371/journal.pcbi.1004579&type=printable
    Download Restriction: no

    File URL: https://libkey.io/10.1371/journal.pcbi.1004579?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Maurice S. Bartlett, 1953. "Stochastic Processes or the Statistics of Change," Journal of the Royal Statistical Society Series C, Royal Statistical Society, vol. 2(1), pages 44-64, March.
    2. Ciro Cattuto & Wouter Van den Broeck & Alain Barrat & Vittoria Colizza & Jean-François Pinton & Alessandro Vespignani, 2010. "Dynamics of Person-to-Person Interactions from Distributed RFID Sensor Networks," PLOS ONE, Public Library of Science, vol. 5(7), pages 1-9, July.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Choi, K. & Choi, Hoyun & Kahng, B., 2022. "COVID-19 epidemic under the K-quarantine model: Network approach," Chaos, Solitons & Fractals, Elsevier, vol. 157(C).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Gregory, Steve, 2012. "Ordered community structure in networks," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 391(8), pages 2752-2763.
    2. De Martino, Giuseppe & Spina, Serena, 2015. "Exploiting the time-dynamics of news diffusion on the Internet through a generalized Susceptible–Infected model," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 438(C), pages 634-644.
    3. Kobayashi, Teruyoshi & Takaguchi, Taro, 2018. "Identifying relationship lending in the interbank market: A network approach," Journal of Banking & Finance, Elsevier, vol. 97(C), pages 20-36.
    4. Fabio Caccioli & Paolo Barucca & Teruyoshi Kobayashi, 2018. "Network models of financial systemic risk: a review," Journal of Computational Social Science, Springer, vol. 1(1), pages 81-114, January.
    5. Stefano Guarino & Enrico Mastrostefano & Massimo Bernaschi & Alessandro Celestini & Marco Cianfriglia & Davide Torre & Lena Rebecca Zastrow, 2021. "Inferring Urban Social Networks from Publicly Available Data," Future Internet, MDPI, vol. 13(5), pages 1-45, April.
    6. Eugenio Valdano & Chiara Poletto & Armando Giovannini & Diana Palma & Lara Savini & Vittoria Colizza, 2015. "Predicting Epidemic Risk from Past Temporal Contact Data," PLOS Computational Biology, Public Library of Science, vol. 11(3), pages 1-19, March.
    7. Ghahramani, Ali & Pantelic, Jovan & Lindberg, Casey & Mehl, Matthias & Srinivasan, Karthik & Gilligan, Brian & Arens, Edward, 2018. "Learning occupants’ workplace interactions from wearable and stationary ambient sensing systems," Applied Energy, Elsevier, vol. 230(C), pages 42-51.
    8. Hanjue Xia & Johannes Horn & Monika J Piotrowska & Konrad Sakowski & André Karch & Hannan Tahir & Mirjam Kretzschmar & Rafael Mikolajczyk, 2021. "Effects of incomplete inter-hospital network data on the assessment of transmission dynamics of hospital-acquired infections," PLOS Computational Biology, Public Library of Science, vol. 17(5), pages 1-18, May.
    9. Mark Kibanov & Raphael H. Heiberger & Simone Rödder & Martin Atzmueller & Gerd Stumme, 2019. "Social studies of scholarly life with sensor-based ethnographic observations," Scientometrics, Springer;Akadémiai Kiadó, vol. 119(3), pages 1387-1428, June.
    10. Masoud Shakiba & Azam Zavvari & Nader Aleebrahim & Mandeep Jit Singh, 2016. "Evaluating the academic trend of RFID technology based on SCI and SSCI publications from 2001 to 2014," Scientometrics, Springer;Akadémiai Kiadó, vol. 109(1), pages 591-614, October.
    11. Laura Ozella & Francesco Gesualdo & Michele Tizzoni & Caterina Rizzo & Elisabetta Pandolfi & Ilaria Campagna & Alberto Eugenio Tozzi & Ciro Cattuto, 2018. "Close encounters between infants and household members measured through wearable proximity sensors," PLOS ONE, Public Library of Science, vol. 13(6), pages 1-16, June.
    12. Massimo Riccaboni & Anna Romiti & Gianna Giudicati, 2011. "Co-experience Network Dynamics: Lessons from the Dance Floor," DISA Working Papers 2011/02, Department of Computer and Management Sciences, University of Trento, Italy, revised 28 Mar 2011.
    13. Barmak, D.H. & Dorso, C.O. & Otero, M., 2016. "Modelling dengue epidemic spreading with human mobility," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 447(C), pages 129-140.
    14. Mikaela Irene D. Fudolig & Daniel Monsivais & Kunal Bhattacharya & Hang-Hyun Jo & Kimmo Kaski, 2020. "Different patterns of social closeness observed in mobile phone communication," Journal of Computational Social Science, Springer, vol. 3(1), pages 1-17, April.
    15. Ventura, Paulo Cesar & Aleta, Alberto & Rodrigues, Francisco A. & Moreno, Yamir, 2022. "Epidemic spreading in populations of mobile agents with adaptive behavioral response," Chaos, Solitons & Fractals, Elsevier, vol. 156(C).
    16. Teruyoshi Kobayashi & Taro Takaguchi, 2017. "Significant ties: Identifying relationship lending in temporal interbank networks," Discussion Papers 1717, Graduate School of Economics, Kobe University.
    17. José F. Fontanari, 2023. "Stochastic Simulations of Casual Groups," Mathematics, MDPI, vol. 11(9), pages 1-16, May.
    18. Matthew Baggetta & Brad R. Fulton & Zoe Caplan, 2022. "Space and Interaction in Civil Society Organizations: An Exploratory Study in a US City," Social Inclusion, Cogitatio Press, vol. 10(3), pages 307-318.
    19. Dun, Han & Shuting, Yan & She, Han & Lingfei, Qian & Chris, Ampimah Benjamin, 2019. "Research on how the difference of personal propagation ability influences the epidemic spreading in activity-driven network," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 514(C), pages 311-318.
    20. Nan Zhang & Boni Su & Pak-To Chan & Te Miao & Peihua Wang & Yuguo Li, 2020. "Infection Spread and High-Resolution Detection of Close Contact Behaviors," IJERPH, MDPI, vol. 17(4), pages 1-18, February.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:plo:pcbi00:1004579. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: ploscompbiol (email available below). General contact details of provider: https://journals.plos.org/ploscompbiol/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.