Skip to main content

Deterministic function computation with chemical reaction networks


Chemical reaction networks (CRNs) formally model chemistry in a well-mixed solution. CRNs are widely used to describe information processing occurring in natural cellular regulatory networks, and with upcoming advances in synthetic biology, CRNs are a promising language for the design of artificial molecular control circuitry. Nonetheless, despite the widespread use of CRNs in the natural sciences, the range of computational behaviors exhibited by CRNs is not well understood. CRNs have been shown to be efficiently Turing-universal (i.e., able to simulate arbitrary algorithms) when allowing for a small probability of error. CRNs that are guaranteed to converge on a correct answer, on the other hand, have been shown to decide only the semilinear predicates (a multi-dimensional generalization of “eventually periodic” sets). We introduce the notion of function, rather than predicate, computation by representing the output of a function \({f:{\mathbb{N}}^k\to{\mathbb{N}}^l}\) by a count of some molecular species, i.e., if the CRN starts with \(x_1,\ldots,x_k\) molecules of some “input” species \(X_1,\ldots,X_k, \) the CRN is guaranteed to converge to having \(f(x_1,\ldots,x_k)\) molecules of the “output” species \(Y_1,\ldots,Y_l\). We show that a function \({f:{\mathbb{N}}^k \to {\mathbb{N}}^l}\) is deterministically computed by a CRN if and only if its graph \({\{({\bf x, y}) \in {\mathbb{N}}^k \times {\mathbb{N}}^l | f({\bf x}) = {\bf y}\}}\) is a semilinear set. Finally, we show that each semilinear function f (a function whose graph is a semilinear set) can be computed by a CRN on input x in expected time \(O(\hbox{polylog} \|{\bf x}\|_1)\).

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2


  1. This is surprising since finite CRNs necessarily must represent large binary data strings in a unary encoding, since they lack positional information to tell the difference between two molecules of the same species.

  2. Semilinear sets have a number of characterizations. They are often thought of as generalizations of arithmetic progressions. They are also exactly the sets that are definable in Presburger arithmetic (Presburger 1930): the first-order theory of the natural numbers with addition. Equivalently, they are the sets accepted by boolean combinations of “modulo” and “threshold” predicates (Angluin et al. 2006b). Semilinear functions are less well-studied. The “piecewise linear” intuitive characterization is formalized in Lemma 4.3.

  3. Those authors use the term “stably compute”, but we reserve the term “compute” to apply to the computation of functions \({f:{\mathbb{N}}^k\to{\mathbb{N}}^l}\).

  4. The definitions of Angluin et al. (2006b) assume that \(\Upupsilon = \Uplambda\) (i.e., every species votes). However, it is not hard to show that we may equivalently assume there are only two voting species, F and T, so that #F > 0 and #T = 0 means that the CRD is answering “false”, and #F = 0 and #T > 0 means that the CRD is answering “true.” This convention will be more convenient in this paper.

  5. Note that reactions may be applicable in an output stable state c. The same holds for our (very similar) definition of output stable states of CRNs that compute functions instead of predicates, defined in Sect. 2.3 The definition simply requires that no sequence of these reactions can either (1) produce a molecule that votes contrary to \(\Upphi({\bf c})\), or (2) consume all molecules voting \(\Upphi({\bf c})\). Our systematic construction in Lemma 4.4 obeys the stronger constraint that every output-stable state is “static”: no reactions are applicable to it. Thus requiring output stable states to be static does not alter the class of functions stably computable by CRNs. However, the time to convergence proven in Theorem 5.2 is sensitive to this choice, since our construction for Theorem 5.2 reaches an output stable state in expected time O(polylog n), but reactions continue to occur for expected time \(\Upomega(\hbox{poly}\,n)\).

  6. i.e. \({(\forall \Updelta \subseteq \Uplambda) (\forall {\bf p}\in{\mathbb{N}}^\Updelta) [((\exists^\infty i\in{\mathbb{N}}) {\bf c}_i \to^* {\bf p}) {\Longrightarrow} ((\exists^\infty j\in{\mathbb{N}}) {\bf p} = {\bf c}_j \upharpoonright \Updelta)].}\)

  7. This definition of fairness is stricter than that used in Angluin et al. (2006b), which used only full configurations rather than partial configurations. We choose this definition to prevent intuitively unfair executions from vacuously satisfying the definition of “fair” simply because of some species whose count is monotonically increasing with time (preventing any configuration from being infinitely often reachable). Such a definition is unnecessary in Angluin et al. (2006b) because population protocols by definition have a finite state space, since they enforce that every reaction has precisely two reactants and two products.

  8. One possibility is to have a “dynamically” growing volume as in Soloveichik et al. (2008).

  9. The random walk is biased downward because of the increasing propensities of the reactions consuming Y i ’s.

  10. Here, H is some species that is guaranteed with high probability to be absent until \(\mathcal{F}\) has halted, and then to increase to large (\(\Upomega(n)\)) count in asymptotically negligible time.


  • Angluin D, Aspnes J, Diamadi Z, Fischer M, Peralta R (2006a) Computation in networks of passively mobile finite-state sensors. Distrib Comput 18:235–253. Preliminary version appeared in PODC 2004

    Google Scholar 

  • Angluin D, Aspnes J, Eisenstat D (2006b) Stably computable predicates are semilinear. In: PODC 2006: proceedings of the twenty-fifth annual ACM symposium on principles of distributed computing. ACM Press, New York, pp 292–299

  • Angluin D, Aspnes J, Eisenstat D (2008) Fast computation by population protocols with a leader. Distrib Comput 21(3):183–199. Preliminary version appeared in DISC 2006

    Google Scholar 

  • Aspnes J, Ruppert E (2007) An introduction to population protocols. Bull Eur Assoc Theor Comput Sci 93:98–117

    MATH  MathSciNet  Google Scholar 

  • Barkai N, Leibler S (1997) Robustness in simple biochemical networks. Nature 387(6636):913–917

    Article  Google Scholar 

  • Cardelli L (2011) Strand algebras for DNA computing. Nat Comput 10(1):407–428

    Article  MATH  MathSciNet  Google Scholar 

  • Cardelli L, Csikász-Nagy A (2012) The cell cycle switch computes approximate majority. Sci Rep 2:656

    Article  Google Scholar 

  • Chen H-L, Doty D, Soloveichik D (2012) Deterministic function computation with chemical reaction networks. In: DNA 18: proceedings of the 18th international meeting on DNA computing and molecular programming. Lecture notes in computer science, vol 7433. Springer, Heidelberg, pp 25–42

  • Condon A, Hu A, Maňuch J, Thachuk C (2012a) Less haste, less waste: on recycling and its limits in strand displacement systems. J R Soc Interface 2:512–521. Preliminary version appeared in DNA 17

    Google Scholar 

  • Condon A, Kirkpatrick B, Maňuch J (2012b) Reachability bounds for chemical reaction networks and strand displacement systems. In: DNA 18: 18th international meeting on DNA computing and molecular programming, vol 7433. Springer, Heidelberg, pp 43–57

  • Cook M, Soloveichik D, Winfree E, Bruck J (2009) Programmability of chemical reaction networks. In: Condon A, Harel D, Kok JN, Salomaa A, Winfree E (eds) Algorithmic bioprocesses. Springer, Berlin Heidelberg, pp 543–584

    Chapter  Google Scholar 

  • Doty D, Hajiaghayi M (2013) Leaderless deterministic chemical reaction networks. In: DNA 2013: proceedings of the 19th international meeting on DNA computing and molecular programming, Tempe

  • Gillespie DT (1977) Exact stochastic simulation of coupled chemical reactions. J Phys Chem 81(25):2340–2361

    Article  Google Scholar 

  • Hjelmfelt A, Weinberger ED, Ross J (1981) Chemical implementation of neural networks and Turing machines. Proc Natl Acad Sci 88(24):10983–10987

    Article  Google Scholar 

  • Jiang H, Riedel M, Parhi K (2012) Digital signal processing with molecular reactions. IEEE Des Test Comput 29(3):21–31

    Article  Google Scholar 

  • Karp RM, Miller RE (1969) Parallel program schemata. J Comput Syst Sci 3(2):147–195

    Article  MATH  MathSciNet  Google Scholar 

  • Kurtz TG (1972) The relationship between stochastic and deterministic models for chemical reactions. J Chem Phys 57(7):2976–2978

    Article  Google Scholar 

  • Lipton R (1976) The reachability problem requires exponential space. Research Report 62. Department of Computer Science, Yale University

  • Magnasco MO (1997) Chemical kinetics is Turing universal. Phys Rev Lett 78(6):1190–1193

    Article  Google Scholar 

  • Nisan N, Wigderson A (1994) Hardness vs randomness. J Comput Syst Sci 49(2):149–167

    Article  MATH  MathSciNet  Google Scholar 

  • Petri CA (1966) Communication with automata. Technical Report, DTIC Document

  • Presburger M (1930) U\(\ddot{\rm b}\)er die vollständigkeit eines gewissen systems der arithmetik ganzer zahlen. In: welchem die Addition als einzige Operation hervortritt. Compte Rendus du I. Congrks des Mathematiciens des pays Slavs, Warsaw, pp 92–101

  • Samoilov MS, Arkin AP (2006) Deviant effects in molecular reaction pathways. Nat Biotechnol 24(10):1235–1240

    Article  Google Scholar 

  • Soloveichik D (2009) Robust stochastic chemical reaction networks and bounded tau-leaping. J Comput Biol 16(3):501–522

    Article  MathSciNet  Google Scholar 

  • Soloveichik D, Cook M, Winfree E, Bruck J (2008) Computation with finite stochastic chemical reaction networks. Nat Comput 7(4):615–633

    Article  MATH  MathSciNet  Google Scholar 

  • Soloveichik D, Seelig G, Winfree E (2010) DNA as a universal substrate for chemical kinetics. Proc Natl Acad Sci 107(12):5393

    Article  Google Scholar 

  • Thachuk C, Condon A (2012) Space and energy efficient computation with DNA strand displacement systems. In: DNA 18: proceedings of the 18th international meeting on DNA computing and molecular programming, Aarhus, pp 135–149

  • Zavattaro G, Cardelli L (2008) Termination problems in chemical kinetics. In: CONCUR 2008-concurrency theory, Toronto, pp 477–491

Download references


We thank Damien Woods and Niranjan Srinivas for many useful discussions, Monir Hajiaghayi for pointing out a problem in an earlier version of this paper, and anonymous reviewers for helpful suggestions. The first author was supported by the Molecular Programming Project under NSF Grant 0832824 and NSC grant 101-2221-E-002-122-MY3, the second and third authors were supported by a Computing Innovation Fellowship under NSF Grant 1019343. The second author was supported by NSF Grants CCF-1219274 and CCF-1162589. The third author was supported by NIGMS Systems Biology Center Grant P50 GM081879.

Author information

Authors and Affiliations


Corresponding author

Correspondence to David Soloveichik.

Additional information

A preliminary version of this paper appeared as Chen et al. (2012).

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Chen, HL., Doty, D. & Soloveichik, D. Deterministic function computation with chemical reaction networks. Nat Comput 13, 517–534 (2014).

Download citation

  • Published:

  • Issue Date:

  • DOI:


  • Molecular programming
  • Stochastic chemical kinetics
  • Distributed computing
  • Population protocols
  • Semilinear functions