English

Exactly simulating stochastic chemical reaction networks in sub-constant time per reaction

Data Structures and Algorithms 2026-02-16 v2

Abstract

The model of chemical reaction networks is among the oldest and most widely studied and used in natural science. The model describes reactions among abstract chemical species, for instance A+BCA + B \to C, which indicates that if a molecule of type AA interacts with a molecule of type BB (the reactants), they may stick together to form a molecule of type CC (the product). The standard algorithm for simulating (discrete, stochastic) chemical reaction networks is the Gillespie algorithm [JPC 1977], which stochastically simulates one reaction at a time, so to simulate \ell consecutive reactions, it requires total running time Ω()\Omega(\ell). We give the first chemical reaction network stochastic simulation algorithm that can simulate \ell reactions, provably preserving the exact stochastic dynamics (sampling from precisely the same distribution as the Gillespie algorithm), yet using time provably sublinear in \ell. Under reasonable assumptions, our algorithm can simulate \ell reactions among nn total molecules in time O(/n)O(\ell/\sqrt n) when n5/4\ell \ge n^{5/4}, and in time O(/n2/5)O(\ell/n^{2/5}) when nn5/4n \le \ell \le n^{5/4}. Our work adapts an algorithm of Berenbrink, Hammer, Kaaser, Meyer, Penschuck, and Tran [ESA 2020] for simulating the distributed computing model known as population protocols, extending it (in a very nontrivial way) to the more general chemical reaction network setting. We provide an implementation of our algorithm as a Python package, with the core logic implemented in Rust, with remarkably fast performance in practice.

Keywords

Cite

@article{arxiv.2508.04079,
  title  = {Exactly simulating stochastic chemical reaction networks in sub-constant time per reaction},
  author = {Joshua Petrack and David Doty},
  journal= {arXiv preprint arXiv:2508.04079},
  year   = {2026}
}

Comments

47 pages, 4 figures