Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 247

Chris Thachuk · Yan Liu (Eds.

)
LNCS 11648

DNA Computing and


Molecular Programming
25th International Conference, DNA 25
Seattle, WA, USA, August 5–9, 2019
Proceedings
Lecture Notes in Computer Science 11648

Founding Editors
Gerhard Goos
Karlsruhe Institute of Technology, Karlsruhe, Germany
Juris Hartmanis
Cornell University, Ithaca, NY, USA

Editorial Board Members


Elisa Bertino
Purdue University, West Lafayette, IN, USA
Wen Gao
Peking University, Beijing, China
Bernhard Steffen
TU Dortmund University, Dortmund, Germany
Gerhard Woeginger
RWTH Aachen, Aachen, Germany
Moti Yung
Columbia University, New York, NY, USA
More information about this series at http://www.springer.com/series/7407
Chris Thachuk Yan Liu (Eds.)

DNA Computing and


Molecular Programming
25th International Conference, DNA 25
Seattle, WA, USA, August 5–9, 2019
Proceedings

123
Editors
Chris Thachuk Yan Liu
California Institute of Technology Arizona State University
Pasadena, CA, USA Tempe, AZ, USA

ISSN 0302-9743 ISSN 1611-3349 (electronic)


Lecture Notes in Computer Science
ISBN 978-3-030-26806-0 ISBN 978-3-030-26807-7 (eBook)
https://doi.org/10.1007/978-3-030-26807-7
LNCS Sublibrary: SL1 – Theoretical Computer Science and General Issues

© Springer Nature Switzerland AG 2019


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are
believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors
give a warranty, expressed or implied, with respect to the material contained herein or for any errors or
omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in
published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

This volume contains the papers presented at DNA 25: the 25th International
Conference on DNA Computing and Molecular Programming. The conference was
held at the University of Washington in Seattle, Washington, USA during August 5–9,
2019, and was organized under the auspices of the International Society for Nanoscale
Science, Computation, and Engineering (ISNSCE). The DNA conference series aims to
draw together researchers from the fields of mathematics, computer science, physics,
chemistry, biology, and nanotechnology to address the analysis, design, and synthesis
of information-based molecular systems.
Papers and presentations were sought in all areas that relate to biomolecular
computing, including, but not restricted to: algorithms and models for computation on
biomolecular systems; computational processes in vitro and in vivo; molecular
switches, gates, devices, and circuits; molecular folding and self-assembly of
nanostructures; analysis and theoretical models of laboratory techniques; molecular
motors and molecular robotics; information storage; studies of fault-tolerance and error
correction; software tools for analysis, simulation, and design; synthetic biology and
in vitro evolution; and applications in engineering, physics, chemistry, biology, and
medicine. Authors who wished to orally present their work were asked to select one of
two submission tracks: Track A (full paper) or Track B (one-page abstract with
supplementary document). Track B is primarily for authors submitting experimental
results who plan to submit to a journal rather than publish in the conference pro-
ceedings. We received 39 submissions for oral presentations: 19 submissions to
Track A and 20 submissions to Track B. Each submission was reviewed by at least four
reviewers, with an average of five reviewers per paper. The Program Committee
accepted 12 papers for Track A and 13 papers for Track B. Additionally, the Program
Committee reviewed and accepted 61 submissions to Track C (poster) and selected
seven for short oral presentation. This volume contains the papers accepted for
Track A.
To commemorate the 25th anniversary of the conference, Microsoft Research
sponsored a special session on Thursday that included a panel discussion and reception.
The conference concluded with a Molecular Technology Day on Friday consisting of
invited and contributed talks.
We express our sincere appreciation to our invited speakers, Leonard Adleman,
David Baker, Michael Elowitz, Dana Randall, Anne Shiu, and Erik Winfree, our
invited Molecular Technology Day speakers, Kate Adamal, Andy Ellington, Jocelyn
Kishi, and Jeff Nivala, and our panelists. We especially thank all of the authors who
contributed papers to these proceedings, and who presented papers and posters during
the conference. Last but not least, the editors thank the members of the Program
Committee and the additional invited reviewers for their hard work in reviewing the
papers and providing constructive comments to authors.

August 2019 Chris Thachuk


Yan Liu
Organization

Steering Committee
Anne Condon (Chair) University of British Columbia, Canada
Luca Cardelli University of Oxford, UK
Masami Hagiya University of Tokyo, Japan
Natasha Jonoska University of South Florida, USA
Lila Kari University of Waterloo, Canada
Chengde Mao Purdue University, USA
Satoshi Murata Tohoku University, Japan
John Reif Duke University, USA
Grzegorz Rozenberg University of Leiden, The Netherlands
Nadrian Seeman New York University, USA
Friedrich Simmel Technical University of Munich, Germany
Andrew Turberfield University of Oxford, UK
Hao Yan Arizona State University, USA
Erik Winfree California Institute of Technology, USA

Program Committee
Chris Thachuk (Co-chair) California Institute of Technology, USA
Yan Liu (Co-chair) Arizona State University, USA
Mark Bathe Massachusetts Institute of Technology, USA
Robert Brijder Hasselt University, Belgium
Yuan-Jyue Chen Microsoft Research, Redmond, USA
Anne Condon University of British Columbia, Canada
Mingjie Dai Harvard University, USA
David Doty University of California, Davis, USA
Andre Estevez-Torres CNRS, France
Elisa Franco University of California, Los Angeles, USA
Cody Geary Aarhus University, Denmark
Anthony J. Genot CNRS, France and University of Tokyo, Japan
Manoj Gopalkrishnan India Institute of Technology, Bombay, India
Elton Graugnard Boise State University, USA
Masami Hagiya University of Tokyo, Japan
Rizal Hariadi Arizona State University, USA
Natasha Jonoska University of South Florida, USA
Lila Kari University of Waterloo, Canada
Yonggang Ke Emory University, USA
Matthew R. Lakin University of New Mexico, USA
Chenxiang Lin Yale University, USA
Satoshi Murata Tohoku University, Japan
viii Organization

Pekka Orponen Aalto University, Finland


Thomas Ouldridge Imperial College London, UK
Matthew Patitz University of Arkansas, USA
Lulu Qian California Institute of Technology, USA
John Reif Duke University, USA
Dominic Scalise Johns Hopkins University, USA
Joseph Schaeffer Autodesk Research, USA
William Shih Harvard University, USA
David Soloveichik University of Texas at Austin, USA
Darko Stefanovic University of New Mexico, USA
Andrew Turberfield University of Oxford, UK
Bryan Wei Tsinghua University, China
Shelley Wickham University of Sydney, Australia
Erik Winfree California Institute of Technology, USA
Damien Woods Maynooth University, Ireland

Additional Reviewers

Aubert-Kato, Nathanael Mohammed, Abdulmelik


Bui, Hieu Schweller, Robert
Durand-Lose, Jérôme Severson, Eric
Eftekhari, Mahsa Shah, Shalin
Fu, Dan Song, Tianqi
Hader, Daniel Stewart, Jaimie
Haley, David Subramanian, Hari
Hendricks, Jacob Summers, Scott
Imai, Katsunobu Sun, Wei
Jacobson, Bruna Viswa Virinchi, Muppirala
Kawamata, Ibuki Wang, Wen
Linder, Johannes Zadegan, Reza M.
Meunier, Pierre-Étienne

Local Organizing Committee for DNA 25


Georg Seelig (Chair) University of Washington, USA
Luis Ceze University of Washington, USA
Karin Strauss Microsoft Research, Redmond, USA and University
of Washington, USA
Max Willsey University of Washington, USA
Organization ix

Sponsors

International Society of Nanoscale Science, Computing, and Engineering


Microsoft Research (USA)
National Science Foundation (USA)
University of Washington
Contents

Chemical Reaction Networks and Stochastic Local Search . . . . . . . . . . . . . . 1


Erik Winfree

Implementing Arbitrary CRNs Using Strand Displacing Polymerase . . . . . . . 21


Shalin Shah, Tianqi Song, Xin Song, Ming Yang,
and John Reif

Real-Time Equivalence of Chemical Reaction Networks


and Analog Computers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Xiang Huang, Titus H. Klinge, and James I. Lathrop

A Reaction Network Scheme Which Implements Inference and Learning


for Hidden Markov Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Abhinav Singh, Carsten Wiuf, Abhishek Behera,
and Manoj Gopalkrishnan

Efficient Parameter Estimation for DNA Kinetics Modeled


as Continuous-Time Markov Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Sedigheh Zolaktaf, Frits Dannenberg, Erik Winfree,
Alexandre Bouchard-Côté, Mark Schmidt, and Anne Condon

New Bounds on the Tile Complexity of Thin Rectangles


at Temperature-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
David Furcy, Scott M. Summers, and Christian Wendlandt

Non-cooperatively Assembling Large Structures . . . . . . . . . . . . . . . . . . . . . 120


Pierre-Étienne Meunier and Damien Regnault

Simulation of Programmable Matter Systems Using Active Tile-Based


Self-Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
John Calvin Alumbaugh, Joshua J. Daymude, Erik D. Demaine,
Matthew J. Patitz, and Andréa W. Richa

Combined Amplification and Molecular Classification for Gene


Expression Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Gokul Gowri, Randolph Lopez, and Georg Seelig

Reversible Computation Using Swap Reactions on a Surface . . . . . . . . . . . . 174


Tatiana Brailovskaya, Gokul Gowri, Sean Yu, and Erik Winfree

Error-Free Stable Computation with Polymer-Supplemented Chemical


Reaction Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Allison Tai and Anne Condon
xii Contents

SIMD||DNA: Single Instruction, Multiple Data Computation with DNA


Strand Displacement Cascades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Boya Wang, Cameron Chalk, and David Soloveichik

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237


Chemical Reaction Networks
and Stochastic Local Search

Erik Winfree(B)

California Institute of Technology, Pasadena, CA, USA


winfree@caltech.edu

Abstract. Stochastic local search can be an effective method for solv-


ing a wide variety of optimization and constraint satisfaction problems.
Here I show that some stochastic local search algorithms map naturally
to stochastic chemical reaction networks. This connection highlights new
ways in which stochasticity in chemical reaction networks can be used
for search and thus for finding solutions to problems. The central exam-
ple is a chemical reaction network construction for solving Boolean for-
mula satisfiability problems. Using an efficient general-purpose stochas-
tic chemical reaction network simulator, I show that direct simulation
of the networks proposed here can be more efficient, in wall-clock time,
than a somewhat outdated but industrial-strength commercial satisfia-
bility solver. While not of use for practical computing, the constructions
emphasize that exploiting the stochasticity inherent in chemical reaction
network dynamics is not inherently inefficient – and indeed I propose
that stochastic local search could be an important aspect of biological
computation and should be exploited when engineering future artificial
cells.

1 Introduction

Can a cell solve Sudoku? While few would take seriously the prospect of whether
an individual E. coli could beat the puzzle page of the Daily Mail, this question
of principle has significant implications. Sudoku, when generalized, is a par-
ticularly relatable example of an NP-complete problem, and it has been effec-
tively used to illustrate methods to solve constraint satisfaction problems [1,2]
as well as to explore neural computing architectures underlying natural intel-
ligence [3,4]. So our real question is whether 1 cubic micron of biochemistry
could efficiently implement the kinds of algorithms necessary to solve difficult
problems like Sudoku, and if so, how? An answer to this more general question
could be valuable for engineering a future artificial cell that makes the most of
its limited computing resources to get by in the world; it may conceivably also
provide new perspectives on the principles exploited by naturally evolved cells
to solve the problems they encounter during their lives.
?
We will use the P = NP question to frame our discussion [5]. Informally, P
is the class of problems that are solvable in polynomial time (with respect to
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 1–20, 2019.
https://doi.org/10.1007/978-3-030-26807-7_1
2 E. Winfree

the size of the problem instance). A canonical problem in P is the CircuitE-


valuation problem, where a problem instance specifies a feedforward Boolean
circuit and values for each input wire, and the solution is what the circuit should
output on the given input. To solve such an instance requires simply evaluating
each gate in order, which requires only polynomial (roughly linear) time. Infor-
mally, NP is the class of problems whose solutions are verifiable in polynomial
time (where a solution now is the answer accompanied by a polynomial-sized
certificate that explains why). A canonical problem in NP is the CircuitSat-
isfiability problem, where a problem instance specifies a feedforward Boolean
circuit and values for each output wire, and the solution is whether there exist
input values for which the circuit produces the specified output; those input
values constitute a certificate that can be verified in polynomial (roughly linear)
time. CircuitSatisfiability is effectively the inverse problem for CircuitE-
valuation. Problems in NP always can be solved within exponential time by
brute-force enumerating all possible certificates, and verifying them one by one
?
– if any certificate checks out, then an answer has been found. The P = NP
question essentially asks whether there are better algorithms for NP problems
that do something much more clever and thus are guaranteed to find solutions
in polynomial time – if this is possible for all NP problems, then P = NP. But
most computer scientists think the answer is “no”: while clever algorithms may
reduce the form of the exponential, or may provide polynomial time solutions
for a subset of cases, nonetheless for the worst-case hard problem instances of
NP problems, no algorithm can guarantee a polynomial time to find a solution.
What interests us here is not whether P = NP or not, but rather the fact
that studying this question has revealed how fundamental and natural the class
NP is. Presuming that P = NP, then there are problems (many problems!) that
are often enough very hard to solve, yet recognizing that a solution has been
found is relatively easy. Problems with this character have substantial impact
in the real world. For example, in cryptography, decoding a message is hard
without a key, but easy with the key – and this makes internet commerce feasible.
But problems with this character can be found far beyond computer science
and technology. For example, in academia, a professor managing a large group
is feasible only because solving research problems is hard and time-consuming
(the graduate student’s job) but recognizing that the research problem has been
solved (the professor’s job) is dramatically easier and less time-consuming. In
fact, the professor is able to steer the research group in the direction she wants
just by wisely posing a set of problems to be tackled, waiting for the students
to solve them (by cleverness, by luck, by standard techniques, by unexpected
genius, by brute force, it doesn’t matter), and then verifying that each solution
is genuine. More generally, hierarchical organization in science, business, and
society relies on the distinction between the difficulty of doing a task and the
ease of verifying that it has been done properly. The design of organizations
that are effective at accomplishing their goals in turn relies on aptly defining the
subtasks and the criteria for success.
Chemical Reaction Networks and Stochastic Local Search 3

Let’s call this programming by recognition: rather than specifying all the
details of an algorithm for how to find a solution, the programmer just provides
a simpler specification for how to recognize a solution. This is in fact a central
idea for constraint logic programming languages, such as Prolog and CLP,
where the programmer concerns himself with what (easy to check) constraints
define the solution that is being sought, and standardized methods are used to
find the solution [6]. Programs in such languages often don’t have guarantees on
run times, but when done carefully, they can often find solutions effectively.
From this perspective, CircuitSatisfiability can be viewed as a very low-
level constraint logic programming language, and along with more powerful gen-
eralizations such as satisfiability modulo theories, Boolean satisfiability solvers
are now used routinely in industry [7–10]. While carefully-crafted deterministic
algorithms remain the dominant general-purpose methods for solving Boolean
constraint problems, for many years a broad class of hard problems were best
solved by surprisingly simple stochastic algorithms that perform biased random
walks through the space of potential solutions [11–14]. This observation posi-
tions stochastic local search as a viable engine to power systems designed using
the programming by recognition paradigm.
There is ample evidence for programming by recognition in biology, suggest-
ing that it provides evolutionary advantages as a system architecture. A classic
example occurs during Eukaryotic cell division, when it becomes necessary to
move one copy of each chromosome to polar opposite sides of the cell. Since
the interior of a cell can be chaotic, this poses the problem of how to find each
chromosome, prior to pushing them into place. Nature’s solution is to grow
microtubules bridging pairs of chromosomes, using a “search and capture” app-
roach [15] whereby microtubules grow in all directions but are stabilized only
when they recognize their proper target. The search involves stochastic explo-
ration and energetically expensive mechanisms such as “dynamic instability”
that alternate fast growth with fast depolymerization, which has been shown to
be a more effective algorithm than a passive and energetically-neutral random
walk of polymer length [16]. Compared to a hypothetical deterministic molec-
ular algorithm for solving the same problem (“take a left at the endoplasmic
reticulum...”), the stochastic “search and capture” algorithm presumably has
the advantages that it is simpler to encode genetically, more robust, and thus
more easily evolvable [17,18]. Moving to a higher level of biological organiza-
tion, a second classic example is learning, which often involves a biased random
walk through parameter space that recognizes when good performance has been
achieved [19,20]. As before, there are advantages: organisms that learn can have
smaller genomes, are more robust, and can evolve faster than organisms with
hard-coded circuity [21]. Indeed, evolution itself exhibits some characteristics of
programming by recognition – if survival is the ultimate form of recognition.
Our interest here is to explore programming by recognition as a paradigm for
engineering circuits within artificial cells that exploit the natural stochasticity
of molecular interactions to provide efficient solutions to hard problems that the
cell might encounter. For simplicity, we ignore the geometric factors present in
4 E. Winfree

the motivating example of cell division and instead focus on well-mixed chemical
reaction networks involving a finite number of species in a finite volume. This
choice is attractive not only for its mathematical simplicity, but also because it
can be considered a programming language for engineering molecular systems
using dynamic DNA nanotechnology [22–25].

2 Stochastic Chemical Reaction Networks

We will use the standard model for formal chemical reaction networks (CRNs)
with discrete stochastic semantics for mass-action kinetics [26]. A CRN is spec-
ified by a finite set of species, e.g. {A, B, C, . . . , X, Y, Z} and a finite set of
k k k k
reactions, e.g. {A + B →1 B, X + A →2 C, Y →3 A + C, A →4 B}, where ki are the
stochastic rate constants with respect to an implicitly given reaction volume.
The state of the CRN at time t is given by the discrete counts of each species,
which we will refer to (with a mild abuse of notation) as At , Bt , etc. The propen-
sity ρi of a reaction i at time t gives the instantaneous rate of firing for that
reaction, and may be calculated as the product of ki and the current counts
of each reactant (if all reaction stoichiometries  are 1), e.g. ρ1 (t) = k1 At Bt in
the example above. The total propensity ρ = i ρi is the sum over all reac-
tions. This implicitly defines a continuous time Markov chain (CTMC) with an
infinite state space (although, depending on the CRN and initial state, only a
finite subset may be reachable). In the standard stochastic simulation algorithm
(SSA), the time at which the next reaction occurs is chosen from an exponential
distribution with mean 1/ρ, and at this time, the reaction that occurs is reaction
i with probability ρi /ρ. Simulation continues until a fixed time is exceeded, or a
state is reached where ρ = 0.
Since our central thesis is that stochastic chemical kinetics allow surprisingly
effective problem-solving, it is worth reviewing how stochastic chemical kinetics
(appropriate for a finite volume containing discrete counts of each species) differs
from the more familiar deterministic chemical kinetics (which models a hypo-
thetical well-mixed but infinite volume where real-valued concentrations are the
appropriate measure and ordinary differential equations provide the appropriate
dynamics). I will offer six perspectives.

Noisy behavior. The classical view is that stochastic CRNs are just noisy
versions of deterministic CRNs. There are senses in which this is true. For
non-explosive CRNs [27], if the volume V of a stochastic CRN is scaled up
while keeping the initial concentrations of each species constant, then for
chosen time t, the concentrations in the stochastic model approach the con-
centrations in the deterministic model [28]. This is a Central Limit Theorem
result, that is, Xt approaches a Gaussian with coefficient of variation shrink-
ing with V . But it is not a uniform convergence: to ensure that the stochastic
CRN’s concentrations are likely within a certain percentage of the determin-
istic CRN, V may have to grow with t (depending on the specific CRN).
Chemical Reaction Networks and Stochastic Local Search 5

Extinction and reachability. For a fixed volume, stochastic CRN behavior


can differ qualitatively from deterministic behavior. Most notably, species (or
reactions) may become extinct in the stochastic CRN despite being active
forever in the deterministic CRN. This occurs in the classical predator-prey
oscillator, {R → 2R, F + R → 2F, F → ∅}. More generally, stochastic CRNs
can be limited by discrete state-space reachability constraints, reflecting deep
connections to computability theory [29–31] that are not present in the con-
tinuous deterministic state space.
Perfect Boolean values. The hard distinction between none and some that
is inherent to stochastic CRNs can make deterministic computation easier
than in deterministic CRNs. For example, implementing feedforward Boolean
logic circuit computations is straightforward with stochastic CRNs [22], where
signals on wires can be represented by counts of 0 or 1 for specific species.
But when signals are represented as high or low real-valued concentrations
in deterministic CRNs, error-correcting non-linearities are needed to perform
signal restoration [32].
Computing with counts. The count for a single chemical species can store
the value of an arbitrary non-negative integer, giving stochastic CRNs the
ability to perform uniform computation – in the sense that a single computing
machine can process arbitrarily large input instances [33–36]. Turing-universal
computation is possible with vanishingly small probability of error.
Computing with distributions. Probabilistic behavior and probabilistic rea-
soning is an adaptive response for living in a world where partial information is
available. Unlike deterministic CRNs, where probabilities must be represented
as concentrations [37,38], stochastic CRNs have the potential to directly rep-
resent probabilities via probabilities [39–41]. Although stochastic CRNs that
satisfy detailed balance can only produce equilibrium distributions that are
products of Poisson distributions [42], constraints of state-space reachabil-
ity can shape marginals to approximate arbitrary distributions, as can non-
equilibrium steady-states in CRNs that do not satisfy detailed balance [43].

That was only five. The sixth perspective – that stochastic CRNs inher-
ently perform stochastic local search – is developed in the rest of this
paper.

3 Evaluating and Satisfying Circuits

We begin by reviewing how stochastic CRNs can efficiently solve CircuitE-


valuation problems, using methods similar those in work cited above. Given a
feedforward Boolean circuit that uses 2-input unbounded fan-out gates, our goal
is to construct a stochastic CRN that, presented with molecules representing
any input to the circuit, will produce molecules representing the output of the
circuit, and then all reactions will become extinct. Specifically, for a circuit c
with N inputs and M gates, the CRN CircuitEvaluationCRN[c] will employ
2(N + M ) species and 4M reactions, as illustrated in Fig. 1(A) and as follows:
6 E. Winfree

Fig. 1. (A) Evaluating feedforward Boolean circuits with stochastic CRNs.


Red reactions correspond to the gate with the red dot; blue reactions correspond to
the gate with the blue dot. (B) Solving Circuit-SAT with stochastic CRNs. Red
reactions correspond to the gate with the red dot. Clamping reactions set the output
to the desired value. In this example, N = 3 and M = 12. (Color figure online)

• Each wire in the circuit is named, and for each wire X we use two species,
X0 and X1.
• Initially, and for all time thereafter, there will be one molecule per wire, i.e.
X0t + X1t = 1.
• For each gate Z = g(X, Y ) where g is a Boolean function, the four reactions
are

X0 + Y 0 + Z(1 − v) → X0 + Y 0 + Z(v) with v = g(0, 0)


X0 + Y 1 + Z(1 − v) → X0 + Y 1 + Z(v) with v = g(0, 1)
X1 + Y 0 + Z(1 − v) → X1 + Y 0 + Z(v) with v = g(1, 0)
X1 + Y 1 + Z(1 − v) → X1 + Y 1 + Z(v) with v = g(1, 1)

where Z(0) ≡ Z0, Z(1) ≡ Z1, and all rate constants are identical, say k.
Chemical Reaction Networks and Stochastic Local Search 7

In other words, for each input case for the gate, there are reactions that
catalytically convert an incorrect output species into a correct output species. It
will be convenient to associate full states of the CRN, in which there are exactly
one molecule for each wire, with assignments of Boolean values to each wire, in
the obvious way. We can generalize this to partial assignments, so that e.g. for
circuit input x, Wires[x] refers to any full state of the CRN such that the species
representing input wires have the specified values, while other species have arbi-
trary counts consistent with the one-molecule-per wire constraint. Similarly, for
circuit output y, Wires[y] refers to any full state of the CRN such that the
output species have the specified values, and other species are unconstrained.

Theorem 1 (Feedforward circuit evaluation). For feedforward Boolean cir-


cuit c, input x, and stochastic CRN CircuitEvaluationCRN[c], any initial
state Wires[x] will evolve to a state Wires[c(x)] at which point all reactions
will be extinct.

Proof. Since c is feedforward, we can order the gates such that their inputs
are always either prior gates or inputs to the circuit. Because each reaction is
catalytic in the gate inputs, once all wires prior to a gate are correct, they will
never change again. That gate will become correct with expected time 1/k. Thus,
all M wires will be correct within expected time O(M/k). 


Feedforward circuits compute from input to output in polynomial time. To


reverse the information flow from output to input, thus solving a circuit sat-
isfaction problem, requires some guesswork or brute-force enumeration, and (if
P = NP) requires more than polynomial time, e.g. exponential time. Surpris-
ingly, the stochastic CRN for solving this problem is not significantly larger, in
terms of the number of reactions.
The idea remains that each CRN reaction will detect a violation of circuit
correctness, such that if all reactions go extinct, then the circuit represents a
valid solution to the problem. There are two new ingredients. First, unlike how
we set the inputs for feedforward evaluation using the initial state, here we will
allow arbitrary initial state, but treat the output species having the wrong value
as a violation of circuit correctness. Therefore, we introduce clamping reactions
that detect if the output is wrong, and if so, fix it. E.g. if output wire Y should be
0, we include a reaction Y 1 → Y 0. Second, when a gate’s output is inconsistent
with its input, we no longer know whether the problem is that the output is
incorrect, or the input is incorrect – so we also include reactions that detect the
gate’s inconsistency and change one of the inputs, instead of changing the output.
These reactions are illustrated in Fig. 1(B). Which reaction fires first is random,
according to stochastic CRN semantics. Altogether, for circuit c and output
y, this construction results in a circuit CircuitSATCRN[c, y] with 2(N + M )
species and 12M + L reactions, where there are L output wires. Note that the
circuit no longer needs to be feedforward, and the clamped target values do not
need to be output wires; our comments below can be trivially extended to this
generalization.
8 E. Winfree

Theorem 2 (Solving circuit satisfiability). For satisfiable Boolean circuit


c, output y, and stochastic CRN CircuitSATCRN[c, y], any initial state will
evolve to a state Wires[x, y] where y = c(x), at which point all reactions will be
extinct.
Proof. Since the set of possible local violations of correctness correspond exactly
to the set of reaction reactants, it follows that if all reactions go extinct, then a
solution has been found. Similarly, if the current CRN state does not correspond
to a solution, then at least one reaction in the CRN will be poised to fire. What
remains to be shown is that, from any initial state, a state representing a valid
solution can be reached. Let s be a CRN state corresponding to a valid solution,
and let s be the current state, which is not a valid solution. Suppose s deviates
from s in n wires. If s is not valid because of an incorrect output wire, then we
can take a reaction that corrects the output wire, leading to a state s that has
n − 1 deviations from s. If s is not valid because of an incorrect gate, then either
an input or the output of that gate deviates from s. One of the 12 reactions for
that gate corrects this deviation, leading to a state s that has n − 1 deviations
from s. Either way, if s is not itself a valid solution, then we recursively show
that there is a sequence of reactions that leads either to s or to another valid
solution. 

Thus, when CircuitSATCRN[c, y] is started in any one-molecule-per-wire
state, it will eventually find a solution x if one exists. However, if no solution
exists – i.e. the circuit is not satisfiable – then the CRN will continue exploring
the state space forever. And even when a solution does exist, we have no useful
bound on how long the CRN will take to find it1 .

4 Formula Satisfiability
The computer science community has converged not on circuit satisfiability
problems, but on formula satisfiability problems as the standard for Boolean
logic constraint solvers. Circuit satisfiability problems can be translated to for-
mula satisfiability problems with little overhead; in fact, even when limited to
clauses with no more than three literals each – i.e. 3-SAT – the problem is still
NP-complete. Such simple building blocks facilitate analysis and constructions.
Figure 2(A) illustrates how to construct stochastic CRN FormulaSATCRN[f ]
that solves 3-SAT formula f using the same principles as for circuit satisfiabil-
ity, but now using just 2N species and 3M reactions, where f has N variables
and M clauses. A sample run is shown in Fig. 2(B). This CRN has similar mer-
its and demerits as the circuit satisfiability CRN: in theory, it is guaranteed to
eventually find a solution if one exists; in practice, you’re not likely to have the
patience to watch it try to solve a hard problem with 100 variables.
1
The sequence of reactions identified in the proof will have a positive probability of
occurring next, specifically, at least (12M + L)−(N +M ) . This provides an exponential
bound on the expected time to halt, to wit, less than (12M +L)N +M /k +(N +M )/k.
But is that useful?
Chemical Reaction Networks and Stochastic Local Search 9

Fig. 2. (A) Solving 3-SAT problems with stochastic CRNs. Red reactions cor-
respond to the red clause; blue reactions correspond to the blue clause; green reaction
correspond to the green clause. The (N = 20, M = 24) formula illustrated here was
once solved on a DNA computer [44], although variables have been renamed. (B)
Space-time history of a 3-SAT run. Species are arranged vertically; each column
of 40 pixels corresponds to the state of the CRN before or after each reaction fires;
black if the species count is 0, grey if the species count is 1 but that disagrees with the
solution eventually found, white if the species count is 1 and it agrees with the solution
eventually found. At the end of time, the CRN has gone extinct. (Color figure online)

Why is our formula satisfiability CRN so ineffective? One intuition is that


when a clause is not satisfied, there are three possible ways to try to fix it – flip
one of the three variables – but some of those actions will cause other clauses to
break. The CRN makes no distinctions, so in a situation where there is one way
to make things better, and two ways to make things worse, it is more likely to
make things worse. Thus, as the CRN performs a stochastic local search of the
state space, the projection onto the number of conflicted clauses does a random
walk that hovers around some average number, making occasional excursions
toward more or toward fewer.
10 E. Winfree

Similar problems have been encountered in conventional SAT-solvers based


on stochastic local search, and effective – though heuristic – countermeasures
have been devised [11–14]. The basic idea is to bias the choice of clause and
variable to flip so as to favor moves that reduce the number of conflicts. A
particularly simple and effective incarnation of this idea is WalkSAT [12]. The
core algorithm is just this:

1. Start with a random assignment of values to variables.


2. At random choose an unsatisfied clause.
3. Flip a variable from that clause, thus making it satisfied, such that the fewest
other clauses become unsatisfied.
4. With some low probability, flip a random variable.
5. If the formula is not satisfied, go back to step 2.

Variants of this algorithm dominated the “random” category in the international


SAT competitions for over a decade, until 2014 [9]. (For formulas generated
randomly with a certain ratio of clauses to variables, α = M/N , there is a
critical value of α ≈ 4.26 below which problems are likely to be satisfiable and
“easy” to solve, and above which problems are likely to be unsatisfiable; near
the threshold, problems become quite hard [14,45,46].)
A similar kind of bias can be introduced into our CRN SAT-solver, yielding a
new construction WalkSATCRN[f ], which now has 4N species and 4M + 2N
reactions. What seems simplest to implement in a CRN is to reject attempts to flip
bits that, if changed, would cause many clauses to become unsatisfied. Our spe-
cific construction is illustrated in Fig. 3(A). If there is an unsatisfied clause, e.g.
(A or L or N ), then the corresponding species will all attempt to flip, e.g. via the
reaction A0+L0+N 0 → tryA1+tryL1+tryN 1. While they are trying to flip, these
variables cannot be involved in additional conflict detection events, thus somewhat
limiting the number of variables that simultaneously try to flip. However, at the
beginning of the run, a “wound area” of variables trying to flip will quickly emerge,
possibly until all clauses either have some flipping variable or are already satisfied.
Now there is a competition for “healing” the wound: at a slow rate, variables try-
ing to flip will successfully solidify their choice via reactions such as tryA1 → A1;
while at a faster rate flips will be rejected if solidifying would have introduced a con-
flict, e.g. via the rejection reaction D0 + tryA1 + K1 → D0 + A0 + K1 associated
with clause (D or !A or !K). Thus, the healing wound will result in changed values
preferentially for variables that introduce no new conflicts, or few of them – with
the preference being more strongly against changes that introduce more conflicts,
because the rate of rejecting an attempted flip will be proportional to the number
of reactions trying to reject it. Nonetheless, occasionally changes will increase the
number of conflicts, since which reaction occurs next is probabilistic in the SSA.
Whereas a simple argument sufficed to show that CircuitSATCRN[c, y]
and FormulaSATCRN[f ] halt with a valid solution if and only if their problem
is satisfiable, the fact that WalkSATCRN[f ] attempts to flip three variables
Chemical Reaction Networks and Stochastic Local Search 11

simultaneously has so far confounded my attempts to prove its correctness2 .


Moreover, we have no theoretical guarantees for the effectiveness of the stochastic
local search bias for finding solutions quickly.
Therefore, without further analysis and sticking with the first fast-to-slow
reaction rate ratio that seemed to work OK, we evaluated the effectiveness of
WalkSATCRN[f ] on random satisfiable formulas near the critical threshold.
Formulas with 100 variables were reliably solved in just a few seconds, while
formulas with 500 variables were reliably solved in under an hour (103.56 seconds)
and typically much faster. In no case did we encounter a satisfiable formula that
the CRN failed solve. Several comments are in order. First, how fast the CRN
runs, in wall-clock time, depends on what CRN simulator you use. Second, it
would be useful to have a point of comparison for how hard it is to solve the
random formula instances.
For the comparison, we used Mathematica’s built-in command SatisfiableQ,
which makes use of the MiniSAT 1.4 library [47]. MiniSAT is a deterministic
algorithm that can both solve satisfiable problems as well as declare problems
to be unsatisfiable. MiniSAT and its variants have been perennial winners in the
international SAT competition, although in recent competitions the improved
MiniSAT 2.2 has merely been the baseline that the winning algorithms soundly
surpass [9].
Regarding the simulator, I used a general-purpose Mathematica-based CRN
simulator originally developed by Soloveichik [48] that I extended to be more effi-
cient on large CRNs by using data structures similar to those in prior work [49–
51]. Specifically, the simulator pre-computes a fixed binary tree of reactions in
which all reaction propensities are stored, along with a list Δi , for each reaction
i, indicating which other reactions’ propensities will be changed when reaction i
fires – i.e. those whose reactants have their counts changed by the given reaction.
Thus, for a CRN with R reactions, each step of the SSA involves lg R choices
through the binary tree to navigate to the selected reaction i, followed by recal-
culation of the propensities of only the reactions in Δi , followed by |Δi | lg R
hierarchical updates of propensities within the binary tree. This avoids much of
the redundant calculations in naive implementations of SSA. For further speed,
the inner loop of the SSA uses Mathematica’s Compile function, which effec-
tively compiles to C. Thus, the CRN simulator we use here is reasonably fast,
but has no optimizations that are specific to the SAT-solving CRN constructions
– it is a general-purpose CRN simulator.
Figure 3(B) compares the wall-clock time for running the CRN simulator on
WalkSATCRN[f ] for random hard formulas f (selected by SatisfiableQ to
be satisfiable) versus the time taken by SatisfiableQ itself to solve the same
problem. For a given problem size (i.e. dot color, labeled by N for M = 4.2N ),

2
A straightforward adaptation of the previous argument works for a closely related
CRN that is identical to WalkSATCRN[f ] except that species tryX0 and tryX1
are conflated as tryX for each variable X. This CRN should work similarly, as the
main difference is merely that a variable being flipped now might spontaneously
revert. But it is not the CRN that I simulated.
12 E. Winfree

Fig. 3. (A) A WalkSAT-inspired CRN for solving 3-SAT problems with


stochastic CRNs. Fast reactions have rate constant 1.0, while slow reactions have
rate constant 0.1. (B) Wall-clock time comparison for solving random 3-SAT
problems. Each dot represents a different random 3-SAT formula with M = 4.2N
and the indicated number of variables. Times are reported by their logarithm base 10.
Blue dashed line indicates where Mathematica’s SatisfiableQ takes the same time as
simulating the CRN. A 2.6 GHz Macbook Pro (2013) was used. (Color figure online)
Chemical Reaction Networks and Stochastic Local Search 13

there is considerable scatter in the times taken to solve different instances. The
vertical scatter (the CRN time) is due not only to the variability in the problem
instance, but also due to variability in the CRN’s stochastic local search pro-
cess – solving the same large instance multiple times reveals a timing standard
deviation nearly equal to the mean. (In contrast, Mathematica’s solver exhibited
only 3% variation when re-solving the same problem, which was presumably due
to background processes in the operating system.) The CRN simulator clearly
has a substantial overhead: for small (N = 50) problems, the average CRN time
is about a third of a second, while Mathematica solves most problems in little
more than a millisecond. Despite this, the CRN becomes more efficient for larger
problems, eventually out-performing Mathematica on the largest (N = 500)
instances. Here, the CRN is taking on average about 5 minutes, while Mathe-
matica is averaging at over two hours. For this N , the CRN has roughly 10,000
reactions.
Today’s best SAT-solvers can beat random 3-SAT problems with α = 4.267
and N > 5000 in under an hour [9]. I have not tried it, but I don’t presume
the WalkSATCRN[f ] simulation would be anywhere close to being compet-
itive. The take-home message is not that simulating a CRN is a good way to
solve SAT problems – I don’t think it is – but rather that stochastic local search
comes fairly naturally to CRNs, and they are not incredibly bad at it. For a
given SAT problem, the size of the CRN is linear in the number of variables and
clauses (specifically, 4M +2N ) and the volume required to store one molecule per
wire is just O(N ). (Note, however, that for a DNA strand displacement imple-
mentation, one DNA fuel complex would be required for each time a reaction
fires, entailing a ridiculously unrealistic overhead since solving SAT problems
of the scale shown in Fig. 3(B) involves millions or billions of reaction events.
For fuel-efficient SAT-solving CRNs, see the beautiful papers by Thachuk and
colleagues [52–54]; their CRNs effectively implement a brute-force enumeration
method, but using reversible reactions within polynomial volume.)

5 Recognizing and Generating Patterns


We are tempted to think of SAT-solving by stochastic local search as a general-
purpose mechanism for programming by recognition in molecular systems. The
hard SAT instances may not represent the most interesting or useful cases; the
value might be in the flexibility and robustness of the computing paradigm.
Consider the problem of making inferences about complex environmental
signals. Formulas, circuits, or most generally, networks of relations [55] can be
used to represent knowledge about a domain in terms of constraints. In the
absence of information from the environment, there may be an enormous number
of possible solutions; perhaps we only need one. When additional information is
available, in the form of certain variables being True or False, all we need are
clamping reactions (such as A1 → A0 if the environment dictates that A is False),
and the stochastic local search will be forced to find a solution that also satisfies
the environmental constraints. Depending on the structure of the network and
which variables are clamped, this may correspond to evaluating a circuit in the
14 E. Winfree

feedforward direction (easy!) or solving a circuit satisfiability problem (hard!)


or something in between. It is a general form for potentially omnidirectional
computing in CRNs by clamping. (There are striking similarities to the Chemical
Boltzmann Machine [40], which allows for similarly omnidirectional inferences to
be made by clamping species representing known information, but in that work
the inference is probabilistic and computes conditional probabilities.)
A classic paradigm for omnidirectional computation is the associative recall
of memories in the Hopfield model [56]. The task here is to store a finite set
of “memories” (i.e. binary vectors) into the weights of a neural network, such
that when the network is initialized with a test vector, the dynamics of neural
updates will bring the system to the known memory that is “closest” (in some
sense) and halt there. For example, suppose the memories are 17 × 17 binary
images of Alan Turing, George Boole, Ludwig Boltzmann, Rosalind Franklin,
Ada Lovelace, and Warren McCulloch. If the network can “see” only the top
half of an image – i.e. the neurons corresponding to those pixels are clamped to
the correct values for one of the memories, while the rest of the neurons continue
to be updated – then it will reconstruct the rest of the image by “associative
recall”. It can do the same if it sees any sufficiently large subset of pixels. If the
pixels that it sees are partially corrupted, then when the clamping is released,
the errors will be corrected and the stored memory established – at least most
of the time, with some caveats, and if not too many memories are stored.
A very similar associative memory task can be accomplished by a Boolean
SAT solver performing stochastic local search. To “store” the memories, one
needs to construct a formula (or circuit) that has several valid solutions – one for
each memory. Now, if enough variables are clamped such that only one memory
is compatible with the clamped variables, the SAT solver is guaranteed to find
that unique solution, thus performing associative recall. If, instead, the variables
are initialized (but not clamped) to a pattern similar to one of the memorized
patterns, then the stochastic local search is likely to reach that solution first.
We demonstrate this idea by constructing a formula whose only solutions are
exactly those shown in Fig. 4(A), using the Exclusion Network approach [55].
Specifically, we randomly choose n triples of variables, for each triple make a
subformula that allows only the combinations that occur in the set of target
memories, and create a formula that is the conjunction of all n subformulas.
This formula is guaranteed to have the target memories as valid solutions, and
as n increases, it excludes more and more alternative solutions (if there are not
too many target memories). After algebraically converting to conjunctive normal
form for 3-SAT, we can build the CRN SAT-solver.
The constraints imposed by a SAT formula may be used to define not only
pattern recognition processes, but also pattern generation processes. To illustrate
the use of SAT solving for a morphogenesis application, we consider a case where,
rather than having a unique solution or a small number of chosen solutions as
in the associative memory discussed above, the SAT constraints define a com-
binatorial set of solutions with meaningful properties in common. Figure 4(B)
shows several solutions of a SAT formula that imposes only local restrictions that
Chemical Reaction Networks and Stochastic Local Search 15

Fig. 4. (A) The WalkSAT-inspired CRN performing as an associative mem-


ory. Top: The principle for constructing a Boolean formula encoding the memo-
ries. Bottom: Clamping a 9-pixel portion of Boltzmann leads to recall of Boltzmann.
Grey pixels are trying to flip. (B) The WalkSAT-inspired CRN maintaining a
membrane-like structure. The Boolean formula only enforces that solutions have
black in the corners and all interior cells are either white or have exactly two immediate
neighbors that are black. Ten representative solutions are shown.
amount to insisting that black pixels form uninterrupted lines that connect to
the corners. Thus, these patterns are fixed points for the SAT-solving CRN, but
if disturbed by external perturbations – or additional internal constraints – the
CRN will perform stochastic local search to re-establish the connectivity of the
membrane-like patterns. Here we see that stochastic local search simultaneously
forms the pattern and provides a self-healing capability.
These examples are intended to highlight the connection between stochastic
local search SAT solvers and more biological notions of memory, inference, mor-
phogenesis, self-healing, homeostasis, and robustness – how a biological organ-
ism self-regulates to restore and maintain critical structures, concentrations, and
functions [57].
16 E. Winfree

Fig. 5. Sudoku. Left: The puzzle instance. Given the black digits, the remaining cells
must be filled in such that every 3 × 3 square has all digits 1 . . . 9, as does every row
and every column. Right: The solution to this puzzle, in red. (Color figure online)

6 Sudoku
This paper wouldn’t be complete without a return to the original question of
whether a cell could solve Sudoku. To take a first stab at answering that question,
note that the constraints of Sudoku can be expressed as a SAT formula [1,2].
Unfortunately, at least for the approach I used, the resulting formulas could
not be easily solved by WalkSATCRN[f ] simulations. This is perhaps not too
surprising; while the classical WalkSAT algorithm is effective for hard random
problems and many easy problems, on most “structured” problems, deterministic
algorithms that perform clever depth-first search, like MiniSAT, perform much
better [14].
Can stochastic CRNs also perform efficient depth-first search? It would be
easier – and nearly as effective – to repeatedly take random dives through the
search tree to a leaf, rather than to deterministically traverse each node exactly
once, which would require extra bookkeeping. Such a stochastic depth-first search
would bear some similarity to dynamic instability in microtubules’ search for
chromosomes [15,16]: the microtubule quickly grows in a random direction, mak-
ing random choices as it goes; if it is unsuccessful finding a chromosome, it even-
tually suffers a “catastophe” and rapidly contracts, then starts over... until it
finds a chromosome.
Based on this vision, we can construct a stochastic CRN to solve an arbitrary
Sudoku puzzle (Fig. 5). There are 93 species whose presence indicates that a spe-
cific digit may possibly be in a specific cell; another 93 that indicate it is definitely
not; another 92 that indicate that a cell’s value is known (i.e. only one digit may
be there); more that indicate it is unknown; and some additional bookkeeping
species, including F orward and Reverse. When F orward is present, a set of
reactions quickly enforce logical constraints among the species; more slowly, a
cell with few options will spontaneously choose one, thus descending the search
tree. If a contradiction is noted, a reaction will convert F orward to Reverse,
and the logic bookkeeping will dissolve... to be rebuilt when Reverse switches to
Chemical Reaction Networks and Stochastic Local Search 17

F orward again. The CRN has roughly 35, 000 reactions, and solves all available
Sudoku problems in under half an hour, including the hardest ones on Gordon
Royle’s list [58].
The number of reactions in the Sudoku CRN is within an order of magnitude
of existing whole-cell models of bacteria [59]. So maybe we could conceive of
a bacterial-sized artificial cell that implemented that many reactions. However,
successfully solving hard Sudoku puzzles involves many dives into the search tree
and many millions or billions of reaction events. Even assuming rate constants on
the order of 1 per second, that would take many days or years. E. coli reproduces
in 20 min. So no, it seems that cells are unlikely to be successful solving Sudoku.

7 Discussion
Nonetheless, we may have learned something during this somewhat stochastic
exploration of ideas. Foremost in my mind is that the stochasticity inherent
in CRNs provides a natural engine for stochastic local search and thus pro-
gramming by recognition – the hallmark algorithmic architecture defining NP
problems. The architecture is robust and flexible, pivoting seamlessly from effi-
cient solution of easy problems to relatively efficient solution of hard problems,
naturally accommodating memory, inference, self-healing, and homeostasis with
respect to constraints.
Software. Mathematica packages and notebooks for the CRN simulator, SAT-
solving CRN constructions, and Sudoku solver can be found on the author’s
website [60].

Acknowledgements. This work was supported in part by National Science Foun-


dation (NSF) grant 1317694 – The Molecular Programming Project. Thanks to Matt
Cook, David Soloveichik, Chris Thachuk, William Poole, Lulu Qian, Grzegorz Rozen-
berg, Moshe Vardi, Tony Rojko, and Henry Lester for stimulating questions, comments,
and encouragement.

References
1. Simonis, H.: Sudoku as a constraint problem. In: Proceedings of the 4th Interna-
tional Workshop on Modelling and Reformulating Constraint Satisfaction Prob-
lems, vol. 12, pp. 13–27 (2005)
2. Lynce, I., Ouaknine, J.: Sudoku as a SAT problem. In: Proceedings of the 9th
International Symposium on Artificial Intelligence and Mathematics (AIMATH)
(2006)
3. Hopfield, J.J.: Searching for memories, Sudoku, implicit check bits, and the iter-
ative use of not-always-correct rapid neural computation. Neural Comput. 20,
1119–1164 (2008)
4. Jonke, Z., Habenschuss, S., Maass, W.: Solving constraint satisfaction problems
with networks of spiking neurons. Front. Neurosci. 10, 118 (2016)
5. Garey, M.R., Johnson, D.S.: Computers and Intractability. W. H. Freeman and
Company, New York (1979)
18 E. Winfree

6. Jaffar, J., Maher, M.J.: Constraint logic programming: a survey. J. Logic Program.
19, 503–581 (1994)
7. Vardi, M.Y.: Boolean satisfiability theory and engineering. Commun. ACM 57, 5
(2014)
8. Järvisalo, M., Le Berre, D., Roussel, O., Simon, L.: The international SAT solver
competitions. AI Mag. 33, 89–92 (2012)
9. Balyo, T., Heule, M.J.H., Jarvisalo, M.: SAT competition 2016: recent develop-
ments. In: Thirty-First AAAI Conference on Artificial Intelligence (2017)
10. de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R.,
Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg
(2008). https://doi.org/10.1007/978-3-540-78800-3 24
11. Selman, B., Kautz, H.A., Cohen, B.: Local search strategies for satisfiability testing.
Cliques, Color. Satisf. 26, 521–532 (1993)
12. Selman, B., Kautz, H.A., Cohen, B.: Noise strategies for improving local search.
In: Proceedings of the 12th National Conference on Artificial Intelligence, vol. 94,
pp. 337–343. MIT Press (1994)
13. Hoos, H.H., Stützle, T.: Stochastic Local Search: Foundations and Applications.
Elsevier, Amsterdam (2004)
14. Gomes, C.P., Kautz, H., Sabharwal, A., Selman, B.: Satisfiability solvers. Founda-
tions of Artificial Intelligence 3, 89–134 (2008)
15. Kirschner, M., Mitchison, T.: Beyond self-assembly: from microtubules to morpho-
genesis. Cell 45, 329–342 (1986)
16. Holy, T.E., Leibler, S.: Dynamic instability of microtubules as an efficient way to
search in space. Proc. Nat. Acad. Sci. 91, 5682–5685 (1994)
17. Gerhart, J., Kirschner, M.: Cells, Embryos, and Evolution: Toward a Cellular and
Developmental Understanding of Phenotypic Variation and Evolutionary Adapt-
ability. Blackwell Science, Malden (1997)
18. Kirschner, M., Gerhart, J.: Evolvability. Proc. Nat. Acad. Sci. 95, 8420–8427 (1998)
19. Cauwenberghs, G.: A fast stochastic error-descent algorithm for supervised learning
and optimization. In: Advances in Neural Information Processing Systems, pp.
244–251 (1993)
20. Sebastian Seung, H.: Learning in spiking neural networks by reinforcement of
stochastic synaptic transmission. Neuron 40, 1063–1073 (2003)
21. Hinton, G.E., Nowlan, S.J.: How learning can guide evolution. Complex Syst. 1,
495–502 (1987)
22. Cook, M., Soloveichik, D., Winfree, E., Bruck, J.: Programmability of chemical
reaction networks. In: Condon, A., Harel, D., Kok, J., Salomaa, A., Winfree, E.
(eds.) Algorithmic Bioprocesses. Natural Computing Series, pp. 543–584. Springer,
Heidelberg (2009)
23. Soloveichik, D., Seelig, G., Winfree, E.: DNA as a universal substrate for chemical
kinetics. Proc. Nat. Acad. Sci. 107, 5393–5398 (2010)
24. Chen, Y.-J.: Programmable chemical controllers made from DNA. Nat. Nanotech-
nol. 8, 755 (2013)
25. Srinivas, N., Parkin, J., Seelig, G., Winfree, E., Soloveichik, D.: Enzyme-free nucleic
acid dynamical systems. Science 358, eaal2052 (2017)
26. Gillespie, D.T.: Stochastic simulation of chemical kinetics. Ann. Rev. Phys. Chem.
58, 35–55 (2007)
27. Anderson, D.F., Cappelletti, D., Koyama, M., Kurtz, T.G.: Non-explosivity of
stochastically modeled reaction networks that are complex balanced. Bull. Math.
Biol. 80, 2561–2579 (2018)
Chemical Reaction Networks and Stochastic Local Search 19

28. Kurtz, T.G.: The relationship between stochastic and deterministic models for
chemical reactions. J. Chem. Phys. 57, 2976–2978 (1972)
29. Karp, R.M., Miller, R.E.: Parallel program schemata. J. Comput. Syst. Sci. 3,
147–195 (1969)
30. Johnson, R.F., Dong, Q., Winfree, E.: Verifying chemical reaction network imple-
mentations: a bisimulation approach. Theor. Comput. Sci. 765, 3–46 (2019)
31. Doty, D., Zhu, S.: Computational complexity of atomic chemical reaction networks.
Natural Comput. 17, 677–691 (2018)
32. Magnasco, M.O.: Chemical kinetics is turing universal. Phys. Rev. Lett. 78, 1190–
1193 (1997)
33. Liekens, A.M.L., Fernando, C.T.: Turing complete catalytic particle computers.
In: Almeida e Costa, F., Rocha, L.M., Costa, E., Harvey, I., Coutinho, A. (eds.)
ECAL 2007. LNCS (LNAI), vol. 4648, pp. 1202–1211. Springer, Heidelberg (2007).
https://doi.org/10.1007/978-3-540-74913-4 120
34. Soloveichik, D., Cook, M., Winfree, E., Bruck, J.: Computation with finite stochas-
tic chemical reaction networks. Nat. Comput. 7, 615–633 (2008)
35. Chen, H.-L., Doty, D., Soloveichik, D.: Deterministic function computation with
chemical reaction networks. Natural Comput. 13, 517–534 (2014)
36. Cummings, R., Doty, D., Soloveichik, D.: Probability 1 computation with chemical
reaction networks. Natural Comput. 15, 245–261 (2016)
37. Napp, N.E., Adams, R.P.: Message passing inference with chemical reaction net-
works. In: Advances in Neural Information Processing Systems, pp. 2247–2255
(2013)
38. Gopalkrishnan, M.: A scheme for molecular computation of maximum likelihood
estimators for log-linear models. In: Rondelez, Y., Woods, D. (eds.) DNA 2016.
LNCS, vol. 9818, pp. 3–18. Springer, Cham (2016). https://doi.org/10.1007/978-
3-319-43994-5 1
39. Fett, B., Bruck, J., Riedel, M.D.: Synthesizing stochasticity in biochemical systems.
In: Proceedings of the 44th Annual Design Automation Conference, pp. 640–645.
ACM (2007)
40. Poole, W., et al.: Chemical boltzmann machines. In: Brijder, R., Qian, L. (eds.)
DNA 2017. LNCS, vol. 10467, pp. 210–231. Springer, Cham (2017). https://doi.
org/10.1007/978-3-319-66799-7 14
41. Cardelli, L., Kwiatkowska, M., Laurenti, L.: Programming discrete distributions
with chemical reaction networks. Nat. Comput. 17, 131–145 (2018)
42. Anderson, D.F., Craciun, G., Kurtz, T.G.: Product-form stationary distributions
for deficiency zero chemical reaction networks. Bull. Math. Biol. 72, 1947–1970
(2010)
43. Cappelletti, D., Ortiz-Munoz, A., Anderson, D., Winfree, E.: Stochastic chemical
reaction networks for robustly approximating arbitrary probability distributions.
arXiv preprint arXiv:1810.02854 (2018)
44. Braich, R.S., Chelyapov, N., Johnson, C., Rothemund, P.W.K., Adleman, L.: Solu-
tion of a 20-variable 3-SAT problem on a DNA computer. Science 296, 499–502
(2002)
45. Kirkpatrick, S., Selman, B.: Critical behavior in the satisfiability of random
Boolean expressions. Science 264, 1297–1301 (1994)
46. Selman, B., Kirkpatrick, S.: Critical behavior in the computational cost of satisfi-
ability testing. Artif. Intell. 81, 273–295 (1996)
47. Strzebonski, A.: Mathematica SatisfiabilityQ uses MiniSAT 1.14. StackExchange
and personal communication (2016, 2019). https://mathematica.stackexchange.
com/questions/103726/why-is-satisfiabilitycount-faster-than-satisfiableq
20 E. Winfree

48. Soloveichik, D.: CRNSimulatorSSA Mathematica Package. Personal Web Site


(2016). http://users.ece.utexas.edu/∼soloveichik/crnsimulator.html
49. Gibson, M.A., Bruck, J.: Efficient exact stochastic simulation of chemical systems
with many species and many channels. J. Phys. Chem. A 104, 1876–1889 (2000)
50. Mauch, S., Stalzer, M.: Efficient formulations for exact stochastic simulation of
chemical systems. IEEE/ACM Trans. Comput. Biol. Bioinf. 8, 27–35 (2011)
51. Thanh, V.H., Zunino, R.: Adaptive tree-based search for stochastic simulation
algorithm. Int. J. Comput. Biol. Drug Des. 7, 341–357 (2014)
52. Condon, A., Hu, A.J., Maňuch, J., Thachuk, C.: Less haste, less waste: on recycling
and its limits in strand displacement systems. Interface Focus 2, 512–521 (2012)
53. Thachuk, C., Condon, A.: Space and energy efficient computation with DNA strand
displacement systems. In: Stefanovic, D., Turberfield, A. (eds.) DNA 2012. LNCS,
vol. 7433, pp. 135–149. Springer, Heidelberg (2012). https://doi.org/10.1007/978-
3-642-32208-2 11
54. Condon, A., Thachuk, C.: Towards space-and energy-efficient computations. In:
Kempes, C., Grochow, J., Stadler, P., Wolpert, D. (eds.) The Energetics of Com-
puting in Life and Machines, chapter 9, pp. 209–232. The Sante Fe Institute Press,
Sante Fe (2019)
55. Matthew M Cook. Networks of Relations. PhD thesis, California Institute of Tech-
nology, 2005
56. Hopfield, J.J.: Neural networks and physical systems with emergent collective com-
putational abilities. Proc. Nat. Acad. Sci. 79, 2554–2558 (1982)
57. Kitano, H.: Towards a theory of biological robustness. Mol. Syst. Biol. 3, 137 (2007)
58. Reich, E.S.: Mathematician claims breakthrough in Sudoku puzzle. Nature (2012).
https://doi.org/10.1038/nature.2012.9751
59. Karr, J.R., Sanghvi, J.C., Macklin, D.N., Arora, A., Covert, M.W.: WholeCellKB
model organism databases for comprehensive whole-cell models. Nucleic Acids Res.
41, D787–D792 (2012)
60. Winfree, E.: Mathematica Notebooks for CRN SAT Solvers. Personal Web Site
(2019). http://www.dna.caltech.edu/SupplementaryMaterial/CRNSAT/
Implementing Arbitrary CRNs Using
Strand Displacing Polymerase
Shalin Shah1(B) , Tianqi Song2 , Xin Song1,3 , Ming Yang2 , and John Reif1,2
1
Department of Electrical and Computer Engineering, Duke University,
Durham, NC 27701, USA
shalin.shah@duke.edu
2
Department of Computer Science, Duke University, Durham, NC 27701, USA
3
Department of Biomedical Engineering, Duke University, Durham, NC 27701, USA
reif@cs.duke.edu

Abstract. The regulation of cellular and molecular processes typically


involves complex biochemical networks. Synthetic nucleic acid reaction
networks (both enzyme-based and enzyme-free) can be systematically
designed to approximate sophisticated biochemical processes. However,
most of the prior experimental protocols for reaction networks relied
on either strand-displacement hybridization or restriction and exonucle-
ase enzymatic reactions. These resulting synthetic systems usually suf-
fer from either slow rates or leaky reactions. In this work, we propose
an alternative architecture to implement arbitrary reaction networks,
that is based entirely on strand-displacing polymerase reactions with
non-overlapping I/O sequences. We first design a simple protocol that
approximates arbitrary unimolecular and bimolecular reactions using
polymerase strand displacement reactions. Then we use these fundamen-
tal reaction systems as modules to show three large-scale applications of
our architecture, including an autocatalytic amplifier, a molecular-scale
consensus protocol, and a dynamic oscillatory system.

Keywords: DNA polymerase · Strand-displacement ·


Chemical reaction networks · Consensus protocol · Chemical kinetics ·
Oscillatory protocols

1 Introduction
Ultra-high specificity and sensitivity of hybridization reactions by deoxyribonu-
cleic acid (DNA) leads to a wide variety of useful applications [7,10,12,13,15,
16,18,19,21,26–28,30,31,37]. Particularly interesting use of DNA is to imple-
ment arbitrary chemical reaction networks [6,32,35]. Chemical Reaction Net-
works (CRNs) have been used to understand complex biochemical processes since
they can represent biochemical systems in a simple-yet-formal way. CRNs are
shown to be Turing universal [4,5,29] and therefore, in theory, can serve as a pro-
gramming language for biochemical systems. A CRN consists of a set of reactant
species (R = {R1 , R2 , . . ., RN }) with an initial stoichiometry. These reactants
react via coupled chemical reactions to produce a set of product species (P = {P1 ,
P2 , . . ., PM }). Several dynamic phenomena have been experimentally described
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 21–36, 2019.
https://doi.org/10.1007/978-3-030-26807-7_2
22 S. Shah et al.

and approximated using DNA as a substrate. For example, the molecular con-
sensus protocol by Chen et al. implemented a set of CRNs using DNA to find
the reactant species with the highest population [2,6]. Another interesting appli-
cation includes implementation of the dynamic rock-paper-scissor oscillator by
Srinivas et al. using DNA hybridization and strand displacement properties [35].
Other experimental demonstrations of dynamic system use either RNA poly-
merase and ribonuclease enzymes [17], or polymerase and nicking enzyme [11,20].

1.1 Motivation for Our Work


Since the early demonstrations of enzyme-free logic computing [25], the field of
DNA nanoscience has mainly focused on using only DNA hybridization and
toehold-mediated strand displacement as a fundamental unit for computing
applications [3,6,7,15,23,40]. Although it is rational to use enzyme-free archi-
tectures because of their biological simplicity, the implementations of complex
biochemical processes using enzyme-free toehold-mediated strand displacement
reactions typically involve intricate sequence designs and additional gate com-
plexes to mitigate problems such as reaction leak [35]. Several solutions have
been proposed such as using clamps [39], shadow strands [33] and base-pair
mismatches [14] to mitigate this issue. A general and practical way to mitigate
such leaky reactions is using low concentrations. However, low concentration also
reduces the overall rate of reaction or the speed of computation.
One way to address this challenge is to localize all the required computing
DNA strands [1,3,36]. In a localization reaction, a breadboard-like structure
such as a DNA nanotrack, DNA origami, and nanoparticles ensures the vicinity
of the computing DNA strands. As all the DNA strands required for the reaction
are placed in the close vicinity, the localized design no longer suffers from the
slow kinetics of strand diffusion and unwanted DNA interactions. Although local-
ization reaction reduced the reaction time and leaks, the overall design process
becomes more complex as it requires design and synthesis of a nanostructure-like
substrate [1].
Several other implementations of the biochemical reaction networks with
much more sophisticated biological components have also been proposed [6,11,
17,35]. For example, arbitrary biochemical systems can be implemented using
the polymerase, nicking, and exonuclease (PEN) toolbox. However, by using the
nicking enzyme, such protocols restrict the overall achievable reaction rates. This
is mainly due to the slower activity of the nicking enzyme as compared to the
polymerase enzyme [11,20].

1.2 Our Contribution


In this work, inspired by the success of enzyme-free DNA dynamic systems, we
introduce a polymerase-based strand displacement architecture to implement
arbitrary CRNs (refer to Fig. 1). We develop detailed designs of the template
CRNs, namely, unimolecular and bimolecular reactions, using polymerase-based
strand displacement. By doing so, we develop a generalized framework that can
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 23

Desired dynamics CRN program DNA implementation DNA approximates dynamics


(ideal conditons) (uses polymerase)
i

Concentration
x
Concentration

X X+X
k1
x* i*
k
X+Y Y+Y2

i y
Y k
W3
i* y*
Time Time

Fig. 1. The basic workflow of DNA systems implementing arbitrary reaction networks.
The desired dynamic behavior can be represented using a set of CRNs. A DNA imple-
mentation of these CRNs can be tuned to approximately behave like the CRNs rep-
resenting the biochemical process. The observed dynamic behavior of DNA systems
mimics the original desired dynamics.

implement any arbitrary CRN since these reactions form the basis. There are
several potential benefits of our CRN design framework. (a) It is simple and less
leaky as compared to toehold-mediated strand displacement since no overlapping
sequence between input and output signals exists, and the polymerase enzyme
is sensitive to 3’ overhangs. (b) It is faster than prior architectures which use
polymerase, nicking and exonuclease together since our designs are polymerase
only. (c) It is modular as we use template CRNs for large-scale applications such
as an autocatalytic amplifier and molecular consensus network. To demonstrate
arbitrary CRNs, we approximate a dynamic oscillator with polymerase-based
DNA design as this requires a very careful calibration of the reaction rates.
All our designs are demonstrated in silico using a system of coupled ordinary
differential equations (ODEs) as it is well-known that the time evolution of a
CRN can be specified by a system of ODEs [1,6,32,40].

1.3 Paper Organization


The rest of the paper is organized as follows: First, we introduce polymerase-
based strand displacement and compare it with the enzyme-free toehold-
mediated strands displacement. In particular, our protocols only use hybridiza-
tion and polymerase-based strand displacement reactions, and do not use
enzyme-free toehold-mediated strands displacement reactions. Second, we intro-
duce two fundamental CRN systems, namely, unimolecular reaction and bimolec-
ular reaction, as they form the basis for any complex biochemical process. Here,
we argue how our DNA design can implement these fundamental reactions.
Third, using these simple CRNs as a template, we demonstrate three differ-
ent applications: (a) an autocatalytic amplifier, (b) a molecular-scale consensus
system, and (c) a dynamic rock-paper-scissor oscillatory system. Finally, we
conclude our paper with a discussion on experimental demonstration and other
future work.

2 Strand Displacement with DNA Polymerase


The basic principles behind toehold-mediated strand displacement as well as
polymerase-based strand displacement are shown in Fig. 2 for comparison.
24 S. Shah et al.

(a) t* o* o* o*
t* o*
SD
o* t o t* o*

t o t o

(b) t* o*
t* o*
SD
o* t o t* o*

t o t o

Fig. 2. The basic mechanism of toehold-mediated strand displacement and polymerase-


based strand displacement. (a) In toehold-mediated strand displacement process, an
incoming signal strand has a short toehold domain that reversibly binds with the
complex until the branch migration step happens and the output signal is completely
displaced from the complex. The toehold domain is usually kept short (approx. under
10 nt) while the branch is kept longer (approx. 15 nt or more). (b) In polymerase-
based strand displacement process, an incoming signal strand permanently binds with
the complementary domain on the complex at which point the polymerase enzyme
kicks in to displace output strand. All the domains such as t and o can be designed
long (approx. 30 nt) as the polymerase enzyme works at higher temperatures. SD refers
to strand displacement.

In toehold-mediated strand displacement, an input signal contains a short


domain called the toehold which can hybridize with the exposed region of a
double-stranded DNA complex. Once the input signal binds with the complex, it
undergoes a back and forth tug-of-war (referred to as the branch migration step)
until the incumbent output strand attached to the complex undergoes complete
dehybridization. The initial attachment of the input signal to the complex is a
reversible process as the toehold domains are usually kept short. However, they
can be made longer to increase the overall rate of the process. In polymerase-
based strand displacement, the input signal is designed such that it comes in
and binds with the complex permanently, as shown in Fig. 2b. Once bound, it
can act as a primer site for the polymerase enzyme. The enzyme attaches to the
DNA complex to begin its polymerase activity, from the 5’ to 3’ direction, along
with the displacement of the incumbent strand. The dotted strand in Fig. 2b
indicates the priming activity of the polymerase enzyme. The benefit of using
polymerase-based implementation is the nonoverlapping DNA sequence between
the input and output signals, which is known to produce reaction leaks [39]. Sev-
eral strand displacement polymerase enzymes are commercially available such as
Bst and Phi providing a wide range of available experimental conditions.
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 25

3 Implementation of Arbitrary Reactions


Unimolecular and bimolecular reactions are the most widely studied class of
chemical reactions as more complex reactions can be easily broken down into
these fundamental reactions [6,8,32,35]. This makes them the basis for imple-
menting arbitrary complex reaction networks. Therefore, in this work, we first
focus on implementing arbitrary unimolecular and bimolecular reactions using
DNA hybridization and polymerase-based strand displacement as the fundamen-
tal building blocks.

(a) Unimolecular CRN (b) DNA implementation


a i k/λ
a i i
q1 a *
i*
A+Gai I a *
i *

A k
B q2
B
I+Gib i b
i b b
i *
b * i* b*

Fig. 3. Arbitrary unimolecular reaction implementation using polymerase-based DNA


strand displacement. (a) An arbitrary transducer CRN network that absorbs A and
emits B in a two-step process. Input A combines with gate Gai to release intermediate
I which then combines with gate Gib to release output B. Both the reactions use
strand displacing polymerase enzyme to facilitate the reaction. (b) A domain-level
implementation of the DNA-based CRN which shows the hybridization, priming, and
polymerization process. The rate of the second step is not shown as it is much faster
and therefore occurs instantaneously w.r.t to the first step.

3.1 Arbitrary Unimolecular Reactions


The simplest CRN system is a signal transducer with applications in the field of
cell biology, molecular biology, and electronics. In this system, an input signal
A is absorbed to produce a different type of signal B as its output, written in
k
a simplified form as A − → B. An enzyme-free implementation of such arbitrary
unimolecular CRN was first proposed by Soloveichik et al. [32]. Here, we report
a simple two-step design that uses the polymerase-based strand displacement
and DNA hybridization as its fundamental units. We implement the unimolec-
ular CRN using a two-step process to avoid complications with sequence design
associated with single-step implementations, especially if the input and output
share the same domain.
k
An arbitrary unimolecular CRN A − → B can be implemented using two gate
complexes Gai and Gib , as shown in Fig. 3. The input signal A can act as a primer
upon hybridization with complex Gai for the polymerase reaction, leading to the
displacement of incumbent intermediate strand I. This intermediate strand I can
hybridize with the output complex Gib to undergo another polymerase-based
strand displacement to release the output B. The dotted strands in the figure
indicate the polymerase activity of the DNA polymerase enzyme.
26 S. Shah et al.

For this two-step DNA implementation to approximate a first order reaction,


the overall rate of reaction should be k[A]. This can be achieved by careful cal-
ibration of reaction conditions. Let us assume that the gate concentrations are
much higher w.r.t input strand i.e [Gai ] >> [A0 ] and [Gib ] >> [A0 ] making their
effective concentrations constant throughout the reaction duration. By doing so
ai q1 [G ]
both the reactions become pseudo-first order reactions given by A −−−−→ I and
q2 [G ]
ib
I −−−− → B. Then to make the overall reaction approach first-order kinetics, we
simply need to make sure intermediate complex I is in quasi-steady-state equi-
librium i.e. it gets consumed immediately after production. We can easily make
second step faster by assuming [Gib ] >> [Gai ]. At the steady state, the con-
centration of I is given by [I] = q1 [Gai ][A]/q2 [Gib ], therefore the overall rate of
reaction becomes q2 [I][Gib ] ≈ q1 [Gai ][A] ≈ q[A] acting as the desired unimolec-
ular reaction.
For simplicity, we also assume that the excess concentration is λ and it is the
same for all the gates. Therefore, in order to implement a unimolecular reaction
of rate k, we simply need DNA implementation with rates q1 = k/λ and q2 is
very fast w.r.t to q1 as shown in Fig. 3b. Note that q2 is faster as compared to q1
hence irrelevant and not shown. For more details on steady state approximation
and other theoretical proofs, refer to the prior work by Soloveichik et al. [32].
The rate of reactions in the DNA implementation can be tuned either by
changing the gate concentration or by tuning the rate of strand displacement.
However, throughout this work, we assume that the gate concentrations are
constant and the programmable behavior comes from the tunable rate of strand
displacement. This can be achieved by adjusting the length of the primer and its
GC content [11,34,35]. Note that the output complex can be easily changed to
incubate one, two or more strands of either same or different types. Therefore,
k
it can be easily tuned to implement a catalytic(A − → A + B) and autocatalytic
k
(A −
→ A + A) reaction, as we will see in the applications section (see Fig. 6).

3.2 Arbitrary Bimolecular Reactions

The simple two-step process used for the unimolecular reaction can be easily
extended to implement a bimolecular reaction. In bimolecular reaction, two set
of inputs A and B combine to produce an output C such that the rate of output
formation depends on the inputs as k[A][B]. A trivial implementation of bimolec-
ular reaction would be to slightly modify unimolecular to design to replace inter-
q1
mediate domain i by input domain b. Then, a two-step reaction A + Gb −→ I
q2
and I + Gio −→ O similar to previous design can act as a bimolecular reaction.
This trivial design has an issue that it expects second input b to be present
in the gated form. This can create a problem, especially, if there are multi-
ple reactions that use b as the input signal. For example, if our system of CRNs
k1 k2
contains A + B −→ C and B −→ D then the input signal B is required in a single-
stranded form in the unimolecular reaction and in the double-stranded form in
the bimolecular reaction. This problem was originally also identified by Solove-
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 27

(a) Biomolecular CRN (b) DNA implementation


b i γ bk a b i b i
q1 a
A+Gbi I a
*
b* i* a* b* i*
A+B k
C I+Gic
q2
C c b i c
b i c
q+
B+Gs q- Gbi+S i *
c * i* c*

Fig. 4. Arbitrary bimolecular reaction implementation using polymerase-based DNA


strand displacement. (a) An arbitrary non-catalytic CRN network that absorbs A and B
in a two-step process to emit C. Input A combines with gate Gbi to releases intermediate
I which then combines with gate Gic to release output C. A linker reaction reversibly
converts input B to gated form Gbi . DNA implementation details of this gate are shown
in Fig. 5(b) A domain-level implementation of the DNA-based CRN. Unlabeled rate
constant is fast and therefore not shown.

(a) Linker gate CRN (b) DNA implementation


i*
yg i y* x* yg x * y
y i
k1
k+ Yg+Lg Gy yg* x yg* x x* y* i*
Yg k- Gy Gy+Ly
k2
Yg y i yg i* y* x* yg yg

x* y* i* x yg* i y x yg*

Fig. 5. Linker gates to interconvert a signal strand. (a) A CRN network that reversibly
converts input signal Y between the gated-form and the single-stranded form. The
single-stranded signal Yg is used in all the unimolecular reactions of Y while the gate
complex Gy will be used as input in all the bimolecular reactions. (b) A domain-
level implementation of the DNA-based CRN. All the reactions are relatively fast and
therefore rate constants are not shown.

ichik et al. [32] when they designed a DNA-only CRN system and they proposed
the use of the well-known toehold exchange reaction to reversibly interconvert
input signal B between its two forms [8,24].
In this work, we design a simple set of strand displacement reactions to
implement interconversion of input signal B between its single-stranded and
gated form. Therefore, the final set of CRNs that implements a bimolecular reac-
tion will consist of the third linker step in addition to the two-step process, as
shown in Figs. 4a and 5. The input signal A can bind with gate Gbi and undergo
polymerase-based strand displacement to release the intermediate I. This inter-
mediate strand I binds with the output complex Gic to release output C. The
additional linker step includes reversible reaction whose full implementation is
shown in Fig. 5.
Abstractly the linker reaction converts single-stranded input signal Yg with
help of linker complexes to gate Gy in a reversible fashion. The polymerase
implementation of this CRN is a two-step process where each step uses only
28 S. Shah et al.

polymerase strand displacement. To interconvert between Yg and Gy , linker


gates Lg and Ly are used. Overall, these two reactions together implement the
reversible buffered reaction that interconverts Y between its single-stranded and
gated form. The single-stranded Y will be used for all the unimolecular reactions
while the gated Y will be used for all the bimolecular reactions.
For the proposed set of DNA implementations to act as a bimolecular reac-
tion, the linker reactions need to be very fast and require excess concentration
of all the gate complexes. This includes the two linker gates Lg and Ly , and the
gate complex Gic . The actual available concentration of the input signal B (or
Y) used in both the unimolecular and bimolecular reactions will be half assum-
ing the linker reaction reaches a quasi-steady-state on a fast time scale w.r.t
other reactions. This means the total concentration of B is [BT ] = [B] + [GB ]. If
e(B) is the equilibrium concentration of B, then under the pseudo-equilibrium
assumption, e(B) = [B]/[BT ]. Therefore, we multiply the rate of reaction by a
scaling factor of γ = 1/e(B) to account for this activity. For simplicity, we keep
the buffered reaction rates k+ = k− = k, where k is a very fast rate similar to
the second reaction in Fig. 4b. Similarly, we assume the concentration of linker
complexes is high w.r.t signal strands and [Lg ] = [Ly ] = λ.
Under these assumptions, it is straightforward to show that the set of DNA
reaction approximates the desired CRN with the rate of γk[A][B]. For more
details on the steady state approximation and proofs, refer to the prior work
by Soloveichik et al. [32]. Finally, note that the output complex can be easily
changed to incubate one, two or more strands of either the same or different
k
types. Therefore, it can be easily tuned to implement catalytic(A + B − → B + C)
k
and autocatalytic (A + B −
→ C + B + B) reactions, as we will see in the applica-
tions section.

4 Scaling Reaction Systems for Practicality

All the DNA implementations of the CRN protocols in this work are scaled by
a time factor α and a concentration factor β as the DNA implementations only
work in a certain range of time and concentration. A standard DNA hybridization
experiment operates in the concentration range of 1 nM to 1 mM and in the time
range of a few minutes to several hours [1,6,11,23,25,34,36,39]. Therefore, a set
of coupled ODEs implementing a CRN system with rate k = 1 can be multiplied
by a time factor α = 10−3 and a concentration factor β = 10−8 . This will
bring our DNA implementation of the CRN systems in a realistic range without
altering the behavior of the original system [32]. Unless otherwise stated all the
applications will use these values of k, α and β for simplicity. All the scaling
factors and other rate values are adopted from Soloveichik et al. [32].
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 29

(a) Auto-catalytic CRN (b) a* x* t* a*

x t a
k
X nX

k/λ
a*
Xi+Ga Ii xi* ti*
Ii+Go X1+X2+...+Xn t1* t2* tn *
a*
x1* x2* xn*
...
(c) 60 x t a a x1 x2 xn
Xo = 1.0x
50
X 6X
Concentration (uM)

40 x1 t
* *
x *
t *
xn tn
* *
X 5X 1 2 2
...
30
X 4X
20 a* x1* x2* ... xn *
X 3X
10 a x1 x2 ... xn
X 2X
0
0 1 2
Time (hour)

Fig. 6. A generalized autocatalytic amplifier using polymerase-based strand displace-


ment. (a) The set of CRNs for an autocatalytic amplifier and CRNs for the DNA
implementation. (b) The flow of an autocatalytic reaction. The input X opens the first
gate to release intermediates which open the second gate to release multiple copies of
X. All the subscripts just indicate the number of times a domain is repeated. Here the
number of domains in the complexes can be tuned to adjust the amplification factor n.
(c) An in silico demonstration of the 2x, 3x, 4x, 5x and 6x amplifier. Excess concen-
tration of the supporting gates is λ = 10−5 M while the unlabeled fast reaction rates
were 105 .

5 Applications
The simple CRNs introduced in the previous sections can act as a basis for
large-scale applications. In this section, we use these simple reactions as a tem-
plate and demonstrate several applications as a use case of our polymerase-based
architecture.

5.1 Generalized Autocatalytic Amplifier


Autocatalytic amplification is one of the simplest and most widely used tasks in
the field of molecular biology and DNA nanoscience. Such an endpoint system
does not require very intricate control of reaction rates and input concentration
making them the simplest to implement. While most amplification techniques
require either programming multiple thermal cycles to achieve an exponential
amplification or a nicking enzyme, our design of autocatalytic amplifier works
at the same temperature and requires only polymerase enzyme [22,38]. The
unimolecular reaction designed in the previous section can be easily tuned to
design a fast autocatalytic amplifier by modification of the gate strand. Such
autocatalytic amplifier can also serve as a signal restoration module in complex
DNA-based digital logic circuits [7] where the output signal decays in each circuit
layer.
The gate complex Gib used in the unimolecular CRN design, shown in Fig. 3,
can be tuned to release multiple copies of B (or A) and implement a generalized
30 S. Shah et al.

autocatalytic amplifier, as shown in Fig. 6a. A corresponding cyclic DNA imple-


mentation of the autocatalytic amplifier is also shown in Fig. 6b. A given input
signal Xi can release an intermediate output Ii as it undergoes polymerase-based
strand displacement upon hybridization with the gate complex Ga . This inter-
mediate output can hybridize with the bigger complex Go to release k copies
of the input strand X. Since our gate designs are modular we can easily tune
the design of 2x autocatalytic amplifier to a generalized kx autocatalytic ampli-
fier, as shown in Fig. 6b. Each of the k copies of input strands released can,
in turn, open k downstream gates. An in silico experiment for the DNA-based
CRNs for our autocatalytic amplifier demonstrates the autocatalytic amplifica-
tion. The gate complex is tuned to release 2, 3, 4, 5 or 6 copies of the input
strands upon polymerase-based strand displacement. The input concentration
was set to 100 nM. Note that our amplified output is limited by the number of
available gate complexes as seen in Fig. 6c.

5.2 Molecular-Scale Consensus Network

We next try a more complex endpoint application to demonstrate the gener-


ality of our polymerase-based architecture. An interesting problem in the field
of distributed computing and contemporary economics is for the network to
reach a consensus. Consensus algorithms can help to decide, for example, the
democratic leader by increasing the population of the party in the majority
while reducing the population of the party in the minority. Such algorithms
are generally required in distributed systems to make them fault tolerant. The
first molecular-scale consensus network was demonstrated by Chen et al. using
toehold-mediated strand displacement [6]. In this work, we tune our template
reactions to design a DNA polymerase-based consensus network.
A CRN-based consensus protocol autonomously identifies the reactant with
the highest initial concentration and increases its concentration to be much
higher. The other reactant with lower initial concentration is decreased close
to zero, as shown in Fig. 7a. The consensus protocol consists of three auto-
k1 k2 k3
catalytic reactions A + B −→ 2 Y, B + Y −→ 2 B and A + Y −→ 2 A. A set of
abstract CRNs along with DNA-based CRNs that can implement this network
is shown in Fig. 7b. Note that we have omitted the domain-level DNA representa-
tion of this CRN for brevity, however it is similar to the template reactions shown
in Figs. 3 and 4. The gate Y was kept at 30 nM concentration while the relative
concentration of input strands A and B were changed 1 to 30 nM (1x = 30 nM)
to test our design of the consensus protocol. The rate constant of each bimolec-
ular reaction is multiplied by γ = 2 to account for the linker effect. All the rate
constants not shown are faster as compared to the main reaction and therefore
not shown. The supporting gates with very high concentration were λ = 10−5 M
while the unlabeled fast reaction rates were 103 . The relative concentration of
each input strand was modified from 0.1x to 0.9x as shown in Fig. 7c. Clearly, as
seen from the in silico experiments, the consensus CRN algorithm can absorb the
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 31

Fig. 7. Molecular-scale polymerase-based consensus network. (a) A block diagram


showing the abstract principle of a consensus network. When multiple species are
present, the algorithm automatically finds the majority by reducing the minority
species close to zero. (b) Abstract ideal CRNs that implement the consensus algo-
rithm and a DNA-polymerase based CRN implementation. Note that the domain-level
DNA implementation is not shown here for brevity. (c) In silico demonstration of the
consensus network at different relative concentrations of inputs A and B. The gate Y
was kept at 30 nM concentration while the inputs A and B were varied from 3 nM to
27 nM (1x = 30 nM) to change the relative concentration. Excess concentration of the
supporting gates is λ = 10−5 M while the unlabeled fast reaction rates were 103 .

species whose population is a minority bringing its concentration down nearly


to zero. The species in majority are consumed initially but eventually stops
decreasing indicating a democratic decision is made by the molecular network.
32 S. Shah et al.

(a) beats

beats beats
Rock Scisscor Paper

(b) Rock-paper-scissor CRN with DNA implementation


k
A+B 2B A+Gb
γ bk
Iab B+Gc
γ ck
Ibc C+Ga
γ ak
Ica
k
B+C 2C Iab+Gob 2B Ibc+Goc 2C Ica+Goa 2A
k
2A B+Lb Gb+Lgb C+Lc Gc+Lgc A+La Ga+Lga
C+A

(c) 11 (d)
10 A 11
B 10
9
Concentration (nM)

C 9
8 8

C (nM)
7 7

6 6
5
5
4
4 3
2
4
3 B (n6 8 10 11
0 0.5 1 1.5 2 2.5 3 3.5 4 M) 10 6 7 8 9
12 2 3 4 5
Time (hours) A (nM)

Fig. 8. Molecular-scale dynamic oscillatory network. (a) A block diagram showing the
abstract principle of a rock-paper-scissor network. (b) Abstract CRNs that implement
the rock-paper-scissor dynamics and a DNA polymerase-based CRN implementation.
Note that the domain-level DNA implementation is not shown here for brevity. (c) An
in silico experiment demonstrating the behavior of the dynamic network. Dotted lines
show the trace of the ideal CRNs. (d) If the DNA-based network is allowed to run
for several epochs, we observe that its behavior slightly diverges from the ideal system
(dotted lines). This is expected as the supporting gates are not infinite.

5.3 Molecular-Scale Dynamic Oscillator


The final application we demonstrate here is the well-known dynamic rock-paper-
scissor oscillator. Such oscillatory protocols have much more stringent require-
ments on the initial conditions and the rate constants than endpoint systems
such as an autocatalytic amplifier or the consensus protocol [6,32,35]. A suc-
cessful DNA implementation of such systems demonstrates a strong use case of
the proposed polymerase architecture. Prior enzyme-free architecture by Srini-
vas et al. reported the first DNA implementation of this oscillator [35]. Other
enzyme-based oscillator systems have also been reported [11,17]. Here we explore
an alternate avenue by designing a DNA polymerase only implementation of this
dynamic system.
The basic principle of such a system is to mimic the zero-sum hand game
rock-paper-scissors, where there is no single winner. Rock can beat scissors by
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 33

breaking it, scissors can beat paper by cutting it and paper can beat rock
by covering it. This forms a cyclic system as shown in Fig. 8a whose CRN
representation is shown in Fig. 8b. Three bimolecular autocatalytic reactions
k1 k2 k3
(A + B −→ 2 B, B + C −→ 2 C, C + A −→ 2 A) are required to implement such
a dynamic system. The first CRN produces B by consuming A. By assuming
A and B as scissor and rock respectively, such CRN implements rock beating
scissor by producing more rock while consuming scissor. Similarly, other CRNs
implement scissor beats paper and paper beats rock respectively. Using our tem-
plate reactions, we can easily implement this CRN system. The CRN for DNA
implementation of each bimolecular reaction is shown in Fig. 8b.
An in silico demonstration of the dynamic system implemented using our
DNA polymerase-based framework is shown in Fig. 8c. Each component of the
CRN exists in gated form and single-stranded form through a reversible linker
reaction. Thus γ = 2 for each reaction as all the inputs are used once in uni-
molecular form and once in bimolecular form. Initial input concentrations were
5 nM, 4 nM and 10 nM. All the supporting gates were kept at an excess concen-
tration of λ = 10−3 M and the unlabeled fast reaction rates were 103 . Initially,
the DNA implementation exactly mimics the ideal CRNs (shown as dotted line
in Fig. 8c), however as time progresses, it starts diverging away (refer Fig. 8d)
since the supporting gates get consumed and therefore effective reaction rates
change.

6 Discussion

6.1 Experimental Demonstration and Considerations

The first step towards experimental demonstration includes a careful study of


the polymerase-based strand displacement kinetics to develop a reliable bio-
physical model. This includes understanding the influence of the primer and
branch length, enzyme concentration, temperature etc. on the overall rate of a
signal transducer reaction. A careful understanding of polymerase-based reac-
tions also involves the study of leaky reactions. Several control experiments can
be conducted with the supporting gates to identify the initial leak and gradual
leaks [35]. However, the longer domain lengths, simple gate design, nonoverlap-
ping I/O sequence and sensitivity of the polymerase enzyme to 3’ overhangs
should potentially mitigate the observed reaction leaks. Lower leaks can also
allow the use of higher input concentrations enabling a much faster rate of reac-
tion. The computing speed of our architecture can be compared to prior archi-
tectures using two different parameters: (a) half-time to reaction completion [1],
(b) estimation of the rate constant [9].

6.2 Replenishing Supporting Gates with Buffered Reaction

Our DNA architecture heavily relies on the supporting and linker gates for
approximating ideal CRNs. However, for example, in contrast to the prior
34 S. Shah et al.

computing gate complex

a b z PSD a b z b z
a *
b*
z * a
*
b* z*

z*
z z a* b z
z b* PSD
b a
*
a *
b *
z*
z *
a
z* a

Fig. 9. Input signal A primes with the gate complex to produce output signal B and
Z. The computing gate can be replenished by adding the buffered gate shown in the
second reaction. All the supporting gates used in our architecture can be replenished by
adding several such buffered complexes. This can autonomously elongate the longevity
of the DNA systems. (Color figure online)

scheme [32], our linker gate design is wasteful. As the linker and other gates
are consumed, the DNA system starts diverging away from the desired dynam-
ics and eventually stops working. Although we can start with a higher initial
concentration, it is not very desirable since several unwanted reactions occur
at higher concentrations. Upon their consumption, either more gates should be
added externally or a simple buffered gate scheme, as shown in Fig. 9, can be
used. In such buffered systems [24], an additional gate complex (marked in the
red box) will release the used gate (marked in the black box) upon its consump-
tion. Such a system can easily elongate the longevity of our DNA systems as the
supporting gates get replenished autonomously.

7 Conclusion

In this work, we introduced a DNA polymerase-based architecture to imple-


ment arbitrary chemical reaction networks. First, we demonstrated a DNA-
based implementation of arbitrary unimolecular and bimolecular reactions as
these form the basis for any complex system. We then used these reactions as
a template to demonstrate several applications such as autocatalytic amplifier,
consensus network, and dynamic rock-paper-scissor oscillator as strong use cases
of our architecture. Our designs used only the polymerase enzyme and DNA
hybridization making them simple to design and implement. The template reac-
tions could be easily tuned to implement arbitrary biochemical reaction networks
demonstrating the modularity of our framework.

Acknowledgements. This work was supported by National Science Foundation


Grants CCF-1813805 and CCF-1617791. The authors thank Keerti Anand for useful
theoretical discussions on ODEs and chemical kinetics. The most up-to-date simulation
scripts are available online as a GitHub repository at https://bit.ly/2X3axAh.
Implementing Arbitrary CRNs Using Strand Displacing Polymerase 35

References
1. Bui, H., Shah, S., Mokhtar, R., Song, T., Garg, S., Reif, J.: Localized DNA
hybridization chain reactions on DNA origami. ACS Nano 12(2), 1146–1155 (2018)
2. Cardelli, L., Csikász-Nagy, A.: The cell cycle switch computes approximate major-
ity. Sci. Rep. 2, 656 (2012)
3. Chandran, H., Gopalkrishnan, N., Phillips, A., Reif, J.: Localized hybridization
circuits. In: Cardelli, L., Shih, W. (eds.) DNA 2011. LNCS, vol. 6937, pp. 64–83.
Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-23638-9 8
4. Chen, H.L., Doty, D., Soloveichik, D.: Deterministic function computation with
chemical reaction networks. Nat. Comput. 13(4), 517–534 (2014)
5. Chen, H.L., Doty, D., Soloveichik, D.: Rate-independent computation in continuous
chemical reaction networks. In: Proceedings of the 5th Conference on Innovations
in Theoretical Computer Science, pp. 313–326. ACM (2014)
6. Chen, Y.J., et al.: Programmable chemical controllers made from DNA. Nat. Nan-
otechnol. 8(10), 755–762 (2013)
7. Cherry, K.M., Qian, L.: Scaling up molecular pattern recognition with DNA-based
winner-take-all neural networks. Nature 559(7714), 370 (2018)
8. Dalchau, N., et al.: Computing with biological switches and clocks. Nat. Comput.
17(4), 761–779 (2018)
9. Eshra, A., Shah, S., Song, T., Reif, J.: Renewable DNA hairpin-based logic circuits.
IEEE Trans. Nanotechnol. 18, 252–259 (2019)
10. Fu, D., Shah, S., Song, T., Reif, J.: DNA-based analog computing. In: Braman,
J.C. (ed.) Synthetic Biology. MMB, vol. 1772, pp. 411–417. Springer, New York
(2018). https://doi.org/10.1007/978-1-4939-7795-6 23
11. Fujii, T., Rondelez, Y.: Predator-prey molecular ecosystems. ACS Nano 7(1), 27–34
(2012)
12. Garg, S., Shah, S., Bui, H., Song, T., Mokhtar, R., Reif, J.: Renewable time-
responsive DNA circuits. Small 14(33), 1801470 (2018)
13. Han, D., et al.: Single-stranded DNA and RNA origami. Science 358(6369),
eaao2648 (2017)
14. Jiang, Y.S., Bhadra, S., Li, B., Ellington, A.D.: Mismatches improve the perfor-
mance of strand-displacement nucleic acid circuits. Angew. Chem. 126(7), 1876–
1879 (2014)
15. Joesaar, A., et al.: DNA-based communication in populations of synthetic proto-
cells. Nat. Nanotechnol. 14, 369 (2019)
16. Johnson-Buck, A., Shih, W.M.: Single-molecule clocks controlled by serial chemical
reactions. Nano Lett. 17(12), 7940–7944 (2017)
17. Kim, J., Winfree, E.: Synthetic in vitro transcriptional oscillators. Mol. Syst. Biol.
7(1), 465 (2011)
18. Kishi, J.Y., Schaus, T.E., Gopalkrishnan, N., Xuan, F., Yin, P.: Programmable
autonomous synthesis of single-stranded DNA. Nat. Chem. 10(2), 155 (2018)
19. Li, J., Johnson-Buck, A., Yang, Y.R., Shih, W.M., Yan, H., Walter, N.G.: Explor-
ing the speed limit of toehold exchange with a cartwheeling DNA acrobat. Nat.
Nanotechnol. 13(8), 723 (2018)
20. Montagne, K., Plasson, R., Sakai, Y., Fujii, T., Rondelez, Y.: Programming an in
vitro DNA oscillator using a molecular networking strategy. Mol. Syst. Biol. 7(1),
466 (2011)
21. Newman, S., et al.: High density DNA data storage library via dehydration with
digital microfluidic retrieval. Nat. Commun. 10(1), 1706 (2019)
36 S. Shah et al.

22. Notomi, T., et al.: Loop-mediated isothermal amplification of DNA. Nucleic Acids
Res. 28(12), e63–e63 (2000)
23. Qian, L., Winfree, E.: Scaling up digital circuit computation with DNA strand
displacement cascades. Science 332(6034), 1196–1201 (2011)
24. Scalise, D., Dutta, N., Schulman, R.: DNA strand buffers. J. Am. Chem. Soc.
140(38), 12069–12076 (2018)
25. Seelig, G., Soloveichik, D., Zhang, D.Y., Winfree, E.: Enzyme-free nucleic acid logic
circuits. Science 314(5805), 1585–1588 (2006)
26. Seo, J., Kim, S., Park, H.H., Nam, J.M., et al.: Nano-bio-computing lipid nano-
tablet. Sci. Adv. 5(2), eaau2124 (2019)
27. Shah, S., Dubey, A., Reif, J.: Programming temporal DNA barcodes for single-
molecule fingerprinting. Nano Lett. 19, 2668–2673 (2019)
28. Shah, S., Dubey, A.K., Reif, J.: Improved optical multiplexing with temporal DNA
barcodes. ACS Synth. Biol. 8(5), 1100–1111 (2019)
29. Shah, S., Gupta, M.: DNA-based chemical compiler (2018). arXiv preprint
arXiv:1808.04790
30. Shah, S., Limbachiya, D., Gupta, M.K.: DNACloud: a potential tool for storing
big data on DNA (2013). arXiv preprint arXiv:1310.6992
31. Shah, S., Reif, J.: Temporal DNA barcodes: a time-based approach for single-
molecule imaging. In: Doty, D., Dietz, H. (eds.) DNA 2018. LNCS, vol. 11145, pp.
71–86. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-00030-1 5
32. Soloveichik, D., Seelig, G., Winfree, E.: DNA as a universal substrate for chemical
kinetics. Proc. Nat. Acad. Sci. 107(12), 5393–5398 (2010)
33. Song, T., et al.: Improving the performance of DNA strand displacement circuits
by shadow cancellation. ACS Nano 12(11), 11689–11697 (2018)
34. Srinivas, N., et al.: On the biophysics and kinetics of toehold-mediated DNA strand
displacement. Nucleic Acids Res. 41(22), 10641–10658 (2013)
35. Srinivas, N., Parkin, J., Seelig, G., Winfree, E., Soloveichik, D.: Enzyme-free nucleic
acid dynamical systems. Science 358(6369), eaal2052 (2017)
36. Teichmann, M., Kopperger, E., Simmel, F.C.: Robustness of localized DNA strand
displacement cascades. ACS Nano 8(8), 8487–8496 (2014)
37. Thubagere, A.J., et al.: A cargo-sorting DNA robot. Science 357(6356) (2017)
38. Walker, G.T., Little, M.C., Nadeau, J.G., Shank, D.D.: Isothermal in vitro amplifi-
cation of DNA by a restriction enzyme/DNA polymerase system. Proc. Nat. Acad.
Sci. 89(1), 392–396 (1992)
39. Wang, B., Thachuk, C., Ellington, A.D., Winfree, E., Soloveichik, D.: Effective
design principles for leakless strand displacement systems. Proc. Nat. Acad. Sci.
115(52), E12182–E12191 (2018)
40. Yordanov, B., Kim, J., Petersen, R.L., Shudy, A., Kulkarni, V.V., Phillips, A.:
Computational design of nucleic acid feedback control circuits. ACS Synth. Biol.
3(8), 600–616 (2014)
Real-Time Equivalence of Chemical
Reaction Networks and Analog Computers
Xiang Huang1 , Titus H. Klinge2 , and James I. Lathrop1(B)
1
Iowa State University, Ames, IA 50011, USA
{huangx,jil}@iastate.edu
2
Drake University, Des Moines, IA 50311, USA
titus.klinge@drake.edu

Abstract. This paper investigates the class RRT CRN of real numbers
that are computable in real time by chemical reaction networks (Huang,
Klinge, Lathrop, Li, Lutz, 2019), and its relationship to general purpose
analog computers. Roughly, α ∈ RRT CRN if there is a chemical reaction
network (CRN) with integral rate constants and a designated species X
such that, when all species concentrations are initialized to zero, X con-
verges to α exponentially quickly. In this paper, we define a similar class
RRT GP AC of real numbers that are computable in real time by general
purpose analog computers, and show that RRT GP AC = RRT CRN using a
construction similar to that of the difference representation introduced
by Fages, Le Guludec, Bournez, and Pouly. We prove this equivalence by
showing that RRT CRN is a subfield of R which solves a previously open
problem. We also prove that a CRN with integer initial concentrations
can be simulated by a CRN with all zero initial concentrations. Using
these results, we give simple and natural constructions showing e and π
are members of RRT CRN , which was not previously known.

1 Introduction

Computing real numbers in real time with a Turing machine was first introduced
by Yamada in the 1960s [22] and was later proven to be equivalent to producing
the first n bits of the fractional part of the number in O(n)-time [15]. It is easy
to see that the rational numbers can be computed in real time, but others are
not as trivial to compute. Some transcendental numbers are known to be real
time computable, such as


λ= 2−n! ,
n=1

which is a Liouville number [18]. Surprisingly, the long standing conjecture by


Hartmanis and Stearms that no irrational algebraic number can be computed
in real time remains unsolved [18]. If the conjecture is true, it would imply that
certain transcendental numbers are easier to compute by a Turing machine than
algebraic numbers, which would be surprising indeed.

This research was supported in part by National Science Foundation Grant 1545028.
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 37–53, 2019.
https://doi.org/10.1007/978-3-030-26807-7_3
38 X. Huang et al.

Recently, Huang, Klinge, Lathrop, Li, and Lutz defined the class RRT CRN
of real time computable real numbers by chemical reaction networks [19]. They
defined a real number α to be in RRT CRN if there is a CRN with a designated
species X that is within 2−t of |α| for all t ≥ 1. Their definition also requires
that all rate constants of the CRN be integral, all species concentrations be
initialized to zero, and all species concentrations be bounded by some constant
β. This definition is closely related to that of Bournez, Fraigniaud, and Koegler’s
large population protocols [3], but differs in key technical aspects. A discussion
of these differences can be found in [19].
Common variants of the chemical reaction network model assume well-mixed
solutions and mass-action kinetics. Small-volume environments such as in vivo
reaction networks are often modeled stochastically with continuous-time Markov
processes, while larger volumes are modeled deterministically with systems of
ordinary differential equations1 . In this paper, we focus on the deterministic
mass-action chemical reaction network which is modeled with autonomous poly-
nomial differential equations. Roughly, a chemical reaction network (CRN) is a
set of reactions of the form
k
X1 + X2 + · · · + Xn −−−→ Y1 + Y2 + · · · + Ym ,

where Xi is a reactant and Yj is a product. The positive real number k is the


rate constant of the reaction, and along with the concentrations of the reactants,
determines the speed at which the reaction progresses. Although reactions with
any number of reactants and products are supported in the model, if they are
restricted to exactly two, then stochastic chemical reaction networks are equiv-
alent to population protocols [1].
Recent research has demonstrated that chemical reaction networks are capa-
ble of rich computation. They are Turing complete [13], and even weaker variants
of the model such as rate-independent environments are still capable of comput-
ing a large class of functions [6,8,9]. The reachability problem in CRNs has
also recently drawn the interest of computer scientists [5] as well as time com-
plexity issues in the model [7,11]. Chemical reaction networks are also becoming
increasingly practical, since they can be compiled into DNA strand displacement
systems to be physically implemented [2].
Chemical reaction networks under deterministic mass action semantics are
also related to the general purpose analog computer (GPAC), first introduced
by Shannon [21]. Shannon’s GPAC was inspired by MIT’s differential analyzer,
a machine designed to solve ordinary differential equations. The model has also
recently been refined, and many remarkable results concerning its computational
power have been published. The GPAC is Turing complete [17], is equivalent to
systems of polynomial differential equations [16], and the class P of languages
computable in polynomial time can be characterized with GPACs whose solu-
tions have polynomial arc length [4]. Moreover, Fages, Le Guludec, Bournez, and
1
The stochastic mass action model was proven to be “equivalent in the limit” to the
deterministic mass action model as the number of molecules and the volume are
scaled to infinity [20].
Real-Time Equivalence of CRNs and GPACs 39

Pouly showed in 2017 that CRNs under deterministic mass action semantics can
simulate GPACs by encoding each variable as the difference of two species con-
centrations [13].
In this paper, we investigate the relationship between real time computable
real numbers by CRNs and general purpose analog computers. We define the
class RRT GP AC of real time computable real numbers by GPACs. Roughly,
α ∈ RRT GP AC if there exists a polynomial initial value problem (PIVP) with
integer coefficients such that, if initialized with all zeros, then all variables are
bounded and one of the variables converges to α exponentially quickly. These
restrictions are analogous to the definition of RRT CRN and ensure that the
PIVP is finitely specifiable and α is computed in real time. We show that
RRT GP AC = RRT CRN by proving that RRT CRN is a subfield of R and using an
extension of the difference representation introduced in [13] that relies on these
closure properties. We also show that the constraint of all zero initial conditions
can be relaxed to integral initial conditions. With these new theorems, we prove
two well-known transcendental numbers e and π are members of RRT CRN . The
proofs and constructions for these transcendental numbers are short and con-
cise, and demonstrate the power of these theorems for generating and proving
real-time CRNs correct.
The rest of this paper is organized as follows. Section 2 introduces relevant
definitions and notations used throughout the paper; Sect. 3 includes the main
theorem of the paper, that RRT GP AC = RRT CRN , along with the proof that
RRT CRN is a field; Sect. 4 includes proofs that e and π are real time computable
by chemical reaction networks using the theorems from Sect. 3; and Sect. 5 pro-
vides some concluding remarks.

2 Preliminaries

Chemical reaction networks have been investigated from the perspective of chem-
istry [12], mathematics [14], and computer science [10], and each field uses
slightly different notation. In this paper we use the notion introduced in [19], and
thus define a chemical reaction network (CRN ) to be an ordered pair N = (S, R)
where S = {Y1 , Y2 , . . . , Yn } is a finite set of species and R is a finite set of reac-
tions. A reaction is a triple ρ = (r, p, k) where r, p ∈ Nn are vectors of reactant
species and product species, respectively, and k ∈ R>0 is the rate constant. We
use ri and pi to denote the ith component of r and p, respectively. We call
Yi ∈ S a reactant of ρ if ri > 0, a product of ρ if pi > 0, and a catalyst of ρ if
ri = pi > 0.
In this paper, we are concerned with deterministic CRNs under mass action
kinetics, and therefore the evolution of a CRN N = (S, R) is governed by a
system of real-valued functions y = (y1 , . . . , yn ) where yi : R≥0 → R≥0 for all
1 ≤ i ≤ n. The value yi (t) is called the concentration of species Yi ∈ S at time
t ∈ [0, ∞). According to the law of mass action, the rate of a reaction ρ = (r, p, k)
is proportional to the rate constant k and the concentrations of the reactants r.
40 X. Huang et al.

Thus, the rate of a reaction ρ at time t is defined as



rateρ (t) = k yi (t)ri . (1)
Yi ∈S

The total rate of change of the concentration yi (t) of a species Yi ∈ S is the sum
of the rates of reactions that affect Yi , and thus is governed by the differential
equation 
yi (t) = (pi − ri ) · rateρ (t). (2)
(r,p,k)∈R

This system of ODEs, along with an initial condition y(0) ∈ Rn>0 , yields a
polynomial initial value problem (PIVP ) and has a unique solution y(t).
For convenience, we allow alternative species names such as X and Z and
make use of more intuitive notation for specifying reactions. For example, a
reaction ρ = (r, p, k) can be written
k
X + Y −−−→ X + 2Z, (3)

where r and p are defined by the complexes X + Y and X + 2Z, respectively.


Thus X, Y are the reactants of ρ, X, Z are the products of ρ, and X is a catalyst
of ρ. If a CRN N = (S, R) consists of only the reaction above, this specifies the
system of ODEs

x (t) = 0,
y  (t) = −kx(t)y(t)
z  (t) = 2kx(t)y(t),

where x(t), y(t), and z(t) are the concentrations of the species X, Y , and Z at
time t. In this paper we use this intuitive notation whenever possible.
Two CRNs can also naturally be combined into one. Given N1 = (S1 , R1 )
and N2 = (S2 , R2 ), we define the join of N1 and N2 to be the CRN

N1  N2 = (S1 ∪ S2 , R1 ∪ R2 ). (4)

For a CRN N = (S, R) and a species X ∈ S, we say that (N, X) is a computer


for a real number α if the following three properties hold:

1. Integral Rate Constants. For each reaction ρ = (r, p, k) ∈ R, the rate


constant k ∈ Z>0 is a positive integer.
2. Bounded Concentrations. There is a constant β such that, if all species
concentrations are initialized to 0, then yi (t) ≤ β for each species Yi ∈ S and
for all time t ≥ 0.
3. Real-Time Convergence. If all species in N are initialized to 0 at time 0,
then for all t ≥ 1,
|x(t) − |α|| ≤ 2−t . (5)
Real-Time Equivalence of CRNs and GPACs 41

The real numbers for which there is a computer (N, X) are called real-time CRN
computable. The set of real-time CRN computable real numbers is denoted by
RRT CRN .
The restriction to integral rate constants ensures that the CRN can be spec-
ified in finitely many bits. Bounded concentrations imposes a limit on the rate
of convergence, which makes the variable t a meaningful measure of time. If
concentrations were unbounded, it is possible to compute a real number arbi-
trarily quickly by catalyzing all reactions with a species whose concentration is
unbounded. Bournez, Graça, and Pouly recently showed that the arc length of
y(t) is a better time complexity metric [4], and bounded concentrations imme-
diately implies the arc length is linear in t, making them equivalent metrics in
this case. The real-time convergence requires that α is computed with t
bits
of accuracy in t units of time, making it analogous to the definition of real time
Turing computation.
The definition of RRT CRN can also be generalized in the following way. Given
two real numbers τ, γ ∈ (0, ∞), we define Rτ,γRT CRN in the same way as RRT CRN
except the real-time convergence constraint (5) is replaced with:

|x(t) − |α|| ≤ e−γt , (6)

for all t ≥ τ . Proven in [19] but restated here for convenience is the following
lemma:
Lemma 1. RRT CRN = Rτ,γ
RT CRN for all τ, γ ∈ (0, ∞).

The above lemma shows that the definition of RRT CRN is robust to linear
changes to the real-time convergence rate. Thus, it suffices to show that a CRN
computes a real number α exponentially quickly, to prove that α ∈ RRT CRN
without explicitly showing that τ = 1 and γ = ln 2.

3 Real-Time Equivalence of CRNs and GPACs


This section is devoted to proving that the class RRT CRN is equivalent to an
analogous class RRT GP AC of real time computable real numbers by general pur-
pose analog computers. We begin by formally defining RRT GP AC .
For a PIVP y = (y1 , y2 , . . . , yn ) satisfying y(0) = 0, we say that y is an
computer for a real number α if the following three properties hold:
1. All coefficients of y are integers,
2. There is a constant β > 0 such that |yi (t)| ≤ β for all 1 ≤ i ≤ n and t ∈ [0, ∞),
and
3. |y1 (t) − α| ≤ 2−t for all t ∈ [1, ∞).
The real numbers for which there is a computer y are called real-time GPAC
computable. The set of real-time CRN computable real numbers is denoted by
RRT GP AC .
Note that the constraints above mirror the definition of RRT CRN in Sect. 2
except for the fact that y1 (t) is converging to α instead of |α|. This difference
42 X. Huang et al.

is due to the CRN restriction of species concentrations to be non-negative real


numbers whereas the value of a GPAC variable yi (t) has no such restriction.
Lemma 2. RRT CRN ⊆ RRT GP AC .

Proof. Given a computer (N, Y1 ) for α ∈ R, let y be the PIVP induced by the
deterministic semantics of N from Eq. (2). Note that (N, Y1 ) computes α when
its species concentrations are initialized to zero, therefore y(0) = 0. The fact that
y is also a computer for α immediately follows from the constraints imposed on
N and the fact that if α < 0, a multiplying each ODE by −1 causes y1 (t) to
converge directly to α instead of |α|. 

Although the inclusion above is trivial, the fact that RRT GP AC ⊆ RRT CRN is
not so obvious. This is due to deterministic CRNs inducing PIVPs with restricted
forms, namely, the polynomial of each ODE has the structure

y  (t) = p(t) − q(t)y(t),

where p and q are polynomials over the concentrations of the species. The fact
that negative terms in the ODE for Y must depend on its own concentration
y(t) makes certain GPAC constructions difficult to implement with CRNs.
The rest of this section is devoted to finishing the proof of the main theorem:
RRT GP AC = RRT CRN . To simplify the proof, we first prove that RRT CRN is a
subfield of R which solves an open problem stated in [19]. The proofs of closure
under addition, multiplication, division, and subtraction rely on certain conver-
gence properties. Thus, we first state and prove two lemmas which demonstrate
that certain differential equations immediately yield exponential convergence to
a target real number. Then we prove the four closure properties necessary to
show that RRT CRN is a field using these lemmas. Finally, we conclude with the
proof of the main theorem that RRT GP AC = RRT CRN .

Lemma 3 (Direct Convergence Lemma). If α ∈ R and x, f : [0, ∞) → R


are functions that satisfy

x (t) = f (t) − x(t) for all t ∈ [0, ∞) (7)

|f (t) − α| ≤ e−t for all t ∈ [1, ∞), (8)

then there exist constants γ, τ ∈ (0, ∞) such that

|x(t) − α| ≤ e−γt for all t ∈ [τ, ∞). (9)

Proof. Assume the hypothesis. The ODE of Eq. (7) can be solved directly using
the integrating factor method and has a solution of the form

x(t) = e−t et f (t)dt. (10)
Real-Time Equivalence of CRNs and GPACs 43

By Eq. (8), we know that for all t ≥ 1,


 
 
et f (t)dt ≤ et α + e−t dt = αet + t + C1 ,

for some constant C1 . This, along with Eq. (10), yields

x(t) ≤ α + e−t (t + C1 ) . (11)

Using a similar argument, it is easy to show that

x(t) ≥ α − e−t (t + C2 ) (12)

for some constant C2 . Choosing C = max { 0, C1 , C2 }, it follows from Eqs. (11)


and (12) that
|x(t) − α| ≤ (t + C)e−t ≤ e−t/2 ,
for all t ≥ max{1, 4 log(C + 1)}. 

Lemma 4 (Reciprocal Convergence Lemma). If α ∈ R>0 and x, f :


[0, ∞) → R are continuous functions that satisfy

x (t) = 1 − f (t) · x(t) for all t ∈ [0, ∞) (13)

|f (t) − α| ≤ e−t for all t ∈ [1, ∞), (14)

then there exist constants γ, τ > 0 such that


 
 
x − 1  ≤ e−γt for all t ∈ [τ, ∞). (15)
 α

Proof. Assume the hypothesis. Since f is continuous, its antiderivative exists,


so the ODE from Eq. (13) can be solved directly using the integrating factor
method with a solution of the form
 t
x(t) = e−F (t) eF (s) ds, (16)
0
t t
where F (t) = 0 f (s)ds. If we let h(t) = f (t) − α, and let H(t) = 0
h(s)ds be
the antiderivative of h, then
 t
F (t) = (α + h(s)) ds = αt + H(t).
0

Using this relationship, we can rewrite Eq. (16) as


 t
−F (t) 1
x(t) = e · eH(s) (αeαs ) ds. (17)
α 0
44 X. Huang et al.

We can now use integration by parts on the integral of Eq. (17) with u(s) = eH(s)
and v  (s) = αeαs to obtain
 t  t
H(s) αs
e (αe ) ds = u(s)v  (s)ds
0 0
t  t

= u(s)v(s) − v(s)u (s)ds
0 0
 t

H(t) αt
=e e −1− eαs h(s)eH(s) ds.
0

Substituting this into Eq. (17) and using the fact that F (t) = αt + H(t), we
obtain  t
−F (t) 1 F (t) F (s)
x(t) = e · e −1− h(s)e ds ,
α 0

which yields the following bound:


   t
 
x(t) − 1  ≤ e−F (t) 1 + |h(s)|eF (s)
ds . (18)
 α 0

It remains to be shown that the right-hand side of Eq. (18) is bounded by an


exponential after some time τ . We begin by showing that H(t) is bounded above
1
and below by the constant C1 = 0 |h(s)|ds + 1e :
 t  1  t
|H(t)| ≤ |h(s)|ds ≤ |h(s)|ds + e−s ds = C1 − e−t ≤ C1 .
0 0 1

It immediately follows that

eF (t) = eαt+H(t) ≤ C2 eαt


e−F (t) = e−αt−H(t) ≤ C2 e−αt
1
where C2 = eC1 . If we define the constant C3 = 0
|h(s)|eF (s) ds, we can bound
the integral of Eq. (18) with
 t  t
|h(s)|eF (s) ds ≤ C3 + e−s (C2 eαs ) ds = C5 + C4 e(α−1)t
0 1

C2
where C4 = α−1 and C5 = C3 − C4 eα−1 . Thus, we can rewrite Eq. (18):
 

 
x(t) − 1  ≤ C2 e−αt 1 + C5 + C4 e(α−1)t = C6 e−αt + C7 e−t
 α

where C6 = C2 (1 + C5 ) and C7 = C2 C4 .  
It immediately follows that there exist constants γ and τ such that x(t) − a1 
is bounded by e−γt for all t ∈ [τ, ∞). 

Real-Time Equivalence of CRNs and GPACs 45

Using Lemmas 3 and 4, we now prove that RRT CRN is a field. We split the
four closure properties into the following four lemmas.

Lemma 5. If α, β ∈ RRT CRN , then α + β ∈ RRT CRN .

Proof. Assume the hypothesis, and let (Nα , X) and (Nβ , Y ) be CRN computers
that compute α and β, respectively. Without loss of generality, we assume that
α, β ≥ 0 and that Nα and Nβ do not share any species.
Now let Z be a new species, and let N = Nα  Nβ  N where N is the CRN
defined by the reactions
1
X −−−→ X + Z
1
Y −−−→ Y + Z
1
Z −−−→ ∅.

, and
Note that the species in Nα and Nβ are unaffected by the reactions of N
the ODE for Z is:
z  (t) = x(t) + y(t) − z(t). (19)
Let f (t) = x(t)+y(t). By Lemma 1, without loss of generality, we can assume
that |f (t) − α − β| ≤ e−t for all t ≥ 1. Immediately by Lemmas 3 and 1, we
conclude that α + β ∈ RRT CRN . 

Lemma 6. If α, β ∈ RRT CRN , then αβ ∈ RRT CRN .

Proof. Assume the hypothesis, and let (Nα , X) and (Nβ , Y ) be CRN computers
that compute α and β, respectively Furthermore, we assume that Nα and Nβ do
not share any species. Without loss of generality, we also assume that α, β ≥ 0.
Now let Z be a new species, and let N = Nα  Nβ  N where N
is the CRN
defined by the reactions
1
X + Y −−−→ X + Y + Z
1
Z −−−→ ∅.

and
Note that the species in Nα and Nβ are unaffected by the reactions of N
yields the following ODE for Z:

z  (t) = x(t)y(t) − z(t). (20)

Let f (t) = x(t)y(t). By Lemma 1, without out loss of generality, we can


assume that |f (t) − αβ| ≤ e−t for all t ≥ 1. Immediately by Lemmas 3 and 1, we
conclude that αβ ∈ RRT CRN . 

1
Lemma 7. If α ∈ RRT CRN and α = 0, then α ∈ RRT CRN .
46 X. Huang et al.

Proof. Assume the hypothesis, and let (Nα , X) be CRN a computer that testifies
to this. Without loss of generality, we also assume that α > 0.
Now let Y be a new species, and let N = Nα  N where N is the CRN defined
by the reactions
1
∅ −−−→ Y
1
X + Y −−−→ X.

and yields the


Note that the species in Nα are unaffected by the reactions of N
following ODE for Y :
z  (t) = 1 − x(t)y(t). (21)
Since α ∈ RRT CRN , we know that |f (t) − α| ≤ e−t for all t ≥ 1. It follows
from Lemmas 4 and 1 that α1 ∈ RRT CRN . 

Lemma 8. If α, β ∈ RRT CRN , then α − β ∈ RRT CRN .

Proof. Assume the hypothesis, and let (Nα , X) and (Nβ , Y ) be CRN computers
that compute α and β, respectively. Furthermore, we assume that Nα and Nβ do
not share any species. Without loss of generality, we also assume that α > β ≥ 0.
Now let Z be a new species, and let N = Nα  Nβ  N where N is the CRN
defined by the reactions
1
∅ −−−→ Z
1
X + Z −−−→ X
1
Y + Z −−−→ Y + 2Z.

and
Note that the species in Nα and Nβ are unaffected by the reactions of N
yields the following ODE for Z:

z  (t) = 1 − (x(t) − y(t))z(t). (22)

Let f (t) = x(t) − y(t). By Lemma 1, without out loss of generality, we can
assume that |f (t) − (α − β)| ≤ e−t for all t ≥ 1. By Lemmas 4 and 1, we know
1
that α−β ∈ RRT CRN . By Lemmas 7, we conclude that α − β ∈ RRT CRN . 

Theorem 1. RRT CRN is a subfield of R.

Proof. This immediately follows from Lemmas 5–8 and the fact that RRT CRN is
non-empty. 

As a consequence of Theorem 1, and the results of [19] we now know that


RRT CRN contains all algebraic numbers and an infinite family of transcendental
numbers. However, we have yet to prove that natural transcendentals such as e
and π are real-time computable by CRNs. These proofs are simplified dramati-
cally using the following theorem which uses a construction similar to [13].
Real-Time Equivalence of CRNs and GPACs 47

Theorem 2. RRT CRN = RRT GP AC .


Proof. We have already shown the forward direction in Lemma 2.
For the backward direction, assume that 0 = α ∈ RRT GP AC , and let
y = (y1 , y2 , . . . , yn ) be the PIVP that testifies to this. Then the individual com-
ponents of y obey the ODEs

y1 = p1 (y1 , . . . , yn ),
y2 = p2 (y1 , . . . , yn ),
..
.

yn = pn (y1 , . . . , yn ).

For each 1 ≤ i ≤ n, we define the variables ŷ = (z, u1 , v1 , u2 , v2 , . . . , un , vn ) as


well as the polynomials

p̂i (ŷ) = pi (u1 − v1 , u2 − v2 , . . . , un − vn ),

noting that each p̂i is indeed an integral polynomial over the variables of ŷ. For
each 1 ≤ i ≤ n, we also define the polynomials p̂+ −
i and p̂i by the positive and
+ −
negative terms of p̂i , respectively, whence p̂i = p̂i − p̂i .
We now define ODEs for each variable ui and vi of ŷ,
 + 
ui = p̂+ −
i − ui vi p̂i + p̂i , (23)
 −
 + −

vi = p̂i − ui vi p̂i + p̂i , (24)

as well as the ODE for the variable z

z  = 1 − (u1 − v1 )z. (25)

Notice that if yi = ui − vi , then

ui − vi = p̂+ − 


i − p̂i = p̂i = pi = yi ,

therefore if ŷ(0) = 0, we know that yi (t) = ui (t) − vi (t) for all t ∈ [0, ∞).
We now prove that every variable of ŷ is bounded from above by some con-
stant. For the sake of contradiction, assume that either ui or vi is unbounded.
Recall that each variable of y is bounded by some β > 0, and therefore
−β ≤ yi (t) ≤ β for all t ∈ [0, ∞). Since yi (t) = ui (t) − vi (t), it follows that

both ui and vi must be unbounded. However,  + this−is
 a contradiction since ui and

vi each include the negative terms −ui vi p̂i + p̂i which grow faster than their
positive terms. Thus, ui and vi must both be bounded.
Since each of the ODEs of ŷ can be written in the form x = p − qx where
p and q are polynomials with positive integral coefficients, there exists a CRN
N = (S, R) with species S = {Ui , Vi | 1 ≤ i ≤ n} ∪ {Z} that obey these ODEs.
Because y1 = u1 − v1 , this means that |u1 (t) − v1 (t) − α| ≤ 2−t . By Lemma 4,
it immediately follows that N real time computes α1 with species Z. Finally, we
obtain that α ∈ RRT CRN by closure under reciprocal. 

48 X. Huang et al.

4 e and π Are Real-Time Computable by CRNs


In this section, we will prove that e and π are real time computable by CRNs,
which was not previously known. However, first we prove a useful theorem that
shows that the constraint that the CRN or GPAC must be initialized to all zeros
can be relaxed to any integral initial condition. This theorem dramatically sim-
plifies the constructions, since the numbers e and π can be naturally computed
if a species is initialized to 1.
Theorem 3. If α ∈ R and y = (y1 , y2 , . . . , yn ), y(0) ∈ Zn is a PIVP such that
1. |yi (t)| ≤ β for all 1 ≤ i ≤ n and t ∈ [0, ∞) for some β > 0, and
2. |y1 (t) − α| ≤ 2−t for all t ∈ [0, ∞),
then α ∈ RRT GP AC .
Proof. Assume the hypothesis. Then there is a polynomial pi corresponding to
each variable yi of y such that yi = pi . We will now define a related PIVP that
when initialized to all zeros computes α.
Define the variables ŷ = (ŷ1 , ŷ2 , . . . , ŷn ) that obey the ODEs

ŷi = pi (ŷ1 + y1 (0), ŷ2 + y2 (0), . . . , ŷn + yn (0)).

Since y(0) ∈ Zn , each ODE ŷi is a polynomial with integral coefficients. We also
note that if ŷi (t) = yi (t) − yi (0) for some t ∈ [0, ∞), then

ŷi (t) = pi (y1 (t), y2 (t), . . . , yn (t)) = yi (t).

Thus, if we initialize ŷ(0) = 0, it follows that ŷi (t) = yi (t) − yi (0) for all t ∈
[0, ∞). Since the PIVP y computes α, it follows that the PIVP ŷ computes
α − y1 (0), and therefore α − y1 (0) ∈ RRT GP AC .
Finally, since y1 (0) ∈ Z, it is also in RRT GP AC , and by closure under addition
we conclude that α ∈ RRT GP AC . 

We now present concise proofs that the e and π are members of RRT CRN .
Theorem 4. e ∈ RRT CRN .
Proof. By Theorem 3, it suffices to show that there exists a CRN computer with
integral initial conditions that computes e exponentially quickly. Consider the
CRN defined by
1
X −−−→ ∅
1
X + Y −−−→ X

along with the initial condition x(0) = 1 and y(0) = 1. This induces the system
of ODES

x (t) = −x(t) (26)



y (t) = −x(t)y(t), (27)
Real-Time Equivalence of CRNs and GPACs 49

which is trivial to solve and has solution


−t
x(t) = e−t , y(t) = e1−e .

It is clear that y(t) exponentially goes to e, and thus e ∈ RRT CRN . 


It is easy to apply the construction of Theorem 3 to the CRN provided in the


proof of Theorem 4, and Fig. 1 shows the plot of this expanded CRN computing
e in this way.

Concentration versus Time


3
vx
ux
uy
vy
zr
2.5 z

2
Concentration

1.5

0.5

0
0 10 20 30 40 50 60 70 80 90 100
Time

Fig. 1. MATLAB visualization of computing e from Theorem 4. This plot is of the


CRN after applying the construction from Theorem 3 so that all species concentrations
are initially zero, and Z is the species converging to e.

Theorem 5. π ∈ RRT CRN .

Proof. By Theorem 3, it suffices to show that there exists a CRN computer with
integral initial conditions that computes π exponentially quickly. Consider the
CRN defined by
1
W −−−→ ∅
2
W + X + Y −−−→ W + Y
1
W + 2X −−−→ W + 2X + Y
1
W + 2Y −−−→ W + Y
1
W + X −−−→ W + X + Z,
50 X. Huang et al.

with initial condition w(0) = x(0) = 1 and y(0) = z(0) = 0. It is easy to verify
that this CRN induces the following system of ODEs

w (t) = −w(t), (28)



x (t) = −2w(t)x(t)y(t), (29)
 2 2
y (t) = w(t)x(t) − w(t)y(t) , (30)
z  (t) = w(t)x(t). (31)

By examining Eq. (28), it is easy to see that w(t) = e−t , and by examining
Eqs. (29) to (31), we see that we can perform a change of variable from t to
t
u(t) = 0 w(s)ds = 1 − e−t to obtain the equivalent system of ODEs:

x (u) = −2x(u)y(u),
y  (u) = x(u)2 − y(u)2 ,
z  (u) = x(u).

This system can be solved directly and has solution


1 u
x(u) = , y(u) = , z(u) = arctan(u).
u2 + 1 u2 + 1
Since RRT CRN is a field, it now suffices to show that z(t) = z(u(t)) =
arctan(1−e−t ) converges to π4 exponentially quickly. Note that Taylor expansion
of the function arctan(x) around 1 gives
π x−1 1
arctan(x) = + − (x − 1)2 + o((x − 1)2 ).
4 2 4
Thus we obtain
π
arctan(u(t)) − = O(u(t) − 1) = O(e−t ).
4
π
Hence arctan(1 − e−t ) converges to 4 exponentially quickly, and therefore π ∈
RRT CRN . 

It is easy to generate the reactions of the explicit CRN that computes π from
an all-zero initial condition. The plot of this CRN is provided in Fig. 2.
Real-Time Equivalence of CRNs and GPACs 51

3.5
Pi_math
V_1
U_1
V_3
3 U_2
V_2
U_3
U_4
V_4
P_r
2.5 P

1.5

0.5

0
0 5 10 15 20 25 30

Fig. 2. MATLAB visualization of computing π from Theorem 4. This plot is of the


CRN after applying the construction from Theorem 3 so that all species concentrations
are initially zero, and P is the species converging to π.

5 Conclusion

In this paper, we investigated the relationship of the class RRT CRN of real
time computable real numbers with chemical reaction networks and the class
RRT GP AC of real time computable real numbers with general purpose analog
computers. In particular, we proved that RRT GP AC = RRT CRN by first solving
the previously open problem posed in [19] that RRT CRN is a field, and then sim-
ulating the GPAC with a CRN in a similar way to [13]. In particular, we extend
their construction so that our CRN simulation computes the real number α with
a single species instead of the difference of two species concentrations. We prove
this using the reciprocal convergence lemma and the fact that RRT CRN is closed
under reciprocal.
We also used the GPAC equivalence to prove that the restriction to all zero
initial conditions is not necessary and can be relaxed to integral initial conditions.
This led to concise and natural proofs that e and π are in RRT CRN . We should
note that applying the constructions in the proofs of Theorems 2 and 3 leads to
CRNs with a large number of reactions.
We hope future research will uncover techniques to compute numbers such as
e and π more efficiently, as well as research that leads to a better understanding
of the structure of RRT CRN .

Acknowledgments. We thank Jack Lutz for helpful comments and suggestions. We


also thank the anonymous reviews for their input, and especially insightful comments
concerning the presentation of this paper.
52 X. Huang et al.

References
1. Angluin, D., Aspnes, J., Eisenstat, D., Ruppert, E.: The computational power of
population protocols. Distrib. Comput. 20(4), 279–304 (2007)
2. Badelt, S., Shin, S.W., Johnson, R.F., Dong, Q., Thachuk, C., Winfree, E.: A
general-purpose CRN-to-DSD compiler with formal verification, optimization, and
simulation capabilities. In: Brijder, R., Qian, L. (eds.) DNA 2017. LNCS, vol.
10467, pp. 232–248. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-
66799-7_15
3. Bournez, O., Fraigniaud, P., Koegler, X.: Computing with large populations using
interactions. In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS 2012. LNCS,
vol. 7464, pp. 234–246. Springer, Heidelberg (2012). https://doi.org/10.1007/978-
3-642-32589-2_23
4. Bournez, O., Graça, D.S., Pouly, A.: Polynomial time corresponds to solutions of
polynomial ordinary differential equations of polynomial length. J. ACM 64(6), 38
(2017)
5. Case, A., Lutz, J.H., Stull, D.M.: Reachability problems for continuous chemical
reaction networks. In: Amos, M., Condon, A. (eds.) UCNC 2016. LNCS, vol. 9726,
pp. 1–10. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41312-9_1
6. Chalk, C., Kornerup, N., Reeves, W., Soloveichik, D.: Composable rate-
independent computation in continuous chemical reaction networks. In: Češka, M.,
Šafránek, D. (eds.) CMSB 2018. LNCS, vol. 11095, pp. 256–273. Springer, Cham
(2018). https://doi.org/10.1007/978-3-319-99429-1_15
7. Chen, H.L., Cummings, R., Doty, D., Soloveichik, D.: Speed faults in computation
by chemical reaction networks. Distrib. Comput. 30(5), 373–390 (2017)
8. Chen, H.-L., Doty, D., Soloveichik, D.: Deterministic function computation with
chemical reaction networks. In: Stefanovic, D., Turberfield, A. (eds.) DNA 2012.
LNCS, vol. 7433, pp. 25–42. Springer, Heidelberg (2012). https://doi.org/10.1007/
978-3-642-32208-2_3
9. Chen, H.L., Doty, D., Soloveichik, D.: Rate-independent computation in continuous
chemical reaction networks. In: Proceedings of the 5th Conference on Innovations
in Theoretical Computer Science, pp. 313–326. ACM (2014)
10. Cook, M., Soloveichik, D., Winfree, E., Bruck, J.: Programmability of chemical
reaction networks. In: Condon, A., Harel, D., Kok, J.N., Salomaa, A., Winfree, E.
(eds.) Algorithmic Bioprocesses. Natural Computing Series, pp. 543–584. Springer,
Heidelberg (2009). https://doi.org/10.1007/978-3-540-88869-7_27
11. Doty, D.: Timing in chemical reaction networks. In: Proceedings of the 25th Sym-
posium on Discrete Algorithms, pp. 772–784 (2014)
12. Epstein, I.R., Pojman, J.A.: An Introduction to Nonlinear Chemical Dynamics:
Oscillations, Waves, Patterns, and Chaos. Oxford University Press, Oxford (1998)
13. Fages, F., Le Guludec, G., Bournez, O., Pouly, A.: Strong turing completeness
of continuous chemical reaction networks and compilation of mixed analog-digital
programs. In: Feret, J., Koeppl, H. (eds.) CMSB 2017. LNCS, vol. 10545, pp. 108–
127. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-67471-1_7
14. Feinberg, M.: Foundations of Chemical Reaction Network Theory. AMS, vol. 202.
Springer, Cham (2019). https://doi.org/10.1007/978-3-030-03858-8
15. Fischer, P.C., Meyer, A.R., Rosenberg, A.L.: Time-restricted sequence generation.
J. Comput. Syst. Sci. 4(1), 50–73 (1970)
16. Graça, D.S.: Some recent developments on shannon’s general purpose analog com-
puter. Math. Logic Q.: Math. Logic Q. 50(4–5), 473–485 (2004)
Real-Time Equivalence of CRNs and GPACs 53

17. Graça, D.S., Costa, J.F.: Analog computers and recursive functions over the reals.
J. Complex. 19(5), 644–664 (2003)
18. Hartmanis, J., Stearns, R.E.: On the computational complexity of algorithms.
Trans. Am. Math. Soc. 117, 285–306 (1965)
19. Huang, X., Klinge, T.H., Lathrop, J.I., Li, X., Lutz, J.H.: Real-time computability
of real numbers by chemical reaction networks. Nat. Comput. 18(1), 63–73 (2019)
20. Kurtz, T.G.: The relationship between stochastic and deterministic models for
chemical reactions. J. Chem. Phys. 57(7), 2976–2978 (1972)
21. Shannon, C.E.: Mathematical theory of the differential analyzer. Stud. Appl. Math.
20(1–4), 337–354 (1941)
22. Yamada, H.: Real-time computation and recursive functions not real-time com-
putable. IRE Trans. Electron. Comput. EC–11(6), 753–760 (1962)
A Reaction Network Scheme
Which Implements Inference
and Learning for Hidden Markov Models

Abhinav Singh1(B) , Carsten Wiuf2 , Abhishek Behera3 ,


and Manoj Gopalkrishnan3
1
UM-DAE Centre for Excellence in Basic Sciences, Mumbai, India
abhinavsns7@gmail.com
2
Department of Mathematical Sciences, University of Copenhagen,
Copenhagen, Denmark
wiuf@math.ku.dk
3
Indian Institute of Technology Bombay, Mumbai, India
abhishek.enlightened@gmail.com, manoj.gopalkrishnan@gmail.com

Abstract. With a view towards molecular communication systems and


molecular multi-agent systems, we propose the Chemical Baum-Welch
Algorithm, a novel reaction network scheme that learns parameters for
Hidden Markov Models (HMMs). Each reaction in our scheme changes
only one molecule of one species to one molecule of another. The reverse
change is also accessible but via a different set of enzymes, in a design
reminiscent of futile cycles in biochemical pathways. We show that every
fixed point of the Baum-Welch algorithm for HMMs is a fixed point
of our reaction network scheme, and every positive fixed point of our
scheme is a fixed point of the Baum-Welch algorithm. We prove that the
“Expectation” step and the “Maximization” step of our reaction network
separately converge exponentially fast. We simulate mass-action kinetics
for our network on an example sequence, and show that it learns the
same parameters for the HMM as the Baum-Welch algorithm.

1 Introduction

The sophisticated behavior of living cells on short timescales is powered by


biochemical reaction networks. One may say that evolution has composed the
symphony of the biosphere, genetic machinery conducts the music, and reaction
networks are the orchestra. Understanding the capabilities and limits of this
molecular orchestra is key to understanding living systems, as well as to engi-
neering molecular systems that are capable of sophisticated life-like behavior.
The technology of implementing abstract reaction networks with molecules is
a subfield of molecular systems engineering that has witnessed rapid advances in
recent times. Several researchers [1–8] have proposed theoretical schemes for
implementing arbitrary reaction networks with DNA oligonucleotides. There
is a growing body of experimental demonstrations of such schemes [2,7,9–11].
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 54–79, 2019.
https://doi.org/10.1007/978-3-030-26807-7_4
A Reaction Network Scheme Which Implements Inference and Learning 55

A stack of tools is emerging to help automate the design process. We can now
compile abstract reaction networks to a set of DNA oligonucleotides that will
implement the dynamics of the network in solution [12]. We can computation-
ally simulate the dynamics of these oligonucleotide molecular systems [13] to
allow debugging prior to experimental implementation. In view of these rapid
advances, the study of reaction networks from the point of view of their compu-
tational capabilities has become even more urgent.
It has long been known that reaction networks can compute any computable
function [14]. The literature has several examples of reaction network schemes
that have been inspired by known algorithms [15–22]. Our group has previously
described reaction network schemes that solve statistical problems like maxi-
mum likelihood [23], sampling a conditional distribution and inference [24], and
learning from partial observations [25]. These schemes exploit the thermody-
namic nature of the underlying molecular systems that will implement these
reaction networks, and can be expressed in terms of variational ideas involving
minimization of Helmholtz free energy [26–28].
In this paper, we consider situations where partial information about the
environment is available to a cell in the form of a sequence of observations. For
example, this might happen when an enzyme is acting processively on a poly-
mer, or a molecular walker [29–31] is trying to locate its position on a grid. In
situations like this, multiple observations are not independent. Such sequences
can not be summarized merely by the type of the sequence [32], i.e., the num-
ber of times various symbols occur. Instead, the order of various observations
carries information about state changes in the process producing the sequence.
The number of sequences grows exponentially with length, and our previously
proposed schemes are algorithmically inadequate. To deal with such situations
requires a pithy representation of sequences, and a way of doing inference and
learning directly on such representations. In Statistics and Machine Learning,
this problem is solved by Hidden Markov Models (HMMs) [33].
HMMs are a widely used model in Machine Learning, powering sequence
analysis applications like speech recognition [34], handwriting recognition, and
bioinformatics. They are also essential components of communication systems
as well as of intelligent agents trained by reinforcement learning methods. In
this article, we describe a reaction network scheme which implements
the Baum-Welch algorithm. The Baum-Welch algorithm is an iterative algo-
rithm for learning HMM parameters. Reaction networks that can do such statis-
tical analysis on sequences are likely to be an essential component of molecular
communication systems, enabling cooperative behavior among a population of
artificial cells. Our main contributions are:

1. In Sect. 2, we describe what the reader needs to know about HMMs and the
Baum-Welch algorithm to be able to follow the subsequent constructions. No
prerequisites are assumed beyond familiarity with matrices and probability
distributions.
2. In Sect. 3, we describe a novel reaction network scheme to learn parameters
for an HMM.
56 A. Singh et al.

3. We prove in Theorem 1 that every fixed point of the Baum-Welch algorithm is


also a fixed point of the continuous dynamics of this reaction network scheme.
4. In Theorem 2, we prove that every positive fixed point of the dynamics of our
reaction network scheme is a fixed point of the Baum-Welch algorithm.
5. In Theorems 3 and 4, we prove that subsets of our reaction network scheme
which correspond to the Expectation step and the Maximization step of the
Baum-Welch algorithm both separately converge exponentially fast.
6. In Example 1, we simulate our reaction network scheme on an input sequence
and show that the network dynamics is successfully able to learn the same
parameters as the Baum-Welch algorithm.
7. If observations are not taken for long enough, or if the target HMM generating
the observations has zero values for some parameters, the Baum-Welch algo-
rithm may have no positive fixed points. In this situation, the conditions for
Theorem 2 to hold are not met. We show in Example 2 that the requirements
of Theorem 2 are not superfluous. When the Baum-Welch algorithm has no
positive fixed points, but has a boundary fixed point, our reaction network
scheme can get stuck at a boundary fixed point that is not a Baum-Welch
fixed point.

2 Hidden Markov Models and the Baum Welch


Algorithm
Fix two finite sets P and Q. A stochastic map is a |P | × |Q|  matrix A =
(apq )|P |×|Q| such that apq ≥ 0 for all p ∈ P and q ∈ Q, and q∈Q apq =
1 for all p ∈ P . Intuitively, stochastic maps represent conditional probability
distributions.
An HMM (H, V, θ, ψ, π) consists of finite sets H (for ‘hidden’) and V (for
‘visible’), a stochastic map θ from H to H called the transition matrix, a
stochastic map ψ from H to V called the emission matrix, and an initial
probability
 distribution π = (πh )h∈H on H, i.e., πh ≥ 0 for all h ∈ H and
h∈H π h = 1. See Fig. 1a for an example.
Suppose a length L sequence (v1 , v2 , . . . , vL ) ∈ V L of visible states is observed
due to a hidden sequence (x1 , x2 , . . . , xL ) ∈ H L . The following questions related
to an HMM are commonly studied:
1. Likelihood: For fixed θ, ψ, compute the likelihood Pr(v1 , v2 , . . . , vL | θ, ψ).
This problem is solved by the forward-backward algorithm.
2. Learning: Estimate the parameters θ̂, ψ̂ which maximize the likelihood of
the observed sequence (v1 , v2 , . . . , vL ) ∈ V L . This problem is solved by the
Baum-Welch algorithm which is an Expectation-Maximization (EM) algo-
rithm. It uses the forward-backward algorithm as a subroutine to compute
the E step of EM.
3. Decoding: For fixed θ, ψ, find the sequence (ĥ1 , ĥ2 , . . . , ĥl , . . . , ĥL ) ∈ H L
that has the highest probability of producing the given observed sequence
(v1 , v2 , . . . , vL ). This problem is solved by the Viterbi algorithm.
A Reaction Network Scheme Which Implements Inference and Learning 57

α1 α+1,1
θ11 θ22
α1 θ11 ψ1v+1
θ12 H1 H1
α1 θ
12 ψ 1
θ 21ψ
2v 1v +
 +1
α 2
H1 H2
θ21
α2 θ22 ψ2v+1
ψ11 ψ12 ψ21 ψ22 H2 H2

V1 V2 V1 V2 α2 α+1,2

v v+1
(a) Hidden Markov Model (b) Forward Algorithm
θ, ψ θ, ψ
β−1,1 β1
θ11 ψ1v β1 Forward Backward
H1 H1
θ12 ψ β 1
1v β
θ 21ψ
 2 1v  αlg βlg

E-Step
θ22 ψ2v β2
H2 H2
ξlgh γlg
β−1,2 β2
M-Step
v−1 v
θ, ψ
(c) Backward Algorithm (d) Baum-Welch Algorithm

Fig. 1. Learning HMMs from sequences. (a) HMM: The hidden states H1 and
H2 are not directly observable. Instead what are observed are elements V1 , V2 from
the set V = {V1 , V2 } of “visible states.” The parameters θ11 , θ12 , θ21 , θ22 denote
the probability of transitions between the hidden states. The probability of observ-
ing states V1 , V2 depends on the parameters ψ11 , ψ12 , ψ21 , ψ22 as indicated in the
figure. (b) The forward algorithm computes the position l + 1 likelihood αl+1,1 =
αl1 θ11 ψ1vl+1 + αl2 θ21 ψ1vl+1 by forward propagating the position l likelihoods αl1
and αl2 . Here vl , vl+1 ∈ V are the observed emissions at position l and l + 1.
(c) The backward algorithm computes the position l − 1 conditional probability
βl−1,1 = θ11 ψ1vl βl1 + θ12 ψ2vl βl2 by propagating the position l conditional probabilities
βl1 and βl2 backwards. (d) The Baum-Welch Algorithm is a fixed point Expectation-
Maximization computation. The E step calls the forward and backward algorithm as
subroutines and, conditioned on the entire observed sequence (v1 , v2 , . . . , vL ) ∈ V L ,
computes the probabilities γlg of being in states g ∈ H at position l and the proba-
bilities ξlgh of taking the transitions gh ∈ H 2 at position l. The M step updates the
parameters θ and ψ to maximize their likelihood given the observed sequence.

The forward algorithm (Fig. 1b) takes as input an HMM (H, V, θ, ψ, π) and
a length L observation sequence (v1 , v2 , . . . , vL ) ∈ V L and outputs the L × |H|
likelihoods αlh = Pr[v1 , v2 , . . . , vl , xl = h | θ, ψ] of observing symbols v1 , . . . , vl
58 A. Singh et al.

and being in the hidden state h ∈ H at time l. It does so using the following
recursion.

= πh ψhv1 for all h ∈ H,


– Initialisation: α1h
– Recursion: αlh = g∈H αl−1,g θgh ψhvl for all h ∈ H and l = 2, . . . , L.

The backward algorithm (Fig. 1c) takes as input an HMM (H, V, θ, ψ, π)


and a length L observation sequence (v1 , v2 , . . . , vL ) ∈ V L and outputs the
L × |H| conditional probabilities βlh = Pr[vl+1 , vl+2 , . . . , vL | xl = h, θ, ψ] of
observing symbols vl+1 , . . . , vL given that the hidden state xl at time l has label
h ∈ H.
= 1, for all h ∈ H,
– Initialisation: βLh
– Recursion: βlh = g∈H θhg ψgvl+1 βl+1,g for all h ∈ H and l = 1, . . . , L − 1.

The E step for the Baum-Welch algorithm takes as input an HMM


(H, V, θ, ψ, π) and a length L observation sequence (v1 , v2 , . . . , vL ). It outputs
the L × H conditional probabilities γlh = Pr[xl = h | θ, ψ, v] of being in hidden
state h at time l conditioned on the observed sequence v by:
αlh βlh
γlh = 
g∈H αlg βlg

for all h ∈ H and l = 1, 2, . . . , L − 1. It also outputs the (L − 1) × H × H


probabilities ξlgh = Pr[xl = g, xl+1 = h | θ, ψ, v] of transitioning along the edge
(g, h) at time l conditioned on the observed sequence v by:

αlg θgh ψhvl+1 βl+1,h


ξlgh = 
f ∈H αlf βlf

for all g, h ∈ H and l = 1, . . . , L − 1.

Remark 1. Note that the E-step uses the forward and backward algorithms as
subroutines to first compute the α and β values. Further note that we don’t need
the forward and backward algorithms to return the actual values αlh and βlh . To
be precise, let αl = (αlh )h∈H ∈ RH denote the vector of forward likelihoods at
time l. Then for the E step to work, we only need the direction of αl and not the
magnitude. This is because the numerator and denominator in the updates are
both linear in αlh , and the magnitude cancels out. Similarly, if βl = (βlh )h∈H ∈
RH denotes the vector of backward likelihoods at time l then the E step only
cares about the direction of βl and not the magnitude. This scale symmetry is
a useful property for numerical solvers. We will also make use of this freedom
when we implement a lax forward-backward algorithm using reaction networks
in the next section.

The M step of the Baum-Welch algorithm takes as input the values γ and
ξ that are output by the E step as reconstruction of the dynamics on hidden
states, and outputs new Maximum Likelihood estimates of the parameters θ, ψ
A Reaction Network Scheme Which Implements Inference and Learning 59

that best explain these values. The update rule turns out to be very simple. For
all g, h ∈ H and w ∈ V :
L−1 L
l=1 ξlgh l=1 γlh δw,vl
θgh ← L−1  , ψhw ←  L
l=1 f ∈H ξlgf l=1 γlh

1 if w = vl
where δw,vl = is the Dirac delta function.
0 otherwise

Remark 2. Like in Remark 1, note that the M step does not require its inputs
to be the actual values γ and ξ. There is a scaling symmetry so that we only
need the directions of the vectors γ(h) = (γlh )l=1,2,...,L ∈ RL for all h ∈ H and
ξ(g) = (ξlgh )1≤l≤L−1,h∈H ∈ R(L−1)×H for all g ∈ H. This gives us the freedom
to implement a lax E projection without affecting the M projection, and we will
exploit this freedom when designing our reaction network.

The Baum-Welch algorithm (Fig. 1d) is a fixed point EM computation


that alternately runs the E step and the M step till the updates become small
enough. It is guaranteed to converge to a fixed point (θ̂, ψ̂). However, the fixed
point need not always be a global optimum.

3 Chemical Baum-Welch Algorithm


3.1 Reaction Networks
Following [25], we recall some concepts from reaction network theory [24,35–39].
Fix a finite set S of species. An S-reaction, or simply a reaction when S is
understood from context, is a formal chemical equation
 

yX X → yX X
X∈S X∈S


where the numbers yX , yX ∈ Z≥0 are the stoichiometric coefficients of species
X on the reactant side and product side respectively. A reaction network
is a pair (S, R) where R is a finite set of S-reactions. A reaction system is a
triple (S, R, k) where (S, R) is a reaction network and k : R → R>0 is called the
rate function.
As is common when specifying reaction networks, we will find it convenient
to explicitly specify only a set of chemical equations, leaving the set of species
to be inferred by the reader.
Fix a reaction system (S, R, k). Deterministic Mass Action Kinetics
describes a system of ordinary differential equations on the concentration vari-
ables {xi (t) | i ∈ S} according to:
 
ẋi (t) = ka→b (bi − ai ) xj (t)aj
a→b∈R j∈S
60 A. Singh et al.

3.2 Baum-Welch Reaction Network

In this section we will describe a reaction network for each part of the Baum-
Welch algorithm.
Fix an HMM M = (H, V, θ, ψ, π). Pick an arbitrary hidden state h∗ ∈ H
and an arbitrary visible state v ∗ ∈ V . Picking these states h∗ ∈ H and v ∗ ∈ V is
merely an artifice to break symmetry akin to selecting leaders, and our results
hold independent of these choices. Also fix a length L ∈ Z>0 for the observed
sequence.
We first work out in full detail how the forward algorithm of the Baum-
Welch algorithm may be translated into chemical reactions. Suppose a length L
sequence (v1 , v2 , . . . , vL ) ∈ V L of visible states is observed. Then recall that the
forward algorithm uses the following recursion:

= πh ψhv1 for all h ∈ H,


– Initialisation: α1h
– Recursion: αlh = g∈H αl−1,g θgh ψhvl for all h ∈ H and l = 2, . . . , L.

Notice this implies

– α1h × 
πh∗ ψh∗ v1 = α1h∗ × πh ψhv ∈ H \ {h∗ },
 1 for all h  
 
– αlh × g∈H α l−1,g θ gh∗ ψh∗ v
l
= αlh∗ ×
g∈H αl−1,g θ gh ψ hv l
for all h ∈

H \ {h } and l = 2, . . . , L.

This prompts the use of the following reactions for the initialization step:

α1h + πh∗ + ψh∗ v1 −


→ α1h∗ + πh∗ + ψh∗ v1
α1h∗ + πh + ψhv1 − → α1h + πh + ψhv1

for all h ∈ H \ {h∗ } and w ∈ V . By design α1h × πh∗ ψh∗ v1 = α1h∗ × πh ψhv1 is the
balance equation for the pair of reactions corresponding to each h ∈ H \ {h∗ }.
Similarly for the recursion step, we use the following reactions:

αlh + αl−1,g + θgh∗ + ψh∗ vl −


→ αlh∗ + αl−1,g + θgh∗ + ψh∗ vl
αlh∗ + αl−1,g + θgh + ψhvl −→ αlh + αl−1,g + θgh + ψhvl

for all g ∈ H, h ∈ H \ {h∗ }, l = 2, . . . , L and w ∈ V . Again by design


⎛ ⎞ ⎛ ⎞
 
αlh × ⎝ αl−1,g θgh∗ ψh∗ vl ⎠ = αlh∗ × ⎝ αl−1,g θgh ψhvl ⎠
g∈H g∈H

is the balance equation for the set of reactions corresponding to each (h, l) ∈
H \ {h∗ } × {2, . . . , L}.
The above reactions depend on the observed sequence (v1 , v2 , . . . , vL ) ∈ V L
of visible state. This is a problem because one would have to design different
reaction networks for different observed sequences. To solve this problem we
A Reaction Network Scheme Which Implements Inference and Learning 61

introduce the species Elw with l = 1, . . . , L and w ∈ V . Now with the Elw
species, we use the following reactions for the forward algorithm:
α1h + πh∗ + ψh∗ w + E1w −
→ α1h∗ + πh∗ + ψh∗ w + E1w
α1h∗ + πh + ψhw + E1w −
→ α1h + πh + ψhw + E1w

for all h ∈ H \ {h∗ } and w ∈ V .


αlh + αl−1,g + θgh∗ + ψh∗ w + Elw −
→ αlh∗ + αl−1,g + θgh∗ + ψh∗ w + Elw
αlh∗ + αl−1,g + θgh + ψhw + Elw −
→ αlh + αl−1,g + θgh + ψhw + Elw

for all g ∈ H, h ∈ H \ {h∗ }, l = 2, . . . , L and w ∈ V . The Elw species are to


be initialized such that Elw = 1 iff w = vl and Elw = 0 otherwise. So different
observed sequences can now be processed by the same reaction network, by
appropriately initializing the species Elw .
The other parts of the Baum-Welch algorithm may be translated into chem-
ical reactions using a similar logic. We call the resulting reaction network the
Baum-Welch Reaction Network BW (M, h∗ , v ∗ , L). It consists of four sub-
networks corresponding to the four parts of the Baum-Welch algorithm, as shown
in Table 1.
The Baum-Welch reaction network described above has a special structure.
Every reaction is a monomolecular transformation catalyzed by a set of species.
The reverse transformation is also present, catalyzed by a different set of species
to give the network a “futile cycle” [40] structure. In addition, each connected
component in the undirected graph representation of the network has a topology
with all transformations happening to and from a central species. This prompts
the following definitions.
Definition 1 (Flowers, petals, gardens). A graph is a triple (Nodes,
Edges, π) where Nodes and Edges are finite sets and π is a map from Edges
to unordered pairs of elements from Nodes. A flower is a graph with a special
node n∗ such that for every edge e ∈ Edges we have n∗ ∈ π(e). A garden is a
graph which is a union of disjoint flowers. A petal is a set of all edges e which
have the same π(e), i.e. they are incident between the same pair of nodes.
Figure 2 shows how the Baum-Welch reaction network can be represented as
a garden graph, in which species are nodes and reactions are edges.
A collection of specific rates is permissible if all reactions in a petal have the
same rate. However, different petals may have different rates. We will denote the
specific rate for a petal by superscripting the type of the species and subscripting
its indices. For example, the specific rate for reactions in the petal for αlh would
α
be denoted as klh . The notation for the remaining rate constants can be read
from Fig. 2.
Remark 3. The “flower” topology we have employed for the Baum-Welch reac-
tion network is only one among several possibilities. The important thing is to
achieve connectivity between different nodes that ought to be connected, ensur-
ing that the ratio of the concentrations of the species denoted by adjacent nodes
62 A. Singh et al.

Table 1. Baum-Welch Reaction Network: The steps and reactions are for all
g, h ∈ H, w ∈ V and l = 1, . . . , L − 1. Notice there are some null reactions of the form
ai Xi → ai Xi , which have no effect on the dynamics, and so can be ignored.

Baum-Welch Algorithm Baum-Welch Reaction Network

α1h + πh∗ + ψh∗ w + E1w −−→ α1h∗ + πh∗ + ψh∗ w + E1w


α1h = πh ψhv1
α1h∗ + πh + ψhw + E1w −−→ α1h + πh + ψhw + E1w

αl+1,h + αlg + θgh∗ + ψh∗ w + El+1,w −−→



αl+1,h = αlg θgh ψhvl+1 αl+1,h∗ + αlg + θgh∗ + ψh∗ w + El+1,w
g∈H αl+1,h∗ + αlg + θgh + ψhw + El+1,w −−→
αl+1,h + αlg + θgh + ψhw + El+1,w

βLh = 1 βlh + βl+1,g + θh∗ g + ψgw + El+1,w −−→


βlh∗ + βl+1,g + θh∗ g + ψgw + El+1,w
 βlh∗ + βl+1,g + θhg + ψgw + El+1,w −−→
βlh = θhg ψgvl+1 βl+1,g
g∈H
βlh + βl+1,g + θhg + ψgw + El+1,w

αlh βlh γlh + αlh∗ + βlh∗ −−→ γlh∗ + αlh∗ + βlh∗


γlh = 
g∈H αlg βlg γlh∗ + αlh + βlh −−→ γlh + αlh + βlh

ξlgh +αlh∗ + θh∗ h∗ + βl+1,h∗ + ψh∗ w + El+1,w −−→


αlg θgh ψhvl+1 βl+1,h ξlh∗ h∗ +αlh∗ + θh∗ h∗ + βl+1,h∗ + ψh∗ w + El+1,w
ξlgh = 
f ∈H αlf βlf ξlh∗ h∗ +αlg + θgh + βl+1,g + ψhw + El+1,w −−→
ξlgh +αlg + θgh + βl+1,g + ψhw + El+1,w

L−1
ξlgh θgh + ξlgh∗ −−→ θgh∗ + ξlgh∗
θgh ← L−1l=1

l=1 f ∈H ξlgf
θgh∗ + ξlgh −−→ θgh + ξlgh

L
l=1 γlh δw,vl
ψhw + γlh + Elv∗ −−→ ψhv∗ + γlh + Elv∗
ψhw ← L
l=1 γlh
ψhv∗ + γlh + Elw −−→ ψhw + γlh + Elw

takes the value as prescribed by the Baum-Welch algorithm. Therefore, many


other connection topologies can be imagined, for example a ring topology where
each node is connected to two other nodes while maintaining the same connected
A Reaction Network Scheme Which Implements Inference and Learning 63

kα+
αlh + αl−1,g + θih∗ + ψh∗ w + Elw −−lh
−→ α
klh
αlh∗ + αl−1,g + θih∗ + ψh∗ w + Elw αlh αlh∗
α−
klh
αlh∗ + αl−1,g + θgh + ψhw + Elw −−−→
αlh + αl−1,g + θgh + ψhw + Elw α α+ α−
klh = klh = klh

|H| × |V | |H| × |V | |V |
αlh βlh ξlgh

αlh∗ α
klh βlh∗ β
klh ξlh h
∗ ∗
ξ
klgh
Petal

Flower

L L
γlh θgh ψhw
γ
γlh∗ klh θgh∗ θ ψhv∗ ψ
kgh khw

Fig. 2. The Baum-Welch Reaction Network represented as an undirected


graph. (a) Each reaction is a unimolecular transformation driven by catalysts. The
nodes represents the species undergoing transformation. The edge represents a pair
of reactions which drive this transformation backwards and forwards in a futile cycle.
Catalysts are omitted for clarity. (b) The network decomposes into a collection of
disjoint flowers. Nodes represent species and edges represent pairs of reactions, species
α, γ have L flowers each, β, ξ have L − 1 flowers each, and species θ and ψ have |H|
flowers each (not shown in figure). All reactions in the same petal have the same specific
rate constant, so the dimension of the space of permissible rate constants is equal to
the number of petals in the graph.

components. In fact, there are obvious disadvantages to the star topology, with
a single point of failure, whereas the ring topology appears more resilient. How
network topology affects basins of attraction, rates of convergence, and emer-
gence of spurious equilibria in our algorithm is a compelling question beyond
the scope of this present work.

The Baum-Welch reaction network with a permissible choice of rate constants


k will define a Baum-Welch reaction system (BW (M, h∗ , v ∗ , L), k) whose
deterministic mass action kinetics equations will perform a continuous time ver-
sion of the Baum-Welch algorithm. We call this the Chemical Baum-Welch
Algorithm, and describe it in Algorithm 1.
64 A. Singh et al.

Algorithm 1. Chemical Baum-Welch Algorithm


Input: An HMM M = (H, V, θ, ψ, π) and an observed sequence v ∈ V L
|H|×|H| |H|×|V |
Output: Parameters θ̂ ∈ R≥0 , ψ̂ ∈ R≥0
Initialization of concentrations at t=0: 
1 if w = vl
1. For w ∈ V and l = 1, . . . , L, initialize Elw (0) such that Elw (0) =
0 otherwise
2. For g ∈ H, initialize βLg = β
3. For every other species, initialize its concentration arbitrarily in R>0 .

Algorithm:
Run the Baum-Welch reaction system with deterministic mass action
kinetics until convergence.

4 Analysis and Simulations

The Baum-Welch reaction network has number of species of each type as follows:

Type π α β θ ψ E γ ξ
Number |H| |H|L |H|L |H|2 |H||V | L|V | |H|L |H|2 (L − 1)

The total number of species is |H| + 3|H|L + |H|2 + |H||V | + L|V | + |H|2 (L − 1)
which is O(L|H|2 + |H||V
 | + L|V |). The number of reactions (ignoring the null
reactions of the form ai Xi → ai Xi ) in each part is:

Forward Backward Expectation Maximization


2(|H| − 1)V (2|H|(|H| − 1)|V |) 2L(|H| − 1) 2|H|(|H| − 1)(L − 1)
+ 2|H|(|H| − 1)(L − 1)|V | (L − 1) + 2(L − 1)(|H|2 − 1) + 2|H|L(|V | − 1)

so that the total number of reactions is O(|H|2 L|V |).


The first theorem shows that the Chemical Baum-Welch Algorithm recovers
all of the Baum-Welch equilibria.

Theorem 1. Every fixed point of the Baum-Welch algorithm for an HMM


M = (H, V, θ, ψ, π) is a fixed point for the corresponding Chemical Baum-Welch
Algorithm with permissible rates k.

See Appendix A.1 for proof.


We say a vector of real numbers is positive if all its components are strictly
greater than 0. The next theorem shows that positive equilibria of the Chemical
Baum-Welch Algorithm are also fixed points of the Baum-Welch algorithm.

Theorem 2. Every positive fixed point for the Chemical Baum-Welch Algo-
rithm on a Baum-Welch Reaction system (BW (M, h∗ , v ∗ , L), k) with permis-
sible rate k is a fixed point for the Baum-Welch algorithm for the HMM
M = (H, V, θ, ψ, π).
A Reaction Network Scheme Which Implements Inference and Learning 65

See Appendix A.1 for proof.


The Baum-Welch algorithm is an iterative algorithm. The E step and the M
step are run iteratively. In contrast, the Chemical Baum-Welch algorithm is a
generalized EM algorithm [41] where all the reactions are run at the same time
in a single-pot reaction.
The next theorem shows that the E step consisting of the forward network,
the backward network, and the E network, converges exponentially fast to the
correct equilibrium if the θ and ψ species are held fixed at a positive point.

Theorem 3. For the Baum-Welch Reaction System (BW (M, h∗ , v ∗ , L), k) with
permissible rates k, if the concentrations of θ and ψ species are held fixed at a
positive point then the Forward, Backward and Expection step reaction systems
on α, β, γ and ψ species converge to equilibrium exponentially fast.

See Appendix A.2 for proof.


The next theorem shows that if the α, β, γ, ξ species are held fixed at a
positive point, then the M step consisting of reactions modifying the θ and ψ
species converges exponentially fast to the correct equilibrium.
Theorem 4. For the Baum-Welch Reaction System (BW (M, h∗ , v ∗ , L), k) with
permissible rates k, if the concentrations of α, β, γ and ξ species are held fixed at
a positive point then the Maximization step reaction system on θ and ψ converges
to equilibrium exponentially fast.
See Appendix A.2 for proof.
The following examples demonstrate the behavior of the Chemical Baum-
Welch Algorithm.
Example 1. Consider an HMM (H, V, θ, ψ, π) with two hidden states H =
{H1 , H2 } and two emitted symbols V = {V1 , V2 } where the starting
proba-
0.6 0.4
bility is π = (0.6, 0.4), initial transition probability is θ = , and ini-
0.3 0.7
0.5 0.5
tial emission probability is ψ = . Suppose we wish to learn (θ, ψ) for
0.5 0.5
the following observed sequence: (V1 , V1 , V1 , V2 , V1 , V1 , V2 , V2 , V2 , V1 , V2 , V2 , V1 ,
V1 , V1 , V1 , V2 , V2 , V2 , V1 , V2 , V1 , V1 , V2 , V2 ). We initialize the corresponding reac-
tion system by setting species El,vl = 1 and El,w = 0 for w = vl , and run the
dynamics according to deterministic mass-action kinetics. Initial conditions of
all species that are not mentioned are chosen to be nonzero, but otherwise at
random.
For our numerical solution, we observe that the reaction network equilibrium
0.5071 0.4928
point coincides with the Baum-Welch steady state θ̂ = and
0.0000 1.0000
1.0000 0.0000
ψ̂ = (See Fig. 3).
0.4854 0.5145
The next example shows that the Chemical Baum-Welch algorithm can some-
times get stuck at points that are not equilibria for the Baum-Welch algorithm.
66 A. Singh et al.

Fig. 3. Simulation of Example 1: Both simulations are started at exactly the same
initial vector. This may not be apparent in the figure because concentration of some
species change rapidly at start in the reaction network.

This is a problem especially for very short sequences, and is probably happening
because in such settings, the best model sets many parameters to zero. When
many species concentrations are set to 0, many reactions get turned off, and the
network gets stuck away from the desired equilibrium. We believe this will not
happen if the HMM generating the observed sequence has nonzero parameters,
and the observed sequence is long enough.

Example 2. Consider an HMM (H, V, θ, ψ, π) with two hidden states H =


{H1 , H2 } and two emitted symbols V = {V1 , V2 }, initial distribution π =
0.6 0.4
(0.6, 0.4) is fixed, initial transition probability θ = , and initial emis-
0.3 0.7

0.5 0.5
sion probability ψ = . Suppose we wish to learn (θ, ψ) for the sequence
0.5 0.5
(V1 , V2 , V1 , V2 , V1 ). We again simulate the corresponding reaction network and
also perform the Baum-Welch algorithm for comparison.
Figure 4 shows that the reaction network equilibrium point does not coin-
1.0000 0.0000
cide with the Baum-Welch steady state. Both converge to ψ̂ = .
0.0000
1.0000
0.3489 0.6510
However, the reaction network converges to θ̂ = whereas the
1.0000 0.0000

0.0000 1.0000
Baum-Welch algorithm converges to θ̂ = which happens to be
1.0000 0.0000
the true maximum likelihood point. Note that this does not contradict Theorem
2 because the fixed point of this system is a boundary point and not a positive
fixed point.
A Reaction Network Scheme Which Implements Inference and Learning 67

Fig. 4. Simulation of Example 2: Both simulations are started at exactly the same
initial vector. This may not be apparent in the figure because concentration of some
species change rapidly at start in the reaction network.

5 Related Work
In previous work, our group has shown that reaction networks can perform the
Expectation Maximization (EM) algorithm for partially observed log linear sta-
tistical models [25,42]. That algorithm also applies “out of the box” to learning
HMM parameters. The problem with that algorithm is that the size of the reac-
tion network would become exponentially large in the length of the sequence,
so that even examples like Example 1 with an observation sequence of length
25 would become impractical. In contrast, the scheme we have presented in this
paper requires only a linear growth with sequence length. We have obtained the
savings by exploiting the graphical structure of HMMs. This allows us to com-
pute the likelihoods α in a “dynamic programming” manner, instead of having
to explicitly represent each path as a separate species.
Napp and Adams [20] have shown how to compute marginals on graph-
ical models with reaction networks. They exploit graphical structure by
mimicking belief propagation. Hidden Markov Models can be viewed as
a special type of graphical model where there are 2L random variables
X1 , X2 , . . . , XL , Y1 , Y2 , . . . , YL with the X random variables taking values in H
and the Y random variables in V . The X random variables form a Markov
chain X1 X2 . . . XL . In addition, there are L edges from Xl to Yl for
l = 1 to L denoting observations. Specialized to HMMs, the scheme of Napp and
Adams would compute the equivalent of steady state values of the γ species,
performing a version of the E step. They are able to show that true marginals
are fixed points of their scheme, which is similar to our Theorem 1. Thus their
work may be viewed as the first example of a reaction network scheme that
exploits graphical structure to compute E projections. Our E step goes further
by proving correctness as well as exponential convergence. Their work also raises
the challenge of extending our scheme to all graphical models.
Poole et al. [43] have described Chemical Boltzmann Machines, which are
reaction network schemes whose dynamics reconstructs inference in Boltzmann
68 A. Singh et al.

Machines. This inference can be viewed as a version of E projection. No scheme


for learning is presented. The exact schemes presented there are exponentially
large. The more realistically sized schemes are presented there without proof. In
comparison, our schemes are polynomially sized, provably correct if the equilib-
rium is positive, and perform both inference and learning for HMMs.
Zechner et al. [11] have shown that Kalman filters can be implemented with
reaction networks. Kalman filters can be thought of as a version of Hidden
Markov Models with a continuum of hidden states [44]. It would be instruc-
tive to compare their scheme with ours, and note similarities and differences. In
passing from position l to position l + 1 along the sequence, our scheme repeats
the same reaction network that updates αl+1 using αl values. It is worth exam-
ining if this can be done “in place” so that the same species can be reused, and a
reaction network can be described that is not tied to the length L of the sequence
to be observed.
Recently Cherry et al. [10] have given a brilliant experimental demonstration
of learning with DNA molecules. They have empirically demonstrated a DNA
molecular system that can classify 9 types of handwritten digits from the MNIST
database. Their approach is based on the notion of “winner-takes-all” circuits
due to Maass [45] which was originally a proposal for how neural networks in
the brain work. Winner-take-all might also be capable of approximating HMM
learning, at least in theory [46], and it is worth understanding precisely how such
schemes relate to the kind of scheme we have described here. It is conceivable
that our scheme could be converted to winner-take-all by getting different species
in the same flower to give negative feedback to each other. This might well lead
to sampling the most likely path, performing a decoding task similar to the
Viterbi algorithm.

6 Discussion
We have described a one-pot one-shot reaction network implementation of the
Baum-Welch algorithm. Firstly, this involves proposing a reaction system whose
positive fixed points correspond to equilibria of the Baum-Welch Algorithm. Sec-
ondly, this involves establishing the conditions under which convergence of solu-
tions to the equilibria can be accomplished. Further, from a practical perspec-
tive, it is essential to obtain an implementation that does not rely on repeated
iteration of a reaction scheme but only requires to be run once.
As we observe in Remark 3, there is a whole class of reaction networks that
implements the Baum-Welch algorithm. We have proposed one such network and
are aware that there are other networks, potentially with more efficient dynam-
ical and analytical properties than the one proposed here. Finding and charac-
terizing efficient reaction networks that can do complicated statistical tasks will
likely be of future concern.
We have only discussed deterministic dynamical properties of the network.
However, in realistic biological contexts one might imagine that the network is
A Reaction Network Scheme Which Implements Inference and Learning 69

implemented by relatively few molecules such that stochastic effects are signifi-
cant. Consequently, the study of the Baum-Welch reaction system under stochas-
tic mass-action kinetics is likely to be of interest.
Lastly, we have mentioned the Viterbi algorithm, but have made no attempt
to describe how the maximum likelihood sequence can be recovered from our
reaction network. This decoding step is likely to be of as much interest for
molecular communication systems and molecular multi-agent systems as it is
in more traditional domains of communications and multi-agent reinforcement
learning. Because of the inherent stochasticity of reaction networks, there might
even be opportunities for list decoding by sampling different paths through the
hidden states that have high probability conditioned on the observations. This
might give an artificial cell the ability to “imagine” different possible realities,
and act assuming one of them to be the case, leading to an intrinsic stochasticity
and unpredictability to the behavior.

A Appendix
A.1 Comparing Points of Equilibria
We will now prove Theorem 1. For the sake of convenience, we first recall the
statement.
Theorem 1. Every fixed point of the Baum-Welch algorithm for an HMM
M = (H, V, θ, ψ, π) is a fixed point for the corresponding Chemical Baum-Welch
Algorithm with permissible rates k.
Proof. Consider a point Φ = (α , β  , γ  , ξ  , θ , ψ  ) with α , β  , γ  ∈ RL×H 
≥0 , ξ ∈
, θ ∈ RH×H and ψ  ∈ RH×V
(L−1)×H×H
R≥0 ≥0 ≥0 . If Φ is a fixed point of Baum-Welch
Algorithm then it must satisfy:
 
– α1h = πh ψhv 1
for all h ∈ H. Then for the chemical Baum-Welch Algorithm
we have    
α̇1h Φ = k1h
α 
α1h∗ πh ψhv 1

− α1h πh∗ ψh ∗ v1 = 0
  
for all h∈ H \ {h∗ } and α̇1h∗ Φ = − h =h∗ α̇1h Φ = 0.
   
– αlh = g∈H αl−1,g θgh ψhvl for all h ∈ H and l = 2, . . . , L. Then for the
chemical Baum-Welch Algorithm we have
⎛ ⎞
  
α̇lh Φ = klh
α ⎝ 
αlh∗ 
αl−1,g 
θgh 
ψhv l

− αlh 
αl−1,g 
θgh 
∗ ψh∗ v
l
⎠=0
g∈H g∈H
  
for allh ∈ H \ {h∗ } and l = 2, . . . , L and α̇lh∗ Φ = − h =h∗ α̇lh Φ = 0.
  
– βlh = g∈H θhg ψgv β
l+1 l+1,g
for all h ∈ H and l = 1, . . . , L − 1. Then for the
chemical Baum-Welch Algorithm we have
⎛ ⎞
  
β̇lh Φ = klh
β ⎝ 
βlh∗ θh ∗ g ψgv

β
l+1 l+1,g

− βlh 
θhg ψgv
β
l+1 l+1,g
⎠=0
g∈H g∈H
  
for all h ∈ H \ {h∗ } and l = 1, 2, . . . , L − 1 and β̇lh∗ Φ = − h =h∗ β̇lh Φ = 0.
70 A. Singh et al.

α β 
– γl (h) =  lh αlh
  for all h ∈ H and l = 1, 2, . . . , L − 1. Then for the
g∈H lg βlg
chemical Baum-Welch Algorithm we have
γ      
γ̇lh = klh (γlh∗ αlh βlh − γlh αlh∗ βlh∗ ) = 0


for all h ∈ H \ {h∗ } and l = 1, 2, . . . , L − 1 and γ̇lh∗ = − h =h∗ γ̇lh = 0.
αlg θgh
 
ψhv 
βl+1,h
– ξl (g, h) =  l+1
  for all g, h ∈ H and l = 1, . . . , L − 1. Then for
f ∈H αlf βlf
the chemical Baum-Welch Algorithm we have
  
ξ˙lgh Φ = klgh
ξ 
ξlh   
∗ h∗ αlg θgh ψhv β 
l+1 l+1,h
− ξ 
α 
∗ θ
lgh lh h h

∗ ∗ ψ 
∗ β 
h vl+1 l+1,h∗ =0

for all g, h ∈ H × H \ {(h∗ , h∗ )} and l = 1, . . . , L − 1 and ξ˙lh∗ h∗ Φ =
 
− (g,h) =(h∗ ,h∗ ) ξ˙lgh Φ = 0.
L−1 
 ξ (g,h)
– θgh =  l 
L−1l=1 for all g, h ∈ H. Then for the chemical Baum-Welch
l=1 f ∈H ξl (g,f )
Algorithm we have
 L−1 L−1

  
θ̇gh Φ = kgh
θ 
θgh∗

ξlgh − 
θgh ξl (g, h∗ ) =0
l=1 l=1
  
for all g ∈ H and h ∈ H \ {h∗ } and θ̇gh∗ Φ = − h =h∗ θ̇gh Φ = 0.
L
 γ  (h)δ
w,vl
– ψhw L l 
= l=1 for all h ∈ H and w ∈ V . Then for the chemical Baum-
l=1 γl (h)
Welch Algorithm we have
 L−1 L−1

  
θ̇gh  = kgh θgh∗
θ
Φ
  
ξlgh − θgh  ∗
ξl (g, h ) = 0
l=1 l=1
  
for all h ∈ H and w ∈ V \ {v ∗ } and ψ̇hw∗ Φ = − w =w∗ ψ̇hw Φ = 0.
So Φ is fixed point of the chemical Baum-Welch Algorithm. 

We will now prove Theorem 2. For the sake of convenience, we first recall the
statement.
Theorem 2. Every positive fixed point for the Chemical Baum-Welch Algorithm
on a Baum Welch Reaction system (BW (M, h∗ , v ∗ , L), k) with permissible rate k
is a fixed point for the Baum-Welch algorithm for the HMM M = (H, V, θ, ψ, π).
Proof. Consider a positive point Φ = (α , β  , γ  , ξ  , θ , ψ  ) with α , β  , γ  ∈ RL×H
>0 ,
 (L−1)×H×H  H×H  H×V
ξ ∈ R>0 , θ ∈ R>0 and ψ ∈ R>0 . If Φ is a fixed point for the
Chemical Baum-Welch Algorithm then we must have:

– α̇1h Φ = 0 for all h ∈ H. This implies α1h 
× πh∗ ψh ∗ v1 = α1h  
∗ × πh ψhv
1

for all h ∈ H \ h . Since Φ is positive, this implies
 

 
 f ∈H α1f
α1h = πh ψhv1   for all h ∈ H
f ∈H πf ψf v1
A Reaction Network Scheme Which Implements Inference and Learning 71

 
 Φ = 0 for all h ∈ H and
– α̇lh  l =  2, . . . , L. This implies αlh ×
α θ ψ
g∈H l−1,g gh∗ h∗ vl = αlh∗ × α θ
g∈H l−1,g gh hvl ψ for all h ∈ H \
{h∗ } and l = 2, . . . , L. Since Φ is positive, this implies
⎛ ⎞ 
 
f ∈H αlf
αlh =⎝ αl−1,g θgh
 
ψhv ⎠    
for all h ∈ H and l = 2, . . . , L
f,g∈H αl−1,g θgf ψf vl
l
g∈H

 
– β̇lh Φ = 0 for all h ∈H and l = 1, . . . , L. This implies βlh

× g∈H θhg
      ∗
ψgvl+1 βl+1,g = βlh∗ × g∈H θh∗ g ψgvl+1 βl+1,g for all h ∈ H \ {h } and l =
1, . . . , L − 1. Since Φ is positive, this implies
⎛ ⎞  

    f ∈H βlf
βlh = ⎝ θhg ψgv βl+1,g ⎠  for all h ∈ H and l = 1, . . . , L − 1
g∈H
l+1
f,g∈H θf g ψgv
 
βl+1,g
l+1


– γ̇lh Φ = 0 for all h ∈ H and l = 1, . . . , L. This implies γl (h) × αlh
 
∗ βlh∗ =
 ∗   ∗
γl (h ) × αlh βlh for all h ∈ H \ {h } and l = 1, 2, . . . , L − 1. Since Φ is
positive, this implies
 

αlh 
βlh 
 
γlh =    γlg for all h ∈ H and l = 1, 2, . . . , L − 1
α
g∈H lg lg β
g∈H

– ξ˙lgh Φ = 0 for all g, h ∈ H and l = 1, . . . , L − 1. This implies ξl (g, h) ×
  
αlh ∗ θh∗ h∗ ψh∗ v β
l+1 l+1,h
 ∗ ∗   
∗ = ξl (h , h ) × αlg θgh ψhv β
l+1 l+1,h
for all g, h ∈ H ×
∗ ∗
H \ {(h , h )} and l = 1, . . . , L − 1. Since Φ is positive, this implies
⎛ ⎞
αlg θgh
 
ψhv β 
 l+1 l+1,h 
ξlgh = ⎝     
⎠ ξlef for all g, h ∈ H × H and l = 1, . . . , L − 1
e,f ∈H αlf θef ψf vl+1 βl+1,f e,f ∈H

 L−1
– θ̇gh Φ = 0 for all g, h ∈ H. This implies θgh
× l=1 ξl (g, h∗ ) = θgh

∗ ×
L−1  ∗
l=1 ξl (g, h) for all g ∈ H and h ∈ H \ {h }. Since Φ is positive, this
implies
 L−1  
l=1 ξlgh

 
θgh =  L−1  θgf for all g ∈ H and h ∈ H
f ∈H ξ
l=1 lgf f ∈H

 L
– ψ̇hw Φ = 0 for all h ∈ H and w ∈ V . This implies ψhw 
× l=1 γl (h)δv∗ ,vl =

L  ∗
∗ ×
ψhv  w,vl for all h ∈ H and w ∈ V \ {v }. Since Φ is positive,
l=1 γl (h)δ
Elv = δv,vl and v∈V δv,vl = 1 this implies
 
L  
 l=1 γlh δw,vl 
ψhw = L ψhv for all h ∈ H and w ∈ V

l=1 γlh v∈V

Because of the relaxation we get by Remark 1, the point Φ qualifies as a fixed


point of the Baum-Welch algorithm. 

72 A. Singh et al.

A.2 Rate of Convergence Analysis

In this section we will prove Theorems 3 and 4, but first we will state and prove
two useful lemmas.

Lemma 1. Let A be an arbitrary n × n matrix. Let W be an r × n matrix


comprising of r linearly independent left kernel vectors of A so that W A = 0r,n ,
where 0i,j denotes a i × j matrix with all entries zero. Further suppose W is in
the row reduced form, that is,
 
W = W  Ir

where Ij denotes the j × j identity matrix and W  is a r × (n − r) matrix. Let


A be given as  
A11 A12
A= ,
A21 A22
where A11 is a (n − r) × (n − r) matrix, A12 is a (n − r) × r matrix, A21 is a
r × (n − r) matrix, and A22 is a r × r matrix.
Then the n − r eigenvalues (with multiplicity) of the matrix A11 − A12 W  are
the same as the eigenvalues of A except for r zero eigenvalues.

Proof. Consider the n × n invertible matrix P given by


   
In−r 0n−r,r −1 In−r 0n−r,r
P = , P = ,
W Ir −W  Ir

with determinant det(P ) = det(P −1 ) = 1. We have


   
−1 In−r 0n−r,r A11 A12 In−r 0n−r,r
P AP =
W Ir A21 A22 −W  Ir
  
A11 A12 In−r 0n−r,r
=
0r,n−r 0r,r −W  Ir
 
A11 − A12 W  A12
=
0r,n−r 0r,r

This implies that the characteristic polynomial of A fulfils

det(A − λIn ) = det(P ) det(A − λIn ) det(P −1 ) = det(P AP −1 − λIn )


 
A11 − A12 W  − λIn−r A12
= det
0r,n−r 0r,r − λIr
= (−1)r λr det(A11 − A12 W  − λIn−r ),

and the statement follows. 




Now we revisit the observation that every reaction in the Baum-Welch reac-
tion network is a monomolecular transformation catalyzed by a set of species. For
A Reaction Network Scheme Which Implements Inference and Learning 73

the purposes of our analysis, each reaction can be abstracted as a monomolec-


ular reaction with time varying rate constants. This prompts us to consider
the following monomolecular reaction system with n species X1 , . . . , Xn and m
reactions
kj (t)
Xrj −−−→ Xpj , for j = 1, . . . , m,

where rj = pj , and rj , pj ∈ {1, . . . , n}, and kj (t), j = 1, . . . , m, are mass-action


reaction rate constants, possibly depending on time. We assume kj (t) > 0 for
t ≥ 0 and let k(t) = (k1 (t), . . . , km (t)) be the vector of reaction rate constants.
Furthermore, we assume there is at most one reaction j such that (rj , pj ) =
(r, p) ∈ {1, . . . , n}2 and that the reaction network is strongly connected. The
later means there is a reaction path from any species Xi to any other species
Xi . (In reaction network terms it means the network is weakly reversible and
deficiency zero.)
The mass action kinetics of this reaction system is given by the ODE system
m
 m

ẋi = −xi kj (t) + kj (t)xrj , i = 1, . . . , n.
j=1 : rj =i j=1 : pj =i

Define the n × n matrix A(t) = (aii (t))i,i =1,...,n by


m

aii (t) = − kj (t),
j=1 : rj =i (1)

aii (t) = kj (t), if there is j ∈ {1, . . . , m} such that (rj , pj ) = (i , i).

Then the ODE system might be written as

ẋ = A(t)x. (2)
n
Note that the column sums of A(t) are zero, implying that i=1 xi is conserved.

Lemma 2. Assume k(t) for t ≥ 0, converges exponentially fast towards k =


m
(k1 , . . . , km ) ∈ R>0 as t → ∞, that is, there exists γ1 > 0 and K1 > 0 such that

|| k(t) − k || ≤ K1 e−γ1 t for t ≥ 0.

Let A(t) be the matrix as defined in Eq. 1. And let A be the matrix obtained with
k inserted for k(t) in the matrix A(t) that is, A = limt→∞ A(t).
Then solutions of ODE system ẋ = A(t)x starting at x(0) ∈ Rn≥0 converges
exponentially fast towards the equilibrium a ∈ Rn>0 of the ODE system ẋ = Ax
starting at x(0) ∈ Rn≥0 , that is, there exists γ > 0 and K > 0 such that

|| x(t) − a || ≤ Ke−γt for t ≥ 0.

Proof. We will first rephrase the ODE system such that standard theory is appli-
cable. Let rank of A be n − r. Let W be as defined in Lemma 1, that is, W be
74 A. Singh et al.

an r × n matrix comprising of r linearly independent left kernel vectors of A so


that W A = 0. Here since rank of A is n − r, the rows of W would form a basis
for the left kernel of A. And as in Lemma 1, further suppose W is in the row
reduced form, that is,  
W = W  Ir .
Then
ẋ = Ax (3)
is a linear dynamical system with r conservation laws (one for each row of W ).
Let W x(0) = T ∈ Rr be the vector of conserved amounts. Let x̂ = (x1 , . . . , xn−r )
and x̃ = (xn−r+1 , . . . , xn ). We will consider the (equivalent) dynamical system
in which r variables are eliminated, expressed through the conservation laws
 
T = W x = W  Ir x, or x̃ = T − W  x̂.

As in Lemma 1, let A be given as


 
A11 A12
A= ,
A21 A22

where A11 is a (n − r) × (n − r) matrix, A12 is a (n − r) × r matrix, A21 is a


r × (n − r) matrix, and A22 is a r × r matrix. This yields
   
   
˙x̂ = A11 A12 x̂ = A11 A12 x̂
x̃ T − W  x̂
 (4)
= (A11 − A12 W )x̂ + A12 T
= C x̂ + DT,

with C = A11 − A12 W  and D = A12 . We call this as the reduced ODE system.
Note that this reduced system has only n − r variables and that the conservation
laws are built directly into it. This implies that the differential equation changes
if T is changed. The role of this construction is so that we can work only with
the non-zero eigenvalues of the A.
As we also have W A(t) = 0 for all t ≥ 0, the ODE ẋ = A(t)x can also be
similarly reduced to
x̂˙ = C(t)x̂ + D(t)T, (5)
with C(t) = A11 (t) − A12 (t)W  and D(t) = A12 (t), where analogous to A11 , we
define A11 (t) to be the top-left (n−r)×(n−r) sub-matrix of A(t) and analogous
to A12 , we define A12 (t) to be the top-right (n − r) × r sub-matrix of A(t).
Now if a is the equilibrium of the ODE system ẋ = Ax starting at x(0),
then â = (a1 , . . . , an−r ) is an equilibrium of the reduced ODE system x̂˙ =
C x̂ + DT starting at x̂(0) = (x1 (0), . . . , xn−r (0)). Suppose we are able to prove
that solutions of reduced ODE x̂˙ = C(t)x̂ + D(t)T starting at x̂(0) converges
exponentially fast towards â then because of the conservation laws x̃ = T −
W  x̂, we would also have that solutions of ẋ = A(t)x starting at x(0) converges
exponentially fast towards a. So henceforth, we will work only with the reduced
A Reaction Network Scheme Which Implements Inference and Learning 75

ODE systems. For notational convenience, we will drop the hats off x̂ and â and
simply refer to them as x and a respectively.
By subtracting and adding terms to the reduced ODE system (in Eq. 5), we
have

ẋ = C(t)x + D(t)T
= Cx + DT + (C(t) − C)x + (D(t) − D)T.

As a is an equilibrium of the ODE system ẋ = Cx + DT , we have Ca + DT = 0.


Define y = x − a. Then

ẏ = Cx + DT + (C(t) − C)x + (D(t) − D)T


= Cy + Ca + DT + (C(t) − C)x + (D(t) − D)T
= Cy + (C(t) − C)x(t) + (D(t) − D)T
= Cy + E(t)

where it is used that Ca + DT = 0, and E(t) = (C(t) − C)x(t) + (D(t) − D)T .


The solution to the above ODE system is known to be
 t
y(t) = eCt y(0) + eC(t−s) E(s) ds. (6)
0

We have, using (6) and the triangle inequality,


 t
|| y(t) || ≤ || eCt y(0) || + || eC(t−s) || || E(s) || ds.
0

Now A as defined (see Eq. 1 with k inserted for k(t)) would form a Laplacian
matrix over a strongly connected graph and so it follows that all the eigenvalues
of A are either zero or have negative real part. And using C = A11 − A12 W 
and Lemma 1 it follows that all eigenvalues of C have negative real part. Hence
it follows that
|| eCt || ≤ K2 e−γ2 t ,
where 0 < γ2 < − (λ1 ) and K2 > 0. Here λ1 is the eigenvalue of C with the
largest real part.
The matrices C(t) and D(t) are linear in k(t). And as k(t) converges expo-
nentially fast towards k, it follows that the matrices C(t) and D(t) converge
exponentially fast towards C and D respectively. Hence it follows that

|| E(t) || = || (C(t) − C)x(t) + (D(t) − D)T ||


≤ || (C(t) − C) || || x(t) || + || (D(t) − D) || || T ||
≤ K3 e−γ3 t + K4 e−γ4 t
≤ K5 e−γ5 t
76 A. Singh et al.

where
– || (C0 (t) − C) || || x(t) || ≤ K3 e−γ3 t for some K3 , γ3 > 0 as C(t) converges
exponentially
n fast towards C and x(t) is bounded (as in the original ODE
i=1 x i is conserved), and
– || (D0 (t) − D) || || T || ≤ K4 e−γ4 t for some K4 , γ4 > 0 as D(t) converges
exponentially fast towards D, and
– K5 = 12 max(K3 , K4 ) and γ5 = min(γ3 , γ4 ).
Collecting all terms we have for all t ≥ 0,
 t
−γ2 t
|| y(t) || ≤ || y(0) || K2 e + K2 e−γ2 (t−s) × K5 e−γ5 s ds
0
 t
−γ0 t
≤ K0 e + K0 e−γ0 t ds
0
= K0 e−γ0 t (1 + t)
≤ Ke−γt
by choosing K0 = max (K2 K5 , || y(0) || K2 ) and γ0 = min(γ1 , γ2 ). In the last line
γ is chosen such that 0 < γ < γ0 and K is sufficiently large. Since y(t) = x(t) − a
we have,
|| x(t) − a || ≤ Ke−γt ,
as required. 

We will now prove Theorem 3. For the sake of convenience, we first recall the
statement.
Theorem 3. For the Baum Welch Reaction System (BW (M, h∗ , v ∗ , L), k) with
permissible rates k, if the concentrations of θ and ψ species are held fixed at a
positive point then the Forward, Backward and Expection step reaction systems
on α, β, γ and ψ species converge to equilibrium exponentially fast.
Proof. It follows by repeated use of Lemma 2. For l = 1 the forward reaction
network can be interpretated as the following molecular reactions:
hπ ∗ψ ∗ E1w
α1h −−−−h−−
w
−−→ α1h∗
πh ψhw E1w
α1h∗ −−−−−−−→ α1h

for all h ∈ H \ {h∗ } and w ∈ V , as they are dynamically equivalent. Here the
effective rate constants (πh∗ ψh∗ w E1w or πh ψhw E1w ) are independent of time
and so the conditions of Lemma 2 are fulfilled. Thus this portion of the reaction
network converges exponentially fast.
The rest of the forward reaction network can be similarly interpretated as
the following molecular reactions:
αl−1,g θgh∗ ψh∗ w Elw
αlh −−−−−−−−−−−−−→ αlh∗
αl−1,g θgh ψhw Elw
αlh∗ −−−−−−−−−−−→ αlh
A Reaction Network Scheme Which Implements Inference and Learning 77

for all g ∈ H, h ∈ H \ {h∗ }, l = 2, . . . , L and w ∈ V . For layers l = 2, . . . , L


of the forward reaction network we observe that the effective rate constants
(αl−1,g θgh∗ ψh∗ w Elw or αl−1,g θgh ψhw Elw ) for layer l depend on time only through
αl−1,g . If we suppose that the concentration of αl−1,g converges exponentially
fast, then we can use Lemma 2 to conclude that the concentration of αlh also
converges exponentially fast. Thus using Lemma 2 inductively layer by layer
we conclude that forward reaction network converges exponentially fast. The
backward reaction network converges exponentially fast, similarly.
For the expectation reaction network it likewise follows by induction. But
here, notice if we interpreted the expectation network similarly into molecular
reactions, the effective rate constants would depend on time through the prod-
ucts such as αlh βlh or αlh βl+1,h . So to apply Lemma 2 we need the following: If
αl (t) and βl (t) converge exponentially fast towards al and bl then the product
αl (t)βl (t) converges exponentially fast towards al bl as
|| αl (t)βl (t) − al bl || = || (αl (t) − al )(βl (t) − bl ) + al (βl (t) − bl ) + bl (αl (t) − al ) ||
≤ || αl (t) − al || || βl (t) − bl || + K || βl (t) − bl || + K || αl (t) − al || ,

where K is some suitably large constant. We can further observe that αl (t)βl (t)
converges exponentially fast towards al bl at rate γ = min(γa , γb ), where γa
and γb , respectively, are the exponential convergence rates of αl (t) and βl (t). A
similar argument goes for the products of the form αl (t)βl+1 (t). And thus the
expectation reaction network, also converges exponentially fast. 

We will now prove Theorem 4. For the sake of convenience, we first recall the
statement.
Theorem 4. For the Baum Welch Reaction System (BW (M, h∗ , v ∗ , L), k) with
permissible rates k, if the concentrations of α, β, γ and ξ species are held fixed at
a positive point then the Maximization step reaction system on θ and ψ converges
to equilibrium exponentially fast.
Proof. Exponential convergence of the maximisation network follows by a similar
layer by layer inductive use of Lemma 2. 


References
1. Soloveichik, D., Seelig, G., Winfree, E.: DNA as a universal substrate for chemical
kinetics. Proc. Natl. Acad. Sci. 107(12), 5393–5398 (2010)
2. Srinivas, N.: Programming chemical kinetics: engineering dynamic reaction net-
works with DNA strand displacement. Ph.D. thesis, California Institute of Tech-
nology (2015)
3. Qian, L., Soloveichik, D., Winfree, E.: Efficient turing-universal computation with
DNA polymers. In: Sakakibara, Y., Mi, Y. (eds.) DNA 2010. LNCS, vol. 6518, pp.
123–140. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18305-
8 12
4. Cardelli, L.: Strand algebras for DNA computing. Nat. Comput. 10, 407–428 (2011)
5. Lakin, M.R., Youssef, S., Cardelli, L., Phillips, A.: Abstractions for DNA circuit
design. J. R. Soc. Interface 9(68), 470–486 (2011)
78 A. Singh et al.

6. Cardelli, L.: Two-domain DNA strand displacement. Math. Struct. Comput. Sci.
23, 02 (2013)
7. Chen, Y.-J., et al.: Programmable chemical controllers made from DNA. Nat. Nan-
otechnol. 8(10), 755–762 (2013)
8. Lakin, M.R., Stefanovic, D., Phillips, A.: Modular verification of chemical reaction
network encodings via serializability analysis. Theor. Comput. Sci. 632, 21–42
(2016)
9. Srinivas, N., Parkin, J., Seelig, G., Winfree, E., Soloveichik, D.: Enzyme-free nucleic
acid dynamical systems. Science 358, 6369 (2017)
10. Cherry, K.M., Qian, L.: Scaling up molecular pattern recognition with DNA-based
winner-take-all neural networks. Nature 559, 7714 (2018)
11. Zechner, C., Seelig, G., Rullan, M., Khammash, M.: Molecular circuits for dynamic
noise filtering. Proc. Natl. Acad. Sci. 113(17), 4729–4734 (2016)
12. Badelt, S., Shin, S.W., Johnson, R.F., Dong, Q., Thachuk, C., Winfree, E.: A
general-purpose CRN-to-DSD compiler with formal verification, optimization, and
simulation capabilities. In: Brijder, R., Qian, L. (eds.) DNA 2017. LNCS, vol.
10467, pp. 232–248. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-
66799-7 15
13. Lakin, M.R., Youssef, S., Polo, F., Emmott, S., Phillips, A.: Visual DSD: a design
and analysis tool for DNA strand displacement systems. Bioinformatics 27(22),
3211–3213 (2011)
14. Hjelmfelt, A., Weinberger, E.D., Ross, J.: Chemical implementation of neural net-
works and Turing machines. Proc. Natl. Acad. Sci. 88(24), 10983–10987 (1991)
15. Buisman, H.J., ten Eikelder, H.M.M., Hilbers, P.A.J., Liekens, A.M.L.: Computing
algebraic functions with biochemical reaction networks. Artif. Life 15(1), 5–19
(2009)
16. Oishi, K., Klavins, E.: Biomolecular implementation of linear I/O systems. IET
Syst. Biol. 5(4), 252–260 (2011)
17. Soloveichik, D., Cook, M., Winfree, E., Bruck, J.: Computation with finite stochas-
tic chemical reaction networks. Nat. Comput. 7(4), 615–633 (2008)
18. Chen, H.-L., Doty, D., Soloveichik, D.: Deterministic function computation with
chemical reaction networks. Nat. Comput. 13(4), 517–534 (2014)
19. Qian, L., Winfree, E.: Scaling up digital circuit computation with DNA strand
displacement cascades. Science 332(6034), 1196–1201 (2011)
20. Napp, N.E., Adams, R.P.: Message passing inference with chemical reaction net-
works. In: Advances in Neural Information Processing Systems, pp. 2247–2255
(2013)
21. Qian, L., Winfree, E., Bruck, J.: Neural network computation with DNA strand
displacement cascades. Nature 475(7356), 368–372 (2011)
22. Cardelli, L., Kwiatkowska, M., Whitby, M.: Chemical reaction network designs for
asynchronous logic circuits. Nat. Comput. 17(1), 109–130 (2018)
23. Gopalkrishnan, M.: A scheme for molecular computation of maximum likelihood
estimators for log-linear models. In: Rondelez, Y., Woods, D. (eds.) DNA 2016.
LNCS, vol. 9818, pp. 3–18. Springer, Cham (2016). https://doi.org/10.1007/978-
3-319-43994-5 1
24. Virinchi, M.V., Behera, A., Gopalkrishnan, M.: A stochastic molecular scheme for
an artificial cell to infer its environment from partial observations. In: Brijder, R.,
Qian, L. (eds.) DNA 2017. LNCS, vol. 10467, pp. 82–97. Springer, Cham (2017).
https://doi.org/10.1007/978-3-319-66799-7 6
A Reaction Network Scheme Which Implements Inference and Learning 79

25. Viswa Virinchi, M., Behera, A., Gopalkrishnan, M.: A reaction network scheme
which implements the EM algorithm. In: Doty, D., Dietz, H. (eds.) DNA 2018.
LNCS, vol. 11145, pp. 189–207. Springer, Cham (2018). https://doi.org/10.1007/
978-3-030-00030-1 12
26. Amari, S.: Information Geometry and Its Applications. Springer, Tokyo (2016).
https://doi.org/10.1007/978-4-431-55978-8
27. Csiszár, I., Matus, F.: Information projections revisited. IEEE Trans. Inf. Theor.
49(6), 1474–1490 (2003)
28. Jaynes, E.T.: Information theory and statistical mechanics. Phys. Rev. 106, 4
(1957)
29. Shin, J.-S., Pierce, N.A.: A synthetic DNA walker for molecular transport. J. Am.
Chem. Soc. 126(35), 10834–10835 (2004)
30. Reif, J.: The design of autonomous DNA nano-mechanical devices: walking and
rolling DNA. In: DNA Computing, pp. 439–461 (2003)
31. Sherman, W., Seeman, N.: A precisely controlled DNA biped walking device. Nano
Lett. 4, 1203–1207 (2004)
32. Cover, T.M., Thomas, J.A.: Elements of Information Theory. Wiley, New York
(2012)
33. Rabiner, L.R.: A tutorial on hidden Markov models and selected applications in
speech recognition. Proc. IEEE 77(2), 257–286 (1989)
34. Juang, B.H., Rabiner, L.R.: Hidden Markov models for speech recognition. Tech-
nometrics 33(3), 251–272 (1991)
35. Feinberg, M.: On chemical kinetics of a certain class. Arch. Rational Mech. Anal
46, 1–41 (1972)
36. Horn, F.J.M.: Necessary and sufficient conditions for complex balancing in chemical
kinetics. Arch. Ration. Mech. Anal. 49, 172–186 (1972)
37. Feinberg, M.: Lectures on chemical reaction networks (1979). http://www.che.eng.
ohio-state.edu/FEINBERG/LecturesOnReactionNetworks/
38. Gopalkrishnan, M.: Catalysis in reaction networks. Bull. Math. Biol. 73(12), 2962–
2982 (2011)
39. Anderson, D.F., Craciun, G., Kurtz, T.G.: Product-form stationary distributions
for deficiency zero chemical reaction networks. Bull. Math. Biol. 72(8), 1947–1970
(2010)
40. Tu, B.P., McKnight, S.L.: Metabolic cycles as an underlying basis of biological
oscillations. Nat. Rev. Mol. Cell Biol. 7, 9 (2006)
41. McLachlan, G., Krishnan, T.: The EM Algorithm and Extensions, vol. 382. Wiley,
Hoboken (2007)
42. Singh, A., Gopalkrishnan, M.: EM algorithm with DNA molecules. In: Poster Pre-
sentations of the 24th Edition of International Conference on DNA Computing and
Molecular Programming (2018)
43. Poole, W., et al.: Chemical Boltzmann machines. In: Brijder, R., Qian, L. (eds.)
DNA 2017. LNCS, vol. 10467, pp. 210–231. Springer, Cham (2017). https://doi.
org/10.1007/978-3-319-66799-7 14
44. Roweis, S., Ghahramani, Z.: A unifying review of linear Gaussian models. Neural
Comput. 11(2), 305–345 (1999)
45. Maass, W.: On the computational power of winner-take-all. Neural Comput.
12(11), 2519–2535 (2000)
46. Kappel, D., Nessler, B., Maass, W.: STDP installs in winner-take-all circuits an
online approximation to hidden Markov model learning. PLoS Comput. Biol. 10,
3 (2014)
Efficient Parameter Estimation for DNA
Kinetics Modeled as Continuous-Time
Markov Chains

Sedigheh Zolaktaf1(B) , Frits Dannenberg2 , Erik Winfree2 ,


Alexandre Bouchard-Côté1 , Mark Schmidt1 , and Anne Condon1
1
University of British Columbia, Vancouver, BC, Canada
nasimzf@cs.ubc.ca
2
California Institute of Technology, Pasadena, CA, USA

Abstract. Nucleic acid kinetic simulators aim to predict the kinetics


of interacting nucleic acid strands. Many simulators model the kinet-
ics of interacting nucleic acid strands as continuous-time Markov chains
(CTMCs). States of the CTMCs represent a collection of secondary struc-
tures, and transitions between the states correspond to the forming or
breaking of base pairs and are determined by a nucleic acid kinetic model.
The number of states these CTMCs can form may be exponentially large
in the length of the strands, making two important tasks challenging,
namely, mean first passage time (MFPT) estimation and parameter esti-
mation for kinetic models based on MFPTs. Gillespie’s stochastic simula-
tion algorithm (SSA) is widely used to analyze nucleic acid folding kinet-
ics, but could be computationally expensive for reactions whose CTMC
has a large state space or for slow reactions. It could also be expensive
for arbitrary parameter sets that occur in parameter estimation. Our
work addresses these two challenging tasks, in the full state space of
all non-pseudoknotted secondary structures of each reaction. In the first
task, we show how to use a reduced variance stochastic simulation algo-
rithm (RVSSA), which is adapted from SSA, to estimate the MFPT of
a reaction’s CTMC. In the second task, we estimate model parameters
based on MFPTs. To this end, first, we show how to use a generalized
method of moments (GMM) approach, where we minimize a squared
norm of moment functions that we formulate based on experimental and
estimated MFPTs. Second, to speed up parameter estimation, we intro-
duce a fixed path ensemble inference (FPEI) approach, that we adapt
from RVSSA. We implement and evaluate RVSSA and FPEI using the
Multistrand kinetic simulator. In our experiments on a dataset of DNA
reactions, FPEI speeds up parameter estimation compared to inference
using SSA, by more than a factor of three for slow reactions. Also, for
reactions with large state spaces, it speeds up parameter estimation by
more than a factor of two.

c Springer Nature Switzerland AG 2019


C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 80–99, 2019.
https://doi.org/10.1007/978-3-030-26807-7_5
Efficient Parameter Estimation for DNA CTMC Kinetics 81

1 Introduction
Nucleic acid kinetic simulators [9,29,34,35] aim to predict the kinetics of inter-
acting nucleic acid strands, such as the rate of a reaction or the sequence of inter-
actions between the strands. These simulators are desirable for building nucleic
acid-based devices whose nucleic acid sequences need to be carefully designed to
control their behaviour. For example, neural networks can be realized in DNA
using strand displacement reactions [6]. However, the rates of reactions vary by
several orders of magnitude depending on sequence and conditions and are hard
to predict, making the design of artifacts challenging. Accurate kinetic simula-
tors would allow many, though not all, unanticipated design flaws to be identified
prior to conducting wet-lab experiments, and would allow more complex molec-
ular devices to be designed and successfully implemented with fewer deficiencies
needing to be debugged experimentally.
Because of these pressing needs, there has been great progress on simula-
tors that can model the kinetics of interacting nucleic acid strands. The sim-
ulators range from coarse-grained models that consider large rearrangements
of the base pairs [34,35], and often factor in tertiary structure, to elementary
step models that consider the forming or breaking of a single base pair [9,29],
and to molecular dynamics models that follow the three-dimensional motion of
the polymer chains [27,31]. Elementary step models are of interest to us here
because they are computationally more efficient than molecular dynamics, yet
they also can represent and thus discover unexpected sequence-dependent sec-
ondary structures within intermediate states. Continuous-time Markov chains
(CTMCs) play a central role in modeling nucleic acid kinetics with elementary
steps, such as Kinfold [9] and Multistrand [28,29]. States of the CTMCs corre-
spond to secondary structures and have exponentially distributed holding times,
and transitions between states correspond to forming or breaking of a single
base pair. Nucleic acid kinetic models [24,42], along with nucleic acid thermal
stability models [2,17,38,39], specify the rate of transition between states and
the holding time of states. These simulators can stochastically sample paths
(sequences of states from an initial to a target state) and trajectories (sequences
of states from an initial to a target state, along with the times to transition
between successive states). The mean first passage time (MFPT) from an initial
to a target state can be estimated from sampled trajectories. The first passage
time of a trajectory is the first time that the trajectory occupies the target state.
Kinetic rates, such as the rate constant of a reaction [28], can then be derived
from such estimates.
Our work addresses two challenging tasks in accurately predicting the MFPT
of a reaction’s CTMC, in the full state space of all non-pseudoknotted1 secondary
structures. The first task is to estimate the MFPT of a reaction’s CTMC, given
a calibrated kinetic model. The second task is to calibrate parameters of kinetic

1
A pseudoknot is a secondary structure that has at least two base pairs in which one
nucleotide of a base pair is intercalated between the two nucleotides of the other
base pair.
82 S. Zolaktaf et al.

models; even though thermal stability models are well calibrated [3,23], param-
eters of kinetic models, which affect the rate of transition between states and
consequently holding times of states, are not well calibrated [42]. These tasks are
challenging, particularly for multistranded DNA kinetics, because when nucleic
acid strands interact, they are prone to the formation of many metastable sec-
ondary structures due to stochastic formation and breakage of base pairs. The
number of possible secondary structures nucleic acids can form may be exponen-
tially large compared to the number of nucleotides the strands contain. More-
over, to make accurate estimations, many sampled trajectories might be required,
which might be time-consuming to obtain (see Sect. 4). In this work, we make
progress on these tasks, by focusing on the Multistrand kinetic simulator [28,29]
(described in Sect. 2.1), that is used to analyze the folding kinetics of multiple
interacting nucleic acid strands and models the kinetics as CTMCs with elemen-
tary steps. In the rest of this section, first, we describe related work for MFPT
estimation and our contributions. Then, we describe related work for calibrating
kinetic models based on MFPTs and our contributions.

1.1 Mean First Passage Time Estimation


Exact linear algebra methods [33,42] can provide an exact solution to the MFPT
of a CTMC that can be explicitly represented. However, their accuracy could be
compromised by numerical errors and it is infeasible to use these methods for
CTMCs with large implicitly-represented state spaces. Our previous work [42]
estimates MFPTs on heuristically obtained reduced state spaces of the CTMCs.
Moreover, the state spaces are customized for each type of reaction. In contrast
to exact linear algebra methods, the MFPT could be approximated in the full
state space or reduced state space with Gillespie’s stochastic simulation algo-
rithm (SSA) [11]. SSA can be slow depending on the CTMC of the reaction. We
could adapt sequential Monte Carlo and importance sampling techniques [8,13],
but these methods require a proposal distribution that efficiently reduces the
variance of the estimator. More recently, machine learning algorithms have been
developed to successfully predict DNA hybridization rates [41] from sequence,
without enumerating the state space of the reaction. However, these methods
can not treat other reactions or kinetics.
Our Contribution. We show how to use a reduced variance stochastic simu-
lation algorithm (RVSSA), a Rao-Blackwellised version [20] of SSA, to estimate
the MFPT of a reaction’s CTMC. In SSA, the variance of MFPT estimates arises
for two reasons. First, the path to a target state affects the MFPT. Second, the
holding time in each state affects the MFPT. RVSSA removes the stochasticity
in the holding times by using expected holding times of states. We prove that
RVSSA produces a lower variance estimator of the MFPT compared to SSA.
Moreover, we show in our experiments that RVSSA has a lower variance than
SSA in estimating the MFPT of a reaction’s CTMC, when in the sampled paths
there exist a small number of states that have large expected holding times com-
pared to other states. One interesting example that we identify is the association
of poly(A) and poly(T) sequences in low concentrations (see Fig. 2b).
Efficient Parameter Estimation for DNA CTMC Kinetics 83

1.2 Parameter Estimation


In order to make accurate MFPT estimations, the underlying parameters of
the CTMCs should be calibrated. Models of nucleic acid thermal stability [2,
17,38,39] have been extensively calibrated to experimental data [3,23]. However,
extensive calibration of nucleic acid kinetic models remains challenging [42]. Our
previous work [42] uses a maximum a posteriori approach and a Markov chain
Monte Carlo approach to calibrate DNA kinetic models on a wide range of
reactions, such as strand displacement [40], but on reduced state spaces of the
reactions. The reduced state spaces are manually designed and coded and the
largest reduced state space contains less than 1.5 × 104 states. Moreover, related
work [32,40] uses reaction specific models to calibrate a kinetic model. These
models are not easily adapted to other kinetic models. There have been advances
in calibrating CTMCs [1,21,30] based on transient probabilities, the likelihood
that a process will be in a given state at a given time, and these advances
have been used for calibration of nucleic acid kinetics [13] and chemical reaction
networks [10,12,19,22].
During the optimization, for every new parameter set, we could use SSA or
RVSSA to obtain an unbiased estimate of the MFPT of a reaction’s CTMC.
However, sampling new trajectories for every new parameter set could be com-
putationally expensive for large CTMCs, slow reactions, or arbitrary parameter
sets. One reason is that transitions might be repeatedly sampled. We could also
use importance sampling techniques [8,13], but these methods would require
a proposal distribution that efficiently reduces the variance of the estimator,
which is challenging when the underlying transition probabilities of the CTMC
are changing throughout parameter estimation.
Our Contribution. To estimate parameters for DNA kinetics modeled as
CTMCs based on MFPTs, we show how to use a generalized method of moments
(GMM) [14] estimator. More importantly, we show how to use a fixed path
ensemble inference (FPEI) approach that speeds up parameter estimation com-
pared to a reference method that uses SSA directly during inference (SSAI).
The GMM method is widely used in econometrics and has also recently been
used in chemical reaction networks [22]. The GMM method can be used when
a maximum likelihood estimate or a maximum a posteriori estimate is infeasi-
ble, as is the case with CTMCs that have very large state spaces. The GMM
method minimizes a weighted norm of moment conditions obtained from sam-
ples. The moment conditions are functions of model parameters and the dataset
such that the expectation of the moment conditions is zero at the true value of
the parameters. To minimize the squared norm of the moment conditions, we use
the Nelder-Mead direct-search optimization algorithm [26], which has been fre-
quently used in optimization problems that have small stochastic perturbations
in function values [4].
To speed up parameter estimation, we introduce and use FPEI. In this
method, we condense paths, where for every path, we compute the set of states
and the number of times each state is visited. Rather than generating new trajec-
tories with SSA for every parameter set variation (the SSAI method), in FPEI
84 S. Zolaktaf et al.

we use fixed condensed paths to speed up parameter estimation. For example,


in this work, the length of the longest path is more than 1 × 108 , whereas the
number of unique states and transitions of the path is approximately 3.8 × 105
and 1.4 × 106 , respectively. In FPEI, we use RVSSA to estimate the MFPT of
the fixed paths given a new parameter set. Since the MFPT estimates obtained
with fixed paths are biased, we alternate between minimizing the error of predic-
tion on fixed paths, and resampling new paths and restarting the optimization
method.
To implement RVSSA and FPEI, we augment the Multistrand kinetic simula-
tor [28,29] where for each reaction the full state space of all non-pseudoknotted
secondary structures is possible. We conduct computational experiments on
experimental DNA reactions that have moderate or large state spaces or are
slow, including hairpin closing, hairpin opening, helix dissociation with and with-
out mismatches, and helix association. We compare the performance of RVSSA
with SSA for MFPT estimation and FPEI with SSAI for parameter estimation.
Results for our example data are encouraging, showing that FPEI speeds up
parameter estimation compared to using SSAI, by more than a factor of three
for slow reactions. Also, for reactions with large state spaces, it speeds up param-
eter estimation by more than a factor of two.

2 Preliminaries

2.1 The Multistrand Kinetic Simulator

The Multistrand kinetic simulator [28,29] models the kinetics of multiple inter-
acting nucleic acid strands as a CTMC. A state of the CTMC represents a system
microstate, in other words, the configuration of the strands in the fixed volume
that we simulate. A system microstate is a collection of complex microstates. A
complex microstate is a set of strands connected by base pairing (secondary struc-
tures). In Multistrand, all possible secondary structures are permitted except for
pseudoknots. Multistrand defines the energy of a state as the sum of the standard
free energy for each complex, which is determined with Multistrand’s nucleic acid
thermal stability model. Transitions between states correspond to the forming
or breaking of a single base pair. For example, in Fig. 1, state t can transition to
states s and u. The transition rate kts from state t to state s is determined by
the energy of the states and a nucleic acid kinetic model.

kst ktu
kts kut
st at e s st at e t st at e u

Fig. 1. State t can transition to states s and u by breaking or forming a single base
pair, respectively. The reverse transitions are also possible.
Efficient Parameter Estimation for DNA CTMC Kinetics 85

We experiment with the Metropolis [24] and the Arrhenius [42] kinetic mod-
els that are implemented in the Multistrand software. The Metropolis kinetic
model has two free parameters kuni and kbi that distinguish between unimolec-
ular and bimolecular transitions, respectively. In the Arrhenius kinetic model,
transition rates additionally depend on the local context of the base pair that is
forming or breaking. The model differentiates between seven different half con-
texts C = {stack, loop, end, stack+loop, stack+end, loop+end, stack+stack}. For
example, in Fig. 1, in the transition from state t to state s, the half contexts of
the base pair that is breaking are a stack and a loop. An Arrhenius rate con-
stant Al and an activation energy El are associated with each half context l. The
model also has a bimolecular scaling constant α. In total, the model has 15 free
parameters.
To sample paths and trajectories for a reaction, experimental conditions need
to be determined, such as the sequence of the strands, the temperature, the
concentration of Na+ and Mg2+ cations, and the initial concentration of the
strands. We adopt the trajectory mode of Multistrand for all reactions of our
dataset. In this mode, SSA is implemented to simulate trajectories over the
CTMC of a reaction, starting in an initial state and halting when the reaction
is over, and to estimate the MFPT. For helix association and hairpin closing
reactions, all trajectories start from the state where no base pairs are formed
and end at the state where the duplex is fully formed. For hairpin opening and
helix dissociation the start and end states are reversed. Given the estimated
MFPT τ̂ r of reaction r, as computed over several trajectories, the reaction rate
constant of reaction r is computed as

1
r r first order reaction
k̂ = τ̂ 1 , (1)
τ̂ r ur second order reaction

where ur is the initial concentration of the reactants of reaction r in the simu-


lation [28]. Equation (1) also holds for the experimental reaction rate constant
and the experimental MFPT, called timescale, of the reaction.

2.2 Gillespie’s Stochastic Simulation Algorithm


Gillespie’s stochastic simulation algorithm (SSA) [11] has been widely used to
simulate stochastic trajectories in CTMCs [28,29]. It provides an unbiased and
consistent estimate of the MFPT from an initial state to a target state. It esti-
mates the MFPT as the mean of the first passage times of sampled trajectories.
In brief, to sample a trajectory and its first passage time, SSA advances forward
in two steps:
1. At a jump from the current state si , SSA samples the holding time Ti of
the state from an exponential distribution with a rate equal to the sum of
the transition
 rates from the state, in other words, Ti | si ∼ Exp(ksi ), where
ksi = s∈S ksi s , S is the state space of the CTMC, ksi s is the transition
rate from state si to state s, if s is not a neighbor of si then ksi s = 0,
E[Ti | si ] = ks−1
i
and Var(Ti | si ) = ks−2
i
.
86 S. Zolaktaf et al.

2. At a jump from the current state si , SSA samples the next state si+1 from
the outgoing transition probabilities of state si , in other words, p(si , s) =
k si s
ks , si = s.
i

Let P be a trajectory of length Z from state s to state t, with holding times


T1 , ..., TZ−1 , obtained by using SSA with initial state s, and ending the first time
that state t is sampled. In SSA, the FPT of the trajectory is computed as
Z−1

F SSA = Ti . (2)
i=1

By using N independently sampled trajectories, 


we obtain a Monte Carlo esti-
N
mator for the MFPT of the CTMC as τ̂NSSA
= N1 n=1 FnSSA .

3 Methodology

3.1 Mean First Passage Time Estimation


In SSA, the variance of MFPT estimates arises for two reasons. First, the path
to a target state affects the MFPT. Second, the holding time in each state affects
the MFPT. Hordijk et al. [18] show how to obtain a reduced variance estimate
of a steady-state measure of an irreducible and positive recurrent CTMC. Their
constant holding-time method eliminates the variability in the random holding
time of states and instead uses expected holding times. To estimate the MFPT of
a reaction’s CTMC, we formulate a Rao-Blackwellised version [20] of SSA, which
similar to Hordijk et al. also eliminates the variability in the random holding
times of states. However, the CTMC is not restricted to be irreducible or positive
recurrent and the MFPT estimate is not necessarily a steady-state measure. We
call this method the reduced variance stochastic simulation algorithm (RVSSA).
Similar to SSA, RVSSA also produces a consistent and unbiased estimator of
the MFPT, but has a smaller variance in predicting MFPTs compared to SSA2 .
In brief, in RVSSA, instead of sampling a random holding time for each state,
we use an estimator based on the expected holding time. The algorithm proceeds
as follows.

1. At a jump from the current state si , compute the expected holding


 time T i
before jumping to the next state, in other words, T i = ks−1
i
= ( s∈S ksi s )
−1
.
−1
Note that E[T i | si ] = ksi and Var(T i | si ) = 0.
2. Step 2 of SSA.

2
For our purpose here, we are only interested in the MFPT, so the smaller variance
is good. In other contexts, the full distribution of FPTs will be of interest, and for
that purpose only SSA, but not RVSSA, will be appropriate.
Efficient Parameter Estimation for DNA CTMC Kinetics 87

Let P be a path of length Z from state s to state t, with expected holding times
T 1 , ..., T Z−1 , obtained by using RVSSA with initial state s, and ending the first
time that state t is sampled. In RVSSA, we compute the MFPT of the path as
Z−1

Y RVSSA = T i. (3)
i=1

By using N independently sampled paths, we


obtain a Monte Carlo estimator
N
for the MFPT of the CTMC as τ̂N
RVSSA
= N1 n=1 YnRVSSA .

Theorem 1. The estimator of the MFPT from state s to state t produced by


RVSSA has a lower variance than the estimator produced by SSA.

Proof. Let P denote a random path from state s to state t. We have


E[F SSA | P ] = E[Y RVSSA | P ], and consequently

Var(E[F SSA | P ]) = Var(E[Y RVSSA | P ]). (4)


 Z−1
Also, E[Var(F SSA | P )] > 0, and E[Var(Y RVSSA | P )] = E[Var( i=1 T i | P )] =
0 because T i are constants and independent given P . Based on the law of total
variance
by Eq. (4)
Var(Y RVSSA ) = E[Var(Y RVSSA | P )] + Var(E[Y RVSSA | P ]) =
E[Var(Y RVSSA | P )] + Var(E[F SSA | P ]) = Var(E[F SSA | P ]) < (5)

E[Var(F SSA | P )] + Var(E[F SSA | P ]) = Var(F SSA ).


N
Therefore, it can be concluded that Var(τ̂N RVSSA
) = Var( N1 n=1 YNRVSSA ) =
1
N Var(Y
RVSSA
) < N Var(F
1 SSA SSA
) = Var(τ̂N ).

For an unbiased estimator, the expected mean squared error (MSE) of the
estimator is equal to the variance of the estimator [36]. Consequently, RVSSA
has a smaller MSE than SSA and requires fewer sampled paths to estimate the
MFPT,
1 1
E[(τ̂N
RVSSA
− τ )2 ] = Var(Y RVSSA ) < Var(F SSA ) = E[(τ̂N
SSA
− τ )2 ]. (6)
N N

3.2 Parameter Estimation


In Sect. 3.1, we assume that the underlying parameters of the CTMCs are known.
Here, we focus on estimating the underlying parameters of the transition rates
when they are not known a priori.
To estimate model parameters, we formulate a generalized method of
moments (GMM) [14] objective function based on experimental and predicted
MFPTs. The GMM estimators have desirable statistical properties under suit-
able conditions, such as consistency and asymptotic normality. The GMM
method minimizes a weighted norm of moment conditions. The moment con-
ditions are functions of model parameters and observed values such that the
88 S. Zolaktaf et al.

expectation of the moment conditions is zero at the true value of the parame-
ters. Given a column vector g of moment conditions and its transpose gT , the
GMM method seeks the true parameter set θ∗ as

θ∗ = argmin g(θ)T Wg(θ), (7)


θ

where W is a positive-definite matrix that controls the variance of the estimator.


For optimally chosen weights, which depend on the covariance of the moment
conditions at the true parameter set θ∗ , the estimator has the smallest possible
variance for the parameters. Since the true parameter set is unknown, there
exist several approaches to deal with this issue. For example, the two-step GMM
estimator [15] uses the identity matrix in the first step to estimate a parameter
set. In the second step, it uses the estimated parameters to produce the weighting
matrix and reestimates the parameters. In our experiments, we only use the
identity weighting matrix, which produces a consistent and asymptotic normal
GMM estimator, and leave other options to future work.
Let θ be a parameter set for a kinetic model that parameterizes the CTMC
of reactions, and let θ∗ be the true parameter set. For reaction r, based on the
experimental MFPT τ r and an unbiased estimator of the MFPT τ̂ r , we can
define a moment condition as g r (θ) = τ̂ r (θ) − τ r . However, since reactions occur
at timescales that cover many orders of magnitude, from slow reactions, such as
helix dissociation, to faster reactions, such as hairpin closing, and since we are
using an identity matrix, we use log10 differences instead; we define a moment
condition as
g r (θ) = log10 τ̂ r (θ) − log10 τ r , (8)
where we approximate E[g r (θ∗ )] = E[log10 τ̂ r (θ∗ )] − log10 τ r ≈ 0 for the true
parameter set θ∗ (if one exists). This approximation is reasonable for an unbi-
ased and low variance estimator of the experimental MFPT τ r . The Taylor
expansion
 of E[log10 τ̂ r (θ∗ )] around log10 E[τ̂r (θ∗ )] = log10 τ r is E[log10 τ̂ r (θ∗ )] ≈
r ∗
E log10 τ r + τ1r (τ̂ r − τ r ) − 2(τ1r )2 (τ̂ r − τ r )2 = log10 τ r − Var(τ̂ (θ ))
2(τ r )2 , where the
second term disappears. Also, note that based on Eq. (1), instead of Eq. (8) we
equivalently use g r (θ) = log10 τ̂ r (θ) − log10 τ r = log10 k r − log10 k̂ r (θ), which
is commonly used in related work [41,42]. Based on the entire reactions of the
dataset D, we define the GMM estimator as
 2
θ∗ = argmin log10 k r − log10 k̂ r (θ) . (9)
θ r∈D

This can be recognized as the least mean squared error (MSE) parameter set.
In our experiments (described in Sect. 4.3), we seek a parameter set that
minimizes the GMM estimator. However, we also considered using the negative
of Eq. (14) from our previous work [42], where g r (θ) is defined to be normally
distributed with an unbiased mean and variance σ 2 , and a small L2 regularization
term is also defined. With this objective function, the predictive quality of the
fixed path ensemble inference (FPEI) approach, which we describe later on, only
slightly changes for our dataset.
Efficient Parameter Estimation for DNA CTMC Kinetics 89

To minimize the objective function, we use the Nelder-Mead direct-search


optimization algorithm [26]. To approximate a local optimum parameter set θ
with size |θ|, the algorithm maintains a simplex of |θ| + 1 parameter sets. The
algorithm evaluates the function value at every parameter set of the simplex. It
proceeds by attempting to replace a parameter set that has the worst function
value with a parameter set reflected through the centroid of the remaining |θ|
parameter sets in the simplex with expansion and contraction as needed. The
algorithm uses only the ranks of the function values to determine the next param-
eter set, and therefore has been frequently used in optimization problems that
have small stochastic perturbations in function values [4]. This robustness is
essential for its use in SSAI.
In SSAI, during the optimization, to obtain an unbiased estimate of τ r for
every parameter set variation, we use SSA. However, obtaining new trajectories
for every parameter set is computationally expensive. One reason is that transi-
tions might be repeatedly sampled. Therefore the length of a trajectory could be
much larger than the number of unique states and transitions of the trajectory
(see Sect. 4.3). We propose to use FPEI which uses an ensemble of fixed paths,
with an efficient data structure, to speed up parameter estimation. In FPEI, for
every reaction, we build a fixed set of paths with an initial parameter set θ0 .
For a new parameter set θm , we use the fixed paths to estimate the MFPT. To
speed up computations, we condense paths; for every path, we compute the set
of states and the number of times each state is visited. We compute the holding
time of a state in a path as if the path is regenerated in the full state space.
To compute the holding time of a state under a new parameter set, we need to
compute the total outgoing transition rate from the state under the new param-
eter set. Therefore, we also store information about the outgoing neighbors of
the states that affect the outgoing transition rate. Alternatively, depending on
memory and storage limitations, similar to SSA and RVSSA, we could repeat-
edly compute the outgoing neighbors of the states on the fly. Given this data, as
the parameter set is updated to θm , we compute the MFPT of path P according
to RVSSA as
Z−1
 1
Y FPEI (θm ) = T i (θm ), where T i (θm ) = , (10)
i=1
ksi (θm )

where the transition rates of the CTMC depend on the parameter set θm
and the path is obtained with θ0 . Because of the condensed representation,
this formula is not literally computed, but rather a mathematically equiva-
lent one with fewer terms is computed. Given N fixed paths obtained with
θ0 , we estimate the MFPT of the CTMC that is parameterized with θm as
N
τ̂N
FPEI
(θm ) = N1 n=1 YnFPEI (θm ).
With fixed paths, the MFPT estimates are biased and the learned parameter
set might not perform well in the full state space where other paths are possible.
Therefore, to reduce the bias and to ensure that the ensemble of paths is a
fair sample with respect to the optimized parameters, we alternate between
minimizing the error of prediction on fixed paths, and resampling new paths and
90 S. Zolaktaf et al.

Algorithm 1. SSAI
θ ← θ0 // Choose initial parameter set θ0
Initialize the simplex in the Nelder-Mead algorithm using θ and its
perturbations
while stopping criteria not met do
// See Section 4.3 for our stopping criteria
θ ← Retrieve a parameter set from the Nelder-Mead algorithm
Update the free parameters of the kinetic model with θ
foreach reaction r ∈ dataset D do
foreach n=1,2,...,N do
Sample a trajectory Pn using SSA and calculate its FPT using
Eq. 2
Calculate the MFPT of the reaction using the FPTs of the trajectories
Calculate the GMM function in Eq. 9 using the MFPT of the reactions
Update the simplex in the Nelder-Mead algorithm based on the GMM
function

Algorithm 2. FPEI
θ ← θ0 // Choose initial parameter set θ0
while stopping criteria not met do
// See Section 4.3 for our stopping criteria
Update the free parameters of the kinetic model with θ
foreach reaction r ∈ dataset D do
foreach n=1,2,...,N do
Sample a path Pn using RVSSA
Condense path Pn for the reaction
Initialize the simplex in the Nelder-Mead algorithm using θ and its
perturbations
while stopping criteria not met do
θ ← Retrieve a parameter set from the Nelder-Mead algorithm
Update the free parameters of the kinetic model with θ
foreach reaction r ∈ dataset D do
foreach n=1,2,...,N do
Calculate the MFPT of path Pn using Eq. 10
Calculate the MFPT of the reaction using the MFPTs of the paths
Calculate the GMM function in Eq. 9 using the MFPT of the reactions
Update the simplex in the Nelder-Mead algorithm based on the GMM
function

restarting the optimization method. An overview of our parameter estimation


framework using SSAI and FPEI, with a GMM estimator and the Nelder-Mead
algorithm, is given in Algorithms 1 and 2, respectively.
We also considered a normalized importance sampling approach [8], to obtain
consistent estimators of the MFPTs using fixed paths. In this approach, we also
compute the set of traversed transitions and how often each of those transi-
tions occur in the path. We weigh the estimated MFPT of each path P by
Efficient Parameter Estimation for DNA CTMC Kinetics 91

the relative likelihood of the path given the new and the initial parameter sets
L̃(θm ) = L(θ m)
L(θ0 ) , where L(θm ) is the likelihood of P under parameter assignment
Z−1 ks s (θm ) −  ks s (θm )T i (θm )
θm . For RVSSA, L(θm ) = i=1  i i+1 e s∈S i , and we esti-
s∈S ksi s (θm )
N
mate the MFPT as τ̂N (θm ) = N L̃ (θ ) n=1 L̃n (θm )Yn
FPEI 1 FPEI
(θm ). In our
n=1 n m
experiments, this approach performed poorly, since the effective sample size of
the relative likelihoods was small.

4 Experiments
To evaluate the performance of RVSSA for MFPT estimation and FPEI for
parameter estimation, in the full state space of all non-pseudoknotted secondary
structures of each reaction, we augment the Multistrand kinetic simulator [28,29]
and we conduct computational experiments. Our dataset and framework are
available at https://github.com/DNA-and-Natural-Algorithms-Group/FPEI.

4.1 Dataset
To evaluate the performance of RVSSA and FPEI, we use 21 experimentally
determined reaction rate constants published in the literature, including hairpin
closing [5], hairpin opening [5], helix association [16,37], and helix dissociation
with and without mismatches [7]. The dataset is summarized in Table 1. Each
reaction of the dataset is annotated with a temperature and the concentration
of Na+ , which affect the transition rates in the kinetic models that we use.

Fig. 2. The MFPT and 95% confidence interval of SSA and RVSSA, where the kinetic
model is parameterized with θ0 . In both (a) and (b), RVSSA and SSA are using
the same sampled paths. In (a), RVSSA and SSA have similar variance. The average
computation time per sampled path, defined as the total computation time divided by
the total number of sampled paths, is 3 × 102 s. In (b), RVSSA has a lower variance
than SSA. The average computation time per sampled path is 0.5 s.
92 S. Zolaktaf et al.

Table 1. Dataset of experimentally determined reaction rate constants. The concen-


tration of the strands is set to 1 × 10−8 M, 5 × 10−8 M, and 1 × 10−8 M, for reactions
no. 1–15, 16–19, and 20–21, respectively.

Reaction type & No. Sequences T/◦ C [N a]+ /M log10 kr


source
Hairpin closing 1–5 CCCAA-(T )30 -TTGGG 14.4–29.8 0.1 3.53–3.69
Fig. 4 from [5]
Hairpin opening 6–10 CCCAA-(T )30 -TTGGG 14.4–29.8 0.1 2.14–3.30
Fig. 4 from [5]
Helix dissociation 11–15 AGGACTTGT + ACAAGACCT 37 0.2 0.19–0.92
(with a mismatch) AGGACTTGT + ACAAGTGCT
Fig. S4 from [7] AGGACTTGT + ACAAGTCGT
AGGACTTGT + ACAAGTCCA
AGGACTTGT†
Helix association 16–19 GCCCACACTCTTACTTATCGACT† 25 0.195 5.71–6.68
Table 1 from [16] GCACCTCCAAATAAAAACTCCGC†
CGTCTATTGCTTGTCACTTCCCC†
ACCCTTTATCCTGTAACTTCCGC†
Helix association 20–21 25-mer Poly (dA)† 48–78 0.4 -
Table 1 from [37] 25-mer Poly (dG)†

The complement of the demonstrated sequence is also a reactant.

4.2 Mean First Passage Time Estimation


Figures 2a and b show the performance of RVSSA compared with SSA for helix
association reactions no. 16 and 20, respectively. To sample paths and trajec-
tories, we parameterize the kinetic model with the Metropolis initial parameter
set [32,42], in other words, θ0 = {kuni = 8.2×106 s−1 , kbi = 3.3×105 M−1 s−1 }. In
both Figs. 2a and b, RVSSA and SSA have the same paths, but the algorithms
generate different holding times for the states of the paths. In Multistrand’s
implementation of SSA, the effort needed to sample the holding time in the cur-
rent state is small when compared to the task of computing outgoing transition
rates. In Fig. 2a, RVSSA and SSA perform the same, whereas in Fig. 2b, RVSSA
has a lower variance than SSA, consistently. To understand the discrepancy
between the two figures, we analyze the experiments, described below.
In Figs. 3a and b, the average length of the paths for both reaction no. 16
and reaction no. 20 is large. Also, in Figs. 3c and d, both reactions have a small
number of bimolecular transitions on average. In Fig. 3e, for reaction no. 16,
the state where two strands are disconnected has a small holding time, because
the state has many fast unimolecular transitions between complementary bases
within a strand in addition to the slow bimolecular transitions. However, in
Fig. 3f, for reaction no. 20, the state where the two strands are disconnected has
a large holding time, since there are no complementary bases within a poly(A) or
poly(T) strand and the only transitions are slow bimolecular transitions. RVSSA
has a significantly lower variance for reaction no. 20 compared to SSA, because in
the sampled paths, there exists a small number of states that have large expected
holding times compared to other states. SSA has a large variance in generating
holding times for these states. Overall, in our experiments with parameter set θ0 ,
Efficient Parameter Estimation for DNA CTMC Kinetics 93

(a) Reaction no. 16 (b) Reaction no. 20 (c) Reaction no. 16 (d) Reaction no. 20

(e) Reaction no. 16

(f) Reaction no. 20

Fig. 3. Histogram of the length of 100 random paths obtained with RVSSA for (a)
reaction no. 16 and (b) reaction no. 20. Histogram of the number of bimolecular join
transitions of the random paths for (c) reaction no. 16 and (d) reaction no. 20. Snapshot
of the i-th state visited, dot-parentheses notation and jump times for a random path
obtained with RVSSA for (e) reaction no. 16 and (f ) reaction no. 20. The jump time
at state i is equal to the jump time at state i − 1 plus the holding time of state i − 1.
The green highlighting indicates where a bimolecular step occurs. (Color figure online)

RVSSA has a lower variance than SSA for reactions no. 20 and 21, but performs
similar to SSA for other reactions in Table 1.

4.3 Parameter Estimation


Figure 4 shows the MSE, defined as the mean of | log10 k r − log10 k̂ r (θ)|2 on
different reactions, of FPEI and SSAI over various iterations, where the methods
are learning parameters for the Arrhenius kinetic model [42]. Also, it shows the
average computation time per iteration, defined as the total computation time
94 S. Zolaktaf et al.

divided by the total number of iterations. Figure 5 shows the MSE and average
computation time per iteration when the entire dataset is used. Reactions no.
20–21 are excluded in parameter estimation because of our uncertainty in our
interpretation of the reported measurements. For reactions no. 1–15, FPEI and
SSAI use 200 paths and 200 trajectories, respectively. For reactions no. 16–19,
where simulations are more time-consuming, FPEI and SSAI use 20 paths and
20 trajectories, respectively.
We conduct distinct experiments by starting with two sets of initial param-
eters, where paths and trajectories are generated in a reasonable time. In one
group of experiments (Figs. 4a, c, e, g, and 5a), we initialize the simplex in
the Nelder-Mead algorithm with the Arrhenius initial parameter set [32,42],
in other words, θ0 = {Al = 468832.1058 s−1/2 , El = 3 kcal mol−1 | ∀l ∈
C} ∪ {α = 0.0402 M−1 } and its perturbations (in each perturbation, a parame-
ter is multiplied by 1.05). In FPEI, we also use θ0 to generate fixed paths. In
another set of experiments (Figs. 4b, d, f, h, and 5b), we adapt parameter set
θ0 = {Al = 468832.1058 s−1/2 , El = 2 kcal mol−1 | ∀l ∈ C} ∪ {α = 0.0402 M−1 }
from θ0 to increase the initial MSE in all experiments. We initialize the simplex
in the Nelder-Mead algorithm with θ0 and its perturbations (in each perturba-
tion, a parameter is multiplied by 1.05). In FPEI, we also generate fixed paths
with θ0 . In SSAI, we run the optimization until a limit on the number of itera-
tions is reached or until a time limit is reached, which ever comes first. We also
use this as the first stopping criteria in FPEI. In FPEI, to reduce the bias and to
ensure that the ensemble of paths is a fair sample with respect to the optimized
parameters, occasionally, the fixed paths are rebuilt from scratch and the opti-
mization restarts. To this end, we set the second stopping criteria in FPEI to 200
iterations or 200 function evaluations of the Nelder-Mead algorithm, whichever
comes first. Note that this empirical value is subject to change for different exper-
iments. We could improve the method, by investigating a more robust way of
when to update the paths. For example, we could compare the performance of
SSA with the fixed paths in shorter intervals and update the fixed paths when
their predictive quality diverges from SSA. During the optimization, we use an
infinite value for parameter sets that have rates that are too slow or too fast; we
bound downhill unimolecular and bimolecular rates (Eq. (7) and Eq. (8) of [42])
in [1 × 104 , 1 × 109 ] s−1 and in [1 × 104 , 1 × 109 ] M−1 s−1 , respectively.
In Figs. 4d–h, FPEI reaches a minimal MSE more quickly than SSAI; con-
sider the average computation time per iteration multiplied by the number of
iterations to reach a minimal MSE. However, in Figs. 4a–c, SSAI reaches a mini-
mal MSE more quickly than FPEI. This is because in Figs. 4d–h, the number of
unique states is significantly smaller than the length of the paths. For example,
in Fig. 4h, in the first set of fixed paths, the average length of a path is more
than 2.3 × 107 , whereas the average number of unique states and transitions is
less than 1.5 × 105 and 5.6 × 105 , respectively. In Fig. 4a, the average length of a
path is 4.6 × 102 , whereas the average number of unique states and transitions
is 1.3 × 102 and 2.4 × 102 , respectively. In Figs. 4e and f, which are slow disso-
ciation reactions, compared to SSAI, FPEI speeds up parameter estimation by
Efficient Parameter Estimation for DNA CTMC Kinetics 95

Fig. 4. The MSE of SSAI and FPEI on different types of reactions from Table 1. The
average computation time per iteration is shown in the label of each method. The
markers show the MSE when trajectories are rebuilt from scratch using the learned
parameter set from FPEI. In Figs. 4e–h, the SSAI traces stop at earlier iterations than
the FPEI traces, even though SSAI was allocated more time than FPEI.
96 S. Zolaktaf et al.

more than a factor of three. In Figs. 4g–h, compared to SSAI, FPEI speeds up
parameter estimation by more than a factor of two. Also, the speed of FPEI in
all the figures could be improved with a better implementation of the method;
in our implementation, in the first iteration, computing neighbor states of all
states in a fixed condensed path is slow, whereas the later iterations which reuse
the fixed condensed paths are much faster than SSAI.
In Figs. 5a and b, where reactions no. 1–19 are all used in the optimization,
FPEI speeds up parameter estimation, by more than a factor of two compared
to SSAI. In Fig. 5a, FPEI reaches an MSE of 0.15 in 1.2 × 106 s, whereas SSAI
reaches an MSE of 0.39 in the same time. In Fig. 5b, FPEI reaches an MSE of
0.43 in 1.3 × 106 s, whereas SSAI reaches an MSE of 3.72 in the same time.

Fig. 5. As in Fig. 4, but reactions no. 1–19 are all used as the dataset.

5 Discussion
In this work, we show how to use RVSSA to estimate the MFPT of a reaction’s
CTMC. In our experiments, RVSSA has a lower variance than SSA in estimating
the MFPT of a reaction’s CTMC, when in the sampled paths there exists a small
number of states that have large expected holding times compared to other states.
Furthermore, we show how to use FPEI along with a GMM estimator and the
Nelder-Mead algorithm to estimate parameters for DNA kinetics modeled as
CTMCs. In FPEI, we use RVSSA instead of SSA, since the MFPT estimator
produced by RVSSA has a lower variance. In FPEI, we use fixed condensed
paths because sampling new paths for every parameter set is computationally
expensive. Since using fixed paths leads to biased estimates, we alternate between
minimizing the error of prediction on fixed paths, and resampling new paths and
restarting the optimization method. FPEI speeds up computations when the
number of unique states is significantly smaller than the length of sampled paths.
In our experiments on a dataset of DNA reactions, FPEI speeds up parameter
estimation compared to using SSAI, by more than a factor of three for slow
reactions. Also, in our experiments, for reactions with large state spaces, it speeds
up parameter estimation by more than a factor of two.
Efficient Parameter Estimation for DNA CTMC Kinetics 97

FPEI can be applied to reactions modeled as CTMCs, when the fixed paths
can be produced in a timely manner. Generating paths for FPEI could be compu-
tationally expensive for slow reactions, such as helix dissociation from Morrison
and Stols [25]. The runtime also depends on the parameter set that is used.
It would be helpful to make FPEI applicable for such reactions, by speeding
up the generation of the fixed paths, for example, with importance sampling
approaches [13].
Finally, in this work, we evaluated FPEI in the context of DNA reactions. It
would be useful to adopt and evaluate FPEI in other CTMC models [9,34,35],
and other domains that require estimating MFPTs in CTMCs, such as protein
folding.

References
1. Andrieu, C., Roberts, G.O.: The pseudo-marginal approach for efficient Monte
Carlo computations. Ann. Stat. 37, 697–725 (2009)
2. Andronescu, M., Aguirre-Hernandez, R., Condon, A., Hoos, H.H.: RNAsoft: a suite
of RNA secondary structure prediction and design software tools. Nucleic Acids
Res. 31, 3416–3422 (2003)
3. Andronescu, M., Condon, A., Hoos, H.H., Mathews, D.H., Murphy, K.P.: Computa-
tional approaches for RNA energy parameter estimation. RNA 16(12), 2304–2318
(2010)
4. Barton, R.R., Ivey Jr., J.S.: Nelder-Mead simplex modifications for simulation
optimization. Manag. Sci. 42(7), 954–973 (1996)
5. Bonnet, G., Krichevsky, O., Libchaber, A.: Kinetics of conformational fluctuations
in DNA hairpin-loops. Proc. Natl. Acad. Sci. 95(15), 8602–8606 (1998)
6. Cherry, K.M., Qian, L.: Scaling up molecular pattern recognition with DNA-based
winner-take-all neural networks. Nature 559(7714), 370 (2018)
7. Cisse, I.I., Kim, H., Ha, T.: A rule of seven in Watson-Crick base-pairing of mis-
matched sequences. Nat. Struct. Mol. Biol. 19(6), 623 (2012)
8. Doucet, A., Johansen, A.M.: A tutorial on particle filtering and smoothing: fifteen
years later. Handb. Nonlinear Filter. 12(656–704), 3 (2009)
9. Flamm, C., Fontana, W., Hofacker, I.L., Schuster, P.: RNA folding at elementary
step resolution. RNA 6, 325–338 (2000)
10. Georgoulas, A., Hillston, J., Sanguinetti, G.: Unbiased Bayesian inference for pop-
ulation Markov jump processes via random truncations. Stat. Comput. 27(4), 991–
1002 (2017)
11. Gillespie, D.T.: Exact stochastic simulation of coupled chemical reactions. J. Phys.
Chem. 81(25), 2340–2361 (1977)
12. Golightly, A., Wilkinson, D.J.: Bayesian parameter inference for stochastic bio-
chemical network models using particle Markov chain Monte Carlo. Interface Focus
1(6), 807–820 (2011)
13. Hajiaghayi, M., Kirkpatrick, B., Wang, L., Bouchard-Côté, A.: Efficient continuous-
time Markov chain estimation. In: International Conference on Machine Learning,
pp. 638–646 (2014)
14. Hansen, L.P.: Large sample properties of generalized method of moments estima-
tors. Econ. J. Econ. Soc. 50, 1029–1054 (1982)
15. Hansen, L.P., Heaton, J., Yaron, A.: Finite-sample properties of some alternative
GMM estimators. J. Bus. Econ. Stat. 14(3), 262–280 (1996)
98 S. Zolaktaf et al.

16. Hata, H., Kitajima, T., Suyama, A.: Influence of thermodynamically unfavorable
secondary structures on DNA hybridization kinetics. Nucleic Acids Res. 46(2),
782–791 (2017)
17. Hofacker, I.L.: Vienna RNA secondary structure server. Nucleic Acids Res. 31(13),
3429–3431 (2003)
18. Hordijk, A., Iglehart, D.L., Schassberger, R.: Discrete time methods for simulating
continuous time Markov chains. Adv. Appl. Probab. 8(4), 772–788 (1976)
19. Horváth, A., Manini, D.: Parameter estimation of kinetic rates in stochastic reac-
tion networks by the EM method. In: 2008 International Conference on BioMedical
Engineering and Informatics, vol. 1, pp. 713–717. IEEE (2008)
20. Lehmann, E.L., Casella, G.: Theory of Point Estimation. Springer, New York
(2006)
21. Loskot, P., Atitey, K., Mihaylova, L.: Comprehensive review of models and methods
for inferences in bio-chemical reaction networks. arXiv preprint arXiv:1902.05828
(2019)
22. Lück, A., Wolf, V.: Generalized method of moments for estimating parameters of
stochastic reaction networks. BMC Syst. Biol. 10(1), 98 (2016)
23. Mathews, D.H., Sabina, J., Zuker, M., Turner, D.H.: Expanded sequence depen-
dence of thermodynamic parameters improves prediction of RNA secondary struc-
ture. J. Mol. Biol. 288(5), 911–940 (1999)
24. Metropolis, N., Rosenbluth, A.W., Rosenbluth, M.N., Teller, A.H., Teller, E.: Equa-
tion of state calculations by fast computing machines. J. Chem. Phys. 21(6), 1087–
1092 (1953)
25. Morrison, L.E., Stols, L.M.: Sensitive fluorescence-based thermodynamic and
kinetic measurements of DNA hybridization in solution. Biochemistry 32, 3095–
3104 (1993)
26. Nelder, J.A., Mead, R.: A simplex method for function minimization. Comput. J.
7(4), 308–313 (1965)
27. Ouldridge, T.E., Louis, A.A., Doye, J.P.: Structural, mechanical, and thermody-
namic properties of a coarse-grained DNA model. J. Chem. Phys. 134(8), 02B627
(2011)
28. Schaeffer, J.M.: Stochastic simulation of the kinetics of multiple interacting nucleic
acid strands. Ph.D. thesis, California Institute of Technology (2012)
29. Schaeffer, J.M., Thachuk, C., Winfree, E.: Stochastic simulation of the kinetics of
multiple interacting nucleic acid strands. In: Phillips, A., Yin, P. (eds.) DNA 2015.
LNCS, vol. 9211, pp. 194–211. Springer, Cham (2015). https://doi.org/10.1007/
978-3-319-21999-8 13
30. Schnoerr, D., Sanguinetti, G., Grima, R.: Approximation and inference methods
for stochastic biochemical kinetics–a tutorial review. J. Phys. Math. Theor. 50(9),
093001 (2017)
31. Schreck, J.S., et al.: DNA hairpins destabilize duplexes primarily by promoting
melting rather than by inhibiting hybridization. Nucleic Acids Res. 43(13), 6181–
6190 (2015)
32. Srinivas, N., et al.: On the biophysics and kinetics of toehold-mediated DNA strand
displacement. Nucleic Acids Res. 41, 10641–10658 (2013)
33. Suhov, Y., Kelbert, M.: Probability and Statistics by Example: Volume 2, Markov
Chains: A Primer in Random Processes and Their Applications, vol. 2. Cambridge
University Press, Cambridge (2008)
34. Šulc, P., Romano, F., Ouldridge, T.E., Rovigatti, L., Doye, J.P., Louis, A.A.:
Sequence-dependent thermodynamics of a coarse-grained DNA model. J. Chem.
Phys. 137(13), 135101 (2012)
Efficient Parameter Estimation for DNA CTMC Kinetics 99

35. Tang, X., Kirkpatrick, B., Thomas, S., Song, G., Amato, N.M.: Using motion
planning to study RNA folding kinetics. J. Comput. Biol. 12(6), 862–881 (2005)
36. Wackerly, D., Mendenhall, W., Scheaffer, R.L.: Mathematical Statistics with Appli-
cations. Cengage Learning, Boston (2014)
37. Wetmur, J.G.: Hybridization and renaturation kinetics of nucleic acids. Annu. Rev.
Biophys. Bioeng. 5(1), 337–361 (1976)
38. Xu, Z.Z., Mathews, D.H.: Experiment-assisted secondary structure prediction with
RNAstructure. In: Turner, D., Mathews, D. (eds.) RNA Structure Determination:
Methods and Protocols, pp. 163–176. Humana Press, New York (2016)
39. Zadeh, J.N., et al.: NUPACK: analysis and design of nucleic acid systems. J. Com-
put. Chem. 32, 170–173 (2011)
40. Zhang, D.Y., Winfree, E.: Control of DNA strand displacement kinetics using
toehold exchange. J. Am. Chem. Soc. 131, 17303–17314 (2009)
41. Zhang, J.X., et al.: Predicting DNA hybridization kinetics from sequence. Nat.
Chem. 10(1), 91 (2018)
42. Zolaktaf, S., et al.: Inferring parameters for an elementary step model of DNA
structure kinetics with locally context-dependent arrhenius rates. In: Brijder, R.,
Qian, L. (eds.) DNA 2017. LNCS, vol. 10467, pp. 172–187. Springer, Cham (2017).
https://doi.org/10.1007/978-3-319-66799-7 12
New Bounds on the Tile Complexity
of Thin Rectangles at Temperature-1

David Furcy, Scott M. Summers(B) , and Christian Wendlandt

Computer Science Department,


University of Wisconsin Oshkosh, Oshkosh, WI 54901, USA
{furcyd,summerss,wendlc69}@uwosh.edu

Abstract. In this paper, we study the minimum number of unique


tile types required for the self-assembly of thin rectangles in Winfree’s
abstract Tile Assembly Model (aTAM), restricted to temperature-1.
Using Catalan numbers, planar self-assembly and a restricted version
of the Window Movie Lemma, we derive a new lower bound on the tile
complexity of thin rectangles at temperature-1 in 2D. Then, we give the
first known upper bound on the tile complexity of “just-barely” 3D thin
rectangles at temperature-1, where tiles are allowed to be placed at most
one step into the third dimension. Our construction, which produces a
unique terminal assembly, implements a just-barely 3D, zig-zag counter,
whose base depends on the dimensions of the target rectangle, and whose
digits are encoded geometrically, vertically-oriented and in binary.

1 Introduction

Intuitively, self-assembly is the process through which simple, unorganized com-


ponents spontaneously combine, according to local interaction rules, to form
some kind of organized final structure.
While nature exhibits numerous examples of self-assembly, researchers have
been investigating the extent to which the power of nano-scale self-assembly can
be harnessed for the systematic nano-fabrication of atomically-precise compu-
tational, biomedical and mechanical devices. For example, in the early 1980s,
Seeman [15] exhibited an experimental technique for controlling nano-scale self-
assembly known as “DNA tile self-assembly”.
Erik Winfree’s abstract Tile Assembly Model (aTAM) is a simple, discrete
mathematical model of DNA tile self-assembly. In the aTAM, a DNA tile is
represented as an un-rotatable unit square tile. Each side of a tile may have
a glue that consists of an integer strength, usually 0, 1 or 2, and an alpha-
numeric label. The idea is that, if two tiles abut with matching kinds of glues,
then they bind with the strength of the glue. In the aTAM, a tile set may
consist of a finite number of tiles, because individual DNA tiles are expensive to
manufacture. However, an infinite number of copies of each tile are assumed to
be available during the self-assembly process in the aTAM. Self-assembly starts
by designating a seed tile and placing it at the origin. Then, a tile can come
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 100–119, 2019.
https://doi.org/10.1007/978-3-030-26807-7_6
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 101

in and bind to the seed-containing assembly if it binds with total strength at


least a certain experimenter-chosen, integer value called the temperature that is
usually 1 or 2. Self-assembly proceeds as tiles come in and bind one-at-a-time in
an asynchronous and non-deterministic fashion.
Tile sets are designed to work at a certain temperature value. For instance,
a tile set that self-assembles correctly at temperature-2 will probably not self-
assemble correctly at temperature-1. However, if a tile set works correctly at
temperature-1, then it can be easily modified to work correctly at temperature-
2 (or higher). In what follows, we will refer to a “temperature-2” tile set as a tile
set that self-assembles correctly only if the temperature is 2 and a “temperature-
1” tile set as a tile set that self-assembles correctly if the temperature is 1.
Temperature-2 tile sets give the tile set designer more control over the order in
which tiles bind to the seed-containing assembly. For example, in a temperature-2
tile set, unlike in a temperature-1 tile set, the placement of a tile at a certain loca-
tion can be prevented until after the placements of at least two other tiles at two
respective adjacent locations. This is known as cooperative binding. Cooperative
binding in temperature-2 tile sets leads to the self-assembly of computationally
and geometrically interesting structures, in the sense of Turing universality [17],
the efficient self-assembly of N × N squares [1,12] and algorithmically-specified
shapes [16].
While it is not known whether the results cited in the previous paragraph hold
for temperature-1 tile sets, the general problem of characterizing the power of
non-cooperative tile self-assembly is important from both a theoretical and prac-
tical standpoint. This is because when cooperative self-assembly is implemented
in the laboratory [3,9,13,14,18], erroneous non-cooperative binding events may
occur, leading to the production of invalid final structures. Of course, the obvi-
ous way to minimize such erroneous non-cooperative binding events is for experi-
menters to always implement systems that work in non-cooperative self-assembly
because temperature-1 tile sets will work at temperature-1 or temperature-2.
Yet, how capable is non-cooperative self-assembly, in general, or even in cer-
tain cases? At the time of this writing, no such general characterization of the
power of non-cooperative self-assembly exists, but there are numerous results
that show the apparent weakness of specific classes of temperature-1 tile self-
assembly [5,8,10,11].
Although these results highlight the weakness of certain types of
temperature-1 tile self-assembly, if 3D (unit cube) tiles are allowed to be placed
in just-barely-three-dimensional Cartesian space (where tiles may be placed in
just the z = 0 and z = 1 planes), then temperature-1 self-assembly is nearly as
powerful as its two-dimensional cooperative counterpart. For example, like 2D
temperature-2 tile self-assembly, just-barely 3D temperature-1 tile self-assembly
is capable of simulating Turing machines [4] and the efficient self-assembly of
squares [4,6] and algorithmically-specified shapes [7].
Furthermore, Aggarwal, Cheng, Goldwasser, Kao, Moisset de Espanés and
Schweller [2] studied the efficient self-assembly of k × N rectangles, where
k < log log N log N
−log log log N at temperature-2 in 2D (the upper bound on k makes
102 D. Furcy et al.

such a rectangle thin). They proved that the size of the smallest set of tiles that
uniquely self-assemble
 1   into
1
 (i.e., the tile complexity of) a thin k × N rectangle is
O N k + k and Ω Nkk at temperature-2. Their lower bound actually applies
to all tile sets (temperature-1, temperature-2, etc.) but their upper bound con-
struction requires temperature-2 and does not work correctly at temperature-1.
In this paper, we continue the line of research into the tile complexity of thin
rectangles, initiated by Aggarwal, Cheng, Goldwasser, Kao, Moisset de Espanés
and Schweller, but exclusively for temperature-1 tile self-assembly.

1.1 Main Results of This Paper

The main results of this paper are bounds on the tile complexity of thin rectan-
gles at temperature-1. We give an improved lower bound for the tile complexity
of 2D thin rectangles as well as a non-trivial upper bound for the tile complexity
of just-barely 3D thin rectangles. Intuitively, a just-barely 3D thin rectangle is
like having at most two 2D thin rectangles stacked up one on top of the other.
We prove two main results: one negative (lower bound) and one positive (upper
bound). Our main negative result gives a new and improved asymptotic lower
bound on the tile complexity of a 2D thin rectangle at temperature-1, without
assuming unique production of the terminal assembly (unique self-assembly).

 1  1. The tile complexity of a k × N rectangle for temperature-1 tile sets


Theorem
is Ω N k .

Currently, the best upper bound for the tile complexity of a k × N rectangle
for temperature-1 tile sets is N +k −1, and is obtained via a straightforward gen-
eralization of the “Comb construction” by Rothemund and Winfree (see Fig. 2b
of [12]). So, while Theorem 1 currently does not give a tight bound, its proof tech-
nique showcases a novel application of Catalan numbers to proving lower bounds
for temperature-1 self-assembly in 2D, and could be of independent interest.
Our main positive result is the first non-trivial upper bound on the tile com-
plexity of just-barely 3D thin rectangles.

Theorem 2. The tile complexity


 of a just-barely
 3D k × N thin rectangle for
1
 k

temperature-1 tile sets is O N 3 + log N . Moreover, our construction pro-
duces a tile set that self-assembles into a unique final assembly.

We say that our main positive result is the first non-trivial upper bound
because a straightforward generalization of the aforementioned Comb construc-
tion would give an upper bound of O (N + k) on the tile complexity of a just-
barely 3D k × N thin rectangle.
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 103

1.2 Comparison with Related Work

Aggarwal, Cheng, Goldwasser,


 Kao,
 Moisset de Espanés and Schweller [2] give
1
a general lower bound of Ω Nkk for the tile complexity of a 2D k × N rect-
angle for temperature-τ tile sets. Our main negative result, Theorem 1, is an
asymptotic improvement of this result for the special case of temperature-1 self-
assembly.
Aggarwal, Cheng, Goldwasser, Kao, Moisset de Espanés and Schweller [2] also
prove that the tile complexity
 1of a 2D k × N thin rectangle for general positive
temperature tile sets is O N + k . Our main positive result, Theorem 2, is
k

inspired by but requires a substantially different proof technique from theirs. Our
construction, like theirs, uses a just-barely 3D counter, the base of which depends
on the dimensions of the target rectangle, but unlike theirs, ours self-assembles
in a zig-zag manner and the digits of the counter are encoded geometrically,
vertically-oriented and in binary.

2 Preliminaries

In this section, we briefly sketch a 3D version of Winfree’s abstract Tile Assembly


Model. Going forward, all logarithms in this paper are base-2.
Fix an alphabet Σ. Σ ∗ is the set of finite strings over Σ. Let Z, Z+ , and N
denote the set of integers, positive integers, and non-negative integers, respec-
tively. Let d ∈ {2, 3}.
A grid graph is an undirected graph G = (V, E), where V ⊂ Zd , such that, for
all {a, b} ∈ E, a − b is a d-dimensional unit vector. The full grid graph of V is
the undirected graph GfV = (V, E), such that, for all x , y ∈ V , {x , y } ∈ E ⇐⇒
x − y  = 1, i.e., if and only if x and y are adjacent in the d-dimensional integer
Cartesian space.
A d-dimensional tile type is a tuple t ∈ (Σ ∗ × N)2d , e.g., a unit square (cube),
with four (six) sides, listed in some standardized order, and each side having a
glue g ∈ Σ ∗ × N consisting of a finite string label and a non-negative integer
strength. We call a d-dimensional tile type merely a tile type when d is clear from
the context.
We assume a finite set of tile types, but an infinite number of copies of each
tile type, each copy referred to as a tile. A tile set is a set of tile types and is
usually denoted as T .
A configuration is a (possibly empty) arrangement of tiles on the integer
lattice Zd , i.e., a partial function α : Zd  T . Two adjacent tiles in a config-
uration bind, interact, or are attached, if the glues on their abutting sides are
equal (in both label and strength) and have positive strength. Each configura-
tion α induces a binding graph Gbα , a grid graph whose vertices are positions
occupied by tiles, according to α, with an edge between two vertices if the
tiles at those vertices bind. For two non-overlapping configurations α and β,
α ∪ β is defined as the unique configuration γ satisfying, for all x ∈ dom α,
104 D. Furcy et al.

γ(x ) = α(x ), for all x ∈ dom β, γ(x ) = β(x ), and γ(x ) is undefined at any
point x ∈ Zd \ (dom α ∪ dom β).
An assembly is a connected, non-empty configuration, i.e., a partial function
α : Zd  T such that Gbdom α is connected and dom α
= ∅. Given τ ∈ Z+ , α
is τ -stable if every cut-set of Gbα has weight at least τ , where the weight of an
edge is the strength of the glue it represents.1 When τ is clear from context, we
say α is stable. Given two assemblies α, β, we say α is a subassembly of β, and
we write α β, if dom α ⊆ dom β and, for all points p ∈ dom α, α(p) = β(p).
A d-dimensional tile assembly system (TAS) is a triple T = (T, σ, τ ), where
T is a tile set, σ : Zd  T is the finite, τ -stable, seed assembly, and τ ∈ Z+ is
the temperature.
Given two τ -stable assemblies α, β, we write α →T1 β if α β and |dom β \
dom α| = 1. In this case we say α T -produces β in one step. If α →T1 β,
dom β \ dom α = {p},and t = β(p), we write β = α + (p → t). The T -frontier
of α is the set ∂ T α = α→T β (dom β \ dom α), i.e., the set of empty locations at
1
which a tile could stably attach to α. The t-frontier of α, denoted ∂tT α, is the
T T 
subset of ∂ α defined as p ∈ ∂ α α →1 β and β(p) = t . T

Let AT denote the set of all assemblies of tiles from T , and let AT<∞ denote
the set of finite assemblies of tiles from T . A sequence of k ∈ Z+ ∪ {∞} assem-
blies α = (α0 , α1 , . . .) over AT is a T -assembly sequence if, for all 1 ≤ i < k,
αi−1 →T1 αi . The result of an assembly sequence α, denoted as res(α), is the
unique limiting assembly (for a finite sequence, this is the final assembly in the
sequence).
We write α →T β, and we say α T -produces β (in 0 or more steps), if there
is a T -assembly sequence  α0 , α1 , . . . of length k = |dom β \ dom α| + 1 such that
(1) α = α0 , (2) dom β = 0≤i<k dom αi , and (3) for all 0 ≤ i < k, αi β. If k
is finite then it is routine to verify that β = αk−1 .
We say α is T -producible if σ →T α, and we write A[T ] to denote the set of
T -producible assemblies.
An assembly α is T -terminal if α is τ -stable and ∂ T α = ∅. We write A [T ] ⊆
A[T ] to denote the set of T -producible, T -terminal assemblies. If |A [T ]| = 1
then T is said to be directed.
In general, a d-dimensional shape is a set X ⊆ Zd . We say that a TAS T self-
assembles X if, for all α ∈ A [T ], dom α = X, i.e., if every terminal assembly
produced by T places a tile on every point in X and does not place any tiles on
points in Zd \ X. We say that a TAS T uniquely self-assembles X if A [T ] = {α}
and dom α = X.
In the spirit of [12], we define the tile complexity of a shape X at temper-
τ
ature τ , denoted by KSA (X), as the minimum number of distinct tile types
of any TAS in which it self-assembles, i.e., KSA τ
(X) = min {n | T = (T, σ, τ ) ,
|T | = n and X self-assembles in T }. The directed tile complexity of a shape X
at temperature τ , denoted by KUτ SA (X), is the minimum number of distinct
1
A cut-set is a subset of edges in a graph which, when removed from the graph,
produces two or more disconnected subgraphs. The weight of a cut-set is the sum of
the weights of all of the edges in the cut-set.
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 105

tile types of any TAS in which it uniquely self-assembles, i.e., KUτ SA (X) =
min {n | T = (T, σ, τ ) , |T | = n and X uniquely self-assembles in T }.

3 Lower Bound

In this section, we prove Theorem 1, which is a lower bound on the tile complexity
of 2D rectangles. So, going forward, let k, N ∈ N. We say that Rk,N 2
is a 2D k ×N
rectangle if Rk,N = {0, 1, . . . , N − 1} × {0, 1, . . . , k − 1}. Throughout this section,
2
2
we will denote Rk,N as simply Rk,N . Our lower bound relies on the following
observation regarding temperature-1 self-assembly.

Observation 1. If T = (T, σ, 1) is a singly-seeded TAS in which some shape X


self-assembles and α ∈ A[T ] such that dom α = X, then Gbα contains a simple
path s from the location of σ to any location of X and there is a corresponding
(simple) assembly sequence α that follows s by placing tiles on and only on
locations in s.

Since, in Observation 1, we do not necessarily assume that T uniquely pro-


duces X, there could be more than one assembly sequence for a given s. Through-
out the rest of this section, unless stated otherwise, let T = (T, σ, 1) be a singly-
seeded TAS in which Rk,N self-assembles.

3.1 Window Movie Lemmas

To prove our lower bound, we will use a variation of the Window Movie Lemma
(WML) by Meunier, Patitz, Summers, Theyssier, Winslow and Woods and a
corollary thereof. In this subsection, we review standard notation [10] for and
give the statements of the variation that we use in our lower bound proof.
A window w is a set of edges forming a cut-set of the full grid graph of
Zd . Given a window w and an assembly α, a window that intersects α is a
partitioning of α into two configurations (i.e., after being split into two parts,
each part may or may not be disconnected). In this case we say that the window
w cuts the assembly α into two configurations αL and αR , where α = αL ∪ αR .
Given a window w, its translation by a vector Δ, written w + Δ is simply the
translation of each one of w’s elements (edges) by Δ.
For a window w and an assembly sequence α, we define a glue win-
dow movie M to be the order of placement, position and glue type for each
glue that appears along the window w in α. Given an assembly sequence α
and a window w, the associated glue window movie is the maximal sequence
Mα ,w = (v 1 , g1 ) , (v 2 , g2 ) , . . . of pairs of grid graph vertices v i and glues gi ,
given by the order of the appearance of the glues along window w in the assem-
bly sequence α. Furthermore, if m glues appear along w at the same instant
(this happens upon placement of a tile which has multiple sides touching w)
then these m glues appear contiguously and are listed in lexicographical order
106 D. Furcy et al.

of the unit vectors describing their orientation in Mα ,w . We use the notation


B (Mα ,w ) to denote the bond-forming submovie of Mα ,w , which consists of only
those steps of Mα ,w that place glues that eventually form positive-strength bonds
in the assembly res (α). We write Mα ,w + Δ to denote the translation of the
glue window movie, that is (v 1 + Δ, g1 ) , (v 2 + Δ, g2 ) , . . ..
Let w be a window that partitions α into two configurations αL and αR , and
assume w + Δ partitions β into two configurations βL and βR . Assume that αL ,
βL are the sub-configurations of α and β containing the seed tile of α and β,
respectively.

Lemma 1 (Standard Window Movie Lemma). If B (Mα ,w ) =


B (Mβ ,w+Δ ) − Δ, then the following two assemblies are producible:
αL (βR − Δ) = αL ∪ (βR − Δ) and βL (αR + Δ) = βL ∪ (αR + Δ).

By Observation 1, there exist simple assembly sequences α = (αi | 0 ≤ i < l)


and β = (βi | 0 ≤ i < m), with l, m ∈ Z+ that place tiles along simple paths
s and s , respectively, leading to results α and β, respectively. The notation
Mα ,w  s represents the restricted glue window submovie (restricted to s), which
consists of only those steps of M that place glues that eventually form positive-
strength bonds along s.

Corollary 1 (Restricted Window Movie Lemma). If Mα ,w  s =


(Mβ ,w+Δ  s ) − Δ, then the following two assemblies are producible:
αL (βR − Δ) = αL ∪ (βR − Δ) and βL (αR + Δ) = βL ∪ (αR + Δ).

The proof of Corollary 1 is identical to that of Lemma 1 and therefore is


omitted. The proof is identical because α (β) follows s (s ) and τ = 1, so glues
that do not follow s (s ) are not necessary for the self-assembly of α (β). Note
that Lemma 1 and Corollary 1 both generalize to 3D. See Fig. 1 for examples
of Mα ,w , B (Mα ,w ) and Mα ,w  s. We now turn our attention to counting the
number of restricted glue window submovies.

3.2 Counting Procedure for Undirected Self-assembly in 2D


In this subsection, we develop a counting procedure that we will use to obtain
an upper bound on the number of distinct restricted glue window submovies.
Let ρ ∈ A [T ]. By Observation 1, there exists a simple path s in Gbρ from the
location of σ to any location in an extreme (i.e., leftmost or rightmost) column
of Rk,N . For the remainder of this section, unless stated otherwise, let α denote
any (simple) assembly sequence that follows a simple path from the location of
σ to some location in the furthest extreme column of Rk,N . So, if σ is in the left
half of Rk,N , then s will go from σ to some location in the rightmost column of
Rk,N . If σ is in the right half of Rk,N , then s will go from σ to some location in
the leftmost column of Rk,N . If σ is in the middle column of Rk,N , then s can
go to either the leftmost or rightmost column of Rk,N .
Index the columns of Rk,N from 1 (left) to N (right). Assume cσ is the index
of the column in which the seed is contained. Consider two consecutive columns,
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 107

Fig. 1. An assembly, a simple path and the various types of glue window movies.

with indices c0 and c1 , satisfying |cσ − c0 | < |cσ − c1 |, and such that either c0 or
c1 (or both) are in between cσ and the furthest (from σ) extreme column. Since
s is a simple path from the location of σ to some location in the extreme column
of Rk,N that is furthest from σ, s crosses between c0 and c1 through e crossing
edges in Gbρ , where 1 ≤ e ≤ k and e is odd, visiting a total of 2e endpoints.
The endpoint of a crossing edge in column c0 (c1 ) is its near (far) endpoint. A
crossing edge points away from (towards) the seed if its near endpoint is visited
first (second).
Observe that the first and last crossing edges visited by s must point away
from the seed but each crossing edge that points away from the seed (except the
last crossing edge) is immediately followed by a corresponding crossing edge that
points towards the seed, when skipping the part of s that connects them without
going through another crossing edge in between them. Assume that the rows of
Rk,N are assigned an index from 1 (top) to k (bottom). Let E ⊆ {1, . . . , k} be
such that |E| = e and f ∈ E and l ∈ E be the row indices of the first and last
crossing edges visited, respectively. We define a near (far) crossing pairing over
E starting at f ∈ E (ending at l ∈ E) as a set of p = e−1 2 non-overlapping pairs
of elements in E\{f } (E\{l}), where each pair contains (the row indices of) one
crossing edge pointing away from the seed and its corresponding crossing edge
pointing towards the seed. See Fig. 2 for examples of the previous definitions.
For counting purposes pertaining to a forthcoming argument, we establish an
injective mapping from near crossing pairings over E to strings of balanced
parentheses of length e − 1.
108 D. Furcy et al.

Lemma 2. There exists an injective function from the set of all near crossing
pairings over E starting at f into the set of all strings of 2p balanced parentheses.

Proof. Given a near crossing pairing P with p pairs, build a string x with 2p
characters indexed from 1 to 2p going from left to right, as follows. For each
element {a, b} of P , with a < b and assuming a is the i-th lowest row index and
b is the j-th lowest row index in E\{f }, place a left parenthesis at index i and
a right parenthesis at index j.

The resulting string x contains exactly p pairs of parentheses. Furthermore,


all of the parentheses in x are balanced because each opening parenthesis appears
to the left of its closing parenthesis (thanks to the indexing used in the string
construction algorithm just described) and, for any two pairs of parentheses in
the string, it must be the case that either (1) they do not overlap (i.e., the
closing parenthesis of the leftmost pair is positioned to the left of the opening
parenthesis of the rightmost pair) or (2) one pair is nested inside the other (i.e.,
the interval defined by the indices of the nested pair is included in the interval
defined by the indices of the outer pair). The other case is impossible, that is,
when the two pairs {a, b} and {c, d} are such that a < c < b < d because it
would be impossible for any path crossing consecutive columns according to P
to be simple. Consider any simple path π{a,b} that links crossing edges a and b
without going through another crossing edge in between them. Since P is a near
crossing pairing, π{a,b} is fully contained in the half-plane H0 on the near side of
c0 toward the seed. This path partitions H0 into two spaces. Since the crossing
edges c and d belong to different components of this partition, any simple path
linking these two crossing edges must cross π{a,b} . Therefore, s, crossing between
c0 and c1 , could not have been simple.
Finally, note that two different near crossing pairings P1 and P2 over E
starting at f will map to two different strings of balanced parentheses, so the
mapping is injective. 


Corollary 2. There exists an injective function from the set of all far crossing
pairings over E ending at l into the set of all strings of 2p balanced parentheses.

The following is a systematic procedure for upper bounding the number of


ways to select and order the 2e endpoints of the e crossing edges between an
arbitrary pair of consecutive columns c0 and c1
(see Fig. 2a). Obviously, the
number of ways to do this is less than or equal to ke (2e)!. We will use crossing
pairings and Catalan numbers to reduce this upper bound.

1. Choose the set E of row indices of the e crossing



edges, out of k possible
edges between consecutive columns. There are ke ways to do this.
2. One of the crossing edges must be first, so, choose the first crossing edge f .
There are e ways to do this.
3. One of the crossing edges must be last, so, choose the last crossing edge l.
There are e ways to do this.
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 109

Fig. 2. A “good” sample run of the counting procedure.

The three previous steps are depicted in Fig. 2b. We purposely allow choosing
l = f because our intention is to upper bound the number of ways to select and
order the endpoints

2p of the crossing edges. Moreover, l = f when e = 1. Denote
as Cp = p+1
1
p the pth Catalan number (indexed starting at 0).

4. For a given pair of consecutive columns, in which f is visited first, s induces


a near crossing pairing over E starting at f , where the elements of each pair
are row indices of near endpoints of crossing edges, including l, but not f .
By Lemma 2, it suffices to count the number of ways to choose a string
of 2p balanced parentheses. Therefore, choose a string x0 of 2p balanced
parentheses, where x0 [i] corresponds to the crossing edge in E with the i-th
lowest row index, excluding f . There are Cp ways to do this.
5. For a given pair of consecutive columns in which l is visited last, s induces
a far crossing pairing over E ending at l, where the elements of each pair
are row indices of far endpoints of crossing edges, including f , but not l.
By Corollary 2, it suffices to count the number of ways to choose a string
of 2p balanced parentheses. Therefore, choose a string x1 of 2p balanced
parentheses, where x1 [i] corresponds to the crossing edge in E with the i-th
lowest row index, excluding l. There are Cp ways to do this.

The two previous steps are depicted in Fig. 2c. At this point, we have chosen
the locations and connectivity pattern of all the crossing edges. We now show
that there is at most one way in which both endpoints of every crossing edge
may be visited by s, subject to the constraints imposed by the previous steps.

6. Let Ij (r) be the index i, such that xj [i] corresponds to the crossing edge
with row index r. The following greedy algorithm attempts to build a path
110 D. Furcy et al.

π of locations that (1) starts at the near endpoint of the first crossing edge,
(2) ends at the far endpoint of the last crossing edge and (3) visits only
the endpoints of the crossing edges while following the balanced parenthesis
pairings of both x0 and x1 .
1 Initialize π = ((c0 , f ) , (c1 , f )) to be a sequence of locations, j = 1 and
r = f , where r stands for “row number” and j stands for the current
side, near (0) or far (1).
2 while r
= l do
3 Let r be the unique row index of the crossing edge, such that, Ij (r)
and Ij (r ) are paired.
4 Set r = r .
5 Append (cj , r) to π.
6 Set j = (j + 1) mod 2.
7 Append (cj , r) to π.
First, note that no endpoint can be visited more than once, so the algorithm
always terminates. Second, note that, when the algorithm terminates, either
|π| = 2e (see Fig. 2d) or |π| < 2e (see Fig. 3). However, regardless of its
length, π is the unique sequence of endpoints of crossing edges that can be
visited by any simple path starting at (c0 , f ), ending at (c1 , l) and following
the balanced parenthesis pairings of both x0 and x1 . The uniqueness of π
follows from the uniqueness of r , given r, based on the balanced parenthesis
pairings of both x0 and x1 .

Fig. 3. A “bad” sample run of the counting procedure. Here, x0 = (())() and x1 =
()()(). With f = 12, l = 2 and E = {2, 4, 5, 6, 8, 10, 12}, there is no valid π (crossing
edges 4 and 5 are skipped, assuming the pairs of parentheses are faithfully followed),
so the algorithm terminates with |π| = 10 < 2e = 14.


 1
2p 2
By the above counting procedure, there are at most ke e p+1 p · 1 ways
to select and order the endpoints of the crossing edges between an arbitrary pair
of consecutive columns c0 and c1 as they are visited by a simple path.

3.3 Lower Bound for Undirected Self-assembly in 2D: Theorem 1


1
To prove a lower bound on KSA (Rk,N ), we turn our attention to upper bounding
the number of restricted glue window submovies of the form Mα ,w  s. For
the remainder of this subsection, assume w is always some window induced by
(a translation of) the y-axis that cuts Rk,N between some pair of consecutive
columns.
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 111

Lemma 3. The number of restricted glue window submovies of the form


Mα ,w  s is less than or equal to |G|k · 23k+2 · k, where G is the set of all glues of
(the tile types in) T .

Proof. Let e be an odd number such that 1 ≤ e ≤ k and Mα ,w  s =


(v 1 , g1 ) , . . . , (v 2e , g2e ) be a restricted glue window submovie. Since α follows
a simple path, g2i−1 = g2i for i = 1, . . . , e. This means that we only need to
assign e glues, with |G| choices for each glue. So, the number of ways to assign
glues in Mα ,w  s is less than or equal to |G|e . Since α follows a simple path,
each location in Mα ,w  s corresponds to an endpoint of a crossing edge that
crosses w. So, the number of ways to assign locations in Mα ,w  s is less than
or equal to the number of ways to select and order the endpoints of e crossing
edges that cross w via α. By the above counting procedure, the number of ways
to select and order the endpoints of e crossing edges that cross w via α is less

 1
2p 2
than or equal to ke e p+1 p . Thus, if m is the total number of restricted
glue window submovies of the form Mα ,w  s, then we have:

k   1 2p2
m≤ e |G| ≤ |G|k · 23k+2 · k
e
e p+1 p
1≤e≤k
e odd




We will use Lemma 3 to prove our impossibility result.


 1
1
Theorem 1. KSA (Rk,N ) = Ω N k .

Proof. Let
 G1 be the set of glues of (the tile types in) T . It suffices to show that
|T | = Ω N k . Since s is the longest path in Gbρ , from the location of σ to some
location in an extreme column of Rk,N , by Lemma 3, if N > 2·|G|k ·23k+2 ·k, then
there exists a window w, along with vectors Δ1 and Δ2 , such that, Δ1
= 0 ,
Δ2
= 0 and Δ1
= Δ2 and satisfying Mα ,w  s = (Mα ,w+Δ 1  s) − Δ1 and
Mα ,w+Δ 1  s = (Mα ,w+Δ 2  s) − Δ2 . Without loss of generality, assume that
w and w + Δ1 are on the same side of σ and w + Δ1 is to the left of w.
Assume that w partitions α into αL and αR and w + Δ1 partitions β = α
into βL and βR . Then, by Corollary 1, βL (αR + Δ1 ) ∈ A[T ]. Since Δ1
= 0 ,
dom (βL (αR + Δ1 )) \Rk,N
= ∅. In other words, T produces some assembly that
places at least one tile at a location that is not an element of Rk,N . Therefore,
it must hold that N ≤ 2 · |G|k · 23k+2 · k, which implies that |G|k ≥ 23k+3
N
·k
, and

N k1 1 1
|G|
thus |G| ≥ 23k+3 ·k ≥ 6k k 1 = 128 . Finally, note that |T | ≥ 4 and it
Nk Nk
 1 (2 ·2 ) k
follows that |T | = Ω N k . 


Note that the main technique for the proof of Theorem 1 does not hold in
3D because Lemma 2 requires planarity.
112 D. Furcy et al.

4 Upper Bound
In this section, we give a construction for a singly-seeded TAS in which a suffi-
ciently large just-barely 3D rectangle uniquely self-assembles. Going forward, we
3
say that Rk,N ⊆ Z3 is a 3D k × N rectangle if {0, 1, . . . , N − 1} × {0, 1, . . . , k −
1} × {0} ⊆ Rk,N3
⊆ {0, 1 . . . , N − 1} × {0, 1 . . . , k − 1} × {0, 1}. For the sake of
3
clarity of presentation, we represent Rk,N vertically.
Following standard presentation conventions for “just-barely” 3D tile self-
assembly, we use big squares to represent tiles placed in the z = 0 plane and
small squares to represent tiles placed in the z = 1 plane. A glue between a z = 0
tile and a z = 1 tile is denoted as a small black disk. Glues between z = 0 tiles
are denoted as thick lines. Glues between z = 1 tiles are denoted as thin lines.
The following is our main positive result.
   1 
= O N  3  + log N .
k
Theorem 2. KU1 SA Rk,N 3

The general idea of our construction is inspired by, but substantially different
from, a similar construction by Aggarwal, Cheng, Goldwasser, Kao, Moisset de
Espanés and Schweller [2] for the self-assembly of two-dimensional k × N thin
rectangles at temperature-2. The basic idea of our construction for Theorem 2 is
to use a counter, the base of which is a function of k and N . Then, we initialize the
counter with a certain starting value and have it increment until its maximum
value, at which point it rolls over to all 0’s and the assembly goes terminal.
See Fig. 4 for an example of our construction shown at two different levels of
granularity.
Since the height (number of tile rows) of each logical row in the counter
depends on k and 
N , 1we
 must choose its starting value  carefully.
 Therefore, let
  N −3l−1
d = k3 , m = N d
5 , l = log m + 1, s = m d
− 3l+2 , c = k mod 3,
and r = N + 1 mod 3l + 2, where d is the number of digits in the counter, m
is the numerical base of the counter, l is the number of bits needed to represent
each digit in the counter’s value plus one for the “left edge”, s is the numerical
start of the counter, and c and r are the number of tile columns and tile rows,
respectively, that must be filled in after and outside of the counter. Each digit
of the counter requires a width of 3 tiles, which has a direct relation with the
tile complexity of the construction. The values of m and s are chosen such that
the counter stops just before reaching a height of N tiles, at which point, the
assembly is given a flat “roof”. For example, in Fig. 4, we have d = 3, m = 3,
l = 3, s = 23, c = 2, and r = 2.
A gadget is a group of tiles that perform a specific task as they self-assemble.
Gadgets are referred to by a name like Gadget. We define the tile set for our
construction that proves Theorem 2 via a series of gadgets. All gadgets are
depicted in a corresponding figure, where the input glue is explicitly specified by
an arrow, output glues are inferred and glues internal to the gadget are configured
to ensure unique self-assembly within the gadget. We say that a gadget is general
if its input and output glues are undefined. From general gadgets, we create
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 113

Fig. 4. A full example of a 11 × 56 construction. The counter begins at 10-01-10 and is


counting in ternary, so the initial value is 23 = 2 · 32 + 1 · 31 + 2 · 30 . Note that the least
significant bit for each digit, which is the lowest bit in each digit column, is actually a
“left edge” indicator, where “1” means “leftmost” and “0” means “not leftmost”. To
help distinguish overlapping tiles, “write gadgets” are drawn in gray.
114 D. Furcy et al.

specific gadgets in which all of the glues are defined. We define a gadget unit as
a collection of gadgets with a singular purpose, like incrementing the value of
a counter. In the rest of this section, we define all of the general gadgets, from
which all of the specific gadgets that comprise all of the gadget units of our
construction are created.

Seed Unit: We begin by


encoding the initial value
of the counter with the
Seed unit. It has d
3-wide (logical/digit) columns,
where each 3-wide column
represents a digit of s in
base-m. A collection of bit-
bumps on the columns’ east
sides encodes the digits into
binary. A small “lip” is added
on the west side of the Seed
unit to increase the width
of the assembly by c, which
catches any vertical filler tiles
at the end of the construc-
tion. The Guess tile on the
east side of the unit initi-
ates the first Counter unit
(defined next). See Fig. 5.
The number of tile types in
the Seed unit in our construc-
tion is O(log N ) for general
 1 
rectangles, or O N  k
3  for
thin rectangles.

Counter Unit: Each Counter


unit reads over a series of bit-
bumps protruding into their
row from the preceding Seed
unit or counter row. After
a Counter unit reads its bit
pattern with Guess tiles, the
unit produces a new bit pat-
tern in the row above it that
encodes a copy or increment
of the current digit. Of the Fig. 5. The Seed gadget unit. The actual seed tile is
“less significant digit” units, at the far-left of any of the Seed Start gadgets.
the one that increments m−1
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 115

to 0 is unique because it initiates another increment unit, that is, a carry is


passed to the digit to its left. Other increment units, as well as the copy units,
will only initiate copy units (no carry is propagated to the left). The first bit
read is always the “left edge” marker, which tells the unit if it represents the
most significant digit of the counter value and needs to start a new row instead
of another Counter unit. The counter terminates when the most significant digit
follows an increment unit and reads m − 1 in its column. At that point, the
counter will have rolled over md − 1 and the Roof unit (defined later) takes over.
The gadgets belonging to the Counter units are shown in Fig. 6. The number of

Fig. 6. The Counter gadget unit. A row of units shares half of its space with the row
above and the other half of its space with the row below.
116 D. Furcy et al.
 1 
tile types in the Counter unit in our construction is O N  3 
k
and see Fig. 7
for an example.

Return Row Unit: To begin a new row of


Counter units following the completion of
the current row, a Return Row gadget unit
must return the frontier of the assembly
to the east side of the construction. After
returning the frontier to the east side, it
initiates an incrementing Counter unit for
the least significant digit. In cases where
there is only one digit column in use, a
single special gadget is used instead of the
multi-piece unit. See Fig. 8. The number
of tile types in theReturnRow unit in our
1

construction is O N  3  .
k

Roof Unit: The Roof unit consists of a


vertical tile column that reaches above
the tiles from the last counter row, then
extends the assembly to a height of N .
Along the column are glues placed period-
ically that accept filler extensions. These
extensions are designed to patch up holes
that are left in the last counter row. The
highest tile in the column has west-facing Fig. 7. An example with a row of
and east-facing glues. These glues accept Counter units colored black. The unit
shingle tiles, which extend the roof west- is incrementing 10-10-00 to 10-10-01.
ward and eastward so that the entire con-
struction is “covered” (the eastward expansion is blocked if r = 0). Each shingle
tile has a south-facing glue that binds to a filler tile, which will cover up any
remaining gaps in the k × N shape. The Roof unit is shown in Fig. 9. The num-
ber of tile types in the Roof unit in our construction is O(log N ) for general
 1 
rectangles, or O N  k
3  for thin rectangles.

5 Future Work
It is 
well-known  that the tile complexity of a 2D N × N square at temperature-2
is O logloglogNN . More formally, for an N × N square SN 2
= SN = {0, 1, . . . , N −
 
1} × {0, 1, . . . , N − 1}, KU2 SA (SN ) = O logloglogNN [1]. However, it is conjec-
tured [8] that KU1 SA (SN ) = 2N − 1, meaning that a 2D N × N square does
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 117

Fig. 8. The Return Row gadget unit. Fig. 9. The Roof gadget unit.
118 D. Furcy et al.

not self-assemble efficiently at temperature-1. Yet, the tile complexity of a just-



3
barely 3D N ×N square at temperature-1 is O logloglogNN . That is, KU1 SA SN =
 
O logloglogNN , where SN
3
is a just-barely 3D N ×N square, satisfying {0, 1, . . . , N −
1}×{0, 1, . . . , N −1}×{0} ⊆ SN3
⊆ {0, 1, . . . , N −1}×{0, 1, . . . , N −1}×{0, 1} [6].
So, a 2D N ×N square has the same asymptotic tile complexity at temperature-2
as its just-barely 3D counterpart
 does attemperature-1.
 Regarding thin rectan-
1
gles, we know that KU2 SA Rk,N 2
= O N k [2] and we speculate whether a
similar upper bound holds for a just-barely 3D k × N thin rectangle   at
1 3
temperature-1. In other words, is it the case that either KSA Rk,N or
   1
KU1 SA Rk,N3
is equal to O N k ? If not, then what are tight bounds
     
1 3
for KSA Rk,N and KU1 SA Rk,N
3
? We conjecture that KU1 SA Rk,N 3
=
 1 
o N 3 .
k

References
1. Adleman, L.M., Cheng, Q., Goel, A., Huang, M.-D.: Running time and program
size for self-assembled squares. In: STOC, pp. 740–748 (2001)
2. Aggarwal, G., Cheng, Q., Goldwasser, M.H., Kao, M.-Y., de Espanés, P.M.,
Schweller, R.T.: Complexities for generalized models of self-assembly. SIAM J.
Comput. 34, 1493–1515 (2005)
3. Barish, R.D., Schulman, R., Rothemund, P.W., Winfree, E.: An information-
bearing seed for nucleating algorithmic self-assembly. Proc. Nat. Acad. Sci.
106(15), 6054–6059 (2009)
4. Cook, M., Fu, Y., Schweller, R.: Temperature 1 self-assembly: deterministic assem-
bly in 3D and probabilistic assembly in 2D. In: Proceedings of the 22nd Annual
ACM-SIAM Symposium on Discrete Algorithms (2011)
5. Doty, D., Patitz, M.J., Summers, S.M.: Limitations of self-assembly at temperature
1. Theor. Comput. Sci. 412, 145–158 (2011)
6. Furcy, D., Micka, S., Summers, S.M.: Optimal program-size complexity for self-
assembled squares at temperature 1 in 3D. Algorithmica 77(4), 1240–1282 (2017)
7. Furcy, D., Summers, S.M.: Optimal self-assembly of finite shapes at temperature
1 in 3D. Algorithmica 80(6), 1909–1963 (2018)
8. Manuch, J., Stacho, L., Stoll, C.: Two lower bounds for self-assemblies at temper-
ature 1. J. Comput. Biol. 17(6), 841–852 (2010)
9. Mao, C., LaBean, T.H., Relf, J.H., Seeman, N.C.: Logical computation using algo-
rithmic self-assembly of DNA triple-crossover molecules. Nature 407(6803), 493–
496 (2000)
10. Meunier, P.-E., Patitz, M.J., Summers, S.M., Theyssier, G., Winslow, A., Woods,
D.: Intrinsic universality in tile self-assembly requires cooperation. In: Proceedings
of the 25th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp.
pp. 752–771 (2014)
11. Meunier, P.-É., Woods, D.: The non-cooperative tile assembly model is not intrin-
sically universal or capable of bounded turing machine simulation. In: Proceedings
of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC
2017, Montreal, 19–23 June 2017, pp. 328–341 (2017)
New Bounds on the Tile Complexity of Thin Rectangles at Temperature-1 119

12. Rothemund, P.W.K., Winfree, E.: The program-size complexity of self-assembled


squares (extended abstract). In: STOC 2000: Proceedings of the Thirty-Second
Annual ACM Symposium on Theory of Computing, pp. 459–468 (2000)
13. Rothemund, P.W.K., Papadakis, N., Winfree, E.: Algorithmic self-assembly of
DNA Sierpinski triangles. PLoS Biol. 2(12), 2041–2053 (2004)
14. Schulman, R., Winfree, E.: Synthesis of crystals with a programmable kinetic bar-
rier to nucleation. Proc. Nat. Acad. Sci. 104(39), 15236–15241 (2007)
15. Seeman, N.C.: Nucleic-acid junctions and lattices. J. Theor. Biol. 99, 237–247
(1982)
16. Soloveichik, D., Winfree, E.: Complexity of self-assembled shapes. SIAM J. Com-
put. 36(6), 1544–1569 (2007)
17. Winfree, E.: Algorithmic self-assembly of DNA. Ph.D. thesis, California Institute
of Technology, June 1998
18. Winfree, E., Liu, F., Wenzler, L.A., Seeman, N.C.: Design and self-assembly of
two-dimensional DNA crystals. Nature 394(6693), 539–544 (1998)
Non-cooperatively Assembling Large
Structures

Pierre-Étienne Meunier1 and Damien Regnault2(B)


1
Maynooth University, Maynooth, Ireland
pierre-etienne.meunier@mu.ie
2
IBISC, Univ Évry, Université Paris-Saclay, 91025 Evry, France
damien.regnault@univ-evry.fr

Abstract. Algorithmic self-assembly is the study of the local, dis-


tributed, asynchronous algorithms ran by molecules to self-organise,
in particular during crystal growth. The general cooperative model,
also called “temperature 2”, uses synchronisation to simulate Turing
machines, build shapes using the smallest possible amount of tile types,
and other algorithmic tasks. However, in the non-cooperative (“tempera-
ture 1”) model, the growth process is entirely asynchronous, and mostly
relies on geometry. Even though the model looks like a generalisation
of finite automata to two dimensions, its 3D generalisation is capable of
performing arbitrary (Turing) computation [SODA 2011], and of univer-
sal simulations [SODA 2014], whereby a single 3D non-cooperative tileset
can simulate the dynamics of all possible 3D non-cooperative systems,
up to a constant scaling factor.
However, the original 2D non-cooperative model is not capable of
universal simulations [STOC 2017], and the question of its computa-
tional power is still widely open and it is conjectured to be weaker than
“temperature 2” or its 3D counterpart. Here, we show an unexpected
result, namely that this model can reliably grow assemblies of diame-
ter Θ(n log n) with only n tile types, which is the first asymptotically
efficient positive construction.

Keywords: Self-assembly · aTAM · Temperature 1

1 Introduction

Our ability to understand and control matter at the scale of molecules conjures
a future where we can engineer our own materials, interact with biological net-
works to cure their malfunctions, and build molecular computers and nanoscale

Research supported by European Research Council (ERC) under the European Union’s
Horizon 2020 research and innovation programme (grant agreement No 772766,
Active-DNA project), and Science Foundation Ireland (SFI) under Grant number
18/ERCS/5746.

c Springer Nature Switzerland AG 2019


C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 120–139, 2019.
https://doi.org/10.1007/978-3-030-26807-7_7
Non-cooperatively Assembling Large Structures 121

factories. The field of molecular computing and molecular self-assembly stud-


ies the algorithms run by molecules to exchange information, to self-organise in
space, to grow and replicate. Our goal is to build a theory of how they compute,
and of how we can program them.
One of the most successful models of algorithmic self assembly is the abstract
tile assembly model, imagined by Winfree [21]. In that model, we start with a
single seed assembly and a finite number of tile types (with an infinite supply of
each type), and attach tiles, one at a time, asynchronously and nondeterminis-
tically, to the assembly, based on a condition on their borders’ colours.
This model has served to bootstrap the field of molecular computing, which
has since produced an impressive number of experimental realisations, from DNA
motors [23] to arbitrary hard-coded shapes at the nanoscale [17], and cargo-
sorting robots [20].
On the theoretical side, the abstract tile assembly model has been used to
explore different features of self-organisation in space, especially in an asyn-
chronous fashion. In many variants of the model, tile assembly is capable of
simulating Turing machines [1–3,6,8,10,14–16,19,21,22]. More surprisingly, in
its original form, the model is intrinsically universal [4], meaning that there is a
single “universal” tileset capable of simulating the behaviour of any other tileset
(that behaviour is encoded only in the seed of the universal tileset).
In the usual form of the model, a part of the assembly must “wait” for another
to grow long enough to cooperate. In the non-cooperative model, however, any
tile can attach to any location, as long as at least one side matches the colour
of that location. Therefore, “synchronising” different parts of the assembly is
impossible, and the main question becomes, what kind of computation can we
do in a completely asynchronous way? The answer seems to depend crucially on
the space in which the assemblies grow: in one dimension, non-cooperative tile
assembly is equivalent to finite automata1 , and are therefore not too powerful. In
three dimensions though, this model is capable of simulating Turing machines [2],
and even of simulating itself intrinsically [12]. If instead of square tiles, we use
tiles that do not tile the plane, the situation becomes even more puzzling: tiles
whose shape are regular polygons can perform arbitrary computation, but only
if they have at least seven sides [9]. In a similar way, polyomino tiles can also
simulate Turing machines, provided that at least one of their dimensions is at
least two [7].
However, in two dimensions with standard square tiles, the capabilities of
this model remain largely mysterious. All we know is that it cannot simulate
the general (cooperative) model up to rescaling [12], and cannot simulate itself
either [13], but we know very little about its actual computational power. A
number of related questions and simpler models have been studied to try and
approach this model: a probabilistic assembly schedule [2], negative glues [15],
no mismatches [5,11], and different tile shapes [7,9].

1
Actually, deterministic tile assembly systems map directly to deterministic finite
automata.
122 P.-É. Meunier and D. Regnault

Due to the proximity with finite automata, a first intuition to prove the
weakness of this model is that we can try to “pump” parts of an assembly
between two tiles of equal type, resulting in infinite, periodic paths. However,
this is not always possible, where an attempt to pump would result in a glue
mismatch, which would block the growth. This conflict leads to consider three
variants of this model: the case without mismatch where any assembly using at
least twice the same tile type is pumpable, the directed case where conflicts can
occur but where a tile assembly will always produce the same terminal assembly
and the non-directed case where a tile assembly will not always produce the
same terminal assembly.
Before this paper, a single positive construction was known, in which for
all ε, a tileset Tε could build multiple assemblies, all of Manhattan diameter
(2 − ε)|Tε | (this means in particular that Tε cannot build any infinite assembly).
Even though that result was the first example of an algorithmic construction,
the term “algorithm” in that case is to be taken in an extremely weak sense
of a program whose running time is larger than its size. Indeed, the resulting
assemblies were only a constant factor bigger than the program size, perhaps
analogous to a program that calls the same function twice.
Here, we show a way to build an assembly of width Θ(n log n) with only n
different tile types, using the two dimensions to build a “controlled loop”:
Theorem 1. For all t ≥ 0, there is a tile assembly system T = (T, σ, 1), where
|σ| = 1, |T | ≥ t, and all assemblies α ∈ A [T ] are of horizontal span w =
Θ(|T | log |T |) and height less than |T |, and contain the same path P of width w.
Our construction relies on non-directedness in such a crucial way that it leads
us to conjecture that the expressiveness of the non-directed case is stronger than
the directed one. Moreover, it also shows that there no “trivial” pumping lemma
since the proof of such a result would have to deal with our construction. How-
ever, there are strong reasons to believe that 2D noncooperative tile assembly
is not capable of performing Turing computation, since it is in particular not
capable of simulating Turing machines inside a rectangle [13], which is the only
known form of Turing computation in tile assembly.

2 Definitions and Preliminaries

These definitions are for a large part taken from [13].

2.1 Abstract Tile Assembly Model

The abstract tile assembly model was introduced by Winfree [21]. In this paper
we study a restriction of this model called the temperature 1 abstract tile assem-
bly model, or noncooperative abstract tile assembly model. For a more detailed
definition of the full model, as well as intuitive explanations, see for exam-
ple [16,18].
Non-cooperatively Assembling Large Structures 123

A tile type is a unit square with four sides, each consisting of a glue type and
a nonnegative integer strength. Let T be a finite set of tile types. The sides of a
tile type are respectively called north, east, south, and west.
An assembly is a partial function α : Z2  T where T is a set of tile types
and the domain of α (denoted dom(α)) is connected. We let AT denote the set
of all assemblies over the set of tile types T . In this paper, two tile types in an
assembly are said to bind (or interact, or are stably attached ), if the glue types
on their abutting sides are equal, and have strength ≥1. An assembly α induces
a weighted binding graph Gα = (V, E), where V = dom(α), and there is an edge
{a, b} ∈ E if and only if the tiles at positions a and b interact, and this edge
is weighted by the glue strength of that interaction. The assembly is said to be
τ -stable if every cut of Gα has weight at least τ . A tile assembly system is a
triple T = (T, σ, τ ), where T is a finite set of tile types, σ is a τ -stable assembly
called the seed, and τ ∈ N is the temperature.
Given two τ -stable assemblies α and β, we say that α is a subassembly of
β, and write α  β, if dom(α) ⊆ dom(β) and for all p ∈ dom(α), α(p) = β(p).
We also write α →T1 β if we can obtain β from α by the binding of a single tile
type, that is: α  β, |dom(β) \ dom(α)| = 1 and the tile type at the position
dom(β) \ dom(α) stably binds to α at that position. We say that γ is producible
from α, and write α →T γ if there is a (possibly empty) sequence α1 , α2 , . . . , αn
where n ∈ N ∪ {∞}, α = α1 and αn = γ, such that α1 →T1 α2 →T1 . . . →T1 αn .
A sequence of n ∈ Z+ ∪ {∞} assemblies α0 , α1 , . . . over AT is a T -assembly
sequence if, for all 1 ≤ i < n, αi−1 →T1 αi .
The set of productions, or producible assemblies, of a tile assembly system
T = (T, σ, τ ) is the set of all assemblies producible from the seed assembly σ
and is written A[T ]. An assembly α is called terminal if there is no β such that
α →T1 β. The set of all terminal assemblies of T is denoted A [T ].
In this paper, we consider that τ = 1. Thus, we make the simplifying assump-
tion that all glue types have strength 0 or 1: it is not difficult to see that this
assumption does not change the behavior of the model (if a glue type g has
strength sg ≥ 1, in the τ = 1 model then a tile with glue type g binds to a
matching glue type on an assembly border irrespective of the exact value of sg ).
Consider an assembly α which is producible by a tile assembly system at tem-
perature 1, since only one glue of strength 1 is needed to stably bind a tile type
to an assembly then any path of the binding graph of α can grow if it is bind to
the seed. Thus at temperature 1, it is more pertinent to consider path instead of
assembly. Now, we introduce definitions which are useful to study temperature 1.

2.2 Paths and Non-cooperative Self-assembly

Let T be a set of tile types. A tile is a pair ((x, y), t) ∈ Z2 × T where (x, y) is
a position and t is a tile type. Intuitively, a path is a finite or one-way-infinite
simple (non-self-intersecting) sequence of tiles placed on points of Z2 so that
each tile in the sequence interacts with the previous one, or more precisely:
124 P.-É. Meunier and D. Regnault

Definition 2 (Path). A path is a (finite or infinite) sequence P = P0 P1 P2 . . .


of tiles Pi = ((xi , yi ), ti ) ∈ Z2 × T , such that:

– for all Pj and Pj+1 defined on P it is the case that tj and tj+1 interact, and
– for all Pj , Pk such that j
= k it is the case that (xj , yj )
= (xk , yk ).

Whenever P is finite, i.e. P = P0 P1 P2 . . . Pn−1 for some n, n is termed the


length of P . Note that by definition, paths are simple (or self-avoiding). We say
a path P of length n is a prefix (resp. suffix) of a path P  of length n if and
only if n ≤ n and for all 0 ≤ i ≤ n − 1, Pi = Pi (resp. Pn−1−i = Pn  −1−i ).
Although a path is not an assembly, we know that each adjacent pair of
tiles in the path sequence interact implying that the set of path positions forms
a connected set in Z2 and hence every path uniquely represents an assembly
containing exactly the tiles of the path. More formally, for a path P we define
the assembly asm(P ) which to a position occupied a tile of P gives the tile type
of this tile (thus the domain of this function is the set of positions occupied
by a tile of P ). In this case, we call asm(P ) a path assembly. A path P is said
to be producible by some tile assembly system T = (T, σ, 1) if the assembly
(asm(P ) ∪ σ) ∈ A[T ] is producible, and we call such a P a producible path. We
define
P[T ] = {P | P is a path and (asm(P ) ∪ σ) ∈ A[T ]}
to be the set of producible paths of T .2 If all paths of P[T ] are finite, then
we can consider their last tile. If there are no free glue on the last tile of a
path then it cannot grow anymore. We call such a path a dead-end. Note that
a producible path P of P[T ] is either a dead-end or there exists a dead-end P 
of P[T ] such that P is a prefix of P  . Thus If we are able to characterize all
producible dead-ends then we are able to characterize P[T ].
For any path P = P0 P1 P2 , . . . and integer i ≥ 0, we write pos(Pi ) ∈ Z2 , or
(xPi , yPi ) ∈ Z2 , for the position of Pi and type(Pi ) for the tile type of Pi . Hence
if Pi = ((xi , yi ), ti ) then pos(Pi ) = (xPi , yPi ) = (xi , yi ) and type(Pi ) = ti .
Note that, since the domain of a producible assembly is a connected set in
Z2 , and since in an assembly sequence of some tile assembly system T = (T, σ, 1)
each tile binding event βi →T1 βi+1 adds a single node v to the binding graph
Gβi of βi to give a new binding graph Gβi+1 , and adds at least one weight-1
edge joining v to the subgraph Gβi ∈ Gβi+1 , then for any tile ((x, y), t) ∈ α in
a producible assembly α ∈ A[T ], there is a edge-path (sequence of edges) in the
binding graph of α from σ to ((x, y), t). From there, the following important fact
about temperature 1 tile assembly is straightforward to see.

Observation 3. Let T = (T, σ, 1) be a tile assembly system and let α ∈ A[T ].


For any tile ((x, y), t) ∈ α there is a producible path P ∈ P[T ] that for some
i ∈ N contains Pi = ((x, y), t).

2
Intuitively, although producible paths are not assemblies, any producible path P
encodes an unambiguous description of how to grow asm(P ) from the seed σ, accord-
ing to the order of the sequence P , to produce the assembly σ ∪ asm(P ).
Non-cooperatively Assembling Large Structures 125

When referring to the relative placements of positions in the grid graph of Z2 ,


we say that a position (x, y) is east (respectively, west, north, south) of another
position (x , y  ) if x ≥ x (respectively x ≤ x , y ≥ y  , y ≤ y  ). A path P is east
of another path P  if and only if any position occupied by a tile of P is east of
all positions occupied by a tile of P  .
If two paths, or two assemblies, or a path and an assembly, share a common
position we say they intersect at that position. Furthermore, we say that two
paths, or two assemblies, or a path and an assembly, agree on a position if they
both place the same tile type at that position and conflict if they place a different
tile type at that position. We sometimes say that a path P is blockable to mean
that there is another path P  (producible by the same tile assembly system as
produced P ) that conflicts with P .
The translation of a tile ((x, y), t) by a vector − →v = (x , y  ) of Z2 is ((x +
 
x , y + y ), t) (the type of the tile is not modified while its position is translated
by −→v ). The translation of a path P by − →
v , written P + − →
v , is the path Q where


and for all indices i of P , Qi = Pi + v . As a convenient notation, for a path P Q
composed of subpaths P and Q, when we write P Q + − →
v we mean (P Q) + − →
v


(i.e. the translation of all of P Q by + v ).
The width of an assembly α is the number of columns on which α has at least
one tile, and the height of α is the number of rows on which α has at least one
tile.

3 The Tile Assembly System

3.1 Definition of the Tile Assembly System

Our construction relies on two parameters k, n ∈ N. Also, we define the series


(hi )i≥0 as:
h0 = 2, h1 = 4 and for i ≥ 2, hi = 3hi−1 − hi−2 .
The tile assembly system will possess a number of tile types which is exponential
according to k. The main theorem will be proven by setting wisely k and n. In
this paper, we work on a zone of the 2D plane delimited as follow: we will only
consider positions (x, y) ∈ N2 such that 0 ≤ x ≤ (k + 1)n − 1 and 0 ≤ y ≤ hk − 1.
The seed will be made of only one tile at position (0, 0) and any assembly will
have a height bounded by hk − 1 and a width bounded by (k + 1)n − 1.
The aim of this section is to define the tile assembly system T (k,n) =
(T (k,n) , σ, 1). The path of Fig. 1 illustrates the definition of the set of tile types
T (k,n) : each tile type is used exactly one time in this assembly. This path is
made of five parts: one is the seed σ and the four others are represented in
green, orange, blue and red. The set of tile types T (k,n) is defined as the union
of these five kinds of tile types S, G, O, B and R.
The Seed.
Consider the tile type s with only one glue called g0 on its east side. We
define S = {s} and the seed σ is defined as the assembly made of only the tile
((0, 0), s). From now on, σ will always be the seed of our tile assembly system.
126 P.-É. Meunier and D. Regnault

Fig. 1. In our examples, we consider k = 4 and n = 10. The seed (in white) is at
position (0, 0) and we represent the path S (4,4) = GO4 B 4 R(4,4) . This path is producible
by T (k,n) and this figure contains exactly one occurrence of each tile type of T (k,n) .
The height of S (4,4) is hk − 1 and its width is 2n − 1. The tiles of O4 and R(4,4) with
a glue on their east side are marked by a black dot. (Color figure online)
Non-cooperatively Assembling Large Structures 127

The green tile types.


The second kind of tile types G is made of n + 2 tile types called
g0 , g1 , . . . , gn+1 defined as follow:
– for all 0 ≤ i ≤ n − 2 the tile type gi is made of the glue gi on its west side and
the glue gi+1 on its east side; moreover the tile Gi is defined as ((1 + i, 0), gi ).
– the tile type gn−1 is made of the glue gn−1 on its west side and the glue gn
on its north side; moreover the tile Gn−1 is defined as ((n, 0), gn−1 ).
– the tile type gn is made of the glue gn on its south side and the glue gn+1 on
its west side; moreover the tile Gn is defined as ((n, 1), gn ).
– the tile type gn+1 is made of the glue gn+1 on its east side and the glue o0
on its north side; moreover the tile Gn+1 is defined as ((n − 1, 1), gn+1 ).
This set of tile types is used to hardcode the path G = G0 G1 . . . Gn+1 .
The orange tile types.
The third kind of tile types O is made of hk − 2 tile types called
o0 , o1 , . . . , ohk −3 defined as follow. For all 0 ≤ i ≤ hk − 3 the tile type oi is
made of:
– the glue oi on its south side;
– the glue oi+1 on its north side if and only if i < hk − 3;
– the glue b0 on its east side if and only if there exists 1 ≤ i ≤ k such that
i = hi − 3.
For all 0 ≤ i ≤ hk − 3, the tile Oi is defined as ((n − 1, 2 + i), oi ). This set of tile
types is used to hardcode the paths Oi = O0 O1 . . . Ohi −3 for 1 ≤ i ≤ k. Note
that, for all 1 ≤ i ≤ k − 1, the path Oi is a prefix of the path Oi+1 .
The blue tile types.
The fourth kind of tile types B is made of 2n tile types called b0 , b1 , . . . , b2n−1
defined as follow:
– for all 0 ≤ i ≤ n − 2 the tile type bi is made of the glue bi on its west side and
the glue bi+1 on its east side; moreover the tile Bi is defined as ((n + i, 3), bi );
– the tile type bn−1 is made of the glue bn−1 on its west side and the glue bn
on its south side; moreover the tile Bn−1 is defined as ((2n − 1, 3), bn−1 );
– the tile type bn is made of the glue bn on its north side and the glue bn+1 on
its west side; moreover the tile Bn is defined as ((2n − 1, 2), bn );
– for all n + 1 ≤ i ≤ 2n − 2, the tile type bi is made of the glue bi on its east
side and the glue bi+1 on its west side; moreover the tile Bi is defined as
((3n − 1 − i, 2), bi );
– the tile type b2n−1 is made of the glue b2n−1 on its east side and the glue r0
on its south side; moreover the tile B2n−1 is defined as ((n, 2), b2n−1 ).
This set of tile types is used to hardcode the path B 1 = B0 B1 . . . B2n−1 . For all
2 ≤ i ≤ k, we define the path B i as B 1 translated by (0, hi − 4).
The red tile types.
The fifth kind of tile types R is made of hk − hk−1 − 2 tile types called
r0 , r1 , . . . , rhk −hk−1 −3 defined as follow. For all 0 ≤ i ≤ hk − hk−1 − 3, the tile
type ri is made of:
128 P.-É. Meunier and D. Regnault

– the glue ri on its north side;


– the glue ri+1 on its south side if and only if i < hk − hk−1 − 3;
– the glue g0 on its east side if and only if there exists 2 ≤ i ≤ k such that
i = hi − hi−1 − 3.
For all 0 ≤ i ≤ hk − hk−1 − 3, the tile Ri is defined as ((n, 1 − i), ri ). This set of
tile types is used to hardcode the path R defined as R0 R1 . . . Rhk −hk−1 −3 . For
all 1 ≤ i ≤ k and 1 ≤ j ≤ k, we define the path R(i,j) as:
– (the empty path of length 0) if i = 1 or j = 1;
– the prefix of R of length hj − hj−1 − 2 translated by (0, hi − 4) otherwise.

Note that, for all 1 ≤ j  ≤ j, the path R(i,j )
is a prefix of R(i,j) .

3.2 Basic Properties


The aim of this section is to define a set of paths which characterized all the
possible prefixes of a path producible by T (k,n) . These paths are obtained by
gluing together the different paths defined in Sect. 3.1. When two of these paths
are glued together, we have to verify that the result of this operation is also a
path. To achieve this goal, we have to check two properties. The first one is that
the last tile of the first path can be glued to the first tile of the second path.
The second one is that that the two paths do not intersect. We start by a first
lemma which gives the positions occupied by the paths defined in Sect. 3.1. This
lemma is useful to show that a path is west or north of another one and thus
that these two paths do not intersect.

Fact 4. For any k, n ∈ N, for any 1 ≤ j ≤ i ≤ k and for any position (x, y)
occupied by:
– a tile of G, we have 1 ≤ x ≤ n and 0 ≤ y ≤ 1;
– a tile of Oi , we have x = n − 1 and 2 ≤ y ≤ hi − 1;
– a tile of B i , we have n ≤ x ≤ 2n − 1 and hi − 2 ≤ y ≤ hi − 1;
– a tile of R(i,j) , we have x = n and hi − hj + hj−1 ≤ y ≤ hi − 3 (for j = i, we
have hi−1 ≤ y ≤ hi − 3).

Now, for all 1 ≤ j ≤ i ≤ k, we defined S (i,j) as GOi B i R(i,j) and we show


that these sequences of tiles are paths producible by T (k,n) . Note that for any
1 ≤ j ≤ i ≤ k, S (i,j) is a prefix of S (i,i) . Thus we can restrict our studies to S (i,i)
for all 1 ≤ i ≤ k.

Lemma 5. For any k, n ∈ N and for any 1 ≤ i ≤ k, S (i,i) is a path producible


by T (k,n) .

The paths (S (i,j) )1≤j≤i≤k will be used to characterize all the paths producible
by T (k,n) . To achieve this goal, we need to know the positions of the free glues
on these paths (see Fig. 1). These glues can be deduced from the free glues of
S (i,i) .
Non-cooperatively Assembling Large Structures 129

Fig. 2. The path S (1,1) = GO1 B 1 = D1 (for k = 4 and n = 10). The south glue of its
last tile does a mismatch. Thus, this path is a dead-end. (Color figure online)

Lemma 6. For any k, n ∈ N and for any 1 ≤ i ≤ k, the free glues of S (i,i) are:
– the north glue ohi −2 of the tile Ohi −3 whose position is (n − 1, hi − 1) if i < k;
– for all 1 ≤ i ≤ i − 1 the east glue b0 of the tile Ohi −3 whose position is
(n − 1, hi −1 );
(i,i)
– for all 2 ≤ j ≤ i the east glue g0 of the tile Rhj −hj−1 −3 whose position is
(n, hi − hj + hj−1 );
(i,i)
– the south glue rhi −hi−1 −2 of the tile Rhi −hi−1 −3 whose position is (n, hi−1 ) if
1 < i < k.

Proof. Pretty straightforward, except for the special case where i = 1 (see Fig. 2)
the last tile of GO1 B 1 R(1,1) is the last tile of B 1 . Nevertheless, the south glue
of the tile B2n−1
1
whose position is (n, 2) is not free because of a mismatch with
the tile Gn whose position is (n, 1) and which has no glue on its north side.

A corollary of this lemma is that S (1,1) is a dead-end (see Fig. 2). Also, for
all 2 ≤ j ≤ i ≤ k, let − →
v (i,j) be the vector (n, hi − hj + hj−1 ) and since the last
tile of S (i,j)
is (n, hi − hj + hj−1 ) and since the type of its east east glue is g0
then for all P producible by T (k,n) , if S (i,j) (G0 + − →
v (i,j) ) is a prefix of P then P
can be written S (i,j) 
P where P − v →
− (i,j)
is a path producible by T (k,n) .

3.3 Analysis of the Prefixes


Now, remark that the only tile with a glue g0 on its west side is G0 then any
path producible by T (k,n) begins by a tile G0 . In fact, this reasoning can be
done for any glue and direction. Thus for any path P and any 0 ≤ i < |P | − 1,
if we know the position and the tile type of Pi and the position of Pi+1 then
we can deduce the tile type of Pi+1 . Thus, consider two paths P and P  which
are producible by T (k,n) , then they share a common prefix until they split away.
They can split away only at a tile with at least three glues on its sides. From
Lemma 6, we have the following fact:

Fact 7. For any k, n ∈ N and for any path P producible by T (k,n) , either P is
a prefix of GOk or there exists 1 ≤ i ≤ k such that GOi B0i is a prefix of P .

There are only k different prefixes for a producible path with is large enough.
Now, let’s look at how these different prefixes can grow. For all 1 ≤ i ≤ k, by
attaching tiles to the end of GOi B0i , this path will always grow into GOi B i .
130 P.-É. Meunier and D. Regnault

For all 1 ≤ i ≤ k, we define Di as the path obtained by attaching red tiles to


GOi B i until it is no more possible to do so (see Fig. 3). For the special case
i = k, we have Dk = S (k,k) since we run out of red tiles. For the other special
case i = 1, the path D1 is S (1,1) since this path is a dead-end then it is not
possible to add any red tiles (see Fig. 2). For the general case 1 < i < k, Di is
a dead-end since its last tile is ((n, 1), rhi −4 ) and its only free glue is the south
one which does a mismatch with the tile Gn = ((n, 1), gn ). In all cases, there are
only i − 1 red tiles with a free glue on their east side (see Lemma 6). Thus if a
path producible by T (k,n) is not a prefix of Di then it has to use on these free
glues. The previous remarks are summarized in the following fact.

Fig. 3. The path D3 for k = 4 and n = 10. This path is obtained by attaching red tiles
to GO3 B 3 until a conflict occurs with G. For all 1 ≤ i < k, the path Di is a dead-end.
The path Dk is a special case since it is equal to S (k,k) (see Fig. 1) whose last tile has
a free glue on its east side. (Color figure online)

Fact 8. For any k, n ∈ N and for any path P producible by T (k,n) , there exists
1 ≤ i ≤ k such that either:
– P is a prefix of Di ;
– there exists 2 ≤ j ≤ i such that S (i,j) (G0 + −

v (i,j) ) is a prefix of P .
Moreover, for all 1 ≤ i < k, Di is a dead-end.

Now, we have obtained k−1 different prefixes which are dead-end and (k−1)2
prefixes which are not. Now, let’s look at how these different prefixes can grow.
Consider 2 ≤ j ≤ i ≤ k and by attaching tiles to the end of S (i,j) , this path will
always grow into S (i,j) (G + −

v (i,j) ) (this assembly is producible by T (k,n) since
G+ v→
− (i,j)
is east of O and R(i,j) , north of G and south of B i (see Lemma 4)).
i
Non-cooperatively Assembling Large Structures 131

The last tile of this path is ((2n − 1, hi − hj + hj−1 + 1), gn+1 ) and this path can
keep growing to the north by attaching orange tiles at its end. We define the
path D(i,j) as the path obtained by attaching orange tiles to S (i,j) (G + − →v (i,j) )
until it is no more possible to do so (see Fig. 4). The last tile of this path is
((2n − 1, hi − 3), ohj −hj−1 −5 ) since it not possible to add an orange tile because
of a mismatch with the tile Bni = ((2n − 1, hi − 2), bn ). Moreover if j > 2, this
path is a dead-end because the last tile of this path has no east glue. Also,
GOj + − →
v (i,j) cannot be a prefix of P  and by applying Lemma 7 to P  − − →v (i,j)
(i,j) 
we obtain that either P is a prefix of D or there exists 1 ≤ i < j such that
S (i,j) (GOi B0i ) + −

 
v (i,j) is a prefix of P . These observations are summarized in
the following fact.

Fig. 4. The path D(3,3) (on the left) and D(3,2) (on the right) for k = 4 and n = 10.
These paths are obtained by attaching blue and orange tiles to S (3,3) and S (3,2) until
a conflict occurs with B 3 . For all 2 < j ≤ i ≤ k, the path D(i,j) is a dead-end. (Color
figure online)

Fact 9. For any k, n ∈ N and for any path P producible by T (k,n) , there exists
1 ≤ i ≤ k such that either:

– P is a prefix of Di ;
– there exists 2 ≤ j ≤ i such that either:
• P is prefix of D(i,j) ;
• there exists 1 ≤ i < j such that S (i,j) (GOi B0i + −

 
v (i,j) ) is a prefix of P .

Moreover, for all 2 < j ≤ i ≤ k, D(i,j) is a dead-end.


132 P.-É. Meunier and D. Regnault

3.4 Analysis of the Tile Assembly System

Consider a path P producible by T (k,n) then Fact 9 gives us a hint to the struc-
ture of P . Indeed, this path is made of several paths S (i1 ,j1 ) , S (i2 ,j2 ) , S (i3 ,j3 ) , . . .
which are glued together up to some translations (see Fig. 5). The index i (resp.
j) represents which east glue of an orange (resp. red) tile is used. Moreover,
Fact 9 also implies that i1 < i2 < i3 < . . . and thus eventually one the three
kinds of dead-end S (1,1) , Di , D(i,j) (for some 2 ≤ j ≤ i ≤ k) will grow up to
some translation and the path will become a dead-end too. We use this sketch
of proof to show that the width and height of any producible path is bounded.

Lemma 10. For any k, n ∈ N and for any path P producible by T (k,n) , if there
exists 1 ≤ i ≤ k such that GOi B0i is a prefix of P then P0 is its southernmost and
westernmost tile and its height is hi − 1 and its width is bounded by (i + 1)n − 1.

Proof. This proof is done by recurrence on i. For i = 1, if GO1 B01 is a prefix


of P then by Fact 8, P is a prefix of S (1,1) and thus its height is h1 − 1 = 3
and its width is bounded by 2n − 1 (see Lemma 4). Then the initialization of
the recurrence is true. Now, consider 1 ≤ i ≤ k − 1 such that the hypothesis
of recurrence is true for all 1 ≤ i ≤ i and consider a path P producible by
T (k,n) whose prefix is GOi+1 B0i+1 . If P is a prefix of Di+1 or D(i+1,j) (for some
1 ≤ j ≤ i + 1) then its height is hi+1 − 1 and its width is bounded by 2n (see
Lemma 4). In this case, the hypothesis of recurrence is true for i + 1. Otherwise
by Fact 9, there exists 1 ≤ i < j ≤ i + 1 such that P can be written as S (i+1,j) P 
and where (GOi B0i ) + − →
 
v (i+1,j) is a prefix of P  then by recurrence the height

of P − v →
− (i+1,j)
is hi − 1 and its width is bounded by (i + 1)n − 1. Thus the
height of P is bounded by hi+1 and its width is bounded by (i + 2)n − 1. The
recurrence is true for i + 1.

This result and Fact 7 imply that we are working on an area of the plane
delimited by 0 ≤ x ≤ (k + 1)n − 1 and 0 ≤ y ≤ hn+1 and that for any path P
producible by T (k,n) , its first tile is the westernmost and southernmost one.

Corollary 11. For any k, n ∈ N and for any terminal assembly α ∈ A [T (k,n) ],
the height of α is bounded by hn+1 and its width is bounded by (k + 1)n − 1.

Now, we aim to assemble the largest path possible (see Fig. 6). Note that, for
all 1 ≤ i ≤ k, the last tile of the path S (i,i) is at distance n to the east of its first
tile (this property is due to the definition of the green tiles). Thus, if we manage
to glue k paths together, we will obtain a path whose width is (k + 1)n − 1.
This is the path we are looking for. Formally, we define the path L1 as S (1,1)
and for all 2 ≤ i ≤ k, we define Li as S (i,i) (Li−1 + − →
v (i,i) ). We remind that

−v (i,i)
= (n, hi−1 ). Now, we show that this sequence of tiles is a path producible
by T (k,n) .

Lemma 12. For all 1 ≤ i ≤ k, Li is a path producible by T (k,n) of width


(i + 1)n − 1.
Non-cooperatively Assembling Large Structures 133

Fig. 5. This path is the concatenation of S (4,3) and D2 up to some translation. It is


producible by T (k,n) (for k = 4 and n = 10) and it is a dead-end since its suffix is D2
up to some translation. (Color figure online)
134 P.-É. Meunier and D. Regnault

Fig. 6. The path L4 , for k = 4 and n = 10. This path is the largest one pro-
ducible by T (k,n) and it appears in any terminal assembly. It is made of the paths
S (4,4) , S (3,3) , S (2,2) and S (1,1) which are glued together up to some translations. (Color
figure online)
Non-cooperatively Assembling Large Structures 135

Proof. This proof is done by recurrence on i. By Lemma 5, S (1,1) is producible


by T (k,n) and the position of the tile Bn−1 1
is (2n − 1, 3) Thus the initialization
of the recurrence is true. Now, consider 1 ≤ i < k such that the recurrence is
true for i. By definition, GOi B0i is a prefix of Li . Then by Lemma 10, for any
position (x, y) ∈ N2 occupied by a tile of Li + − →
v (i+1,i+1) , we have n + 1 ≤ x ≤
(i+2)n−1 and hi ≤ y ≤ 2hi −1. By Lemma 4, L + → i −
v (i+1,i+1) is west of Oi+1 and
R (i+1,i+1)
, north of G and south of B i+1
and thus Li + − →v (i,i) neither intersects
i
S (i+1,i+1)
nor the seed. By recurrence L is a path producible by T (k,n) and thus
S (i+1,i+1)
(Li + −
→v (i,i) ) is also a path producible by T (k,n) . Finally, the width of
S (i,i)
is (i + 1)n − 1 by recurrence and then the width of Li+1 is (i + 2)n − 1.

Lemma 13. For any k, n ∈ N and for any terminal assembly α ∈ A [T (k,n) ],
Lk is a subassembly of α.

Proof. Consider the following hypothesis of recurrence for 1 ≤ i ≤ k: “Consider


 
a path P producible by T (k,n) , if there exists 1 ≤ i ≤ i such that GOi B0i is
prefix a P then there is no conflict between Li and P ”. By Fact 8, if GO1 B01 is a
prefix of P then P is a prefix of S (1,1) = L1 and the recurrence is true for i = 1.
Now suppose that the recurrence is true for 1 ≤ i < k. By definition, GOi B0i is
a prefix of Li . Then by Lemma 10, for any position (x, y) ∈ N2 occupied by a
tile of Li + −
→v (i+1,i+1) , we have hi ≤ y ≤ 2hi − 1. Consider a path P producible
 
by T (k,n)
such that GOi B0i is prefix of P for some 1 ≤ i ≤ i. To prove the
recurrence for i + 1, we have to study five cases which are illustrated in Fig. 7.

Fig. 7. Graphical representation of the step of recurrence of the proof of Lemma 13 for
k = 4, n = 10 and i = 3. We represent here a prefix of L3 , note that the remaining
suffix of L3 is in the stripe defined by h2 ≤ y ≤ 2h2 − 1. If a path producible by T (k,n)
creates a conflict with L3 then it has to fork from this prefix by one of its free glue. We
represent the five possible cases and give the main argument to deal with each case.
(Color figure online)
136 P.-É. Meunier and D. Regnault

Case 1: if i < i then by Lemma 10, P is south of Li + − →v (i+1,i+1) . Also,



P is south of the suffix of S (i+1,i+1)
obtained by removing the prefix GOi to
i+1
S (i+1,i+1)
. Thus, there is no conflict between P and L in this case.
Case 2: suppose that P is a prefix of Di+1 then S (i+1,i+1) is a prefix of both
Li+1 and Di+1 . Also, Li + − →v (i+1,i+1) is north of the suffix of Di+1 obtained by
removing the prefix S (i+1,i+1)
to Di+1 . Thus, there is no conflict between P and
i+1
L in this case.
Case 3: if there exists 1 ≤ j < i + 1 such that S (i,j) (G0 + − →
v (i,j) ) is a prefix
i+1
of P . Then, S (i+1,j)
is a prefix of both L and P . Moreover, P can be written
as S (i+1,j) P  where P  − − →
v (i,j) is producible by T (k,n) . Thus by Lemma 10, P0
is the southernmost tile of P  . Then for any position (x, y) ∈ N2 occupied by a
tile of P  , we have y ≥ hi+1 − hj + hj−1 ≥ hi+1 − hi + hi−1 ≥ 2hi . Then P  is
north of Li + − →v (i+1,i+1) . Also, P  is north of the suffix of S (i+1,i+1) obtained by
removing the prefix S (i+1,j) to S (i+1,i+1) . Thus, there is no conflict between P
and Li+1 in this case.
Case 4: suppose that P is prefix of D(i+1,i+1) then S (i+1,i+1) (GOi ) +

−v (i+1,i+1)
is a prefix of both D(i+1,i+1) and Li+1 . Also, Li + − →v (i+1,i+1) is south
(i+1,i+1)
of the suffix of D obtained by removing the prefix S (i+1,i+1) (GOi ) +

−v (i+1,i+1)
to D (i+1,i+1)
. Thus, there is no conflict between P and Li+1 in this
case.
Case 5: if P does no match the previous cases, then by Fact 9, there exists 1 ≤
i < i + 1 such that P can be written as S (i+1,i+1) P  where (GOi ) + − →

v (i+1,i+1)

is a prefix of P . Since i < i + 1 then by recurrence, there is no conflict between
P − −→v (i+1,i+1) and Li . Since S (i+1,i+1) is prefix of P and Li+1 then there is no
conflict between P and Li+1 in this final case.
Thus the recurrence is true and for any path P producible by T (k,n) , if there
exists 1 ≤ i ≤ k such that GOi B0i is prefix a P then there is no conflict between
Lk and P . Since GOk is a prefix of Lk then by Fact 7, the lemma is true.

3.5 Conclusion of the Proof


Now, we obtain our main result by setting the parameters k and n correctly
and by combining the main results of the previous section (Corollary 11 and
Lemmas 12 and 13).

Lemma 14. For all k ∈ N, there exists a path P producible by a tile assembly
system (T , σ, 1) such that:
– |T | = 8hk − hk−1 − 1;
– the width of P is Θ(|T | log3 (|T |));
– for any terminal assembly α ∈ A [T ], asm(P ) is a subassembly of α and the
width and height of α are bounded by Θ(|T | log3 (|T |)).

Proof. Consider k, n ∈ N and the tile assembly system T (k,n) , its set of tile types
is made of 1 tiles types for the seed, n+2 green tiles types, hk −2 orange tile types,
2n blue tile types, hk − hk−1 − 2 red tile types. Thus, we have |T (k,n) | = 3n +
2hk −hk−1 −1. By setting n = 2hk , we obtain that |T (k,n) | = 8hk −hk−1 −1 ≤ 4n.
Non-cooperatively Assembling Large Structures 137

Moreover, a simple induction shows that for any k ≥ 3, we have hk ≤ 3k . Thus,


if k ≥ 3 then k ≥ log3 (n) − 1. Now, this theorem is a corollary of Corollary 11,
Lemmas 12 and 13.

4 Open Questions
Three questions arise from this article. The first one is to improve our construc-
tion by increasing its width or to prove its optimality. The second question is to
characterize the tile assembly systems whose terminal assemblies are finite: is it
possible to build larger finite terminal assembly without relying on this method?
The third question is to investigate if this construction can be achieved in the
directed case: either the directed case is more complex than initially though or
there is a difference in complexity between the directed and non-directed case.

Acknowledgments. We would like to thank Damien Woods for invaluable discus-


sions, comments, and suggestions.

A Make Your Own Large Paths


A python script is available to generate a LATEX document with the same kind
of terminal assembly as in Fig. 6. For any value of the two integers k ≥ 1 and
n ≥ 1 used in this proof, this script is meant to be called in the following way:
$ python positive.py k n
For example, the drawing in Fig. 6 was produced with:
$ python positive.py 3 10
The script is available on https://github.com/P-E-Meunier/largepaths.

References
1. Cannon, S., et al.: Two hands are better than one (up to constant factors).
In: STACS: Proceedings of the Thirtieth International Symposium on Theoret-
ical Aspects of Computer Science, pp. 172–184. LIPIcs (2013). arxiv preprint:
arXiv:1201.1650
2. Cook, M., Fu, Y., Schweller, R.T.: Temperature 1 self-assembly: deterministic
assembly in 3D and probabilistic assembly in 2D. In: SODA: Proceedings of the
22nd Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 570–589 (2011).
arxiv preprint: arXiv:0912.0027
3. Demaine, E.D., et al.: One tile to rule them all: simulating any tile assembly sys-
tem with a single universal tile. In: Esparza, J., Fraigniaud, P., Husfeldt, T.,
Koutsoupias, E. (eds.) ICALP 2014. LNCS, vol. 8572, pp. 368–379. Springer,
Heidelberg (2014). https://doi.org/10.1007/978-3-662-43948-7 31. arxiv preprint:
arXiv:1212.4756
4. Doty, D., Lutz, J.H., Patitz, M.J., Schweller, R.T., Summers, S.M., Woods, D.:
The tile assembly model is intrinsically universal. In: FOCS: Proceedings of the
53rd Annual IEEE Symposium on Foundations of Computer Science, pp. 439–446.
IEEE, October 2012. arxiv preprint: arXiv:1111.3097
138 P.-É. Meunier and D. Regnault

5. Doty, D., Patitz, M.J., Summers, S.M.: Limitations of self-assembly at temperature


1. Theor. Comput. Sci. 412(1–2), 145–158 (2011). arxiv preprint: arXiv:0906.3251
6. Fekete, S.P., Hendricks, J., Patitz, M.J., Rogers, T.A., Schweller, R.T.: Univer-
sal computation with arbitrary polyomino tiles in non-cooperative self-assembly.
In: SODA: ACM-SIAM Symposium on Discrete Algorithms, pp. 148–167. SIAM
(2015). http://arxiv.org/abs/1408.3351
7. Fekete, S.P., Hendricks, J., Patitz, M.J., Rogers, T.A., Schweller, R.T.: Universal
computation with arbitrary polyomino tiles in non-cooperative self-assembly. In:
Indyk, P. (ed.) Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium
on Discrete Algorithms, SODA 2015, San Diego, CA, USA, 4–6 January 2015, pp.
148–167. SIAM (2015). https://doi.org/10.1137/1.9781611973730.12
8. Gilbert, O., Hendricks, J., Patitz, M.J., Rogers, T.A.: Computing in continuous
space with self-assembling polygonal tiles. In: SODA: ACM-SIAM Symposium on
Discrete Algorithms, pp. 937–956. SIAM (2016). arxiv preprint: arXiv:1503.00327
9. Gilbert, O., Hendricks, J., Patitz, M.J., Rogers, T.A.: Computing in continuous
space with self-assembling polygonal tiles (extended abstract). In: Krauthgamer,
R. (ed.) Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on
Discrete Algorithms, SODA 2016, Arlington, VA, USA, 10–12 January 2016, pp.
937–956. SIAM (2016). https://doi.org/10.1137/1.9781611974331.ch67
10. Hendricks, J., Patitz, M.J., Rogers, T.A., Summers, S.M.: The power of duples (in
self-assembly): it’s not so hip to be square. In: Cai, Z., Zelikovsky, A., Bourgeois,
A. (eds.) COCOON 2014. LNCS, vol. 8591, pp. 215–226. Springer, Cham (2014).
https://doi.org/10.1007/978-3-319-08783-2 19. arxiv preprint: arXiv:1402.4515
11. Maňuch, J., Stacho, L., Stoll, C.: Two lower bounds for self-assemblies at temper-
ature 1. J. Comput. Biol. 17(6), 841–852 (2010)
12. Meunier, P.É., Patitz, M.J., Summers, S.M., Theyssier, G., Winslow, A., Woods,
D.: Intrinsic universality in tile self-assembly requires cooperation. In: SODA:
Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, pp. 752–771
(2014). arxiv preprint: arXiv:1304.1679
13. Meunier, P., Woods, D.: The non-cooperative tile assembly model is not intrinsi-
cally universal or capable of bounded Turing machine simulation. In: STOC: Pro-
ceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing,
pp. 328–341 (2017)
14. Padilla, J.E., Patitz, M.J., Schweller, R.T., Seeman, N.C., Summers, S.M., Zhong,
X.: Asynchronous signal passing for tile self-assembly: fuel efficient computation
and efficient assembly of shapes. Int. J. Found. Comput. Sci. 25(4), 459–488 (2014).
arxiv preprint: arxiv:1202.5012
15. Patitz, M.J., Schweller, R.T., Summers, S.M.: Exact shapes and turing univer-
sality at temperature 1 with a single negative glue. In: Cardelli, L., Shih, W.
(eds.) DNA 2011. LNCS, vol. 6937, pp. 175–189. Springer, Heidelberg (2011).
https://doi.org/10.1007/978-3-642-23638-9 15. arxiv preprint: arXiv:1105.1215,
http://dl.acm.org/citation.cfm?id=2042033.2042050
16. Rothemund, P.W.K.: Theory and experiments in algorithmic self-assembly. Ph.D.
thesis, University of Southern California, December 2001
17. Rothemund, P.W.K.: Folding DNA to create nanoscale shapes and patterns. Nature
440(7082), 297–302 (2006). https://doi.org/10.1038/nature04586
18. Rothemund, P.W.K., Winfree, E.: The program-size complexity of self-assembled
squares (extended abstract). In: STOC: Proceedings of the Thirty-Second Annual
ACM Symposium on Theory of Computing, pp. 459–468. ACM, Portland (2000).
http://doi.acm.org/10.1145/335305.335358
Non-cooperatively Assembling Large Structures 139

19. Soloveichik, D., Winfree, E.: Complexity of self-assembled shapes. SIAM J. Com-
put. 36(6), 1544–1569 (2007)
20. Thubagere, A.J., et al.: A cargo-sorting DNA robot. Science 357(6356), eaan6558
(2017)
21. Winfree, E.: Algorithmic self-assembly of DNA. Ph.D. thesis, California Institute
of Technology, June 1998
22. Winfree, E.: Simulations of computing by self-assembly. Technical report, Caltech
CS TR:1998.22, California Institute of Technology (1998)
23. Yurke, B., Turberfield, A.J., Mills, A.P., Simmel, F.C., Neumann, J.L.: A DNA-
fuelled molecular machine made of DNA. Nature 406(6796), 605–608 (2000)
Simulation of Programmable Matter
Systems Using Active Tile-Based
Self-Assembly
John Calvin Alumbaugh1 , Joshua J. Daymude2 , Erik D. Demaine3 ,
Matthew J. Patitz1(B) , and Andréa W. Richa2
1
Department of Computer Science and Computer Engineering,
University of Arkansas, Fayetteville, AR, USA
mpatitz@self-assembly.net
2
Computer Science, CIDSE, Arizona State University, Tempe, AZ, USA
{jdaymude,aricha}@asu.edu
3
MIT Computer Science and Artificial Intelligence Laboratory,
Cambridge, MA, USA
edemaine@mit.edu

Abstract. Self-assembly refers to the process by which small, simple


components mix and combine to form complex structures using only local
interactions. Designed as a hybrid between tile assembly models and cel-
lular automata, the Tile Automata (TA) model was recently introduced
as a platform to help study connections between various models of self-
assembly. However, in this paper we present a result in which we use TA
to simulate arbitrary systems within the amoebot model, a theoretical
model of programmable matter in which the individual components are
relatively simple state machines that are able to sense the states of their
neighbors and to move via series of expansions and contractions.
We show that for every amoebot system, there is a TA system capa-
ble of simulating the local information transmission built into amoebot
particles, and that the TA “macrotiles” used to simulate its particles are
capable of simulating movement (via attachment and detachment oper-
ations) while maintaining the necessary properties of amoebot particle
systems. The TA systems are able to utilize only the local interactions of
state changes and binding and unbinding along tile edges, but are able
to fully simulate the dynamics of these programmable matter systems.

Keywords: Programmable matter · Simulation · Self-assembly ·


Tile Automata · Amoebot model

1 Introduction
Theoretical models of self-assembling systems are mathematical models that
allow for the exploration of the limits of bottom-up construction and self-
Daymude and Richa are funded in part by the National Science Foundation under
awards CCF-1422603, CCF-1637393, and CCF-1733680. Alumbaugh and Patitz are
funded in part by National Science Foundation Grants CCF-1422152 and CAREER-
1553166.
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 140–158, 2019.
https://doi.org/10.1007/978-3-030-26807-7_8
Simulating Programmable Matter with Self-Assembly 141

assembly via simple (usually square) tiles. There are a wide variety of tile-
based models of self-assembly (e.g., [13,14,16,17,20–22]), each with differing
constraints and dynamics, resulting in great variations in the relative powers
between systems. One of the easiest ways to evaluate their relationships is to
use notions of simulation to attempt to simulate one model by another, and this
has led to the creation of a “complexity hierarchy” of self-assembly models and
categories of systems [8,12,15,18,23].
Another category of theoretical models attempts to capture the dynamics
of so-called programmable matter, in which small and simple, but dynamic and
mobile, components are able to interact with each other to form structures,
perform tasks and computations, etc. [7,24].
This paper attempts to bridge the divide between these categories of mod-
els, showing how self-assembling tiles can mimic the behaviors of programmable
matter. Specifically, we demonstrate how the recently introduced Tile Automata
(TA) model [5] can be used to simulate the amoebot model [7]. In the TA model,
the fundamental components are unit square tiles which form structures by
attaching and forming bonds, and can also change states based on their own
states and those of their neighbors, causing them to be able to form new bonds
or to remove existing bonds. The basic components in the amoebot model are
particles which can also change their states based on the current states of them-
selves and their neighbors, but which can also move via series of expansions
and contractions. While the components of both models rely only upon local
information and communication, the design goals of their systems tend to dif-
fer fundamentally. The main goal of TA systems is to self-assemble into target
structures, but amoebot systems have been used to solve system-level problems
of movement and coordination (e.g., shape formation [9], object coating [10],
leader election [6], gathering [4], bridging gaps [2], etc.). We present a construc-
tion in which constant-sized assemblies of TA tiles, called macrotiles, assemble
and disassemble following the rules of the TA model and are able to simulate
the behaviors of individual amoebot particles. Via carefully designed processes
of building and breaking apart assemblies, they are collectively able to correctly
simulate the full dynamics of amoebot systems. We thus show how the dynamics
of systems of self-assembling tiles with the ability to form and break bonds can
be harnessed to faithfully simulate the dynamics of collections of programmable
matter particles capable of local communication and motion. Not only does
this provide a way to connect and leverage existing results across models, this
also provides a new paradigm for designing systems to accomplish the goals of
programmable matter. It additionally allows amoebots to serve as a higher-level
abstraction for designing systems exhibiting complex behaviors of programmable
matter but with a translation to implementation in TA.
The paper is organized as follows. Section 2 presents a high-level definition of
the TA model, and Sect. 3 provides a full mathematical definition for the amoebot
model. (We note that this is the first full mathematical definition for the amoebot
model and thus is also a contribution of this paper.) Section 4 gives the formal
definition, preliminaries, and overview of the simulation of the amoebot model
142 J. C. Alumbaugh et al.

by TA, while Sect. 5 gives more of its details. A brief discussion and conclusion
are given in Sect. 6. Due to space constraints, not all details are contained in this
version. Please see [1] for an additional Technical Appendix containing a more
rigorous definition of the TA model, as well as low-level technical details about
the construction.

2 The Tile Automata Model

The Tile Automata model seeks to connect and evaluate the differences between
some of the seemingly disparate models of tile-based self assembly by combining
components of the Two Handed Assembly Model (2HAM) of self-assembly with a
rule set of local state changes that are similar to asynchronous cellular automata.
This section provides an overview of the TA model which is sufficient for the
purposes of this paper, however a more thorough and detailed definition of the
TA model is available in the technical appendix, which is based on [5] (Fig. 1).

Fig. 1. Example of a TA system. The five components that define a TA system con-
stitute the left and middle columns of this figure, while the rightmost boxes indicate
producible and terminal assemblies.

The Tile Automata Model has many similarities with other tile based self
assembly systems. Tiles, the fundamental units of this model that interact with
one another, use only local information, in this case the state of their neighbors.
Tiles exist as a stateful unit square centered on a point on the square lattice
over the integers in two dimensions, so that a tile’s coordinates (x, y) ∈ Z2 . Tiles
may form bonds with adjacent neighbors via attaching to one another according
to the affinity function, which defines a set of two states and either a vertical
or horizontal relative orientation (denoted as ⊥ and , respectively) as well as
Simulating Programmable Matter with Self-Assembly 143

an attachment strength. A connection between tiles or groups of connected tiles


must have the property of τ stability to persist. Every TA system has defined
an integer stability threshold or τ that represents the minimum strength bond
with which tiles must be bound in order to be τ stable. Two adjacent tiles of
states s, s , with the tile of state s directly to the right of the tile of state s , will
form an attachment if there exists a rule in the affinity function (s  s ≥ τ ). An
assembly is a τ stable connected set of TA tiles, with the property that there
exists no way to separate the tiles without breaking bonds of at least τ strength.
Further, a pair of tiles may transition according to a transition rule that takes
as input two adjacent tiles (oriented by either ⊥ or ) and outputs new states
for those tiles. So the tiles in our example of s  s may transition to states t  s
if there exists a rule in the set of transition rules provided in the definition of a
TA system of the form (s , s, t, s, ), where (s , s) are the input states, (t, s) are
the output states, and  is their relative orientation.

Fig. 2. Depiction of signal S being passed down a wire. The W tiles represent wires in
their default state, and the grey tiles above and below the wire are filler tiles. Starting
in state in (a) and a transition rule (SW  SS), the signal propagates down the wire
in (b) and (c).

2.1 Wire Transmission

One of the most useful aspects of the Tile Automata model is the tiles’ ability
to transition states based on local information. This capability makes commu-
nication from one group of tiles to another, non-adjacent group easy, with a
structure we will call a wire. A wire in TA is a contiguous line of tiles from one
group of tiles to another, usually surrounded by inert filler tiles so as to avoid
interference with the signal being transmitted. (See Fig. 2 for an example.)

3 The Amoebot Model


Introduced in [11], the amoebot model is an abstract computational model of
programmable matter, a substance that can change its physical properties based
on user input or stimuli from its environment. The amoebot model envisions
programmable matter as a collection of individual, homogeneous computational
elements called particles. In what follows, we extend the exposition of the model
in [7] to the level of formality needed for our simulation.
Any structure a particle system can form is represented as a subgraph of an
infinite, undirected graph G = (V, E) where V is the set of positions a particle
144 J. C. Alumbaugh et al.

can occupy and E is the set of all atomic movements a particle can make. Each
node in V can be occupied by at most one particle at a time. This work further
assumes the geometric amoebot model where G = GΔ , the triangular lattice with
nearest neighbor connectivity (see Fig. 3a). This lattice is preferred for work in
the 2D plane, as it allows for a maximum of nearest neighbor connectivity for
particles moving step wise around the perimeter of the particle swarm. Particles
attempting to move around a “corner” of a particle swarm risk disconnection
with the neighborhood implied by nearest neighbor connectivity on the square
lattice. Each particle occupies either a single node in V (i.e., it is contracted ) or
a pair of adjacent nodes in V (i.e., it is expanded ), as in Fig. 3b. Two particles
occupying adjacent nodes of GΔ are neighbors. We further will define a group of
particles as a particle system.

Fig. 3. (a) A section of the triangular lattice GΔ (black) and its dual, the hexagonal
tiling (gray). (b) Expanded and contracted particles (black dots) on GΔ (gray lattice).
Particles with a black line between their nodes are expanded. (c) Two particles with
different orientations. The expanded particle’s tail port would be 6 if its head were the
upper node; the contracted particle’s tail port is ε.

Each particle keeps a collection of ports—one for each edge incident to the
node(s) it occupies—that have unique labels from its own perspective. Con-
tracted particles have six ports while expanded particles have ten (see Fig. 3c).
The particles are assumed to have a common sense of clockwise direction (a.k.a.
chirality), but do not share a coordinate system or global compass. Thus, par-
ticles can label their ports in clockwise order starting from a local direction 0,
but may have different orientations in O = {0, 1, ..., 5} encoding their offsets for
local direction 0 from global direction 0 (to the right).
For example, in Fig. 3c, the particle on the right has orientation 0 (i.e., it
agrees with the global compass) while the particle on the left has orientation 4
(i.e., its local direction 0 is global direction 4). When a particle expands, it keeps
its port labeling consistent by assigning label 0 to a port facing local direction
0 and then labeling the remaining ports in clockwise order.1 In this way, it can
recover its original labeling when it later contracts. A particle p communicates
1
Note that there may be ambiguity in choosing a port facing local direction 0; e.g.,
in Fig. 3c, both port 0 and port 8 face local direction 0. In this case, the port facing
local direction 0 and “away” from the particle is labeled 0.
Simulating Programmable Matter with Self-Assembly 145

with a neighbor q by placing a flag from the constant-size alphabet Σ on its port
facing q. This can be thought of as p sending a message for q to read when q is
next activated. Conversely, p receives information from q by reading the flag q
has placed on its port facing p. The flag alphabet Σ is assumed to contain the
“empty flag”  to be used when no information is being communicated.
Particles move via a series of expansions and contractions: a contracted par-
ticle can expand into an unoccupied adjacent node to become expanded, and
may then contract to occupy a single node once again. An expanded particle’s
head is the node it last expanded into and the other node it occupies is its tail ;
a contracted particle’s head and tail are the same. If an expanded particle con-
tracts into its head node, it has moved. Otherwise, contracting back into its tail
node can be thought of as the particle exploring a potential location to which it
could expand but deciding not to over the course of two activations. Neighboring
particles can coordinate their movements in a handover, which can occur one of
two ways. A contracted particle p can “push” an expanded neighbor q by expand-
ing into one of the nodes occupied by q, forcing q to contract. Alternatively, an
expanded particle q can “pull” a contracted neighbor p by contracting, forcing
p to expand into the node it is vacating. During its movements, each particle
maintains a tail port in T = {0, 1, . . . , 9} ∪ {ε} denoting the port furthest from
its head if it is expanded or ε if it is contracted (see Fig. 3c). This information
serves as the particle’s memory about whether or not it is expanded, and, if so,
what direction its tail is relative to its head.
More formally, the set of all possible movements is M = {idle} ∪ {expandi :
i ∈ 0, 1, . . . , 5} ∪ {contracti : i ∈ 0, 1, ..., 9} ∪ {handoveri : i ∈ 0, 1, ..., 5}. An
idle move simply means the particle does not move. If a particle p performs
expandi , p expands into the node its i-th port faces only if p is contracted and
that node is unoccupied. If a particle p performs contracti , p contracts out of
the node incident to its i-th port only if p is expanded. The handoveri moves are
not push or pull handover specific, nor do they actually perform the handover
movements described above. Instead, a particle p performs handoveri when it
initiates a handover with the neighbor its i-th port faces, say q. This initiation
only succeeds if a neighboring particle q actually exists and p is contracted
while q is expanded (or vice versa). To aid in executing the initiated handover—
which will be described shortly—each particle keeps an expansion direction in
E = 0, 1, ..., 5 ∪ {} denoting the local direction it would like to expand in or 
if no expansion is needed.
The amoebot model assumes that particle systems progress by individual
particles performing atomic actions asynchronously, where each particle inde-
pendently and continuously executes its own instance of the given algorithm at
potentially varying speeds. Assuming any conflicts that may arise in this con-
current execution are resolved—as is the case in the amoebot model, see [7]—a
classical result under the asynchronous model states that there is a sequential
ordering of atomic actions producing the same end result. Thus, we assume there
is an activation scheduler responsible for activating exactly one particle at a time.
This scheduler is assumed to be fair : each particle is assumed to be activated
146 J. C. Alumbaugh et al.

infinitely often. When a particle p is activated by the scheduler, it computes its


transition function δ and applies the results:

δ : Q × Σ 10 × T × E → P(Q × Σ 10 × T × E × M ).
For a given algorithm under the amoebot model, Q is a constant-size set
of particle states while the flag alphabet Σ, the tail ports T , the expansion
directions E, and the movements M are as defined above. The transition function
δ allows a particle to use its state, its neighbors’ flags facing it, its tail port, and
its expansion direction to update these values and decide whether to move. If δ
maps a unique input to multiple outputs, one output set is chosen arbitrarily. δ
largely depends on the algorithm being executed; here, we describe a few general
rules for δ our simulation will consider. Suppose that δ(q, (f0 , f1 , . . . , f9 ), t, e) =
(q  , (f0 , f1 , . . . , f9 ), t , e , m ).

– The movement m must be valid according to the defined movement rules;


e.g., if m = expandi , particle p must be contracted and the node its i-th port
faces must be unoccupied.
– If t = ε, then f6 = · · · = f9 = ; i.e., if particle p is contracted, it cannot set
flags for ports it doesn’t have. This holds also for t and (f6 , . . . , f9 ).
– If e = , then t = ε; i.e., particle p can only intend to expand in local direction
e if it is contracted. This holds also for e and t .
– If m = expandi , then t = ε and e = ; i.e., if particle p expands in local direc-
tion i, it will be expanded (setting t to the label opposite i after expansion)
and should not intend to expand again immediately.
– If e = , then either m = expande or m = idle. That is, if particle p intends
to expand in local direction e this activation, it either does so or has to wait.
– If m = contracti , then t = ε.

It remains to describe how handovers are executed with respect to δ. In a


concurrent execution, a handover is performed as a coordinated, simultaneous
expansion and contraction of two neighboring particles. In our sequential setting,
however, we instead use a local synchronization mechanism to ensure the con-
tracting particle moves first, followed by the expanding particle. To achieve this,
we make one change to the scheduler. Whenever a particle p returns a movement
m = handoveri as output from δ, the scheduler finds the neighbor q facing the
i-th port of p and ensures that the next three particles to be activated are q,
then p, then q again.2 We first describe a pull handover initiated by an expanded
particle p with a contracted neighbor q.

1. Suppose p is chosen by the scheduler. Based on its state, its neighbors’ flags
facing it, its tail port indicating it is expanded, and its (empty) expansion
direction, suppose δ returns m = handoveri . δ must also set fi to a handover
flag indicating that p has initiated a handover with its neighbor.

2
Note that this forced scheduling is simply a result of our formalism and does not
alter or subvert the underlying asynchrony assumed by the amoebot model.
Simulating Programmable Matter with Self-Assembly 147

2. On seeing m = handoveri returned, the scheduler finds neighbor q (the neigh-


bor faced by the i-th port of p) and schedules [q, p, q] as the next three particles
to be activated. It activates q.
3. Based on the inputs to δ for particle q, and in particular the handover flag fj
from p and the fact that it is contracted, δ must evaluate such that q sets fj
as a will-expand flag, sets e = j, and sets m = idle.
4. The scheduler now has [p, q], so it activates p.
5. Based on the inputs to δ for particle p, and in particular the will-expand flag
fi from q, δ must evaluate such that it clears fi =  and sets m = contracti
(setting t = ε, following the rules above). Thus, it contracts.
6. The scheduler now has [q], so it activates q.
7. Based on the inputs to δ for particle q, and in particular its expansion direc-
tion e = j, δ must evaluate such that q clears fj =  and sets m = expande
(setting t to the corresponding tail port opposite e).
8. The scheduler has no queued activations, so it chooses arbitrarily but fairly.
A push handover initiated by a contracted particle p with an expanded neigh-
bor q is handled similarly. The first activation of p is the same as Step 1 above,
causing the scheduler to do the same queuing as in Step 2. However, in Step
3, q sees the handover flag but also that it is expanded, meaning this is a push
handover. Note, however, that a push handover is symmetric to a pull handover
with the exception of which particle initiates; i.e., p performing a push handover
with q yields the same result as q performing a pull handover with p. So, on
seeing this is a push handover, q simply proceeds as particle p starting in Step
1, effectively exchanging roles with p.
The configuration of a particle p is C(p) = (v, o, q, t, e, (f0 , . . . , f9 )), where
v ∈ V is the coordinates of its head node, o ∈ O is its orientation, q ∈ Q
is its state, t ∈ T is its tail port, e ∈ E is its expansion direction, and each
fi ∈ Σ is the flag on its i-th port, for i ∈ {0, 1, . . . , 9}. Note that although
the configuration of a particle p includes all information needed to reconstruct
p, particle p itself does not have access to any global information or unique
identifiers; in particular, it has no knowledge of v or o. The configuration of
a particle system P is C ∗ (P ) = {C(p) : p ∈ P }, the set of all configurations
of particles in P . A system configuration is valid if no two particles in the
system occupy a common node in GΔ . We define C(P ) to be the set of all
valid system configurations of P . An amoebot system is defined as a 5-tuple
A = (Q, Σ, δ, P, σ), where Q is a constant-size set of particle states, Σ is a
constant-size alphabet of flags, δ is the transition function, P is the particle
system, and σ ∈ C(P ) is the initial system configuration of A mapping each
particle to its starting configuration.
For system configurations α, α ∈ C(P ), where α = α , we say α yields α
(denoted α →A α ) if α can become α after a single particle activation. We use
α →A  
∗ α if α yields α in 0 or more activations. A sequence of configurations
(α0 , α1 , . . . , αk ) is a valid transition sequence if for every i ∈ [k] we have αi ∈
C(P ), αi = αi+1 , and αi →A αi+1 . A configuration α ∈ C(P ) is called reachable
if there exists a valid transition sequence beginning at the initial configuration
148 J. C. Alumbaugh et al.

σ and ending at α. A configuration α ∈ C(P ) is called terminal if there is no


configuration α ∈ C(P ) such that α →A α . A set of configurations Γ ⊆ C(P )
is called terminal if for all α ∈ Γ there is no configuration α ∈ Γ such that
α →A α (i.e., no configuration in Γ can transition to any configuration outside
of Γ ). An amoebot system A = (Q, Σ, δ, P, σ) is called directed if every transition
sequence from σ leads to the same terminal configuration, or directed to set Γ
if every transition sequence from σ leads to a configuration in Γ . Finally, given
a shape S (i.e., a connected set of nodes in GΔ ), we say that system A forms
shape S if and only if, for some set of configurations Γ ⊆ C(P ), A is directed
to Γ and for every α ∈ Γ , the locations of the particles in α are exactly the
locations of S (up to translation and rotation).

4 Simulating Amoebot Systems with Tile Automata

In this section, we present our main result, which is a construction that takes
as input an amoebot system and which outputs a Tile Automata system that
simulates it. However, we must first define what we mean by the term “simulate”
in this context.

4.1 Defining Simulation

Intuitively, our simulation of an amoebot sys-


tem by a Tile Automata system will consist of
groups of tiles, called macrotiles, which each
represent a single amoebot particle. Starting
from an assembly which maps (via a mapping
function to be described) to the initial config-
uration of an amoebot system, singleton tiles
as well as macrotiles will attach, detach, and
change states. Any changes to the assembly,
modulo a scale factor, will map to new, valid
configurations of the amoebot system. Con-
versely, for any valid configuration change of
the amoebot system, the assembly will be
able to change in such a way that it repre- Fig. 4. A portion of the tessellation
sents the new amoebot configuration, under by the macrotile shape of our con-
the mapping function. struction (shown in Figs. 6 and 5)
A macrotile is a connected, finite region with an overlay of GΔ .
of the plane Z2 , whose shape can be any polyomino composed of connected
unit squares. For a macrotile shape M to be valid to use for a simulation, it
must tessellate. Since we are defining simulation of amoebot systems, which are
embedded in the triangular grid, by Tile Automata, which are embedded in the
square grid, a further condition is required for macrotile shapes. Let T(M ) be a
tessellation of the plane by macrotiles of shape M . Let G be the graph formed
where every node is a macrotile in T(M ) and there is an edge between a pair
of nodes if and only if they are adjacent to each other in T(M ). Then, graph G
Simulating Programmable Matter with Self-Assembly 149

must be isomorphic to the triangular grid graph (i.e. the graph of the triangular
grid where each intersection is a node). This means each macrotile has the same
6-neighbor neighborhood as nodes in the triangular grid graph (see Fig. 4).
Let v be the coordinates of a node in GΔ , and let mv be the macrotile location
which corresponds to it. Given Tile Automata system Γ and its set of producible
assemblies PRODΓ , for assembly A ∈ PRODΓ , let α ∈ A be a positioned assembly
of A, and let α|mv be the (possibly empty) subassembly of α contained in the
locations of mv . Given Γ and an amoebot system A = (Q, Σ, δ, P, σ), a macrotile
representation function R, from Γ to A, is a function which takes as input the
portion of an assembly contained within a single macrotile locations, and which
returns either information about the configuration of an amoebot particle from
P , or  (which maps to empty space). That is, given some α|mv , R(α|mv ) ∈
{(t, e, o, q, (f0 , f1 , ..., f9 )) | t ∈ T , o ∈ O, q ∈ Q, e ∈ E, and fi ∈ Σ} ∪ {}, where
t ∈ T is the relative direction of a particle’s tail from its head, o ∈ O is its
orientation offset, q ∈ Q is its state, and each fi ∈ Σ, for 0 ≤ i < 9, is the flag
in its ith port. An assembly representation function, or simply representation
function, R∗ from Γ to A takes as input an entire positioned assembly of Γ
and applies R to every macrotile location and returns a corresponding amoebot
system configuration from C(P ).
For a positioned assembly α ∈ PRODΓ such that R∗ (α) = α ∈ C(P ), α
is said to map cleanly to α under R∗ if for all non empty blocks α|mv ∈
dom α, v ∈ dom α or v  ∈ dom α for some v  = v + u where u ∈
{(1, 0), (0, 1), (−1, 0), (0, −1), (−1, 1), (1, −1)}. In other words, α may have tiles
in a macrotile location representing a particle in α , or empty space in α but
only if that position is adjacent to a particle in α . We call such growth “around
the edges” of α fuzz and thus restrict it to be adjacent to macrotiles representing
particles.
Note that the following definitions of follows, models, and simulates, as well as
the previous definitions of macrotiles, fuzz, etc. are based upon similar definitions
used to prove results about simulation and intrinsic universality in [8,12,18,19]
and several other papers.
Definition 1 (A follows Γ ). Given Tile Automata system Γ , amoebot system
A, and assembly representation function R∗ from Γ to A, we say that A follows
Γ (under R), and we write A R Γ , if α →Γ β, for α, β ∈ PRODΓ , implies that
R∗ (α) →A ∗
∗ R (β).

Definition 2 (Γ models A). Given Tile Automata system Γ , amoebot system


A = (Q, Σ, δ, P, σ), and assembly representation function R∗ from Γ to A, we
say that Γ models A (under R), and we write Γ |=R A, if for every α ∈ C(P ),
there exists Ψ ⊂ PRODΓ where R∗ (α ) = α for all α ∈ Ψ , such that, for every
β ∈ C(P ) where α →A β, (1) for every α ∈ Ψ there exists β  ∈ PRODΓ where
R∗ (β  ) = β and α →Γ β  , and (2) for every α ∈ PRODΓ where α →Γ β  , β  ∈
PRODΓ , R∗ (α ) = α, and R∗ (β  ) = β, there exists α ∈ Ψ such that α →Γ α .
Definition 2 essentially specifies that every time Γ simulates an amoebot con-
figuration α ∈ C(P ), there must be at least one valid growth path in Γ for each
150 J. C. Alumbaugh et al.

of the possible next configurations that α could transition into from α, which
results in an assembly in Γ that maps to that next step.
Definition 3 (Γ simulates A). Given Tile Automata system Γ , amoebot sys-
tem A, and assembly representation function R∗ from Γ to A, if A R Γ and
Γ |=R A, we say that Γ simulates A under R.
With the definition of what it means for a Tile Automata system to simulate
an amoebot system, we can now state our main result.
Theorem 1. Let A be an arbitrary amoebot system. There exists a Tile
Automata system Γ and assembly representation function R∗ from Γ to A such
that Γ simulates A under R. Furthermore, the simulation is at scale factor 100.
To prove Theorem 1, we let A = (Q, ΣA , δ, P, σ) be an arbitrary amoe-
bot system. We will now show how to construct a Tile Automata system
Γ = (ΣΓ , Λ, Π, Δ, τ ) such that Γ simulates A at scale factor 100. The rest
of this section contains details of our construction.

4.2 Construction Definitions


Neighborhood - In the geometric amoebots model, particles are aware of the
occupation of all locations on the lattice adjacent to their own. The neighborhood
of a given location on the lattice is the set of its six neighbors. Pertaining to a
particle, we say that a particle’s neighborhood is the set all particles occupying
adjacent locations on the lattice, defined by N (p), where p is a particle. Note
that |N (p)| ≤ 6 if p is contracted and 10 if it is expanded.
Macrotile - A τ -stable assembly of TA tiles g such that the macrotile represen-
tation function R maps g to a valid particle in A. This simulation makes use of
macrotiles with an approximately hexagonal shape and special tiles within each
macrotile used to calculate information about its movement and neighborhood.
See Fig. 5 for an overview.
Clock Tiles - The tiles at the middle of every particle macrotile used to keep
track of state, flags, T value, and neighborhood information. The middle clock
tile is responsible for maintaining the particle’s state q ∈ Q, and the surrounding
clock tiles (called subordinate clock tiles) combine information from the particle
edges and neighbors to pass into the central clock tile.
Wire Tiles - Rows of tiles leading from the bank of clock tiles in the middle of
every macrotile to each edge, purposed with transmitting information from the
clock to the neighboring tiles and available edges.
Filler Tiles - Tiles that serve no function within a macrotile other than to
maintain connectivity with other components and shape the macrotile.
Flag Tiles - Exposed wire ends on each side of the tile responsible for main-
taining flag states from Σ in A, as well as reading flags from their respective
neighbors. Neighboring flags are retrieved via wire transmission.
Simulating Programmable Matter with Self-Assembly 151

Timing Tiles - Individual tiles in Γ that diffuse into specific slots in the particle
macrotiles that “start” that particle’s turn, and disconnect after the turn is
finished. Timing tiles are inert except for connecting to a central clock tile, and
serve as the “asynchronous clock” for our simulation.
 Tiles - Individual tiles in Γ that attach to the available flag tiles of macrotiles
with non-full neighborhoods who are querying or attempting to lock their neigh-
borhood flags.  tiles can only attach to the exposed end of a wire displaying
a lock or query signal flag. After attaching, they serve only to undergo a single
state transition, which indicates to the wire end that there exists no neighbor
there. After this transition, the wire propagates this information back to its clock
bank and the  tile detaches.
Floating Macrotile - These macrotiles (“floats”), will represent (portions of)
particles in A but are not connected to the swarm. They attach to valid sites
along the perimeter and simulate the “head” of an expanding particle.
Configuration Tile - After macrotiles complete their turn, they combine
all values of their configuration of which they are aware (q ∈ Q, e ∈
E, (f0 , f1 , ..., f9 ∈ Σ 10 ), t ∈ T ) into a single tile proximal to the clock bank
called the Configuration Tile. When a macrotile is engaging in an expansion or
handover move, the configuration tile is used by the representation function R
to map the active macrotile to its previous configuration, until the transition
completes. An active macrotile engaged in these moves will be mapped by its
configuration tile until it’s no longer displaying a flag indicating it is engaged in
either an expansion or handover on any of its wires, ensuring the simulation of
an atomic move. (For a more complete explanation, see appendix B of [1]s.)

4.3 Simulation Overview


The simulation of A by Γ is affected
with the assistance of the hexagonal
macrotiles and the signals implemented
via TA state transitions. In [5], since there
were only four directions from which sig-
nals could come, it was sufficient for each
macrotile to have one clock tile, which
would transition its own state based on
Fig. 5. Blue tiles are subordinate clock
signals received from wires and send its
tiles, dark blue is the central clock tile,
state down the wires. Since the geometric green tiles wires, and grey tiles filler.
amoebots model exists on the GΔ , signals The empty location immediately east
can come from up to six directions, neces- of the central clock tile is where the
sitating the use of multiple clock tiles. timing tile attaches to signal the cen-
Figure 5 contains a high-level depiction of tral clock tile to begin the turn. Flags
a macrotile in Γ that simulates a particle are displayed on the the outermost tile
of A. of every wire. (Color figure online)
Figure 6 illustrates a simple example
of simulated particle movement. Macrotiles must be initially arranged into a
152 J. C. Alumbaugh et al.

configuration α that under R∗ (α) maps to a valid configuration α ∈ C(P ),


with connected edges representing adjacency in α . Macrotiles start with their
respective states, flags, and t values set to whatever those states are for the
corresponding particle in α . Swarm macrotiles may then begin to accept tim-
ing tiles, starting their turns. We use neighborhood lock signals to ensure that
no particles that are in the same neighborhood attempt to move at the same
time, avoiding asynchronous conflicts. Expansion is facilitated by the attachment
along perimeter sites of floating macrotiles. The authors additionally considered
systems where moves progressed by growing a new macrotile wherever a par-
ticle wanted to expand, but this construction technique requires a longer wait
between neighborhood locks and unlocks. In the interest of minimizing the over-
head that simulation requires, we wanted to minimize the amount of time that
a neighborhood had to be locked in order to encourage collaborative movement,
and decided to use prefabricated floating macrotiles.
Once a particle macrotile has received a timing tile, it only continues its
turn if it is not already locked by a neighbor. If the particle is not locked down,
then the active macrotile sends signals to all of its neighbors to lock down its
neighborhood and it can continue without fear of causing conflict. Should two
lock signals be traveling towards each other along a shared wire between two
macrotiles, whichever signal is first carried into the other macrotile’s wires via
state transitions overwrites the signal originating from the slower macrotile, and
the faster propagating signal’s originator locks down the slower. The neighboring
flags are needed to simulate the transition function, and are sent from neighbors
to the active macrotile via wire transmission. Once the active macrotile has
decided its new state, flags, and move, it updates this information and attempts
to execute its chosen move. If the move is a simple expansion, it marks the site
where it wants to expand with a valid attachment signal and keeps the neigh-
borhood locked until a floating macrotile connects to it, representing the “head”
of the expanding particle. If the particle chooses to contract, it sends signals to
the tail to detach from the swarm, whereupon it will become another float, and
then unlocks its neighborhood. If the particle chose a handoveri , it performs some
additional checks to ensure viability and then sends signals either “taking over”
one of a neighboring expanded particle’s macrotiles, or ceding control of one of
its macrotiles to a neighboring tile. In the case of handoveri , an additional state
and flags for the subordinate particle are returned from the transition function,
to be propagated from the active macrotile to the subordinate macrotile via wire
transmissions as control of the macrotile changes hands.

5 Simulation of Movement
Before the simulation begins, given A with initial configuration σ, we pro-
duce Λ for Γ which consists of a connected configuration of macrotiles, each
macrotile mapping to a corresponding particle in σ under R. To capture the
asynchronous nature of amoebot particle activations, we utilize timing tile diffu-
sion into macrotiles to “activate” them for their turns. After attachment, the tile
Simulating Programmable Matter with Self-Assembly 153

Fig. 6. Particle B simulates movement by allowing a float to attach to a free edge,


then detaching the original macrotile representing particle B over the course of two
activations.

sends a signal to the central clock to start its turn. After a given macrotile has
started its turn and has successfully locked its neighborhood, it gathers all infor-
mation necessary for its transition function via wire-propagated signals (detailed
in the technical appendix). To ensure that the transition function affected by
macrotiles is isomorphic to the transition function affected by A, we combine
all of the flags, e and t values (resulting in a |Σ 10 | ∗ |t| ∗ |e| increase in state
complexity for clock tiles) into the tile to the left of the central clock tile. Once
this value is at that tile, the central clock tile, which holds the state, undergoes
a state transition defined in the construction of Δ.
Once the new state, flags, and move are produced, the particle propagates its
flags down their respective wires and in the case that handoveri is returned for
the value of m, the particle additionally sends a signal (detailed in the technical
appendix) to its ith neighbor to ensure that the neighbor has the proper orien-
tation to facilitate that move. For expandi , the active macrotile sends a signal
down the wire in the ith direction that allows a float to attach to that edge.
After connection of a float, the active macrotile further sends a CopySignal
to the newly attached float so the new float can copy the states and relevant
flags of the expanding macrotile and fully become the head. The float sends an
AcknowledgementSignal after it is displaying the proper state and flags, which
tells the newly expanded macrotile that it’s safe to unlock its neighborhood.
For contracti , the expanded macrotile sends a Detach signal to the macrotile
that contains the ith port. After detachment, the recently contracted macrotile
unlocks its neighborhood. For idle, states and flags may be updated, but no
change to the orientation of the simulated particles occurs. Once a macrotile
executing an idle move changes its state and sends the new flags to its flag tiles,
it unlocks its neighborhood and ends its turn. Figure 7 depicts the series of steps
of a move containing a handover, which is described in the following section.
154 J. C. Alumbaugh et al.

Fig. 7. (1) The initial configuration of a subset of a valid swarm. Note that only A has a
purple timing tile to the right of its Central Clock tile. (2) The flow of the LockSignali
sent out from A’s CC tile. (3) The responses from A’s wires flow back to the CC tile.
Unoccupied edges allow for the attachment of yellow epsilon tiles, which indicate to
a given wire that it has no macrotile neighbor. A has no neighbors attempting their
own move, and is safe to continue its move. (4) A is attempting to execute a handover,
and so must check to ensure that the subordinate particle it intends to use is in the
proper configuration. It sends out a handoverConf irmi signal, to which B responds
with an Acknowledgement signal containing B’s t value. (5) Since B is in the proper
configuration to enable a handoverP ushi , A continues by sending a handoverP ushi
signal to the subordinate macrotile it wants to take over. The subordinate macrotile Bt
strips the flags, state, and new t value pertinent to itself and propagates the remaining
new flags, state and t value to its other half Bh . (6) Bh alters its state and flags in
response to the signal it has just received and sends back an acknowledgement signal
to its tail. As this signal travels through the shared wires between Bh and Bt , it clears
the handover flags which indicate to the representation function that it should check
those macrotiles’ configuration tile for information instead of flags and the CC tile for
the state. The clearing of these flags is the event that precipitates the transition of
the representation of the macrotile displaying them, so that R∗ (α) = R∗ (β), where
α and β are the macrotile before and after this step. (7) Finally, At receives the
acknowledgement signal propagated from what now maps to Ah , so it sends out a final
U nlock signal to all of its neighborhood and A ends the turn by the CC undergoing
a transition with the timing tile, rendering it inert and without affinities, thereby
detaching it. (Color figure online)
Simulating Programmable Matter with Self-Assembly 155

Fig. 8. A handoverP ulli movement executed by particle A. The overall orientation of


the swarm does not change, but T ailA changes hands and becomes the head of B, the
subordinate particle in this exchange.

5.1 handover

The Amoebots model defines a move called the handoveri , which allows two
neighboring particles, one expanded and one contracted, to simultaneously con-
tract from and expand into the same grid location. This move can be initiated by
either particle, and involves the initiating particle’s neighbor in the ith direction.
There are four possibilities for handover contracts: A contracted particle can
expand into a spot previously occupied by a head, a contracted particle can
expand into a spot previously occupied by a tail, an expanded particle can con-
tract and “force” its neighbor into expanding into wherever its head is currently
located, and an expanded particle can contract and “force” its neighbor into
expanding into wherever its tail is currently located. It’s necessary that both
moves happen simultaneously to enable certain actions such as moving a col-
lection of particles through a static tunnel of width one. For any handoverP ull
movement, the initiating particle must be expanded and the subordinate particle
contracted, while for any handoverP ush movement, the reverse is true (Fig. 8).
All moves involve locking down the active particle’s neighborhood. Since
handoveri necessarily changes the orientation of both the initiating and sub-
ordinate particles, it is necessary to lock down the respective neighbor-
hoods of all particles involved. Thus, the handoverP ulli movement requires a
P rogressiveLockdownSignali to be sent to the subordinate particle(s) to be fur-
ther propagated to their respective neighborhoods. Note, that for the duration
of the execution of a handover move, a handoveri flag will be displayed, ensuring
that the macrotile maps to its previous configuration under the representation
function R until the handoveri or expandi flags are cleared from the macrotiles’
respective ports. This ensures that we have smooth transitions for macrotiles
mapping to the atomic transitions of amoebots.
Handover moves in our simulation occur after the initiating particle has
locked down its own neighborhood, checked to ensure move validity with the
handoveri signal, and further sent a P rogressiveLockdownSignali to each sub-
ordinate particle. The initiating particle ensures that the configuration of expan-
sions and contractions are appropriate for the move it is attempting, and then
sends a signal to the macrotile that will be passed from one particle to another.
This signal contains the new state and flags for the subordinate macrotile(s).
Once these fields are updated, and the handoveri flags are cleared from the
156 J. C. Alumbaugh et al.

macrotiles’ wires, the macrotile that changed state is considered to be the head
of the newly expanded particle, which sends an acknowledgement signal back
to the initiating macrotile. Macrotiles engaged in a handoveri move are mapped
by R via their configuration tiles until they clear the flags, after which they
revert to the normal mode of operation for R, which checks a macrotile’s central
clock tile and the subordinate clock tile to the immediate west. After receiving
the acknowledgement of successful transition, the initiating macrotile sends out
unlock signals to its neighborhood (which necessarily propagate from subordi-
nate particles to their respective neighborhoods as well), and finally the initiating
macrotile detaches its timing tile, ending the turn.

5.2 Attachment Sites


To avoid potential conflicts between tiles undergoing their state transitions and
the floating macrotiles, we only allow the floating macrotiles to attach to valid
attachment sites along the perimeter of the swarm. The perimeter of the swarm
shares no affinity with the float tiles by default. Only after a perimeter par-
ticle undergoes its transition function and returns M = expandi and marks
that edge with a state that has affinity with the float can any float attach to
the particle that wants to expand. Floats attach to the swarm via a τ -strength
attachment along the exposed wire end of the perimeter particle that is attempt-
ing to expand. The only time macrotiles can detach from the swarm is when a
given expanded macrotile receives a Detach signal from its other end. When
this occurs, the detaching macrotile sends signals from its clock bank to all
edges to have them change their exposed wire ends to a state with no affinity
to the swarm. Once the macrotile is no longer part of the swarm, it sends query
signals to all of its edges. In the case that a macrotile receives six  responses
from its wires (that is, it has no neighbors) after a query signal, it undergoes
states transitions in the clock and wires that make it a float. The newly con-
tracted macrotile prevents unintentional reattachments of other floats because
the Detach signal, after leaving the contracted particle’s wire, leaves the wire in
its respective flag state with no affinity with floats. The wire that corresponds
to the detached macrotile will not allow attachments again until it receives an
Attach signal from the central clock bank again.

6 Conclusion
We have presented a simulation construction in which an amoebots system can
be simulated by a collection of Tile Automata macrotiles. The mechanisms by
which particle movement is simulated were discussed as well, such as how the
atomic actions of the amoebots model were replicated within the simulation
without threat of interruption via state transitions. We hope this fits into a larger
schema of comparing the power of various computational models by simulation.

Acknowledgements. The authors would like to thank Schloss Dagstuhl – Leibniz


Center for Informatics and the organizers and participants of Dagstuhl Seminar 18331
Simulating Programmable Matter with Self-Assembly 157

“Algorithmic Foundations of Programmable Matter” [3]. The initial brainstorming and


work for this paper began during that workshop and was inspired by many interesting
discussions with the participants.

References
1. Alumbaugh, J.C., Daymude, J.J., Demaine, E.D., Patitz, M.J., Richa, A.W.: Simu-
lation of programmable matter systems using active tile-based self-assembly. Tech-
nical Reports 1906.01773, Computing Research Repository (2019). http://arxiv.
org/abs/1906.01773
2. Andrés Arroyo, M., Cannon, S., Daymude, J.J., Randall, D., Richa, A.W.: A
stochastic approach to shortcut bridging in programmable matter. Nat. Comput.
17(4), 723–741 (2018)
3. Berman, S., Fekete, S.P., Patitz, M.J., Scheideler, C.: Algorith-
mic foundations of programmable matter (dagstuhl seminar 18331).
Dagstuhl Rep. 8(8), 48–66 (2019). https://doi.org/10.4230/DagRep.8.8.48.
http://drops.dagstuhl.de/opus/volltexte/2019/10235
4. Cannon, S., Daymude, J.J., Randall, D., Richa, A.W.: A Markov chain algorithm
for compression in self-organizing particle systems. In: Proceedings of the 2016
ACM Symposium on Principles of Distributed Computing, pp. 279–288, PODC
2016. ACM, New York (2016)
5. Chalk, C., Luchsinger, A., Martinez, E., Schweller, R., Winslow, A., Wylie, T.:
Freezing simulates non-freezing tile automata. In: Doty, D., Dietz, H. (eds.) DNA
2018. LNCS, vol. 11145, pp. 155–172. Springer, Cham (2018). https://doi.org/10.
1007/978-3-030-00030-1 10
6. Daymude, J.J., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: Improved
leader election for self-organizing programmable matter. In: Fernández Anta, A.,
Jurdzinski, T., Mosteiro, M.A., Zhang, Y. (eds.) ALGOSENSORS 2017. LNCS,
vol. 10718, pp. 127–140. Springer, Cham (2017). https://doi.org/10.1007/978-3-
319-72751-6 10
7. Daymude, J.J., Hinnenthal, K., Richa, A.W., Scheideler, C.: Computing by pro-
grammable particles. In: Flocchini, P., Prencipe, G., Santoro, N. (eds.) Distributed
Computing by Mobile Entities: Current Research in Moving and Computing.
LNCS, vol. 11340, pp. 615–681. Springer, Cham (2019). https://doi.org/10.1007/
978-3-030-11072-7 22
8. Demaine, E.D., Patitz, M.J., Rogers, T.A., Schweller, R.T., Summers, S.M.,
Woods, D.: The two-handed tile assembly model is not intrinsically universal. In:
Fomin, F.V., Freivalds, R., Kwiatkowska, M., Peleg, D. (eds.) ICALP 2013. LNCS,
vol. 7965, pp. 400–412. Springer, Heidelberg (2013). https://doi.org/10.1007/978-
3-642-39206-1 34
9. Derakhshandeh, Z., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: Uni-
versal shape formation for programmable matter. In: Proceedings of the 28th ACM
Symposium on Parallelism in Algorithms and Architectures SPAA, pp. 289–299.
2016. ACM, New York (2016)
10. Derakhshandeh, Z., Gmyr, R., Richa, A.W., Scheideler, C., Strothmann, T.: Uni-
versal coating for programmable matter. Theor. Comput. Sci. 671, 56–68 (2017)
11. Derakhshandeh, Z., Richa, A., Dolev, S., Scheideler, C., Gmyr, R., Strothmann, T.:
Brief announcement: amoebot-a new model for programmable matter. In: Annual
ACM Symposium on Parallelism in Algorithms and Architectures, pp. 220–222.
Association for Computing Machinery (2014)
158 J. C. Alumbaugh et al.

12. Doty, D., Lutz, J.H., Patitz, M.J., Schweller, R.T., Summers, S.M., Woods, D.:
The tile assembly model is intrinsically universal. In: 2012 Proceedings of the
53rd Annual IEEE Symposium on Foundations of Computer Science, pp. 302–310.
FOCS (2012)
13. Fekete, S.P., Hendricks, J., Patitz, M.J., Rogers, T.A., Schweller, R.T.: Universal
computation with arbitrary polyomino tiles in non-cooperative self-assembly. In:
2015 Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete
Algorithms (SODA 2015), San Diego, CA, USA, pp. 148–167, 4–6 January 2015
14. Gilbert, O., Hendricks, J., Patitz, M.J., Rogers, T.A.: Computing in continuous
space with self-assembling polygonal tiles. In: 2016 Proceedings of the Twenty-
Seventh Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2016),
Arlington, VA, USA, pp. 937–956, 10–12 January 2016
15. Hendricks, J., Padilla, J.E., Patitz, M.J., Rogers, T.A.: Signal transmission across
tile assemblies: 3D static tiles simulate active self-assembly by 2D signal-passing
tiles. In: Soloveichik, D., Yurke, B. (eds.) DNA 2013. LNCS, vol. 8141, pp. 90–104.
Springer, Cham (2013). https://doi.org/10.1007/978-3-319-01928-4 7
16. Hendricks, J., Patitz, M.J., Rogers, T.A., Summers, S.M.: The power of duples
(in self-assembly): it’s not so hip to be square. Theor. Comput. Sci. 743, 148–166
(2015)
17. Kao, M.-Y., Schweller, R.: Randomized self-assembly for approximate shapes.
In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A.,
Walukiewicz, I. (eds.) ICALP 2008. LNCS, vol. 5125, pp. 370–384. Springer, Hei-
delberg (2008). https://doi.org/10.1007/978-3-540-70575-8 31
18. Meunier, P.E., Patitz, M.J., Summers, S.M., Theyssier, G., Winslow, A., Woods,
D.: Intrinsic universality in tile self-assembly requires cooperation. In: 2014 Pro-
ceedings of the ACM-SIAM Symposium on Discrete Algorithms (SODA 2014),
Portland, OR, USA, pp. 752–771, 5–7 January 2014
19. Meunier, P., Woods, D.: The non-cooperative tile assembly model is not intrin-
sically universal or capable of bounded turing machine simulation. In: 2017 Pro-
ceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing,
STOC 2017, Montreal, QC, Canada, pp. 328–341, 19–23 June 2017
20. Padilla, J.E., Patitz, M.J., Schweller, R.T., Seeman, N.C., Summers, S.M., Zhong,
X.: Asynchronous signal passing for tile self-assembly: Fuel efficient computation
and efficient assembly of shapes. Int. J. Found. Comput. Sci. 25(4), 459–488 (2014)
21. Patitz, M.J., Schweller, R.T., Summers, S.M.: Exact shapes and turing universality
at temperature 1 with a single negative glue. In: 2011 Proceedings of the 17th
International Conference on DNA Computing and Molecular Programming, pp.
175–189. DNA (2011)
22. Winfree, E.: Algorithmic self-assembly of DNA. Ph.D. thesis, California Institute
of Technology, June 1998
23. Woods, D.: Intrinsic universality and the computational power of self-assembly.
Philos. Trans. R. Soc. Lond. A: Math. Phys. Eng. Sci. 373(2046), 1–13 (2015)
24. Woods, D., Chen, H.L., Goodfriend, S., Dabby, N., Winfree, E., Yin, P.: Active
self-assembly of algorithmic shapes and patterns in polylogarithmic time. In: Pro-
ceedings of the 4th Conference on Innovations in Theoretical Computer Science,
ITCS 2013, pp. 353–354. ACM, New York (2013)
Combined Amplification and Molecular
Classification for Gene Expression
Diagnostics

Gokul Gowri1 , Randolph Lopez2 , and Georg Seelig2(B)


1
California Institute of Technology, Pasadena, CA, USA
2
University of Washington, Seattle, WA, USA
gseelig@uw.edu

Abstract. RNA expression profiles contain information about the state


of a cell and specific gene expression changes are often associated with
disease. Classification of blood or similar samples based on RNA expres-
sion can thus be a powerful method for disease diagnosis. However, bas-
ing diagnostic decisions on RNA expression remains impractical for most
clinical applications because it requires costly and slow gene expression
profiling based on microarrays or next generation sequencing followed
by often complex in silico analysis. DNA-based molecular classifiers that
perform a computation over RNA inputs and summarize a diagnostic
result in situ have been developed to address this issue, but lack the
sensitivity required for use with actual biological samples. To address
this limitation, we here propose a DNA-based classification system that
takes advantage of PCR-based amplification for increased sensitivity. In
our initial scheme, the importance of a transcript for a diagnostic deci-
sion is proportional to the number of molecular probes bound to that
transcript. Although probe concentration is similar to that of the RNA
input, subsequent amplification of the probes with PCR can dramati-
cally increase the sensitivity of the assay. However, even slight biases
in PCR efficiency can distort weight information encoded by the origi-
nal probe set. To address this concern, we developed and mathematically
analyzed multiple strategies for mitigating the bias associated with PCR-
based amplification. We evaluate these amplified molecular classification
strategies through simulation using two distinct gene expression data
sets and associated disease categories as inputs. Through this analysis,
we arrive at a novel molecular classifier framework that naturally accom-
modates PCR bias and also uses a smaller number of molecular probes
than required in the initial, naive implementation.

1 Introduction
Detection and quantification of RNA molecules in blood or tissue can be a
powerful tool for disease diagnosis. Although detection of a single, differentially
expressed molecular marker might be ideal, such a distinctive marker may not
exist for a disease state of interest. Instead, a diagnostic decision may have to be
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 159–173, 2019.
https://doi.org/10.1007/978-3-030-26807-7_9
160 G. Gowri et al.

based on panels of differentially expressed genes and may require careful weigh-
ing of the contributions of each gene in the panel. The conventional workflow
for building such multi-gene classifiers consists of experimentally measuring gene
expression in different “states” (e.g. healthy and disease) using microarrays or
high-throughput sequencing, followed by training of a computational classifier
that learns to assign labels to the samples based on differences in gene expression
between those states. Once the classifier is trained it can be used to label pre-
viously unseen samples based on their gene expression profiles, thus providing
a powerful tool for aiding diagnostics decisions. For example, an in silico whole
blood gene expression classifier has been developed to distinguish bacterial infec-
tions, viral infections, and non-infectious disease [1]. Similarly, an in silico blood
platelet gene expression classifier has been developed to distinguish six different
types of cancer [2]. Both of these classifiers were trained using support vector
machine (SVM) methods, and each involved more than 100 features (i.e. differ-
entially expressed genes) [1,2]. These examples provide proof-of-principle for the
power of a diagnostic approach based on analysing multi-gene panels but the
complexity and cost of gene expression classification has limited its implemen-
tation to a research setting and to a small subset of clinical problems.
Using molecular computation to implement a disease classifier could over-
come some of the limitations of existing technologies. In such an approach, the
molecular diagnostic “computer” could be mixed with the patient sample, per-
form an analysis of the sample through a sequence of molecular interactions
and then summarize the result into an easy-to-interpret signal that represents
the diagnosis. If realized, such an approach could accelerate the diagnosis by
simplifying the measurement process and eliminating the need for separate com-
putational analysis.
DNA-based circuits have long been proposed as a platform for performing
gene expression diagnostics [3]. In our own previous work, we demonstrated a
platform to translate a linear classifier into a DNA strand displacement circuit
that can operate on a set of RNA inputs and classify a sample by calculating a
weighted sum over those inputs [4]. However, our work was limited to a proof-of-
principle implementation with in vitro transcribed RNA since the concentration
of RNA molecules in biological samples is significantly below the detection limit
of that assay.
In this work, we propose a method for combining targeted RNA amplifi-
cation and molecular classification for gene expression diagnostics. We begin
by proposing a classifier design that combines computation with enzymatic
amplification (Sect. 2). In our approach, molecular probes are used to assign
weights to each RNA feature in the classifier and PCR-based amplification is
used to amplify the signal resulting from each probe. The workflow for such an
approach is shown in Fig. 1. We then demonstrate a computational approach,
starting from gene expression data, for learning a sparsely-featured classifier
that is well-suited for molecular implementation (Sect. 3). However, this formal
framework assumes that molecular classifier components behave ideally, while
in practice nucleic acid amplification mechanisms are biased, i.e. different probe
Combined Amplification and Molecular Classification 161

sequences get amplified to varying degrees which distorts the classification result
(Sect. 4). We then explore the effects of amplification bias and developed strate-
gies to mitigate amplification bias and maintain classification accuracy. First, we
explore a strategy for averaging over multiple probes, each with an unknown bias
(Sect. 5). Although successful to an extent, we will argue that this naive strat-
egy is impractical because of the large number of probes required. Moreover,
because in practice the amplification bias is consistent across samples, it is pos-
sible to actually measure the probe bias and incorporate that information into
the classifier design. Second, we thus ask whether accurate classification can be
achieved if individual probes are biased but well-characterized (Sect. 6). We will
show that this approach results in a more compact molecular implementation of
the classifier but that classification accuracy is still limited compared to an ideal
classifier. Finally, we develop an approach wherein each weight associated with
a transcript is implemented by just two competing probes, one associated with
a negative and the other with a positive weight (Sect. 7). We show that even
with biased probes any target value of the weight can be closely approximated
as long as we have precise control over probe concentrations. We validate each
of our designs by simulating molecular classification of gene expression profiles
in the context of cancer and infectious disease diagnostics. Our results indicate
that probe characterization and subsequent selection enable the construction
of sensitive, accurate and cost-effective molecular classifiers for gene expression
diagnostics.

2 A Molecular Classifier with Built-In Amplification

Here, we lay out a strategy for creating a molecular classifier with a built-in
amplification mechanism. We first review our earlier classifier design that pro-
vides that basis for our work and then discuss how an enzymatic amplification
step can be used to dramatically increase the specificity of the earlier approach.
In the molecular classifiers reported in [4], the magnitude of a weight associ-
ated with a transcript is implemented by the number of probes designed to target
that transcript; an identity domain appended to the hybridization domain indi-
cates the sign of a each probe and thus of each weight. The total concentration
of all positive (negative) identity domains thus represents the sum of all positive
(negative) weights in the system. Identity domains interact with a downstream
DNA circuit that performs subtraction through pairwise annihilation of positive
and negative signal [4,5]. The remaining signal is converted to fluorescent out-
put. Alternatively, if reporter constructs labeled with distinct fluorophores are
used to separately read out the concentrations of positive and negative identity
domains, the subtraction can be performed in silico. In either case, this approach
requires weights to be small (<10) integers, because each unit weight requires a
unique binding site on a transcript. This design is demonstrated in Fig. 2. More-
over, in this framework, the output signal has similar magnitude to the input
signal, so sensitivity is low, and not sufficient for clinical disease diagnostics.
162 G. Gowri et al.

Fig. 1. Workflow for combined amplification and classification of RNA samples. An in-
silico classifier is trained and validated on publicly available gene expression data. Then,
multiple probes are designed and synthesized to target the set of genes in the classifier.
This set of probes is amplified using an RNA sample with known gene expression data.
Using next-generation sequencing, the number of amplified probes can be counted in
batch in order to determine probe specific amplification bias. Subsequently, this data
informs a design for molecular classifier that will implement the desired classification
model.

Increasing Sensitivity. Amplification reactions based on strand displacement


cascades [6–9] provide one interesting approach to signal amplification and such
systems have even been used to create amplifiers with controllable gain that
can be combined into linear classifier circuits [10,11]. Still, the gain that can be
achieved with a single strand displacement-based catalytic amplifier is typically
limited and cascades of multiple amplifiers that might have higher gain are often
leaky or simply not robust enough for practical applications.
In order to address the lack of sensitivity intrinsic to our initial classifi-
cation scheme we thus compared several enzyme-based approaches for targeted
RNA amplification including NASBA [14], rolling-circle amplification [15,17,18],
RASL [12] and multiplex PCR [19]. Upon evaluating and characterizing several
of these methods, we decided to implement a molecular classification workflow
using RASL probes. RASL (RNA-mediated oligonucleotide annealing, selection,
and ligation) is commonly used for targeted RNA sequencing for the purpose of
gene expression quantification [12].
Probe Amplification with RASL. In the RASL protocol, shown in Fig. 3a,
custom probe pairs are designed for each RNA of interest. The two probes of
Combined Amplification and Molecular Classification 163

Fig. 2. An example molecular implementation of a linear classifier with the approach


previously demonstrated in [4]. The red and blue domains represent positive and nega-
tive values respectively for downstream subtraction and reporting mechanisms. (Color
figure online)

a pair bind neighboring sites on an mRNA target such that they create a con-
tiguous sequence with a nick at the center. Adjacent probes are then ligated
together. Importantly, ligation can only occur if probes are bound to the RNA.
Each probe also contains universal amplification overhangs. PCR amplification
of the ligated probes enables accurate amplification of low total RNA amounts
(10 nanograms) for gene expression quantification using next-generation sequenc-
ing. Because only ligated probes can be efficiently amplified and because ligation
requires the RNA template, RASL is specific and quantitative method for RNA
detection.
A molecular classifier using RASL probes is shown in Fig. 3b. Different inte-
ger weights can be implemented by varying the number of probes per transcript.
To implement positive and negative weights, each probe also contains a sequence
barcode that triggers either a green or red fluorescent reporter during amplifi-
cation. The difference between the aggregate fluorescent signals from the two
channels is the classification output.
Amplification by RASL is consistent across samples, but is inconsistent
within samples, such that certain probes are amplified with greater propen-
sity than others [12]. As a result, n probes will not necessarily yield n times as
large a signal as a single probe representing unit weight, so molecular classifiers
designed with the approach of [4] will not behave similarly to the in silico clas-
sifier upon amplification. Below we discuss how such bias can be accounted for
in the classifier design.
164 G. Gowri et al.

Fig. 3. Overview of existing RASL-seq and our modified method for molecular classifi-
cation. In panel A, the standard RASL-seq protocol for targeted gene expression count-
ing using next-generation sequencing is shown. Multiple probe pairs are hybridized to
their RNA targets followed by ligation of gaps. The yellow circled P’s indicate the 5’
phosphates required for ligation. The ligated products can be amplified using common
primers and then used as input for next generation sequencing. Sequencing data is then
used for gene expression analysis. In panel B, the protocol for molecular classification
using RASL is shown. Our modified RASL probes contain a positive or negative bar-
code (red or green domain) associated with each probe. The number of probes that
bind to each transcript can be varied to tune the effective amplification weight on each
transcript. During amplification, two fluorescent reporters (FAM and ROX) are trig-
gered based on the presence of each barcode. This fluorescent signal can then determine
the classification outcome for a given sample. (Color figure online)

3 Computational Design of Sparsely Featured Diagnostic


Classifiers

Before building a molecular classifier for gene expression diagnostics, we first


train an in silico disease classifier on available gene expression data. This com-
putational classifier is then mapped onto a molecular classifier. In a molecular
classifier, each feature corresponds to a target transcript, and probes are imple-
mented as oligonucleotides that can bind to a unique region within a transcript.
Although feasible in principle, molecular classifiers with large numbers of fea-
tures are currently not practical because of the large numbers of probes required
to implement them. As s first step in the classifier design workflow we thus aim
to create sparsely featured yet clinically valuable classifiers.
Using the publicly available data sets associated with [1] and [2], we identi-
fied reliable classifiers that have feasible molecular implementations by limiting
the scope of the classification problems and training support vector machines
with high feature selection penalties. Regularization parameters were determined
through iterative search, and a hard sparsity constraint of a maximum of 50 fea-
tures was used. In particular, we identified a sparsely-featured classifier that
Combined Amplification and Molecular Classification 165

differentiates between bacterial infections and viral infections from whole blood
RNA samples, similar to that previously implemented as a molecular classifier
for in vitro use [4]. We also created a sparsely-featured classifier that discrimi-
nates between cancer and healthy patients based on platelet RNA samples. Both
classifiers were tested on validation sets that were disjoint from the training sets,
and consisted of approximately 16 the number of samples of the training sets, cor-
responding to validation sets of 35 and 56 samples respectively. The accuracy
of the classifiers on the validation set will henceforth be referred to as model
accuracy, and are shown in Table 1.

4 Simulating the Accuracy of a Molecular Classifier


The sequence dependent amplification bias in RASL is not well characterized,
but based on the evaluation of probe bias in [12], we will roughly approximate it
as a log2 -normal distribution. The largest difference in amplification factor of the
25 probes tested in [12] is approximately 26 , so we approximate the underlying
normal distribution of probe bias to have μ = 0, σ = 3.
We estimate the accuracy of a molecular implementation by generating ran-
dom amplification biases according to the previously described distribution for
each probe, then summing the biases of the probes for each target transcript
in order to determine an effective weight for each feature. The resulting set of
weights is then evaluated on the validation set to obtain an accuracy that can
be compared to the model accuracy. Several such simulations are executed to
determine an expected accuracy of a molecular implementation. The simulated
accuracy of molecular classifiers implemented with the approach of [4] are shown
in Table 1.
As mentioned before, the parameters of the distribution of probe bias are
rough estimates. In Fig. 4, we see the effect of the standard deviation of the
underlying normal distribution of probe bias on the simulated accuracy. This
indicates that unless we have σ < 1, the accuracy of the molecular implementa-
tion of a classifier deviates highly from the model accuracy. Based on the data
presented in [12], it seems unreasonable to expect that variation in amplification
bias is so small. As such, a method of mitigating the effect of amplification bias
is necessary.

Table 1. Properties of the sparsely-featured disease diagnostic classifiers. Basic molecu-


lar classifier accuracy is the estimated accuracy of the molecular classifiers implemented
with amplification and without bias mitigation, averaged over 500 simulations.

Task # of features In silico model Simulated basic molecular


accuracy classifier accuracy
Viral vs. bacterial 5 0.89 0.59
Cancer diagnosis 24 0.96 0.60
166 G. Gowri et al.

(a) Bacterial vs. viral classifier (b) Cancer diagnosis classifier

Fig. 4. Effect of variation in amplification bias of DNA probes on simulated accuracy


of molecular classifiers implemented with no amplification bias mitigation. σ is the
standard deviation of the normal distribution underlying the log2 -normal distribution
of probe bias, with a mean μ = 0. For each σ, 500 independent simulations were done,
and the shade of blue indicates the frequency of an outcome. (Color figure online)

5 Scaling up Weights to Reduce Bias Variation


The ideal method of mitigating amplification bias would involve no experimental
procedures beyond those previously characterized in molecular gene expression
classifiers. One such approach is to simply increase the number of probes used
to implement a unit weight, such that a weight of magnitude k would be imple-
mented by c ∗ k probes, where c is constant across all weights, as depicted in
Fig. 5. This is equivalent to scaling up all weights by a constant factor. Intuitively,
this will reduce the effect of probe bias because the average of c amplification
factors should be less variable than the amplification factor of a single probe.
The desired effect of this approach can be seen in the following mathematical
characterization:
For a molecular classifier with a set of target transcripts T , let

Pt = {pt1 , pt2 , ...ptc∗|t| }

be the set of amplification factors of the probes used to implement desired weight
|t| of a transcript t ∈ T , where each pti represents the amplification factor of the
i-th probe targeting transcript t. We will define the effective weight of a target
transcript t as
c∗|t|

Wt = pti
i=1

The effective weight is the weight implemented by the molecular classifier after
amplification. Using the approximation that amplification factors are distributed
Combined Amplification and Molecular Classification 167

Fig. 5. Molecular implementation of bias mitigation through scaling up weights, with


scaling factor c = 2 for a simple toy classifier. Probes are not drawn to scale, and
represent the RASL-seq probes shown in Fig. 3.

as pti ∼ 2N (μ,σ) , we see that for large c,

Wt ≈ c ∗ |t| ∗ 2μ

In order to implement the desired classifier, the effective weights do not need to
be the same as the desired weights – constantly scaled weights will yield identical
classification results. As a result, if the effective weights have the same relative
values as the desired weights, the implementation can be considered successful.
We see that for any pair of transcripts u, v ∈ T ,

Wu c ∗ |u| ∗ 2n |u|
≈ n
=
Wv c ∗ |v| ∗ 2 |v|

so the classifier will implement the desired weights, regardless of individual


amplification biases.
However, c cannot be arbitrarily large, as it is limited by the number of
unique binding sites per transcript and the cost of oligonucleotide synthesis.
Instead, we must determine if an experimentally feasible c will yield a sufficient
approximation for gene expression classification.
In Fig. 6, we see the effect of c on the simulated accuracy of a molecular
classifier. The plots indicate that for even c = 10, corresponding to up to 50
distinct probes per transcript, there is still a large disparity between the pre-
dicted implementation accuracy and the model accuracy. Based on these results,
it seems that knowledge of the amplification biases of the probes is necessary in
order to construct a molecular classifier.
168 G. Gowri et al.

(a) Bacterial vs. viral classifier (b) Cancer diagnostic classifier

Fig. 6. Simulated accuracy of molecular classifiers using c probes to implement a unit


weight. The shade of blue indicates the frequency of an outcome. 500 independent
simulations were done for each c. (Color figure online)

6 Classifier Calibration by Screening Probes


A simple extension of the approach to implementing molecular classifiers pre-
sented in [4] is to measure the amplification biases of a set of probes for each
target transcript, then select a subset of these probes that will yield effective
weights that best approximate the desired weights, as shown in Fig. 7. This app-
roach can be mathematically characterized similarly to the approach described
in Sect. 5:
For a molecular classifier with a set of target transcripts T , let
Pt = {pt1 , pt2 , ...ptn }
be the set of amplification factors of n probes targeting a transcript t ∈ T with
desired weight |t|, where pti represents the amplification factor of the i’th probe
targeting transcript t. Let ℘(Pt ) be the power set of Pt , representing the set of
all weights that could be implemented using the given set of probes. The effective
weight of a subset of probes St ∈ ℘(Pt ) is

Wt = pti
pti ∈St

Our goal is to select subsets of probes St for all transcripts t ∈ T that yield
  
Wu |u| 2
min ( − )
Wv |v|
u,v∈T

This minimization problem requires us to search |℘(Pt )||T | = 2n∗|T | possible


solutions. For the bacterial vs. viral classifier, with an experimentally reason-
able 10 probes per target transcript, there would be a massive 250 possible sets
Combined Amplification and Molecular Classification 169

Fig. 7. Molecular implementation of classifier built by selecting optimal subset of


probes, with n = 3 probes per transcript, for a simple toy classifier, with probe biases
(denoted by the number next to the probe) selected for demonstration purposes. The
grey probes are omitted in the classifier implementation, and the colored probes are
the subset that best approximates the desired weight. Probes are not drawn to scale,
and represent the RASL-seq probes shown in Fig. 3. (Color figure online)

of weights, so it seems likely that the optimal selection of probes would yield
desired classifier behavior. However, the large solution space also makes identify-
ing the solution challenging. In order to estimate the accuracy of this approach
analogously to Fig. 6, with 500 simulations of randomly biased probes, it is not
feasible to search the entire solution space. Instead, for each transcript, we sim-
ply find the subset of probes whose sum is closest to the weight normalized to
n ∗ μ, where μ is the mean of the log2 -normal distribution. In other words, we
select subsets of probes St for all transcripts t ∈ T that yield
 
min (Wt − |t| ∗ μ)2

t∈T

This minimization problem requires us to search |℘(Pt )| ∗ |T | = |T | ∗ 2n possible


solutions, which makes the search much more feasible for simulation purposes.
The accuracy of the classifier built with this selection of probes gives us a rea-
sonable lower bound on the accuracy of the optimal subset, which could feasibly
be identified when implementing a disease diagnostic classifier. These estimated
lower bounds of accuracy are shown for different n in Fig. 8. The lower bound
of expected molecular classifier accuracy begins to approach the model accuracy
at n = 10, which is experimentally feasible.
170 G. Gowri et al.

(a) Bacterial vs. viral classifier (b) Cancer diagnostic classifier

Fig. 8. Simulated accuracies of molecular classifiers using subsets of n probes per tran-
script. The shade of blue indicates the frequency of an outcome. 500 independent
simulations were done for each n. (Color figure online)

7 Encoding Weights in Probe Concentration

In the previously described methods of implementing molecular classifiers, in


order to change the effective weights of the classifier, one must use a different
set of probes to construct the classifier. It may be possible to instead encode
classifier weights in probe concentration, similar to previous DNA-based neural
network constructions [13]. Because disease diagnostic molecular classifiers must
accept analog input, and we wish to minimize the number of strand displacement
reactions in the system, the mechanism of weight multiplication should be differ-
ent from previous DNA-based neural network constructions. An implementation
of analog multiplication by DNA strand displacement has been proposed [16],
but the design involves a complex reaction network that would likely be difficult
to experimentally construct for the purposes of in situ molecular classification.
We have designed a method of implementing arbitrary classifier weights with
a constant number of probes per transcript, by encoding classifier weights in the
concentration of the probes. For each transcript, we select exactly one binding
domain. For each binding domain, we design one positive probe and one negative
probe. When constructing the classifier, we add all probes in excess, while con-
trolling the ratios of each pair of positive and negative probes. The difference of
the relative concentrations of the probes will encode the weight of the transcript.
If a positive probe has the same concentration as its negative counterpart, then
the weight of their target transcript should be 0. Similarly, a larger concentra-
tion of positive probe will encode a positive weight, and a larger concentration
of negative probe will encode a negative weight. This weight implementation
strategy is depicted in Fig. 9.
Combined Amplification and Molecular Classification 171

Fig. 9. Cartoon depiction of competitive hybridization based weight implementation


strategy. The arrows indicate complementary domains. Probes are not drawn to scale,
and represent the RASL-seq probes shown in Fig. 3. x = |positive |positive probe|
probe|+|negative probe|
,
the concentration of the positive probe normalized to the sum of the concentrations of
the positive and negative probe.

(a) Bacterial vs. viral classifier (b) Cancer diagnostic classifier

Fig. 10. Simulated accuracies for molecular classifiers built with weights encoded in
probe concentration. Decimals of precision indicates the control of the ratios. For exam-
ple, 1 decimal of precision means that only ratios with increments of ten percent can
be implemented.

Implementing weights in this fashion would allow for manipulation of classi-


fier weights without changing the probes used. One could measure probe biases,
then adjust the concentrations such that the effective weights are identical to the
weights of the in silico model. Since the effective weight is simply a linear func-
tion of the relative concentrations, the ability to implement arbitrary weights
is dependent on the ability to arbitrarily control the concentrations of probes.
The simulated accuracy of molecular classifiers built with this weight implemen-
tation strategy after bias mitigation are shown in Fig. 10 for different degrees
of concentration precision. We see that if ratios can be controlled to precision
172 G. Gowri et al.

10−3 (i.e. being able to implement concentrations in ratio 0.501:0.499), then


we expect the molecular classifiers to approach the model accuracy. This seems
experimentally feasible, but in the case that such precision cannot be attained,
a larger number of probes per transcript can be characterized, and the probes
with the most similar biases can be selected to decrease the minimum difference
in concentration.

8 Discussion
Based on these analyses, both selecting subsets of probes and encoding classifier
weights in probe concentration appear to be viable approaches to mitigating
amplification bias in molecular classifiers. When mitigating bias by selecting
subsets of probes, one can use almost exactly the experimental construction
presented in [4]. The only additional steps involve characterizing probe bias.
For this reason, it is nearly certain that such a strategy could be used to build
molecular classifiers. However, it is possible that many probes will need to be
screened in order to identify a subset of probes that implements the desired
classifier.
While encoding the classifier weights in probe concentration requires a
slightly different, currently experimentally unverified construction, it would
likely use a much smaller set of probes in order to implement the desired clas-
sifier, and thus be more cost effective. Even with very limited implementation
precision, one could imagine having to screen far fewer probes than in the subset
selection method. Furthermore, it allows one to implement weights with more
specificity than the subset selection method, so provided that there is sufficient
implementation precision, it should allow for more accurate implementation of
an in silico classifier.
Gene expression profiling is increasingly an important clinical metric for diag-
nosis a wide number of human diseases. The approach presented here would
enable amplification and classification of RNA samples containing multiple
biomarkers in a single reaction with a two-channel fluorescent readout. This could
drastically reduce the complexity of gene expression classification and poten-
tially enable a point-of-care solution to this type of diagnostics. Even though
this approach would result in a more complex development stage, once a final
construction is found, the implementation is drastically simpler than existing
alternatives.

Acknowledgment. G. G. was supported by Caltech’s Summer Undergraduate


Research Fellowship program. R. L. and G. S. were supported by NSF grant CCF-
1714497.
Combined Amplification and Molecular Classification 173

References
1. Tsalik, E.L., et al.: Host gene expression classifiers diagnose acute respiratory ill-
ness etiology. Sci. Transl. Med. 8, 322ra11 (2016)
2. Best, M.G., et al.: RNA-Seq of tumor-educated platelets enables blood-based pan-
cancer, multiclass, and molecular pathway cancer diagnostics. Cancer cell 28, 666–
676 (2015)
3. Benenson, Y., Gil, B., Ben-Dor, U., Adar, R., Shapiro, E.: An autonomous molec-
ular computer for logical control of gene expression. Nature 429, 423–429 (2004)
4. Lopez, R., Wang, R., Seelig, G.: A molecular multi-gene classifier for disease diag-
nostics. Nat. Chem. 10, 746–754 (2018)
5. Zhang, D.Y.: Cooperative hybridization of oligonucleotides. J. Am. Chem. Soc.
133, 1077–1086 (2010)
6. Turberfield, A.J., Mitchell, J., Yurke, B., Mills Jr., A.P., Blakey, M., Simmel, F.C.:
DNA fuel for free-running nanomachines. Phys. Rev. Lett. 90, 118102 (2003)
7. Dirks, R.M., Pierce, N.A.: Triggered amplification by hybridization chain reaction.
Proc. Nat. Acad. Sci. USA 101, 15275–15278 (2004)
8. Seelig, G., Yurke, B., Winfree, E.: Catalyzed relaxation of a metastable DNA fuel.
J. Am. Chem. Soc. 128, 12211–12220 (2006)
9. Zhang, D.Y., Turberfield, A.J., Yurke, B., Winfree, E.: Engineering entropy-driven
reactions and networks catalyzed by DNA. Science 318, 1121–1125 (2007)
10. Zhang, D.Y., Seelig, G.: DNA-based fixed gain amplifiers and linear classifier cir-
cuits. In: Sakakibara, Y., Mi, Y. (eds.) DNA 2010. LNCS, vol. 6518, pp. 176–186.
Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18305-8 16
11. Chen, S.X., Seelig, G.: A DNA neural network constructed from molecular variable
gain amplifiers. In: Brijder, R., Qian, L. (eds.) DNA 2017. LNCS, vol. 10467, pp.
110–121. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66799-7 8
12. Li, H., Qiu, J., Fu, X.D.: RASL-seq for massively parallel and quantitative analysis
of gene expression. Curr. Protoc. Mol. Biol. 98, 4–13 (2012)
13. Cherry, K.M., Qian, L.: Scaling up molecular pattern recognition with DNA-based
winner-take-all neural networks. Nature 559, 370 (2018)
14. Burchill, S.A., Perebolte, L., Johnston, C., Top, B., Selby, P.: Comparison of the
RNA-amplification based methods RT-PCR and NASBA for the detection of cir-
culating tumour cells. Br. J. Cancer 86, 102 (2002)
15. Deng, R., Zhang, K., Sun, Y., Ren, X., Li, J.: Highly specific imaging of mRNA
in single cells by target RNA-initiated rolling circle amplification. Chem. Sci. 8,
3668–3675 (2017)
16. Song, T., Garg, S., Mokhtar, R., Bui, H., Reif, J.: Analog computation by DNA
strand displacement circuits. ACS Synth. Biol. 5, 898–912 (2016)
17. Stougaard, M., Juul, S., Andersen, F.F., Knudsen, B.R.: Strategies for highly sen-
sitive biomarker detection by Rolling Circle Amplification of signals from nucleic
acid composed sensors. Integr. Biol. 3, 982–992 (2011)
18. Takahashi, H., Matsumoto, A., Sugiyama, S., Kobori, T.: Direct detection of green
fluorescent protein messenger RNA expressed in Escherichia coli by rolling circle
amplification. Anal. Biochem. 401, 242–249 (2010)
19. Stahlberg, A., Krzyzanowski, P.M., Jackson, J.B., Egyud, M., Stein, L., Godfrey,
T.E.: Simple, multiplexed, PCR-based barcoding of DNA enables sensitive muta-
tion detection in liquid biopsies using sequencing. Nucleic Acids Res. 44, e105–e105
(2016)
Reversible Computation Using Swap
Reactions on a Surface

Tatiana Brailovskaya, Gokul Gowri(B) , Sean Yu, and Erik Winfree

California Institute of Technology, Pasadena, CA 91125, USA


{tbrailov,ggowri,ssyu,winfree}@caltech.edu

Abstract. Chemical reaction networks (CRNs) and DNA strand dis-


placement systems have shown potential for implementing logically and
physically reversible computation. It has been shown that CRNs on a sur-
face allow highly scalable and parallelizable computation. In this paper,
we demonstrate that simple rearrangement reactions on a surface, which
we refer to as swaps, are capable of physically reversible Boolean com-
putation. We present designs for elementary logic gates, a method for
constructing arbitrary feedforward digital circuits, and a proof of their
correctness.

1 Introduction
In traditional digital logic, information is lost, making computation logically irre-
versible. For example, an AND gate transforms two inputs into a single output,
where the inputs cannot be deduced from the output. Landauer argued that irre-
versible logic, implemented by physically irreversible systems, dissipate at least
a minimum energy, kT log 2, with each binary computational step [1]. Charles
Bennett countered that computation could be done in a logically reversible fash-
ion, indicating that physically reversible systems could compute with arbitrarily
little energy expenditure [2]. A surprising flip side to this discovery was that
several simple models of constant-energy reversible systems, such as perfect bil-
liard balls [3,4] and even a microscopic model of heat diffusion within molecular
aggregation [5], were shown to be capable of carrying out arbitrary compu-
tations. The connections between computation and thermodynamics are now
richly developed [6,7]. However, despite considerable effort [8], practical com-
puting systems that perform reversible computing with asymptotically minimal
energy expenditure have not been demonstrated.
In his seminal work, Bennett references biological nucleic acid systems as
examples of logically and physically reversible computing [2,9]. Recently, build-
ing on techniques for compiling arbitrary formal chemical reaction networks
(CRNs) into DNA strand displacement systems (DSDs) [10–12], the poten-
tial of synthetic nucleic acid systems to implement reversible computing has
been explored theoretically and shown to be feasible for polynomial-space prob-
lems [13–15]. By further storing information in a DNA polymer based system,
T. Brailovskaya, G. Gowri and S. Yu—Equal contribution.
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 174–196, 2019.
https://doi.org/10.1007/978-3-030-26807-7_10
Reversible Computation Using Swap Reactions on a Surface 175

a scheme for physically and logically reversible Turing-universal computing has


been proposed [16]. However, neither of these approaches allow for parallel com-
puting, and they require many distinct species.
This motivated a framework for computing using chemical reaction networks
on a surface (surface CRNs) [17]. In a surface CRN, a bimolecular reaction
A + B → C + D can occur if a molecule of species A is adjacent to a molecule
of species B on the surface. A C molecule will replace the A molecule, and a D
molecule will replace the B molecule. Note that the molecules can be adjacent in
any orientation, such that A + B → C + D ≡ B + A → D + C; both are distinct
from A + B → D + C. The surface CRN framework can be used to construct
massively parallelizable space-bounded Turing machines and continuously active
logic circuits of different sizes with a constant set of species [17].
In the proposed DNA implementation of surface CRNs [17], species are bound
to a DNA origami surface, and free-floating fuel molecules are consumed (and
waste molecules produced) to facilitate irreversible reactions between two neigh-
boring species via DNA strand displacement [17]. While one could simulate a
reversible surface CRN by utilizing pairs of irreversible reactions of the form
{A + B → C + D; C + D → A + B}, it is plausible that a genuinely reversible
implementation could be devised such that the waste of the forward reaction
is the fuel of the reverse reaction, and vice versa (as is the case for some DSD
implementations of well-mixed solution CRNs [16]). Implementing such a surface
CRN in DNA would involve using one fuel molecule for the forward reaction,
and a different fuel molecule for the reverse reaction. In a closed system, where
there is no external power maintaining fuels and wastes at constant concentra-
tions, an occurrence of the forward reaction would bias the system toward the
reverse direction, as the amount of fuel for the forward direction decreases, while
the amount of fuel for the reverse reaction increases. Computation using these
pseudo-reversible reactions would be difficult to drive forward unless the system
guarantees that each reaction is used equally in each direction, on average [13–
15]. Such restrictions impose difficult design constraints.
Another approach to constructing reversible surface CRNs is to use only
reactions of the form A + B → B + A, which are implicitly reversible because
surface CRNs do not consider absolute orientation. When the forward reaction’s
waste is the reverse reaction’s fuel, there is therefore no net change in fuels or
wastes – the implementation is effectively catalytic. These reactions are simply
the rearrangement of two neighboring molecules, henceforth referred to as swaps,
and abbreviated as A ↔ B.
Swap reactions were previously discussed as a way to simulate diffusion on
a surface [17], but we have found that they can exhibit much more complex
programmable behavior. One may initially think that systems built using only
swap reactions cannot perform useful computation. No new species can be intro-
duced after computation begins, so NOT gates and signal fanout may at first
seem infeasible. Furthermore, since reactions are completely reversible, it may
also seem that computation cannot be biased to proceed forward. Indeed, if swap
176 T. Brailovskaya et al.

reactions were implemented in a well-mixed solution rather than on a surface,


they would be utterly useless.
However, because we are considering swap reactions on a surface, we can
take advantage of the geometry of the surface and local nature of the swaps. We
are able to obtain behavior that is far more controlled than random diffusion.
In this paper, we will show that by carefully designing initial configurations and
swap reactions, arbitrary digital logic circuits can be computed using reversible
reactions on a surface.

2 Computing Paradigm

We seek to construct a set of species, along with a set of permissible swap rules
and a starting arrangement of those species on the lattice, that is able to compute
logical functions.
To represent bits, we will use two species, denoted 1 and 0. Each lattice point
will be shown as a square. Within an arrangement of species on a surface, certain
lattice points will be designated as input locations and certain lattice points will
be designated as output locations. We will denote the input locations with arrows
pointing towards them and outputs with arrows pointing away (e.g. see the
arrows in the leftmost and rightmost locations in Fig. 1a). In our constructions,
if the input lattice locations are replaced with any permutation of bits, then
it is possible to reach an arrangement (through the permissible swaps) where
the output locations are filled with bits. We can think of this abstractly as the
arrangement computing some Boolean function f : {0, 1}n → {0, 1}m , where
n, m are the number of input and output lattice locations respectively, so long
as a unique set of output values are reachable.
Consider the task of constructing a wire. Let’s define a species w that is
permitted to swap both with 0 and 1 (i.e. we permit the reactions 0 ↔ W and
1 ↔ W ). Imagine a line of W , as shown in Fig. 1.
If we let the leftmost lattice point be the input location and rightmost be
the output location, then this arrangement computes the identity function. The
input bit will randomly walk along the line of W , eventually occupying the
output location. Any line of W is a wire, as it simply transmits a signal. In order
to develop more complex systems, we will introduce more species and rules,
and use larger layouts. With this paradigm in mind, we design composable logic
gates, which allow us to construct arbitrary digital logic circuits.

(a) (b) (c)

Fig. 1. Basic wire operation. (a) Wire starting configuration. (b) Initial loaded con-
figuration. (c) Computation in progress.
Reversible Computation Using Swap Reactions on a Surface 177

3 Building Logic Circuits with Swaps


We have designed a constant set of 16 species and 23 swap rules, shown in
Table 1, that are capable of universal Boolean logic, through the composition of
NOT, AND, OR, fanout, and wirecross gate layouts on a surface.

Table 1. List of swap rules required to implement NOT, AND, OR, fanout and wire-
cross. No species beyond those that appear in these swap rules are necessary. Recall
that the rule A ↔ B is equivalent to the implicitly reversible surface CRN reaction
A+B →B+A

3.1 NOT, AND, OR

For these gates, we had several important goals in mind, the most important
being that the gates had to be logically reversible. Fredkin and Toffoli demon-
strate in [3] a set of universal logic gates that are reversible called the Fredkin
and the Toffoli gates. Each of them is a three input - three output gate in which
it is uniquely possible to determine the input from the output.
In the case of AND, OR logic, this is impossible (since the gate is not injec-
tive). However for our systems, it is sufficient to be able to uniquely determine
the input to a gate from the output plus the final configuration of the gate. The
idea is that even though different inputs give the same output, the way in which
inputs rearrange in the gate will be unique.

NOT Logic. Initially, it may seem impossible to construct a NOT gate using
only swap reactions, as the output of a NOT gate is not present in the input, and
swap reactions cannot generate new species. However, we are able to implement
a NOT gate by instead storing both a 1 and a 0 inside the gate, and releasing
the appropriate bit depending on the input.
The starting configuration of a NOT gate is shown in Fig. 2a. In this config-
uration, no swaps are possible. Upon the arrival of a bit in the input location,
it goes either right or left depending on its value, as 1 swaps with W 1 and not
W 0, and 0 swaps with W 0 and not W 1. Upon this first transition, the bit may
now swap with the I species, which may now travel down the two consecutive J
species, and release the appropriate output bit. The output bit can then swap
into the output location. This motif is symmetric for both inputs, as shown in
Fig. 2b. An example trajectory for the 0 input case is shown in Fig. 2c.
178 T. Brailovskaya et al.

Statespace. In order to give a more quantitative explanation of what is hap-


pening in this swap system, we have to introduce the notion of the state space
as a graph. The nodes of said graph are unique configurations on the 2D surface.
Two nodes are connected by an edge if a single swap can take one vertex to the
other. From this point forward this graph will be referred to as the statespace
graph. For instance, the state space graph for the NOT gate can be seen in
Fig. 2d. It is simply a linear graph of 7 nodes, which corresponds to the sequence
of states shown in Fig. 2c.

(a) (b)

(c)

(d)

Fig. 2. NOT gate implementation via swap reactions. The unidirectional black arrows
indicate the input and output locations. (a) Gate layout and swap rules. (b) Condensed
representation of computation. Blue lines represent the initial movement of the input
bit. The red represents the trajectory of the I species. The purple line is the movement
of the output bit, which occurs after interacting with the I species. Dotted lines refer
to when the input is 1, while solid lines are for input 0. (c) Computation trajectory
on input 0. The bidirectional black arrows represent transition via swap rule. (d)
Statespace of the NOT gate. (Color figure online)
Reversible Computation Using Swap Reactions on a Surface 179

All of our logic gates (AND, OR, NOT) have the property that there is
only one state in which a correct output is in the output square. This means
that in whatever circuit we embed our gates into, when the output leaves the
gate, the remainder of the gate can only be in one possible configuration. In
particular with the logic gates that we have constructed, after the output bit
leaves, the remainder of the gate is stable (where stable means that no swaps
can happen between the species in the remaining configuration). Furthermore,
the gates are stable before any inputs arrive. This stability property is achieved
without sacrificing reversibility by leveraging spatial separation.

AND Logic. Next, we will show how a small change in the NOT gate con-
struction yields an AND gate. Consider a gate with the same layout as NOT
except that the 1 and 0 species that are stored inside the gate are switched. If
this gate receives an input 1, the output will be 1. Similarly, if the gate receives
input 0, the output with be 0. Now, further modify this gate by removing the
stored 1 and turning it into another input location, as shown in Fig. 3a. Observe
that an AND gate will return 0 whenever there is a 0 in the input. Thus, in
this construction, if the top input receives a 0, the gate will correctly output 0,
regardless of what value arrives at the side input. It remains to verify that this
gate works correctly when the top input receives a 1. Whenever the top input
receives a 1, the side input will appear in the output location. Thus, if the side
input receives 0, the output will be 0, as it should. Similarly, if the side input
and top input both receive 1, the output will be 1, as desired.

OR Logic. Even though AND and NOT are sufficient for expressing any logical
formula, it is convenient to also have a simple way of computing OR directly.
Observe that in an OR gate, whenever there is a 1 in the input, the output should
be 1. Thus, we can create OR analogously to AND, by fixing 1 as a stored input
that always appears if the top input is 1. The layout is shown in Fig. 3b.

(a) (b)

Fig. 3. Gate layout of AND and OR. For these two gates we have two inputs, denoted
by the arrows pointing into the system. (a) AND gate. (b) OR gate.
180 T. Brailovskaya et al.

Selector Motif. If no bits are stored in the previously described gates such that
they have three input locations (top, left, and right), then the gate is equivalent
to a data selector (or multiplexer), a device frequently used by electrical engineers
that outputs one of two values determined by an additional input signal. We
have shown the implementation of AND, OR, and NOT by fixing certain inputs,
but we can also implement several other functions with this strategy, including
strictly less than and strictly greater than. However, in our constructions, we
use only the canonical AND, OR, and NOT gates.
The selector design was originally inspired by the Fredkin gate [3]. The Fred-
kin gate works by switching signals two and three in the output if signal one is
1, else the signals are output unchanged. A Fredkin gate can be programmed by
fixing one or two of the three input signals and observing the output value of
either signal two or three to compute AND, OR and NOT. Here, we effectively
construct a Fredkin gate that only outputs the relevant signal that stores the
value of AND, OR, or NOT.

3.2 Fanout, Wirecross


Although they are not essential for universality, wirecross and fanout are very
helpful in creating compact circuits. It has been shown that it is possible to
construct a wirecross from just fanout and elementary logic gates [18]. Wirecross
seems challenging on a two dimensional surface, as wires cannot use the third

(a) (b)

Fig. 4. Fanout mechanism. (a) Fanout layout. The input arrives on the left side indi-
cated by the arrow. The two outputs leave on the right at the specified locations. (b)
Fanout computation. The dotted lines represent the computation when a 0 bit serves
as the input and the solid lines represent computation when a 1 bit serves as the input.
The red lines represent the trajectory of the input. The yellow lines are the trajectory
of the I1 and I species for the cases in which the input is 1 and 0 respectively. The
green lines are the movement of the top output bit and the blue lines are the movement
of the bottom output bit. (Color figure online)
Reversible Computation Using Swap Reactions on a Surface 181

dimension to avoid intersection. Fanout also seems challenging since we cannot


create new species via swaps. We are able to implement wirecross by effectively
constructing two unique wire types, and we are able to implement fanout by
storing the additional bits inside the gate.

Fanout. In Fig. 4a we demonstrate our design for a fanout gate. The key idea is
to store an additional copy of the bit inside the gate to simulate bit duplication.
Overall, the gate consists of two interconnected columns, each of which is capable
of copying a bit. One column will duplicate the input bit if it is 1 and the other
will duplicate the input if it is 0. The bit is “duplicated” by freeing the extra
stored bit of the same value.
If the input bit is a 1, then the first column duplicates it, and the two outputs
travel on wires parallel to the W 0 wire. We introduce a new species K that can
both carry the 1 bit and the indicator I species. We also have to introduce a
new species I1 to allow the 1 bit to duplicate. Refer to Table 1 for the associated
swap rules.

Wirecross. Designing a wirecross that allows two bits to cross paths is chal-
lenging because if the signals are travelling along identical wire types, there is
nothing stopping them from trading places and going down the wrong wires. In
order to get around this issue, we translate the bits into intermediates that travel
on distinct wire types and then release the appropriate bit once the crossing has
taken place. We see this design in Fig. 5. At the top, we translate the input bit
a ∈ {0, 1} to W a ∈ {W 0, W 1}. This W a then travels along a path specified by
the P species. The other input b is translated to Ib ∈ {I0, I1}, which travels
along a path specified by the J species. The center species is initially occupied

Fig. 5. Wirecross layout.


182 T. Brailovskaya et al.

with a J, which means the input coming in from the left can pass, while the
input from the top must wait. We introduce a final new species X which can
swap with both Ib and W a. First the Ib traverses the intersection and places
the X species in the center. Then the displaced W a can traverse the intersection
point.

3.3 Compiling a Feedforward Circuit to a Surface Layout


With our gate constructions, we can compile arbitrary feedforward logic circuits
(involving only AND, OR, NOT, fanout and wirecross) into surface layouts that
evaluate the same functions via swap reactions. Here we describe one method of
compilation of a circuit to a layout, following a standard crossbar array archi-
tecture [19]. This is not a spatially efficient way of constructing a surface layout;
it is merely here to demonstrate that any feedforward circuit can be laid out on
a surface.
We define a feedforward circuit as a graph by associating a circuit with a
directed graph in the following way (for an explicit example of such a graph see
Fig. 6a). Let the nodes denote inputs, outputs and gates (AND, OR, NOT). The
in-edge at node b from node a indicates that output of node a is fed as input to
the gate at node b. Similarly, an out-edge from node a to node b indicates that
output of a is fed into the gate at node b. If such a graph is acyclic, then we say
that the corresponding circuit is feedforward.
For simplicity, assume that all gate, fanout and wirecross layouts fit within
a square of dimensions s × s lattice points, with sufficient space to route inputs
on the top and left to outputs on the bottom and right. Our construction places
the inputs regularly along the top of a rectangular region, and places the gates
regularly along an offset diagonal, with inputs and gates each providing their
output along vertical wires directly below them, extending to the bottom of the
rectangle. To route the appropriate inputs to each logic gate, we use horizontal
wires extending left from the gate, using the wirecross to pass through undesired
wires and using the fanout to acquire the desired input signal while leaving that
signal available for downstream gates that might also want it. The feedforward
order of the circuit ensures that we can order the gates along the diagonal such
that the inputs for a gate are always available to its left. As shown in Fig. 6b,
this leads to a complete circuit layout of size not much larger than (n + m)s ×
2 ms lattice points for a circuit with n input and m gates, which is worst-case
asymptotically optimal [20].

3.4 4-Bit Square Root Circuit


Following the examples in refs. [21] and [17], we designed a system that computes
the floor of the square root of a 4-bit binary number. The layout, shown in
Fig. 7, was not created using the procedure described in Sect. 3.3, but rather
was designed by hand to be more compact. The correctness of the circuit was
verified through exhaustive enumeration of the state space for every input, with
long wires abbreviated in order to reduce simulation time. Since the system is
Reversible Computation Using Swap Reactions on a Surface 183

Fig. 6. A systematic feedforward circuit layout compilation. The circuit analyzed


here computes G2(G1(IN 1, IN 2), IN 2) and G3(G1(IN 1, IN 2), IN 3). G1, G2, G3 are
gates, IN 1, IN 2, IN 3 are inputs, and OU T 1, OU T 2 are outputs. (a) Directed acyclic
graph specification of the desired circuit. (b) Surface layout of the given circuit gener-
ated according to procedure described in Sect. 3.3. Filled circles indicate fanout. Empty
squares indicate wirecross.

stochastic, parallel, and reversible, correctness was evaluated not with respect
what the system does do, but rather with respect to what it could do, i.e. which
states are reachable from a given input state. There was no combination of inputs
for which the exhaustive enumeration found a state in which any incorrect output
was produced, and for all input combinations the enumeration found a state in
which all correct outputs were produced. Therefore, for all input combinations,
the circuit will (with probability 1) eventually reach a state where all outputs
are correct, and will never reach a state where any output is incorrect (though
perhaps most of the time the outputs will be empty).

4 Proving Circuit Correctness


Leaving aside the question of kinetics for now, we will proceed to argue for
the general correctness of feedforward circuit layouts, in the above sense. Our
argument relies on establishing the composability of our gates in a surface CRN
using strong and weak bisimulation similar to as in [22,23]. We start by showing
that each gate is equivalent to a simple stochastic CRN. Then, we show that
a composition of the stochastic CRNs for individual gates is equivalent to a
composition of gates in a surface CRN. Finally, we will show that the composed
stochastic CRN is logically equivalent to the intended function. In other words,
when gates are composed on the surface CRN, the function they compute is
exactly the logical composition of the gates.
When constructing an equivalent stochastic CRN for each gate in the surface
CRN, we require that, upon starting with the set of species corresponding to
184 T. Brailovskaya et al.

bits being loaded into the input locations in the gate, the set of states of the
stochastic CRN will be in bisimulation with the configuration of the gate on the
surface when the same input bits are loaded. Observe that each gate’s operation
involves a set of independent random walks that come together at particular
points. For example if we consider the OR gate, the top input takes a random
walk and ends up in the top right corner. Meanwhile the indicator species I
takes a random walk from its original location in the top right to the bottom
right. If we give each of these random walks a label, then the entire state of the
gate can be described by how far each random walk trajectory has progressed
and which bit is being expressed on the trajectory. The species of our stochastic
CRN will have the form Abi where A is the label of the trajectory, i the index of
the trajectory (how far it has progressed) and b is the bit that is being expressed
on the trajectory. We also allow i to be S or F indicating respectively that the
trajectory has not started yet (it is in the starting configuration) or that the
trajectory is finished.
The most basic reaction of the stochastic CRN is Abi ↔ Abi+1 indicating
progress on trajectory A (provided Abi+1 is an allowed species). When we have
one trajectory lead unconditionally into another we see a reaction that looks like
Abn + BS ↔ AbF + B1b . When two trajectories come together in the surface CRN
layout, this corresponds to reactions consuming the final numbered species of
two trajectories and producing the first numbered species of a new trajectory.
In order for the stochastic CRN to be equivalent we must show that there
is a bisimulation between the state space of the surface CRN (given a specific
combination of inputs in the input locations) and the set of reachable states in the
stochastic CRN (from the corresponding set of starting species). To demonstrate

(a) Surface Layout (b) Circuit Diagram

Fig. 7. 4-bit square root circuit. (a) Layout of the surface CRN 4-bit square root (done
by hand in order to use less space than the general circuit layout scheme). Locations
marked in purple represent the fanout mechanism. Red represents an OR gate, blue
represents an AND, green a NOT, and grey a wirecross. Lattice points in light blue are
input locations for the circuit and orange represents output locations. Black represents
wires. (b) Abstract circuit diagram. (Color figure online)
Reversible Computation Using Swap Reactions on a Surface 185

this we will have a paint function f that maps states of the stochastic CRN to
configurations (states) of the surface gate. This mapping will have the property
that the available swaps from a state f (s) on the surface correspond exactly to
the set of reactions available to the stochastic CRN state s. By this we mean
that applying the paint function f and then applying the swap will result in the
same thing as applying the CRN reaction corresponding to the swap, and then
applying the paint function. The paint function operates as follows, each species
will specify how to paint a part of the surface. The parts of the surface that
are not specified by any species will be the same as its initial configuration. We
demonstrate a paint function for the OR gate in Fig. 8.

Fig. 8. Paint functions for the OR gate. All species in the stochastic CRN that cor-
respond to the OR gate as well as their associated paint functions are shown. In each
table, the left hand column is the list of species. Each row is a paint function for a
particular species. Each column represents how a particular lattice point is painted.
(0)
For example, the AF species would paint the lattice point C1 as W 0, the lattice point
D1 as J, and so on. (a) Initial configuration of the gate with each lattice point labeled
with a row number and a column letter. (b) Paint function for A(0) including AS . (c)
Paint function for D. (d) Paint function for B. (e) Paint function for C. (f ) Paint
function for A(1) excluding AS .
186 T. Brailovskaya et al.

The reactions for the stochastic CRN that correspond to the OR gate are
(0) (0) (0) (0) (0)
A5 + B1 + CS ↔ AF + BF + C1
(0) (1) (0) (1) (1)
A5 + B1 + CS ↔ AF + BF + C1
(0) (0) (0)
C1 + DS ↔ CF + D1
(1) (1) (1)
(1)
C1 + DS ↔ CF + D1
(1) (1) (1)
A6 + DS ↔ AF + D1
(b) (b)
Xi ↔ Xi+1 ∀X ∈ {A, D}, ∀b ∈ {0, 1}, ∀i

If we load the inputs b1 , b2 on the top and on the right of the OR gate
respectively, the equivalent state in the stochastic CRN is to have one copy
(b ) (b )
each of A1 1 and B1 2 along with CS and DS . One can verify by hand that,
starting from these initial four species, reachable reactions in the stochastic CRN
correspond exactly to reachable swaps on the surface. In fact whenever at most
one input arrives at either input location, the stochastic CRN is in (strong)
bisimulation with the surface CRN. If for example b1 entered through the top
input, but nothing had entered through the right input, we can start the system
(b )
in the state {A1 1 , BS , CS , DS }. We represent this CRN pictorially in Fig. 9a.
Now notice that if we drop all subscripts in our species formulation, then the
stochastic CRN reduces to

A(0) + B (0) + C ↔ A(0) + B (0) + C (0)


A(0) + B (1) + C ↔ A(0) + B (1) + C (1)
C (0) + D ↔ C (0) + D(0) (2)
C (1)
+D ↔C (1)
+D (1)

A(1) + D ↔ A(1) + D(1)

This simplification of the CRN has a nice interpretation. If we think of each


trajectory label A as some wire in part of the system, the species A(b) has the
interpretation of “wire A is hot and is carrying bit b”. Now having an input of
b1 , b2 like described above is equivalent to starting with {A(b1 ) , B (b2 ) , C, D}. This
reduced stochastic CRN is in weak bisimulation with the full stochastic CRN,
for valid initial conditions. In Fig. 9b, we show a further simplified version of this
CRN. The nodes in this graph represent distinct species (written out explicitly in
Fig. 9a). Edges in this graph represent reactions with one node adjacent to that
edge being a product and the other a reactant that additionally involves species
C or D. Thus, Fig. 9b shows how different combinations of inputs A(b1 ) , B (b2 ) are
combined to obtain DOR(b1 ,b2 ) . Thus this reduced stochastic CRN makes it easy
to see that our gate works as expected, with A, B being the input trajectories
and D being the output trajectory.
The equivalent paint functions for the stochastic CRNs for AND and NOT
are straightforward extensions of the above. The equivalent paint function for
Reversible Computation Using Swap Reactions on a Surface 187

the stochastic CRNs for them and for fanout and wirecross can be found in the
Appendix. What happens now when we have a composition of gates in which
the output lattice points of certain gates are linked with input lattice points
of other gates via a (possibly bent) linear wire? We can create a “stitched”
version of the stochastic CRN. We start with the stochastic CRN for each gate,
and we relabel the species so that the same trajectories from two different OR
gates, for example, are syntactically different. Next, we consider each wire in the
composition. Suppose a given wire W links the output trajectory O of some gate
to the input trajectory I of some other gate. Then we create a new trajectory
for the movement of bits on a wire—let us call it W —and add the following
reactions:
(b) (b)
On(b) + WS ↔ OF + W1
(b) (b) (b)
Wl + IS ↔ WF + I1 (3)
(b) (b)
Wi ↔ Wi+1 ∀b ∈ {0, 1}, ∀i s.t. 1 ≤ i < l
(b)
where l is the length of the wire and On is the last state of the output
trajectory. In the reduced CRN this is effectively O(b) ↔ I (b) , which makes
sense. Since we have already established every reaction in each gate’s individual

(a) (b)

Fig. 9. Pictorial representation of the stochastic CRN for the OR gate.(a) The full
stochastic CRN. Species and arrows shown in gray correspond to species that serve
as indicators of whether a certain trajectory is in an initial or a final configuration.
(b) A graph representation of the CRN without the grey indicator species. All species
that only differ in their subscript are associated with each other. Note that the node
above D(1) that appears to have two possible predecessors is actually deterministically
reversible when the indicator species are accounted for.
188 T. Brailovskaya et al.

stochastic CRN corresponds to some swap on the surface, its fairly clear that
within this stitched stochastic CRN, all reactions still correspond to reachable
swaps on the surface. What is left to show is that no reachable swaps cannot be
expressed as some reaction in the stitched stochastic reaction. First, we claim
that if the circuit is feedforward and each of its input locations is loaded with
exactly one bit, then the circuit as a whole receives exactly 1 input per input
wire. Consider what happens if this is not the case. Suppose a gate receives two
inputs at an input lattice. Consider the first such occurrence. Let g be the first
gate this happened to. g must have received two inputs from a previous gate,
some g  that it was connected to. But g  could not have produced two outputs
since we know g  received at most one input per lattice (by our selection of g).
Therefore we have a contradiction, and so no such g can exist. If each gate will
receive at most one input per input wire, the behavior of each gate is entirely
captured by its individual stochastic CRN. Because the stochastic CRN for the
circuit is a stitching of individual stochastic CRNs it must capture all possible
swaps. Therefore the stitched stochastic CRN is in bisimulation with the surface
CRN.

5 Kinetics and Entropics

As discussed above, for each gate there is only one state with correct output.
Therefore, in a circuit in which every wire leads toward an output lattice point
(such as the one in Fig. 7a), there is also only one state with all outputs simulta-
neously occupied. This is problematic for large circuits because the probability
of observing an output state becomes extremely small as the circuit increases in
size. The source of the issue is that forward and reverse reaction rates are iden-
tical for a single swap reaction. Thus, every possible configuration of the surface
has the same energy. As a result, at equilibrium each reachable surface configu-
ration is equally likely. In the case of the 4-bit square root, there is exactly one
state in which we have outputs, and > 106 states in which we do not. As such,
probability that the surface is in the output state is very low.
Conveniently, the reduced stochastic CRN provides a framework for quan-
titatively assessing entropic factors, which in turn suggests a solution to the
problem. Consider a “wire” of length n that is represented in the full stochas-
tic CRN by {XS , X1 , . . . , Xn , XF } and is represented in the reduced stochastic
CRN by {XS , X, XF }. We say that a signal is on the wire if some Xi with
1 ≤ i ≤ n is present in the full stochastic CRN, and if X is present in the
reduced stochastic CRN. A state α of the reduced stochastic CRN with signals
on m wires X 1 , X 2 , . . . , X m 
(of respective lengths n1 , n2 , . . . , nm ) will therefore
correspond to exactly wα = 1≤k≤m nk states of the full stochastic CRN. Con-
sequently, we consider α to be a macrostate with  Boltzmann weight wα and thus
equilibrium probability pα = wα /Z where Z  = α wα . Equivalently, we could
say that macrostate α has energy Eα = −kT 1≤k≤m log nk .
As an initial application of this quantitative framework, we can determine
the effect of the “unnecessary” fanout gates in the construction of Fig. 6b. These
Reversible Computation Using Swap Reactions on a Surface 189

gates were introduced in the construction as a convenience so that input signals


and computed signals can be propagated down vertical wires, just in case they
will be needed later on – and we did not bother to complicate the construction
by specifying how to remove the unnecessary wires and fanout gates. Yet they
have an interesting side effect: system states with signals on all the output loca-
tions will also have signals trapped on the unnecessary wires. Thus, rather than
there being exactly one such output state, there will be many—for example, the
product of the lengths of the unnecessary wires, in a simple case. These wires
therefore, by their presence, bias the computation forward. By introducing addi-
tional unnecessary fanout gates throughout the circuit, we could further bias
each step of the computation to ensure that there are no deep valleys in the
macrostate energy landscape that could kinetically trap the system. Noting that
a fanout gate can reverse itself only if both its output signals come back, we can
see that it provides a probabilistic kinetic ratchet as well.
As a more compact alternative to this use of fanout gates for their entropic
side-effects, we introduce a compact entropic driver mechanism (Fig. 10) that
biases computation forward. The mechanism results in an inflation of the number
of states after a bit has traversed the mechanism.
Consider loading the gadget in Fig. 10 with a 0 bit species on the left. There
is only one state in which there is a 0 bit species on the leftmost lattice point.
However, if that bit travels to the right side, then we observe that the number
of states in which the 0 bit species is on the rightmost point is 4. This is because
after the bit travels to the right side, each of the I and J species and can swap;
the entropy gadget has been “activated”. Thus each of the pairs can either swap
or not, which means we have 2 × 2 = 4 possible configurations.
If we have an entropic gadget placed after a gate G1 connected via a wire to
gate G2 , the output bit is less likely to return into G1 and more likely to enter G2 ,
than if there was no entropic gadget present. This happens for two reasons. First,
the J species could be blocking the wire for the bit to move backwards, favoring
progression of computation forward. Second, the presence of the entropic gadget
quadruples the number of states in which the bit has entered G2 , thus increasing
the probability that the bit is in G2 . Thus, the entropic gadget can be used to
increase the likelihood of observing the output state of a circuit.

Fig. 10. The entropic driver gadget. The blue line indicates the trajectory of the pri-
mary bit traveling down the wire. The red and green lines represent the movement of
the I and J species after the primary bit has passed. (Color figure online)
190 T. Brailovskaya et al.

By adjusting the size or the number of entropic driver mechanisms, we can


control the increase in number of states, and bias computation forward to an
arbitrary degree. For instance, if we change the number of Js from 1 to n by
adding more Js on top and bottom, on the left and the right of the entropic
gadget, respectively, the number of states of the entropic gadget will be (n +
1)2 . With larger n, we further increase the likelihood that computation moves
forward. Alternatively, we can put many entropic gadgets next to each other. A
wire consisting of n gadgets in series will have 4n states at the end of the wire. As
computation proceeds, more entropy gadgets become activated and the number
of possible configurations is exponential in the number of gadgets activated.
Thus, by including sufficiently many entropy gadgets or increasing the number
of J species, we can drive computation forward to an arbitrary extent.
By judiciously introducing entropy driver gadgets, it should be possible to
modify any circuit such that the energies of the macrostates are decreasing
roughly linearly as a function of number of gates completed, and thus computa-
tion is thermodynamically driven forward. Note that the entropy thus produced
by circuit operation entails a corresponding energetic cost to performing the
computation.

6 Future Directions

In this work, we constructed arbitrary feedforward circuits using reversible swap


reactions on a surface. We also devised a entropic driver mechanism to tun-
ably drive computation forward. However, many fascinating questions regarding
swap reaction systems remain unanswered. For instance, the circuits we con-
struct above are not reusable. Might it be possible to devise renewable swap
systems that, for example, implement reversible sequential logic or reversible
Turing machines using swap reactions?
When we first thought about swap reactions, a primary motivation was that
due to the simplicity of such a reaction, there may exist a simple molecular
implementation. The DNA strand displacement mechanism that was originally
proposed for implementing arbitrary bimolecular reactions on a surface [17] is
complex and potentially not suitable for experimental implementation. Now that
the computational potential of swap rules has been established, the search for a
simpler, more experimentally feasible mechanism is well motivated.

Acknowledgements. Support from National Science Foundation grant CCF-1317694


is gratefully acknowledged. We also thank Lulu Qian and Chris Thachuk for helpful
discussion and comments.
Reversible Computation Using Swap Reactions on a Surface 191

Appendix

Species C3 C4
BS W W
(1)
B1 1 W
(1)
B2 W 1
(0)
B1 0 W
(0)
B2 W 0
(a) (b)
Species C1 D1 E1 D2 D3 E3
AS W Species C1 B1 A1 B2 B3 A3
(0) (1)
A1 0 W0 I J J 1 A1 1 W1 I J J 0
(0) (1)
A2 W0 0 I J J 1 A2 W1 1 I J J 0
(0) (1)
A3 W0 I 0 J J 1 A3 W1 I 1 J J 0
(0) (1)
A4 W0 J 0 I J 1 A4 W1 J 1 I J 0
(0) (1)
A5 W0 J 0 J I 1 A5 W1 J 1 J I 0
(0) (1)
A6 W0 J 0 J 1 I A6 W1 J 1 J 0 I
(0) (1)
AF W0 J 0 J W I AF W1 J 1 J W I
(c) (d)
(b) (b)
Ai ↔ Ai+1 ∀b ∈ {0, 1}
(b) (b) (¬b)
A6 +BS ↔ AF +B1 ∀b ∈ {0, 1}

(e)

Fig. 11. Paint functions for the NOT gate. All species in the stochastic CRN that
corresponds to the NOT gate as well as their associated paint functions are shown. In
each table, the left hand column is the list of species. Each row is a paint function for
a particular species. Each column represents how a particular lattice is painted. (a)
Initial configuration of the NOT gate with each lattice point labeled with a row number
and a column letter. (b) Paint function for B. (c) Paint function for A(0) including
AS . (d) Paint function for A(1) excluding AS . (e) Stochastic CRN equivalent to the
NOT gate.
192 T. Brailovskaya et al.

Species C1 B1 A1 B2 B3 Species C3 C4
(1)
A1 1 W1 I J J DS W
(1) (0)
A2 W1 1 I J J D1 0 W
(1) (0)
A3 W1 I 1 J J D2 W 0
(1) (1)
A4 W1 J 1 I J D1 1 W
(1) (1)
A5 W1 J 1 J I D2 W 1
(1)
AF W1 J 1 J DF W W
(a) (b) (c)
Species C1 D1 E1 D2 D3 E3
AS W
(0)
A1 0 W0 I J J 0
(0)
A2 W0 0 I J J 0
(0)
Species A3 Species B3 A3 W I 0 J J 0
(0)
BS W CS A4 W0 J 0 J I 0
(0) (0) (0)
B1 0 C1 0 A5 W0 J 0 J I 0
(1) (1) (0)
B1 1 C1 1 A6 W0 J 0 J 0 I
(0)
BF I CF W AF W0 J 0 J W I
(d) (e) (f)
(0) (0) (0)
A6 + DS ↔ AF + D1
(1) (0) (0) (1)
A5 +B1 +CS ↔ C1 +AF +BF
(1) (1) (1) (1)
A5 +B1 +CS ↔ C1 +AF +BF
(b) (b)
C1 + DS ↔ D1 + CF ∀b ∈ {0, 1}
(b) (b)
Xi ↔ Xi+1 ∀X ∈ {A, D} ∀b ∈ {0, 1}

(g)

Fig. 12. Paint functions and the stochastic CRN for the AND gate. (a) Initial AND
gate surface layout with each lattice labeled with a row number and a column letter.
(b) Paint function for A(1) . (c) Paint function for D. (d) Paint function for B. (e)
Paint function for C. (f ) Paint function for A(0) . (g) Stochastic CRN equivalent to
AND gate.
Reversible Computation Using Swap Reactions on a Surface 193

Species B1 B2 B3 B4 Species A2 A3 A4 A5
AS W W BS I1 W1 I W
(1) (1)
A1 1 W B1 1 W1 I W
(1) (1)
A2 W 1 B2 W1 1 I W
(1) (1)
AF W B3 W1 I 1 W
(0) (1)
A1 0 W W0 W0 B4 W1 I W 1
(0) (1)
A2 W 0 W0 W0 BF W1 I W W
(0) (0)
A3 W W0 0 W0 B1 0 W
(0) (0)
A4 W W0 W0 0 B2 W 0
(0) (0)
AF W W0 W0 BF W W
(a) (b) (c)
Species B2 C2 D2 C3 C4 C5
CS J 1 W1 K W Species B4 C4 D4 E4 D5 C5
(1) (0)
C1 I1 J 1 W1 K W C1 I K J 0 W0 W
(1) (0)
C2 J I1 1 W1 K W C2 K I J 0 W0 W
(1) (0)
C3 J 1 I1 W1 K W C3 K J I 0 W0 W
(1) (0)
C4 J W1 I1 1 K W C4 K J 0 I W0 W
(1) (0)
C5 J W1 I1 K 1 W C5 K J W0 I 0 W
(1) (0)
C6 J W1 I1 K W 1 C6 K J W0 I W 0
(1) (0)
CF J W1 I1 K W W CF K J W0 I W W
(d) (e)

(1) (1) (1) (1)


A2 +BS +CS ↔ AF +B1 +C1
(0) (0) (0) (0)
A4 +BS +CS ↔ AF +B1 +C1
(b) (b)
Xi ↔ Xi+1 ∀X ∈ {A, B, C}, ∀b ∈ {0, 1}

(f)

Fig. 13. Paint functions for the fanout gate. (a) Initial configuration of the fanout gate
with each lattice labeled with a row number and a column letter. (b) Paint function
for A. (c) Paint function for B. (d) Paint function for C (1) including CS . (e) Paint
function for C (0) excluding CS . (f ) Stochastic CRN equivalent to fanout.
194 T. Brailovskaya et al.

Species A3 B3 C3 Species D3 E3 E2 E4
AS J J J BS X J J0 J1
(1) (1)
A1 I1 J J B1 I1 J J0 J1
(1) (1)
A2 J I1 J B2 J I1 J0 J1
(1) (1)
A3 J J I1 B3 J J1 J0 I1
(1) (1)
AF J J BF J J0 I1
(0) (0)
A1 I0 J J B1 I0 J J0 J1
(0) (0)
A2 J I0 J B2 J I0 J0 J1
(0) (0)
A3 J J I0 B3 J J0 I0 J1
(0) (0)
AF J J BF J I0 J1
(a) (b) (c)
Species C3 C4 C5
DS X P P
(1)
Species C1 C2 D1 W1 P P
(1)
CS P P D2 P W1 P
(1) (1)
C1 W1 P D3 P P W1
(1) (1)
C2 P W1 DF P P
(1) (0)
CF P D1 W0 P P
(0) (0)
C1 W0 P D2 P W0 P
(0) (0)
C2 P W0 D3 P P W0
(0) (0)
CF P DF P P
(d) (e)

(b) (b)
Xi ↔ Xi+1 ∀X ∈ {A, B, C, D} ∀b ∈ {0, 1}
(b) (b) (b)
A3 +BS ↔ AF +B1 +DS ∀b ∈ {0, 1}
(b) (b) (b)
C2 +DS ↔ CF +D1 ∀b ∈ {0, 1}

(f)

Fig. 14. Paint function for partial wirecross. Truncated portions are equivalent to
trajectories found in AND/OR/NOT gates. (a) Initial configuration of the central
portion of wirecross with each lattice labeled with a row number and a column letter.
(b) Paint function for A. (c) Paint function for B. (d) Paint function for C. (e) Paint
function for D. (f ) Stochastic CRN equivalent to central portion of wirecross.
Reversible Computation Using Swap Reactions on a Surface 195

References
1. Landauer, R.: Irreversibility and heat generation in the computing process. IBM
J. Res. Dev. 5, 183–191 (1961)
2. Bennett, C.H.: Logical reversibility of computation. IBM J. Res. Dev. 17, 525–532
(1973)
3. Fredkin, E., Toffoli, T.: Conservative logic. Int. J. Theor. Phys. 21, 219–253 (1982)
4. Margolus, N.: Physics-like models of computation. Phys. D Nonlinear Phenom. 10,
81–95 (1984)
5. D’Souza, R.M., Homsy, G.E., Margolus, N.H.: Simulating digital logic with the
reversible aggregation model of crystal growth. In: Griffeath, D., Moore, C. (eds.)
New Constructions in Cellular Automata, pp. 211–230. Oxford University Press,
Oxford (2003)
6. Ouldridge, T.E.: The importance of thermodynamics for molecular systems, and
the importance of molecular systems for thermodynamics. Nat. Comput. 17, 3–29
(2018)
7. Wolpert, D.: The stochastic thermodynamics of computation. J. Phys. Math.
Theor. 52, 193001 (2019)
8. Perumalla, K.S.: Introduction to Reversible Computing. Chapman and Hall/CRC,
Boca Raton (2013)
9. Bennett, C.H.: The thermodynamics of computation-a review. Int. J. Theor. Phys.
21, 905–940 (1982)
10. Soloveichik, D., Seelig, G., Winfree, E.: DNA as a universal substrate for chemical
kinetics. Proc. Natl. Acad. Sci. 107, 5393–5398 (2010)
11. Chen, Y.-J., et al.: Programmable chemical controllers made from DNA. Nat. Nan-
otechnol. 8, 755–762 (2013)
12. Srinivas, N., Parkin, J., Seelig, G., Winfree, E., Soloveichik, D.: Enzyme-free nucleic
acid dynamical systems. Science 358, eaal2052 (2017)
13. Thachuk, C., Condon, A.: Space and energy efficient computation with DNA strand
displacement systems. In: Stefanovic, D., Turberfield, A. (eds.) DNA 2012. LNCS,
vol. 7433, pp. 135–149. Springer, Heidelberg (2012). https://doi.org/10.1007/978-
3-642-32208-2 11
14. Codon, A., Hu, A.J., Manuch, J., Thachuk, C.: Less haste, less waste: on recycling
and its limits in strand displacement systems. Interface Focus 2, 512–521 (2012)
15. Condon, A., Thachuk, C.: Towards space- and energy-efficient computations. In:
Kempes, C., Grochow, J., Stadler, P., Wolpert, D. (eds.) The Energetics of Com-
puting in Life and Machines, Chap. 9, pp. 209–232. The Sante Fe Institute Press,
Sante Fe (2019)
16. Qian, L., Soloveichik, D., Winfree, E.: Efficient turing-universal computation with
DNA polymers. In: Sakakibara, Y., Mi, Y. (eds.) DNA 2010. LNCS, vol. 6518, pp.
123–140. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18305-
8 12
17. Qian, L., Winfree, E.: Parallel and scalable computation and spatial dynamics with
DNA-based chemical reaction networks on a surface. In: Murata, S., Kobayashi, S.
(eds.) DNA 2014. LNCS, vol. 8727, pp. 114–131. Springer, Cham (2014). https://
doi.org/10.1007/978-3-319-11295-4 8
18. Goldschlager, L.M.: The monotone and planar circuit value problems are log space
complete for P. ACM SIGACT News 9, 25–29 (1977)
19. Masson, G.M., Gingher, G.C., Nakamura, S.: A sampler of circuit switching net-
works. Computer 12, 32–48 (1979)
196 T. Brailovskaya et al.

20. Savage, J.E.: Models of Computation. Addison-Wesley, Reading (1998). Section


12.6
21. Qian, L., Winfree, E.: Scaling up digital circuit computation with DNA strand
displacement cascades. Science 332, 1196–1201 (2011)
22. Milner, R.: Communication and Concurrency. Prentice Hall, Upper Saddle River
(1989)
23. Johnson, R.F., Dong, Q., Winfree, E.: Verifying chemical reaction network imple-
mentations: a bisimulation approach. Theor. Comput. Sci. 765, 3–46 (2019)
Error-Free Stable Computation
with Polymer-Supplemented Chemical
Reaction Networks
Allison Tai(B) and Anne Condon

University of British Columbia, Vancouver, BC V6T 1Z4, Canada


{tyeuyang,condon}cs.ubc.ca

Abstract. When disallowing error, traditional chemical reaction net-


works (CRNs) are very limited in computational power: Angluin et al.
and Chen et al. showed that only semilinear predicates and functions
are stably computable by CRNs. Qian et al. and others have shown that
polymer-supplemented CRNs (psCRNs) are capable of Turing-universal
computation. However, their model requires that inputs are pre-loaded
on the polymers, in contrast with the traditional convention that inputs
are represented by counts of molecules in solution. Here, we show that
psCRNs can stably simulate Turing-universal computations even with
solution-based inputs. However, such simulations use a unique “leader”
polymer per input type and thus involve many slow bottleneck reactions.
We further refine the polymer-supplemented CRN model to allow for
anonymous polymers, that is, multiple functionally-identical copies of a
polymer, and provide an illustrative example of how bottleneck reactions
can be avoided in this new model.

Keywords: Stable computation · Chemical reaction networks ·


DNA polymers

1 Introduction
The logical, cause-and-effect nature of chemical reactions has long been recog-
nized for its potential to carry information and make decisions. Indeed, biolog-
ical systems exploit interacting digital molecules to perform many important
processes. Examples include inheritance with DNA replication, passing infor-
mation from the nucleus to the cytoplasm using messenger RNA, or activating
different cellular states through signal transduction cascades. Chemical reaction
networks (CRNs) exploit these capabilities to perform molecular computations,
using a finite set of molecular species (including designated input and output
species) and reactions. Reactions among molecules in a well-mixed solution cor-
respond to computation steps. CRN models may use mass-action kinetics, where
the dynamics of the reactions are governed by ordinary differential equations,
or stochastic kinetics, where the choice of reaction and length of time between
reactions depends on counts of molecular species. We focus on stochastic CRNs
in this work.
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 197–218, 2019.
https://doi.org/10.1007/978-3-030-26807-7_11
198 A. Tai and A. Condon

Stochastic CRNs using unbounded molecular counts are Turing-universal [1],


but have a non-zero chance of failure. One challenge is that CRNs are unable to
detect the absence of a molecule, and therefore when all molecules of a particu-
lar species have been processed. For example, when trying to simulate a register
machine, if their count of a species corresponds to a register value, then a test-for-
zero instruction needs to detect when all molecules have been depleted, i.e., their
count is zero. Indeed, while the error of a CRN simulation of Turing-universal com-
putation can be made arbitrarily small, it can never reach zero [2].
Error-free CRNs include those that exhibit stable computation: the output
can change as long as it eventually converges to the correct answer; and commit-
ting computation: the presence of a designated “commit” species indicates that
the output is correct and does not change subsequently. The class of predicates
stably computable by CRNs is limited to semilinear predicates [3], and functions
computable by committing CRNs are just the constant functions [2].
Cummings et al. [4] introduced the notion of limit-stable computation, which
relaxes the stability requirement. In a computation of a limit-stable CRN, the
output may change repeatedly, but the probability of changing the output from
its correct value goes to zero in the limit. Cummings et al. show that any halting
register machine can be simulated by a limit-stable CRN. Their construction
involves repeated simulations of a register machine, resetting the register values
each time, along with slowing down any error-prone reactions each time they
occur. They show that the computational power then becomes equivalent to
that of a Turing machine with the ability to change its output a finite number
of times, capable of deciding predicates in the class Δ02 of limit-computable
function.
From these insights, we can see that CRN computations that produce the
correct answer with probability 1 are still severely limited. We ask, “Is there any
way to extend CRNs to work around the lack of ability to detect absence?” Qian
et al. [5] gave a promising answer to this question by introducing a CRN model
that is supplemented by polymers that behave as stacks, onto which monomers
can be pushed and popped. Most importantly, this extended model allows for
the stack base unit ⊥ to be used as a reactant in implementing a “stack empty”
operation. Indeed, Qian et al. use this operation in an error-free simulation of a
stack machine. The resulting protocol, however, requires that the entire input is
pre-loaded onto one of the stacks, a large change from traditional CRNs which
assumes the inputs are well-mixed in a solution.
Motivated by the work of Qian et al., we wish to go one step further: Is
Turing-universal stable computation by polymer-supplemented CRNs (psCRNs)
possible when the input is represented by counts of monomers in a well-mixed
solution? Intuitively, if input monomers can be loaded on to a polymer, absence
of that species from the system could be detected by emptiness of the polymer,
and thus circumvent a significant barrier to error-free, Turing-universal compu-
tation. The obvious obstacle is that it seems impossible to guarantee that all
inputs are loaded on the polymer before computation can begin, if we can’t reli-
ably check for absence of inputs in the environment. At first glance, the logic
appears circular, but we show that indeed stable Turing-universal computation
is possible, and also present ideas for speeding up such computations.
Stable Computation with Polymers 199

In the rest of this section we describe our four main contributions and review
related work. Section 2 introduces our polymer CRN models, Sects. 3, 4, and 5
describe our results, and Sect. 6 concludes with a summary and directions for
future work.

1.1 Contributions and Highlights


Stable Register Machine Simulation Using CRNs with Leader Polymers. We
design a polymer-supplemented CRN (psCRN) that simulates a register machine,
assuming that all inputs are pre-loaded on polymers, with one polymer per
species. We then augment the simulator CRN with CRNs that detect when an
input has been loaded, and that restarts the simulator in this case. This scheme is
similar to the error correction scheme of Cummings et al., but leverages polymers
to ensure stable computation. Our polymer simulation of register machines, and
thus Turing-universal computation, has a unique polymer per input species,
as well as a “program counter” to ensure that execution of reactions follows
the proper order. In the parlance of traditional CRNs, these molecules serve
as “leaders”. As a consequence, the simulation has a high number of so-called
bottleneck reactions, which involve two leader reactants. Bottleneck reactions
are undesirable because they are slow.

Anonymous Polymers Can Help Avoid Bottleneck Reactions. To avoid bottle-


neck reactions, we propose a CRN polymer model with no limit on the number
of polymers of a given species, other than the limit posed by the volume of
the system. In addition to type-specific increment, decrement and test-if-empty
operations (which are applied to one polymer of a given species), polymer stubs
can be created or destroyed. We call such polymers “anonymous”. We illustrate
the potential of psCRNs with anonymous polymers to reduce bottleneck reac-
tions, by describing psCRN to compute f (n) = n2lg n (which is the same as n2
when n is a power of 2).

Abstractions for Expressing CRN Multi-threading and Synchronization. Our


CRN for f (n) = n2lg n uses threading to ensure that polymer reactions can
happen in parallel, and uses a “leader” polymer for periodic synchronization.
To describe our psCRN, we develop threading abstractions for psCRNs with
anonymous polymers.

Time Complexity and a Simulator for CRNs with Anonymous Polymers. To test
the correctness of our psCRNs and evaluate their running times, we developed
a custom CRN simulator designed to support anonymous polymers and their
associated reactions. Underlying our simulator is a stochastic model of psCRN
kinetics that is a natural extension of traditional stochastic CRNs and population
protocols. We also use this model to analyze the expected time complexities of
our psCRNs examples in this paper, showing how speedups are possible with
anonymous polymers.
200 A. Tai and A. Condon

1.2 Related Work


Soloveichik et al. [6] demonstrated how Turing-universal computation is possi-
ble with traditional stochastic CRNs, achieving arbitrarily small (but non-zero)
error probability. For the CRN model without polymers Cummings et al. [4]
showed how to reset computations so as to correct error and achieve limit-stable
computation (which is weaker than stable computation).
In order to understand the inherent energetic cost of computation, Bennett
[7,8] envisioned a polymer-based chemical computer, capable of simulating Tur-
ing machines in a logically reversible manner. Qian et al. [5] introduced a stack-
supplemented CRN model in which inputs are pre-loaded on stacks, and showed
how the model can stably simulate stack machines. Johnson et al. [9] intro-
duce a quite general linear polymer reaction network (PRN) model for use with
simulation and verification, as opposed to computation. Cardelli et al. [10] also
demonstrated Turing-universal computation using polymers, using process alge-
bra systems, but these systems are not stochastic. Jiang et al. [11] also worked on
simulating computations with mass-action chemical reactions, using a chemical
clock to synchronize reactions and minimize errors.
Lakin et al. [12] described polymerizing DNA strand displacement systems,
and showed how to model and verify stack machines at the DSD level. They also
simulated their stochastic systems using a “just-in-time” extension of Gillespie’s
algorithm. Their model has a single complex to represent a stack. Recognizing
limitations of this, they noted that “it would be desirable to invent an alternative
stack machine design in which there are many copies of each stack complex...”,
which is what we do in this paper. They propose that updates to stacks could
perhaps be synchronized using a clock signal such as that proposed by Jiang
et al. [11]. In contrast, our synchronization mechanism is based on detection of
empty polymers.
The population protocol (PP) model introduced by Angluin et al. [13], which
is closely related to the CRN model, focuses on pairwise-interacting agents that
can change state. In Angluin et al.’s model, agents in a PP are finite-state. An
input to a computation is encoded in the agents’ initial states; the number of
agents equals the input size. Any traditional CRN can be transformed into a
PP and vice versa. Chatzigiannakis et al. [14] expand the n agents to be Turing
machines, then examine what set of predicates such protocols can stably compute
using O(log n) memory. Although the memory capacity of our polymers can
surpass O(log n), polymer storage access is constrained to be that of a counter
or stack, unlike the model of Chatzigiannakis et al.

2 Polymer-Supplemented Chemical Reaction Networks


A polymer-supplemented stochastic chemical reaction network (psCRN) models
the evolution of interacting molecules in a well-mixed volume, when monomers
can form polymers. We aim for simplicity in our definitions here, providing just
enough capability to communicate the key ideas of this paper. Many aspects of
our definitions can be generalized, for example by allowing multiple monomer
Stable Computation with Polymers 201

species in a polymer, or double-end polymer extensibility, as is done in the work


of Johnson et al. [9], Lakin et al. [12], Qian et al. [5], and others.

Reactions. A traditional CRN describes reactions involving molecules whose


species are given by a finite set Σ. A reaction

r + r −−→ p + p (1)

describes what happens when two so-called reactant molecules of species r, r ∈ Σ


collide: they produce molecules of species p ∈ Σ and p ∈ Σ. We assume that all
reactions have exactly two reactants and two products, that the multi-sets {r, r }
and {p, p } are not equal, that for any r and r , there is at most one reaction
with reactants of species r and r . For now we do not ascribe a rate constant to
a reaction; we will do that in Sect. 5.
Polymer-supplemented chemical reaction networks (psCRNs) also have reac-
tions pertaining to polymers. A designated subset Σ (m) of Σ is a set of
monomers. A polymer of type σ ∈ Σ (m) , which we also call a σ-polymer, is
a string ⊥σ σ i , i ≥ 0; its length is i and we say that the polymer is empty if its
length is 0. We call ⊥σ a stub and let ⊥ = {⊥σ | σ ∈ Σ (m) } ⊂ Σ. Reactions
can produce stubs from molecules of other species in Σ; this is an important
way in which our model differs from previous work [5,12]. Polymer reactions
also involve molecules in a set A = {Aσ | σ ∈ Σ (m) } of active query molecules,
where A ⊆ Σ − Σ (m) . For each σ ∈ Σ (m) there is a reversible polymer reaction,
with the forwards and backwards directions corresponding to σ-push and σ-pop,
respectively:

Later, we will introduce “inactive” variants of the Aσ molecules, both to help


control when pushes and pops happen, and to help track whether a polymer is
empty (has length 0) or not.

Configurations. A configuration specifies how many molecules of each species


are in the system, keeping track also of the lengths of all σ-polymers. Formally,
a configuration is a mapping c : Σ ∪ {⊥σ σ i | i ≥ 1} → N, where N is the set
of nonnegative integers. We let c([⊥σ . . .]) denote total number of σ-polymers
in the system (including stubs) and let c([⊥σ . . . σ]) denote total number of σ-
polymers in the system that have length at least 1. With respect to configuration
c, we say that a molecule of species σ ∈ Σ is a leader if c(σ) = 1, and we say
that a σ-polymer is a leader if c([⊥σ . . .]) = 1.
A reaction of type (1) is applicable to configuration c if, when r = r , c(r) ≥ 1
and c(r ) ≥ 1, and when r = r , c(r) ≥ 2. If the reaction is applied to c, a new
configuration c is reached, in which the counts of r and r decrease by 1 (when
r = r the count of r decreases by 2), the counts of p and p increase by 1 (when
p = p the count of p increases by 2), and all other counts remain unchanged.
A σ-push is applicable if c([⊥σ . . .]) > 0 and c(σ) > 0, and a σ-pop is
applicable if c([⊥σ . . . σ]) > 0 and c(Aσ ) > 0. The result of applying a σ-push
reaction is that c(σ) decreases by 1, c(Aσ ) increases by 1 and also for exactly one
202 A. Tai and A. Condon

i ≥ 0 such that c(⊥σ σ i ) > 0, c(⊥σ σ i ) decreases by 1 and c(⊥σ σ i+1 ) increases
by 1. Similarly, the result of applying a σ-pop reaction is that c(σ) increases
by 1, c(Aσ ) decreases by 1, and for exactly one i ≥ 1 such that c(⊥σ σ i ) > 0,
c(⊥σ σ i ) decreases by 1 and c(⊥σ σ i−1 ) increases by 1. Intuitively, the length of
one σ-polymer in the system either grows or shrinks by 1 and correspondingly
the count of Aσ either increases or decreases by 1. The affected polymer is
chosen nondeterministically; exactly how the polymer is chosen is not important
in the context of stable computation. For example, the polymer could be chosen
uniformly at random, consistent with the model of Lakin and Phillips [12]. We
defer further discussion of this to Sect. 5.
If c results from the application of some reaction to c, we write c → c and
say that c is directly reachable from c. We say that c is reachable from c if for
some k ≥ 0 and configurations c1 , c2 , . . . , ck ,

c → c1 → c2 . . . → ck → c .

Computations and Stable Computations. We’re interested in CRNs that com-


pute, starting from some initial configuration c0 that contains an input. For
simplicity, we focus on CRNs that compute functions f : Nk → N. For example,
the function may be Square, namely f (n) = n2 .
In a function-computing psCRN, the input n = (n1 , . . . , nk ) ∈ Nk is repre-
sented by counts of species in a designated set I = {X1 , X2 , . . . , Xk } ⊆ Σ (m)
and the output is represented by the count of a different designated species
Y ∈ Σ (m) . In the initial configuration c0 = c0 (n), the initial counts of the input
species Xi is ni , 1 ≤ i ≤ k, and the counts of all species other than the input
species, including polymers and active query molecules, is 0, with the following
exceptions. First, there may be some leader molecules or polymers present. Sec-
ond, the count of a designated “blank” species B ∈ Σ may be positive. Blank
molecules are useful in order to keep all reactions bimolecular, since a unimolec-
ular reaction r → p can be replaced by r + B → p + B (if B’s are guaranteed to
always be present). Blanks can also be used to create new copies of a particular
molecular species.
A computation of a psCRN is a sequence of configurations starting with
an initial configuration c0 , such that each configuration (other than the first)
is directly reachable from its predecessor. Let C be a psCRN, and let c be a
configuration of C. We say that c is stable if for all configurations c reachable
from c, c(Y ) = c (Y ), where Y is the output species. The psCRN stably computes
a given function f : Nk → N if on any input n ∈ Nk , for any configuration c
reachable from c0 (n), a stable configuration c is reachable from c and moreover,
c (Y ) = f (n). Finally if psCRN C stably computes a given predicate, we say that
C is committing if C has a special “commit” species LH such that for all n ∈ Nk ,
for any configuration c reachable from c0 (n) that contains species LH , if c is
reachable from c then c also contains LH and c (Y ) = f (n).

Bottleneck Reactions. In our CRN algorithms of Sect. 3, many reactions involve


a leader molecule, representing a program counter, that reacts with a leader
Stable Computation with Polymers 203

polymer. Such reactions, in which the count of both reactants is 1, is often


described as a bottleneck reaction [15]. As explained in Sect. 5, in a stochastic
CRN that executes in a well-mixed system with volume V , the expected time for
such a reaction is Θ(V ) [6]. Our motivation for the anonymous polymer model
in Sect. 4 is to explore how to compute with polymers in a way that reduces
bottleneck reactions.

3 Stable, Turing-Universal Computation by Sequential


PsCRNs with Leader Polymers
Here we describe how psCRNs with leader polymers can stably simulate register
machines, thereby achieving Turing-universal computation. Before doing so, we
first introduce psCRN “pseudocode” which is convenient for describing psCRN
algorithms. Then, as an illustration, we describe a psCRN to compute the Square
function f (n) = n2 . We first do this for a slightly different input convention than
that described in Sect. 2: we assume that all input molecules are “pre-loaded” on
polymers. For this pre-loaded input model, building strongly on a construction
of Cummings et al. [4], we show how committing psCRNs can simulate register
machines, thereby achieving Turing-universal computation. Finally, we remove
the requirement that the input is pre-loaded by adding mechanisms to detect
when an input is loaded, and to restart the simulator in this case.

Sequential psCRN Pseudocode. Following earlier work [4–6,16], we describe a


psCRN program as a sequence of instructions, ordered consecutively starting at
1. Because one instruction must finish before moving on to the next, we call these
sequential psCRNs. Corresponding to each instruction number i is a molecular
“program counter” species Li ∈ Σ. One copy of L1 is initially present, and no
other Li for i = i is initially present.
The instructions inc(σ) and dec(σ) of Table 1 increase and decrease the
length of a σ-polymer by 1, respectively, making it possible to use the polymers
as counters. We assume that always a sufficient number of blanks are in the
system in order for the inc() instruction to proceed. In order to ensure that
the push and pop reactions happen only within the inc() and dec() reactions,
the inc(σ) operation generates the active query Aσ , which is converted into
an inactive variant Iσ ∈ Σ − Σ (m) before the instruction execution completes,
and the dec(σ) instruction reactivates Aσ in order to reduce the length of a
σ-polymer by 1. If a psCRN executes only instructions of Table 1, starting from
an initial configuration in which there is no polymer of length greater than 0,
then we have the following invariant:

Invariant: Upon completion of any instruction, the count of Iσ equals the


sum of the lengths of σ-polymers.

The jump-if-empty instruction is useful when there is a leader σ-polymer.


This σ-polymer is empty (has length 0) if and only if a stub ⊥σ is in the sys-
tem. Assuming that our invariant holds, the leader σ-polymer is not empty if
204 A. Tai and A. Condon

and only if at least one Iσ molecule is in the system. Either way, the instruc-
tion ensures that the program counter advances properly. When the σ-polymer
is empty, the dec(σ) cannot proceed and causes an algorithm to stall. The
jump-if-empty(σ, k) instruction provides a way to first check whether the
σ-polymer is empty, and if not, dec(σ) can safely be used. The create and
destroy instructions provide a way to create and destroy copies of a species. For
clarity, we also include create-polymer(σ) and destroy-polymer(σ) instruc-
tions, which create and destroy the stub ⊥σ , respectively. While more than one
reaction is needed to implement one instruction, all will have completed when
the instruction has completed and the program counter is set to the number of
the next instruction to be executed in the pseudocode.

Table 1. Instruction abstractions of psCRN reactions. The decrement dec(σ) instruc-


tion can complete only if some σ-polymer has length is at least 1.

Pseudocode instructions may also be function calls, where a function is itself


a sequence of instructions expressed as pseudocode. Suppose again that there
is a leader σ-polymer and also a leader σ  -polymer in the system. Then the
copy(σ, σ  ) function (using a temporary τ -polymer) extends the length of the
σ  -polymer by the length of the σ-polymer. Another useful function is flush(σ)
which decrements the (leader) σ-polymer until its length is 0. A third function,
release-output(σ), is useful to “release” molecules on a (leader) σ-polymer as
Y molecules into the solution. This function uses an additional special leader
Y  -polymer which is empty in the initial configuration, and whose length at the
end of the function equals the number of released Y molecules. The Y  molecule
will be useful later, when we address how a psCRN can be restarted (and should
not be used elsewhere in the code).
Stable Computation with Polymers 205

i: copy(σ, σ  ) i : goto(i.1)
i.1: create-polymer(τ )
i.2: jump-if-empty(σ, i.7)
i.3: dec(σ)
i.4: inc(σ  )
i.5: inc(τ )
i.6: goto(i.2)
i.7: jump-if-empty(τ, i.11)
i.8: dec(τ )
i.9: inc(σ)
i.10: goto(i.7)
i.11: destroy-polymer(τ )
i.12: goto(i + 1)

i: flush(σ) i: goto(i.1)
i.1: jump-if-empty(σ, i + 1)
i.2: dec(σ)
i.3: goto(i.1)

i: release-output(σ) i: goto(i.1)
i.1 jump-if-empty(σ, i + 1)
i.2 dec(σ)
i.3 inc(Y  )
i.4 create(Y )
i.5 goto(i.1)

Numbering of Function Instructions. For clarity, we use i.1, i.2, and so on to


label the lines of a function called from line i of the main program. Upon such
a function call, the CRN’s program counter first changes from Li to Li.1 . The
program counter is restored to Li+1 upon completion of the function’s instruc-
tions, e.g., via a goto(i+1) instruction or a jump-if-empty(σ, i+1) instruction.
If one function fB is called from line a.b of another function fA , the program
counter labels would be a.b.1, a.b.2 and so on, and so the label “i” in the func-
tion description should be interpreted as “a.b”. In this case, when the function
fB completes, control is passed back to line a.(b + 1) of function fA ; that is,
the “goto(i + 1)” statement should be interpreted as “goto(a.(b + 1))”. Also for
clarify, we use special labeling of instructions in a few special places, such as the
restart function below, in which instructions are labeled s1, s2 and so on.

psCRNs with Pre-loaded Inputs. As noted in the introduction, a challenge in


achieving stable computation with psCRNs is detecting the absence of inputs.
To build up to our methods for addressing this challenge, we first work with a
more convenient convention, that of pre-loaded inputs. By this we mean that if
the input contains ni molecules of a given species Xi , then in the initial config-
uration there is a unique Xi -polymer of length ni (the “pre-loaded” polymer).
Furthermore, there are ni copies of the inactive query molecule IXi in the sys-
tem. Intuitively, the pre-loaded initial configuration is one that would be reached
206 A. Tai and A. Condon

if ni inc(Xi ) operations were performed from an initial configuration with no


inputs and an empty Xi -polymer, for every input species Xi .

A Committing, Sequential psCRN with Pre-loaded Inputs for Square. Our


psCRN for the Square function f (n) = n2 has one input species X and one out-
put species Y . In the pre-loaded initial configuration, the input is represented
as the length n of a leader X-polymer, and the count of IX is n. The number
of blanks in the initial configuration must be greater than n2 , since blanks are
used to produce the n2 output molecules. The only other molecule in the initial
configuration is the leader program counter L1 . The psCRN has a loop (imple-
mented using jump-if-empty and goto) that executes n times, adding n to an
intermediate Yint -polymer each time. When the loop completes, the output is
released from the Yint -polymer in the form of Y , so that the number of Y ’s in
solution is n2 , and the psCRN halts. The halting state is in effect a committing
state, since no transition is possible from LH .

Algorithm 1. Sequential-n2 -psCRN, with input n pre-loaded on X-polymer.


1: create-polymer(X  )
2: create-polymer(Yint )
3: copy(X, X  )
4: jump-if-empty(X  ,8)
5: dec(X  )
6: copy(X, Yint )
7: goto(4)
8: release-output(Yint )
9: halt

Committing Turing-Universal Computation by psCRNs with Pre-loaded Inputs.


Turing-universal computation is possible with register machines (RMs). To sim-
ulate a halting register machine that computes function f : Nk → N with r ≥ k
unary registers, a psCRN has r unary counters R1 , R2 , . . . , Rr , the first k of
which initially contain the input counts n1 , n2 , . . . , nk , while the others are ini-
tially 0. Throughout the simulation of the register machine, the psCRN has
exactly one Rl -polymer for each register Rl , 1 ≤ l ≤ r. In addition, there is one
additional polymer, a Y  -polymer, which is initially empty and is used by the
release-output function. A register machine program is a sequence of instruc-
tions, where instructions can increment a register; decrement a non-empty reg-
ister; test if a register is empty (0) and jump to a new instruction if so; or halt.
Table 1 already shows how all four of these instructions can be implemented
using a psCRN. We assume in what follows that these are the only instructions
used by the psCRN simulator; in particular, no additional registers (polymers)
are ever created or destroyed. If register Rr is used to store the output, then the
output is released into solution, using release-output(Rr ), once the machine
being simulated reaches its halt state. We assume that release-output(Rr ) is
the only function call of the RM simulator.
Stable Computation with Polymers 207

Stable, Turing-Universal Computation by psCRNs. We now handle the case that


the input is represented as counts of molecules, rather than pre-loaded poly-
mers. That is, in the initial configuration of the psCRN all polymers of types
R1 , R2 , . . . , Rr are empty, and instead, for each input nl , 1 ≤ l ≤ k, there are nl
copies of molecule Rl in solution. Our scheme uses the Rl -push reaction to load
inputs. We add CRNs to detect input-loading and to restart the simulator in
this case. Once all inputs are loaded, the system is never subsequently restarted.
Overall our simulation has four components:
– Input loading: This is done as Rl -push, which can happen at any time until
all inputs are loaded. Recall that the Rl -push reactions are

Each such reaction generates an active query molecule ARl which, as


explained below, triggers input detection.
– Register machine (RM) simulation: Algorithm 2 shows the simulator in
the case of three input registers. This psCRN program has a “prelude” phase
that starts by creating three new polymers R1 , R2 and R3 (lines p1, p2, and
p3), and then copies the input register polymers R1 , R2 , and R3 to polymers
R1 , R2 , and R3 , respectively (lines p4, p5, and p6). Then starting from line
numbered 1, the simulation uses register Rl rather than Rl , 1 ≤ l ≤ 3, as well
as the remaining initially empty registers R4 , . . . , Rr . Upon completion of the
computation, the output is released from register Rr , and the simulator halts
(produces the LH species).

Algorithm 2. Sequential-RM-psCRN, k = 3 input registers, r registers in total.


p1: create-polymer(R1 )
p2: create-polymer(R2 )
p3: create-polymer(R3 )
p4: copy(R1 , R1 )
p5: copy(R2 , R2 )
p6: copy(R3 , R3 )
1: // Rest of psCRN simulation pseudocode here, with
2: // R1 , R2 and R3 replaced by R1 , R2 and R3
: ...
: // ending with release-output(Rr ) function and halt instruction.

– Input detection: This is triggered by the presence of an active query


molecule ARl . For each value i of the main program counter after the prelude
phase (i.e., after lines p1 through p6) and for LH we have the following reac-
tions, where s1 is the first number of the restart pseudocode (see below).
The reactions convert the active ARl molecule into its inactive counterpart,
IRl , since the input molecule is now loaded, and also changes the program
counter to Ls1 , which triggers restart.
Li + ARl −−→ Ls1 + IRl , 1 ≤ l ≤ k,
LH + ARl −−→ Ls1 + IRl , 1 ≤ l ≤ k.
208 A. Tai and A. Condon

LH is no longer a committing species, since it may change to Ls1 .

No input detection is done in prelude lines p1, p2, and p3. Line p4 is a
function call to copy(R1 , R1 ), which executes instructions numbered p4.1
through p4.11 of copy. Input detection is only done at line p4.2, the first
jump-if-empty instruction:

Lp4.2 + AR1 −−→ Lp4.2 + IR1 .

It does not trigger a restart, but simply converts the active query molecule
AR1 to IR1 . Similarly, for lines p5 and p6, we add the reactions

Lp5.2 + AR2 −−→ Lp5.2 + IR2 and


Lp6.2 + AR3 −−→ Lp6.2 + IR3 .

– Restart: Restart happens a number of times that is at most the total input
length n1 + n2 + . . . nk , since each input molecule is loaded into a register
exactly once, generating one active query molecule. For k = 3, the registers
R1 , R2 and R3 , as well as the registers R4 , . . . , Rr are flushed, and any outputs
that have been released in solution are destroyed, assuming that the number
of outputs released into the solution was tracked by some Y  register, as
before. Then the program counter is set to line p4 of the simulator (leader
molecule Lp4 ). Algorithm 3 shows the restart pseudocode.

Algorithm 3. Restart
s1: flush(R1 )
s2: flush(R2 )
s3: flush(R3 )
s4: flush(R4 )
...
sr: flush(Rr )
s(r + 1): destroy-output()
s(r + 2): goto(p4)

i: destroy-output() i: goto(i.1)
i.1: jump-if-empty(Y  ,i.5)
i.2: dec(Y  )
i.3: destroy(Y )
i.4: goto(i.1)
i.5: goto(i + 1)

Correctness of Algorithm 2: Sequential-RM-psCRN. We claim that our register


machine simulator without pre-loaded inputs stably computes the same function
as the register machine, assuming that sufficiently many blank molecules B are
Stable Computation with Polymers 209

present to ensure that reactions with B as a reactant can always proceed. (We
note that no “fairness” assumption regarding the order in which reactions happen
is necessary to show stability, since stability is a “reachability” requirement.)
The first three instructions, lines p1, p2, and p3), simply create polymers R1 ,
R2 , and R3 . The delicate part of the simulation lies in the next three instructions


on lines p4, p5, and p6, which copy input registers R1 , R2 , and R3 to R1 , R2 and
R3 , respectively. For concreteness, consider the instruction copy(R1 , R1 ) in line
p4. (The argument is the same for line p5, with R2 , R2 substituted for R1 , R1 ,
and is also the same for line p6, with R3 , R3 substituted for R1 , R1 .)
The R1 -push reaction used in input loading can cause a violation of our earlier
invariant that upon completion of each instruction, the count of IR1 equals the
length of the (leader) R1 -polymer. Instead, we have that IR1 is less than or equal
to the length of the R1 -polymer. This can cause the jump-if-empty instruction
numbered p4.2 in the copy function to stall, when there is no IR1 and also no
⊥R1 (since the R1 -polymer is not empty due to input loading). In this case, the
input detection reaction (introduced above)

Lp4.2 + AR1 −−→ Lp4.2 + IR1 ,

will convert AR1 to IR1 . This averts stalling, since jump-if-empty can proceed
using IR1 . The subsequent lines of the copy(R1 , R1 ) code can then proceed.
Once lines p4, p5, and p6 have completed, the correctness of the psCRN
simulation of the register machine, using the copies R1 , R2 and R3 , is not affected
by input loading. Input loading and input detection can also proceed. These
are the only viable reactions from the “halting” state LH , and so eventually
(since the RM machine being simulated is a halting machine), on any sufficiently
long computation path, all inputs must be loaded and detected. Input detection
after the prelude phase produces a “missing” Iσ molecule and triggers a restart.
The restart flushes all registers used by the simulator, and also, using the Y -
polymer, destroys any outputs in solution. (Since restart is triggered only when
the program counter is at a line of the main program, restart does not interrupt
execution of the release-output function.) A new simulation is then started at
line p4, ensuring that any inputs that have been loaded since the last detect are
copied to the simulator’s input registers R1 , R2 and R3 .
Once all inputs have been detected, the invariant is restored and the simulator
proceeds correctly, producing the correct output. This correct output is never
subsequently changed, and so the computation is stable.

Bottleneck Reactions. In our sequential psCRNs, both inc(σ) and dec(σ) contain
bottleneck reactions, and so copy(σ, σ  ) has Θ(|σ|) bottleneck reactions. Thus
the psCRN for Square has Θ(n2 ) bottleneck reactions. In the next section we
show how to compute a close variant of the Square function with fewer bottleneck
reactions, using anonymous polymers rather than leader polymers.
210 A. Tai and A. Condon

4 Faster Computation of Square by Threaded psCRNs


with Anonymous Polymers
To avoid the bottleneck reactions of our sequential psCRN, we enable the inc(σ)
and dec(σ) instructions to operate on many functionally-identical “anonymous”
σ-polymers, rather than just a single leader polymer. Here we describe how this
can work, using the function f (n) = n2lg n as an example, and focusing only
on the pre-loaded input model. Error detection and correction can be layered
on, in a manner similar to Sect. 3.
We start with a single Y -polymer of length n, and we wish to create a total
of 2lg n Y -polymers, whose lengths sum to n2lg n . Algorithm 4 proceeds in
lg n rounds (lines 6–9), doubling the number of Y ’s on each round. To keep
track of the Y molecules, we introduce a distributed σ-counter data structure,
and use it with σ = Y . The data structure consists of σ-polymers that we call
σ-thread-polymers, plus a thread-polymer counter Tσ , which is a leader polymer
whose length, |Tσ |, is the number of σ-thread-polymers. The value of this dis-
tributed counter is the total length of all σ-thread-polymers. We explain below
how operations on this distributed counter work.

Algorithm 4. Threaded-n2logn -psCRN.


1: create-polymer(H)
2: copy(X, H)
3: create-distributed-counter(Y )
4: add-thread-polymer(Y ,1)
5: copy(X, Y )
6: halve(H)
7: jump-if-empty(H,10)
8: double(Y )
9: goto(6)
10: halt

Algorithm 4 counts the number of rounds using a leader H-polymer, whose


length is halved on each round. The halve function is fairly straightforward to
implement, using the instructions and functions already introduced in Sect. 3.
i: halve(H) i: goto(i.1)
i.1: create-polymer(H  )
i.2: copy(H, H  )
i.3: jump-if-empty(H  , i.9)
i.4: dec(H  )
i.5: dec(H)
i.6: jump-if-empty(H  , i.9)
i.7: dec(H  )
i.8: goto(i.3)
i.9: destroy-polymer(H  )
i.10: goto(i + 1)
Stable Computation with Polymers 211

The double(σ) function of Algorithm 4 is where we leverage our distributed


Y -counter (with σ = Y ). Recall that a distributed σ-counter data structure
consists of a set of anonymous σ-polymers, which we call σ-thread-polymers,
plus a thread-polymer counter Tσ , which is a leader polymer whose length is
the number of σ-thread-polymers. The double function first creates two other
distributed counters τ and τ  (lines i.1 and i.2), and gives each the same number
of thread-polymers as σ, namely |Tσ | thread-polymers (lines i.3 and i.4), all
of which are empty. The heart of double (line i.5) transfers the contents of
the distributed σ-counter to τ and τ  , emptying and destroying all σ-thread-
polymers in the process. It then creates double the original number of (empty)
σ-thread-polymers (lines i.6 and i.7; note that the number of threads of τ is the
original value of |Tσ |). It finally transfers the τ and τ  polymers back to σ (lines
i.8 and i.9), thereby doubling σ.

i: double(σ) i.1 create-distributed-counter(τ )


i.2 create-distributed-counter(τ  )
i.3 add-thread-polymers(τ , Tσ )
i.4 add-thread-polymers(τ  , Tσ )
i.5 transfer(σ, τ , τ  )
i.6 add-thread-polymers(σ, Tτ )
i.7 add-thread-polymers(σ, Tτ  )
i.8 transfer(τ , σ)
i.9 transfer(τ  , σ)
i.10 destroy-distributed-counter(τ )
i.11 destroy-distributed-counter(τ  )
i.12 goto(i + 1)
Next are details of instructions used to create an empty distributed counter, and
to add empty threads to the counter. Again, these are all straightforward sequential
implementations (no threads), using leader polymers to keep track of counts.

i: create-distributed-counter(σ) i: goto(i.1)
// Creates an empty counter i.1 create-polymer(Tσ )
// with zero polymers i.2 goto(i + 1)
i add-thread-polymers(σ, T ) i goto(i.1)
// Adds |T | empty i.1: create-polymer(Temp)
// thread-polymers to the i.2: copy(T ,Temp)
// distributed σ-counter, i.3: jump-if-empty(Temp, i.8)
// where T is a counter i.4: dec(Temp)
i.5: create-polymer(σ)
i.6: inc(Tσ )
i.7: goto(i.3)
i.8: destroy-polymer(Temp)
i.9: goto(i + 1)
i add-thread-polymer(σ, 1) i goto(i.1)
// Adds one empty i.1: create-polymer(σ)
// thread-polymer to the i.2: inc(Tσ )
// distributed σ-counter i.3: goto(i + 1)
212 A. Tai and A. Condon

The transfer function transfers the value of a distributed σ-counter to two


other distributed counters called τ and τ  . In line i.2 of transfer, function
create-threads creates Tσ identical “thread” program counters, Lt . Once again
this is straightforward, using a leader polymer to keep track of counts. All of
the thread program counters execute the thread-transfer function in line i.4
of transfer, thereby reducing bottleneck reactions (details below). The “main”
program counter, now at line i.4 of the transfer function, can detect when all
threads have completed, because each decrements Thread-Count exactly once,
and so Thread-Count has length zero exactly when all threads have completed.
At that point, the main program counter progresses to line i.5, destroying the
thread program counters using the destroy-threads function (not shown, but
uses the destroy function to destroy each single thread).

i: transfer(σ, τ, τ  ) i: goto(i.1)
// transfer σ to i.1: create-polymer(Thread-Count)
// both τ and τ  i.2: create-threads(Tσ , Lt )
i.3: copy(Tσ , Thread-Count)
i.4: loop-until-empty(Thread-Count, i.5)
thread-transfer(σ, τ, τ  ,Thread-Count)
i.5: destroy-threads(Lt )
i.6: destroy-polymer(Thread-Count)
i.7: goto(i + 1)

The function transfer(σ, τ ), not shown but used in double, is the same as
transfer(σ, τ , τ  ), except the call to thread-transfer does not include τ  and
the “inc(τ  )” line is removed in the implementation of thread-transfer.

Finally, we describe how threads work in thread-transfer. The threadon()


function executes |Tσ | times, one per copy of Lt , thereby creating |Tσ | Lt1
program counters that execute computation “threads”. Using the function
dec-until-destroy-polymer, each thread repeatedly (zero or more times)
decrements one of the σ-thread-polymers and then increments both τ and τ  .
This continues until the thread finds an empty σ-thread-polymer, i.e., the stub
⊥σ , in which case it destroys the stub and moves to line t.5. The dec(σ) and
inc(σ) functions of Sect. 3 work exactly as specified, even when applied to dis-
tributed counters. A key point is that the threads work “anonymously” with
Stable Computation with Polymers 213

the thread-polymers; it is not the case that each thread “owns” a single thread-
polymer. Accordingly, one thread may do more work than another, but in the
end all thread-polymers are empty.
A thread exits the dec-until-destroy-polymer loop by destroying exactly
one σ-polymer. Since at the start of thread-transfer the number of σ-thread-
polymers equals the number of thread program counters, all thread program
counters eventually reach line t.5, and there are no σ-thread-polymers once all
threads have reached line t.5 of the code. At line t.5, each thread decrements
Thread-Count, and then stalls at line t.6. Moreover, once all threads have reached
line t.6, polymer ThreadCount is empty. At this point, the program counter for
transfer changes from line i.4 to line i.5, and all thread program counters are
destroyed.
i: thread-transfer
(σ,τ ,τ  ,Thread-Count) i: threadon()
t.1: dec-until-destroy-polymer(σ, t.5)
t.2: inc(τ )
t.3: inc(τ  )
t.4: goto(t.1)
t.5: dec(Thread-Count)
t.6:

Correctness. We claim that on any input n ≥ 0, pre-loaded on a leader X-


polymer, Algorithm 4: Threaded-n2lg n -psCRN eventually halts with the value
of the distributed-Y -counter being f (n) = n2log n .
The algorithm creates and initializes H to be a polymer of length n (lines
1–2), and the Y -distributed-counter to have a single polymer-thread of length n
(lines 3–5). When n = 0, H is empty, so from line 6 the algorithm jumps to line
10 and halts, with the value of Y being f (0) = 0 as claimed.
Suppose that n > 0. Reasoning about the halve function is straightforward,
since it is fully sequential. We claim that in each round of the algorithm (lines 6–
9), lines 7 and 8 complete successfully, with |H| halving (that is, |H| → |H|/2 )
in line 7, and with both the value of Y and |TY |, the number of Y -thread-
polymers, doubling in line 8. As a result, |H| = 0 after lg n rounds and the
algorithm halts with value(Y ) = f (n).
214 A. Tai and A. Condon

Correctness of the double function is also straightforward to show, if we show


that the transfer(σ, τ, τ  ) (and the transfer(σ, τ ) variant) works correctly.
Line i.4 is the core of transfer. We show that line i.4 does complete, that is,
Thread-Count does become empty, that execution of line i.4 increases the values
of distributed counters τ and τ  by the value of σ (while leaving the number of τ -
and τ  -thread-polymers unchanged), and also changes value(σ) and the number
of σ-thread-polymers to 0.
The loop-if-empty instruction ensures that the main program counter must
stay at line i.4 of function transfer until Thread-Count is empty. Meanwhile,
this main program counter can also activate threads using the threadon() func-
tion, that is, change the thread program counters from Lt to Lt.1 . From line i.2
of transfer, the number of such thread program counters is |Tσ |.
Each of these program counters independently executes thread-transfer.
At line t.1, either (i) a dec(σ) is performed (first three reactions of
dec-until-destroy-polymer), or (ii) a σ-polymer-thread is destroyed and the
polymer-thread-count Tσ is decremented (last four reactions). In case (i), both
τ and τ  are incremented (lines t.2 and t.3), and the thread goes back to the
dec-until-destroy-polymer instruction. In case (ii), the thread moves to line
t.4, decrements Thread-Count exactly once, and moves to line t.5.
Because the number of threads equals the value of Thread-Count at the
start of the loop-until-empty (line i.4), and because the main program counter
can’t proceed beyond line i.4 of the transfer function until Thread-Count is
zero, all threads must eventually be turned on each of these threads must reach
line t.4 and must decrement Thread-Count. Only then can the main program
counter proceed to line i.5 of transfer. This in turn means that each thread
must destroy a σ-polymer-thread. Since the number of σ-polymer-threads, |Tσ |,
equals Thread-Count, all threads are destroyed (and the Tσ -polymer is empty)
upon completion of thread-transfer.

Bottleneck Reactions. In each round, the halve(σ) function decreases the length
of the H-polymer by a factor of 2, starting from n initially. Each decrement or
increment of the H-polymer includes a bottleneck reaction, so there are Θ(n)
bottleneck reactions in total, over all rounds. The double function creates 2l
thread-polymers in round l, for a total of Θ(n) thread-polymers over all rounds.
The transfer function creates 2l threads in round l and similarly destroys 2l
threads, and copies a polymer of length 2l , so again has Θ(n) bottleneck reactions
over all rounds. The reactions in thread-transfer are not bottleneck reactions
(except in round 1); we analyze these in the next section.

5 psCRN Time Complexity Analysis and Simulation

We follow the stochastic model of Soloveichik et al. [6] for well-mixed, closed
systems with fixed volume V . We assume that all reactions have rate constant
1. When in configuration c, the propensity of reaction R : r + r → p + p is
c(r)c(r )/V if r = r , and is c(r) 
2 /V if r = r . Let Δ(c) be the sum of all reaction
Stable Computation with Polymers 215

propensities, when in configuration c. When a reaction occurs in configuration c,


the probability that it is reaction R is the propensity of R divided by Δ(c), and
the expected time for a reaction is 1/Δ(c). When the only applicable reaction
is a bottleneck reaction, and the volume V is Θ(n2 ), the expected time for
this bottleneck reaction is Θ(n2 ). Soloveichik et al. [6] consider CRNs without
polymers, but the same stochastic model is used by Lakin et al. [12] and Qian
et al. [5], where the reactants r or r (as well as the products) may be polymers.
Expected time complexity of Algorithm 1: Sequential-n2 -psCRN. This psCRN has
n rounds, with Θ(n) instructions per round; for example, the copy of length n in
each round has n inc instructions. So the total number of instructions executed,
over all rounds is Θ(n2 ); moreover, there are Θ(n2 ) inc(σ) instruction overall.
The program’s instructions execute sequentially, that is, the ith instruction com-
pletes before the (i+1)st instruction starts, so the total expected time is the sum
of the expected times of the individual instructions. Each instruction involves
a constant number of reactions. Some instructions involve bottleneck reactions;
for example, the push reaction of the inc instruction is a bottleneck reaction. So
an execution of the program involves Θ(n2 ) bottleneck reactions. Each of these
takes Θ(n2 ) time, so the overall expected time is Θ(n4 ).
Expected time complexity of Algorithm 4: Threaded-n2logn -psCRN. We noted
earlier that Algorithm 4 has Θ(n) non-threaded instructions, and in fact Θ(n)
bottleneck instructions. These take expected time Θ(n3 ) overall, since the time
for each is Θ(V ) = Θ(n2 ).
Now, consider the threaded function, thread-transfer. In round l, 1 ≤ l ≤
lg n , thread-transfer has 2l threads, and pushes n2l Y monomers on to
2l anonymous Y -polymers. Since each Y -push reaction is independent and is
equally likely to increment each of the 2l Y -polymers, the expected number of
molecules per polymer is n. Using a Chernoff tail bound, we can show that
all polymers have length in the range [n/2, 2n] with all but negligibly small
probability. In what follows, we assume that this is the case.
During the first ≥ n/2 of the thread-transfer decrements in round l, the
count of each of the reactants is 2l : one program counter per thread and 2l
polymers in total. So the expected time for these decrements is Θ(V /22l ). Pes-
simistically, if all of the decrements happen to the same polymer, whose length
could be as little as n/2 by our assumption above, there are 2l − 1 polymers and
threads available for the next decrements, 2l − 2 polymers and threads available
for the next n decrements after that once a second polymer is depleted, and so
2 l
on. So the total expected time is O(V n j=1 (1/j 2 )) = O(nV ). Multiplying by
lg n , the number of rounds, and noting that V = O(n2 ), we have that the total
expected time for the thread-transfer over all rounds is O(n3 lg n).

Simulator. To test the correctness of our protocols, we developed a custom CRN


simulator designed to support anonymous polymers, though we only show the
results of our sequential protocol here in this paper. The simulator uses a slightly
modified version of Gibson and Bruck’s next reaction method [17], which itself
is an extension of Gillespie’s algorithm [18]. We redefine what a single “species”
216 A. Tai and A. Condon

Fig. 1. (a) Simulation of f (n) = n2 starting with pre-loaded input, n = 100. (b)
Simulation of f (n) = n2 with input detection and restart, n = 100. Each coloured line
in the plots shows the count of the outputs as a function of the number of interactions,
with the blue line being the count of output species Y finally released into solution,
while the red line shows the size of the Yint polymer. By interaction, we mean a
collision of two molecular species in the system, which may or may not result in a
reaction. (Color figure online)

Fig. 2. (a) Simulations of f (n) = n2 starting with pre-loaded input, covering a range
of n. (b) Simulations of f (n) = n2 with input detection and restart, covering a range
of n. Each blue circle plots a single simulation, showing the final count of the output
species Y against the number of interactions it took to complete. (Color figure online)

is from the algorithm’s point of view, classifying all σ-polymers as one species,
and track polymer lengths separately.
Interestingly, simulation of our stable, error-corrected sequential psCRN for
Square usually takes little extra time compared to the committing, pre-loaded
sequential psCRN (see both Figs. 1 and 2). This is because each of the n error
detection steps, and subsequent restart, is expected to happen in O(n2 ) time,
which is negligible compared to the time for the Θ(n4 ) expected running time
of the psCRN with fully loaded input.
Stable Computation with Polymers 217

6 Conclusions and Future Work


In this work, we’ve expanded the computing model of stochastic chemical reac-
tion networks with polymers, by considering inputs that are represented as
monomers in solution, as well as anonymous polymers that facilitate distributed
data structures and threaded computation. We’ve shown that stable, error-free
Turing-universal computation is possible in the monomer input model, by intro-
ducing an error-correction scheme that takes advantage of the ability to check
for empty polymers. We’ve illustrated how programming with anonymous poly-
mers can provide speed-ups, compared with using leader polymers only, and
how leader polymers can be used for synchronization purposes by CRNs with
anonymous polymers.
There are many interesting directions for future work. First, we have shown
how to use anonymous polymers to get a speed-up for the Square problem, but
we have not shown that such a speed-up is not possible without the use of anony-
mous polymers. Is it possible to show lower bounds on the time complexity of
problems when only leader polymers are available? Or, could bottleneck reac-
tions be reduced or avoided by a psCRN computing Square? Second, our faster
psCRN for Square with anonymous polymers still uses leader polymers for syn-
chronization. Is the speed-up possible even without the use of leader polymers?
More generally, how can synchronization be achieved in leaderless psCRNs? Are
there faster psCRNs, with or without leader polymers? It would be very inter-
esting to know what problems have stable psCRNS that use no leaders, but can
use anonymous polymers. Finally, it would be valuable to have more realistic
models of reaction propensities for psCRN models.

References
1. Soloveichik, D., Cook, M., Winfree, E., Bruck, J.: Computation with finite stochas-
tic chemical reaction networks. Nat. Comput. 7(4), 615–633 (2008)
2. Chen, H.-L., Doty, D., Soloveichik, D.: Deterministic function computation with
chemical reaction networks. Nat. Comput. 13, 517–534 (2014)
3. Angluin, D., Aspnes, J., Eisenstat, D.: Stably computable predicates are semilinear.
In: Proceedings of the Twenty-Fifth Annual ACM Symposium on Principles of
Distributed Computing, PODC 2006, New York, pp. 292–299. ACM Press (2006)
4. Cummings, R., Doty, D., Soloveichik, D.: Probability 1 computation with chemical
reaction networks. Nat. Comput. 15(2), 245–261 (2014)
5. Qian, L., Soloveichik, D., Winfree, E.: Efficient turing-universal computation with
DNA polymers. In: Sakakibara, Y., Mi, Y. (eds.) DNA 2010. LNCS, vol. 6518, pp.
123–140. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18305-
8 12
6. Soloveichik, D., Cook, M., Winfree, E., Bruck, J.: Computation with finite stochas-
tic chemical reaction networks. Nat. Comput. 7, 615–633 (2008)
7. Bennett, C.: Logical reversibility of computation. IBM J. Res. Dev. 17(6), 525–532
(1973)
8. Bennett, C.: The thermodynamics of computation - a review. Int. J. Theor. Phys.
21(12), 905–940 (1981)
218 A. Tai and A. Condon

9. Johnson, R., Winfree, E.: Verifying polymer reaction networks using bisimulation
(2014)
10. Cardelli, L., Zavattaro, G.: Turing universality of the biochemical ground form.
Math. Struct. Comput. Sci. 20, 45–73 (2010)
11. Jiang, H., Riedel, M., Parhi, K.: Synchronous sequential computation with molec-
ular reactions. In: Proceedings of the 48th Design Automation Conference, DAC
2011, New York, pp. 836–841. ACM (2011)
12. Lakin, M.R., Phillips, A.: Modelling, simulating and verifying turing-powerful
strand displacement systems. In: Cardelli, L., Shih, W. (eds.) DNA 2011. LNCS,
vol. 6937, pp. 130–144. Springer, Heidelberg (2011). https://doi.org/10.1007/978-
3-642-23638-9 12
13. Angluin, D., Aspnes, J., Diamadi, Z., Fischer, M.J., Peralta, R.: Computation in
networks of passively mobile finite-state sensors. Distrib. Comput. 18, 235–253
(2006)
14. Chatzigiannakis, I., Michail, O., Nikolaou, S., Pavlogiannis, A., Spirakis, P.G.: Pas-
sively mobile communicating machines that use restricted space. In: Proceedings
of the 7th ACM ACM SIGACT/SIGMOBILE International Workshop on Foun-
dations of Mobile Computing, FOMC 2011, New York, pp. 6–15. ACM (2011)
15. Chen, H.-L., Cummings, R., Doty, D., Soloveichik, D.: Speed faults in computation
by chemical reaction networks. In: Kuhn, F. (ed.) DISC 2014. LNCS, vol. 8784,
pp. 16–30. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-45174-
82
16. Angluin, D., Aspnes, J., Eisenstat, D.: Fast computation by population protocols
with a leader. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 61–75. Springer,
Heidelberg (2006). https://doi.org/10.1007/11864219 5
17. Gibson, M.A., Bruck, J.: Efficient exact stochastic simulation of chemical systems
with many species and many channels. J. Phys. Chem. A 104(9), 1876–1889 (2000)
18. Gillespie, D.T.: Exact stochastic simulation of coupled chemical reactions. J. Phys.
Chem. 81(25), 2340–2361 (1977)
SIMD||DNA: Single Instruction, Multiple
Data Computation with DNA Strand
Displacement Cascades

Boya Wang(B) , Cameron Chalk, and David Soloveichik

The University of Texas at Austin, Austin, USA


bywang@utexas.edu

Abstract. Typical DNA storage schemes do not allow in-memory com-


putation, and instead transformation of the stored data requires DNA
sequencing, electronic computation of the transformation, followed by
synthesizing new DNA. In contrast we propose a model of in-memory
computation that avoids the time consuming and expensive sequencing
and synthesis steps, with computation carried out by DNA strand dis-
placement. We demonstrate the flexibility of our approach by developing
schemes for massively parallel binary counting and elementary cellular
automaton Rule 110 computation.

Keywords: DNA storage · DNA computing · Parallel computing ·


Strand displacement

1 Introduction
Studies have espoused DNA as an incredibly dense (up to 455 exabytes per gram)
and stable (readable over millenia) digital storage medium [5]. Experiments stor-
ing text, images, and movies of hundreds of megabytes have demonstrated the
potential scalability of the approach [11]. Importantly, DNA’s essential biologi-
cal role ensures that the technology for manipulating DNA will never succumb
to obsolescence.
Typical DNA storage schemes have high information density but do not
permit “in-memory” computation: modifying data involves sequencing DNA,
classically computing the desired transformation, and synthesizing new DNA.
In contrast, strand displacement systems store information in the pattern of
reconfiguration of exposed single-stranded regions. This pattern can be directly
manipulated through toehold exchange and other molecular primitives as a form
of information processing [25]. However, strand displacement is incompatible
with traditional DNA storage schemes.
Here we combine DNA storage with massively parallel computation on the
data stored using strand displacement. In our proposed scheme, which we call
SIMD||DNA (Single Instruction Multiple Data DNA), a multi-stranded DNA
complex acts as a single register storing a (binary) string. Although all the
c Springer Nature Switzerland AG 2019
C. Thachuk and Y. Liu (Eds.): DNA 25, LNCS 11648, pp. 219–235, 2019.
https://doi.org/10.1007/978-3-030-26807-7_12
220 B. Wang et al.

complexes share the same sequence, different information is encoded in each


complex in the pattern of nicks and exposed single-stranded regions. There are
as many independent registers as the number of molecules of the multi-stranded
complexes, each capable of storing and manipulating a different string. This
allows information in different registers to be modified at the same time, utilizing
the parallelism granted by molecular computation.
Our method of storing information in DNA is motivated by recent develop-
ments in DNA storage employing topological modifications of DNA to encode
data. DNA storage based on programmable nicking on native DNA (forming
strand breaks at desired locations) permits high throughput methods of writing
information into registers [20]. To enable subsequent read-out, recently devel-
oped methods [9] could potentially read information encoded in nicks and single-
stranded gaps in double stranded DNA in a high throughput manner. Reading
out specific bits of registers could also be achieved with fluorescence based meth-
ods. Note that compared with storing data in the DNA sequence itself, encoding
data in nicks sacrifices data density but reduces the cost of large-scale synthesis
of DNA [20]. Here we show that it also enables greater flexibility of in-memory
computation.
To do parallel in-memory computation on our DNA registers, we employ sin-
gle instruction, multiple data (SIMD)1 programs. An overview of a program’s
implementation is given in Fig. 1. Each instruction of a program corresponds
to the addition of a set of DNA strands to the solution. The added strands
undergo toehold-mediated strand displacement with strands bound to the regis-
ter, changing the data. The long “bottom” strands of these registers are attached
to magnetic beads, allowing sequential elution operations. After the strands dis-
placed from the registers are eluted, subsequent instructions can be performed.
Note that the same instruction is applied to all registers in solution in paral-
lel (since they share sequence space), but the effect of that instruction can be
different depending on the pattern of nicks and exposed regions of the given
register.
We show that our DNA data processing scheme is capable of parallel, in-
memory computation, eliminating the need for sequencing and synthesizing new
DNA on each data update. Note that instruction strands are synthesized inde-
pendently of the data stored in the registers, so that executing an instruction
does not require reading the data. We should also note the doubly-parallel nature
of SIMD||DNA programs: instructions act on all registers in parallel, and instruc-
tion strands can act on multiple sites within a register in parallel.
1
Single instruction, multiple data (SIMD) is one of the four classifications in Flynn’s
taxonomy [7]. The taxonomy captures computer architecture designs and their par-
allelism. The four classifications are the four choices of combining single instruction
(SI) or multiple instruction (MI) with single data (SD) or multiple data (MD). SI
versus MI captures the number of processors/instructions modifying the data at a
given time. SD versus MD captures the number of data registers being modified
at a given time, each of which can store different information. Our scheme falls
under SIMD, since many registers, each with different data, are affected by the same
instruction.
SIMD||DNA 221

Fig. 1. Each DNA register is a multi-stranded complex. Different information is


encoded in the pattern of nicks and exposed single-stranded regions in the register.
Registers are attached to magnetic beads (MB). To perform each instruction, first a
set of instruction strands is added to the solution and reacts with all the registers
in parallel. Then waste species (unreacted instruction strands and displaced reaction
products) are washed away by elution.

Our programs require a small number of unique domains (subsequences of


nucleotides which act as functional units), independent of the register length.
A common assumption for correctness in strand displacement systems is that
domains are orthogonal, meaning two domains which are not fully complemen-
tary do not bind. In experiments, enforcing this assumption requires specialized
sequence design. Further, for any fixed domain length, the space of orthogonal
domains is limited, restricting the scalability of the system. SIMD||DNA encodes
information in the pattern of nicks and exposed domains. This allows our pro-
grams to require only a constant set of orthogonal domains to be used (five for
one program and six for the other), simplifying the sequence design problem
for experimental implementation. In addition, the instruction strands for one
instruction can share sequences, resulting in a reduced cost of strand synthesis.
In this paper, we show two SIMD||DNA programs. One of the programs
implements binary counting. Starting from arbitrary initial counts stored in dif-
ferent registers, each computation step increments all the registers in parallel.
Binary counting allows one SIMD||DNA program to move data through a num-
ber of states exponential in the size of the register. We consider this a requirement
of any useful data storage/computation suite: if instead not all configurations
of the register were reachable from some initial configuration via some program,
then the useful density of the storage would be reduced.
222 B. Wang et al.

In addition to binary counting, we also give a program which simulates


elementary cellular automaton (CA) Rule 110.2 Critically, Rule 110 has been
shown to be Turing universal [6], so this simulation shows that SIMD||DNA’s
in-memory computation model is as powerful as any other space-bounded com-
puting technique. In other words, our space-bounded simulation of Rule 110
immediately gives that any computable function—if the required space is known
beforehand—can be computed by a SIMD||DNA program.
We note the contrast to typical strand displacement schemes that perform
a single computation in solution. For example, although a logic circuit [13,18]
computation might involve hundreds of billions of separate molecules, the redun-
dancy does not help computationally. Such schemes seem to not use the massively
parallel power of chemistry [1]. Previous ideas for performing parallel compu-
tation with strand displacement cascades relied on a complex scheme involving
4-way branch migration on DNA origami [14] or information processing in differ-
ent spatial locations [17]. Turing universal computation with strand displacement
could not handle multiple independent computations running in parallel [12],
leaving the extension to parallel computation as the major open question.
Note that SIMD||DNA is non-autonomous since each instruction requires
manual strand addition and elution. In this regard it is similar to early stud-
ies of parallel DNA computing machines. Dating back to the 1990s, Adle-
man experimentally demonstrated solving instances of NP-complete problems
using DNA [1], which encouraged other DNA computing models. Many models
rely on enzymes to introduce covalent modification on DNA [2,3,8,15], which
increases experimental complexity. Other enzyme-free models such as the sticker
model [16] encode information in the pattern of exposed domains, similar to
our scheme. However, the sticker model requires a number of orthogonal domain
types that scales with the amount of data. In addition, these domains require
well-tuned binding affinities to allow a melting procedure which selectively dis-
sociates some strands but not others. In contrast, our programs only require
a constant number of unique domains for any register length. Instead of com-
putation through controlled hybridization and melting, strand displacement is
a more versatile mechanism to achieve modification of information, potentially
making parallel molecular computation more feasible.3

2 SIMD||DNA

Here we propose the general scheme. First we will explain the notations we use
in this paper. We use the domain level abstraction for DNA strands. Consecutive
2
In [24] an enumeration of all possible rules for elementary CA is given. Rule 110
refers to that enumeration.
3
In a sense, we realize an extension of the sticker model envisioned by [4]: “Recent
research suggests that DNA ‘strand invasion’ might provide a means for the specific
removal of stickers from library strands. This could give rise to library strands that
act as very powerful read-write memories. Further investigation of this possibility
seems worthwhile.”.
SIMD||DNA 223

nucleotides that act as a functional unit are called a domain. Complementary


domains are represented by a star (∗). The length of the domains is chosen so
that: (1) each domain can initiate strand displacement (can act as a toehold), (2)
strands bound by a single domain readily dissociate, and (3) strands bound by
two or more domains cannot dissociate.4 We call an exposed (unbound) domain
a toehold.

2.1 Encoding Data


Data is stored in multi-stranded complexes (Fig. 1), each called a register. A
register contains one long strand, called the bottom strand and multiple short
strands, called top strands, bound to the bottom strand. Each bottom strand
is partitioned into sets of consecutive domains called cells. Each cell contains
the same number of domains. Depending on the configuration of the top strands
bound (e.g., their lengths, or the presence or absence of toeholds), cells encode
information. In this work we use a binary encoding, with each cell representing
one bit.
See Sect. 4.1 for a discussion of potential experimental methods of preparing
the initial registers.

2.2 Instructions
An instruction is a set of strands. To apply an instruction to the data, these
strands are added to the solution at high concentration. Adding these strands can
lead to three different types of reactions on the registers. Figure 2a explains the
figure notation used to describe instructions throughout the paper, and Fig. 2b
gives examples of the three types of reactions. They are:
Attachment: This reaction preserves all the strands originally bound to the
register and attaches new strands. An instruction strand can attach to registers if
it binds strongly enough (by two or more domains). Note that the attachment of
an instruction strand can lead to a partial displacement of a pre-existing strand
on the register.
Displacement: This reaction introduces new strands to the register and
detaches some pre-existing strands. Upon binding to a toehold on the regis-
ter, the instruction strand displaces pre-existing strands through 3-way branch
migration.5 Toehold exchange reactions are favored towards displacement by the
instruction strand since they are added at high concentration. Two instruction
strands can also cooperatively displace strands on the register.
Detachment: This reaction detaches pre-existing strands without introduc-
ing new strands to the registers. An instruction strand that is complementary to
4
Given these properties, in practice one could choose the domain length to be from
5 to 7 nucleotides at room temperature.
5
Although other more complicated strand displacement mechanisms (e.g. 4-way,
remote toehold, associative toehold strand displacement) could provide extra power
in this architecture, they usually sacrifice the speed and increase the design com-
plexity, so we do not include them in this work.
224 B. Wang et al.

a pre-existing strand with an open overhang can use the overhang as a toehold
and pull the strand off the register. Throughout this paper, a dashed instruction
strand indicates the domains in the instruction strand are complementary to
other vertically aligned domains.
When an instruction strand displaces a top strand, we assume the waste top
strand does not interact further within the system (the instruction strands are
present in high concentration while the waste is in low concentration). After
the reactions complete, the waste is removed via elution. We assume washing
removes all species without a magnetic bead. Lastly, we assume there is no
leak —displacement of a strand without prior binding of a toehold. We discuss
the possibility and extent of errors caused by relaxing these assumptions in
Sect. 4.2.
In general, two reactions can be applicable but mutually exclusive. Then two
(or more) resulting register states may be possible after adding the instruction
strands. The instructions used in this paper do not have this issue. This point
is related to deterministic versus nondeterministic algorithms, and is discussed
further in Sect. 4.5.

2.3 Programs
We consider sequences of instructions, called programs. We design programs for
functions f : {0, 1}n → {0, 1}n so that, given a register encoding any s =
{0, 1}n , after applying all instructions in the program sequentially as in Fig. 1,
the resulting register encodes f (s).

3 Programs for Binary Counting and Rule 110


Here we give our two programs: binary counting and simulation of elementary
cellular automaton Rule 110. We first present the Rule 110 simulation, as the
program is simpler to explain than binary counting.

3.1 Cellular Automaton Rule 110


An elementary one-dimensional cellular automaton consists of an infinite set of
cells {. . . , c−1 , c0 , c1 , . . .}. Each cell is in one of two states, 0 or 1. Each cell
changes state in each timestep depending on its left and right neighbor’s states.
Rule 110 is defined as follows: the state of a cell at time t + 1, denoted ci (t + 1),
is f (ci−1 (t), ci (t), ci+1 (t)), where f is the following:
f (0, 0, 0) = 0 f (1, 0, 0) = 0
f (0, 0, 1) = 1 f (1, 0, 1) = 1
f (0, 1, 0) = 1 f (1, 1, 0) = 1
f (0, 1, 1) = 1 f (1, 1, 1) = 0
Note that a simple two-rule characterization of f is as follows: 0 updates to 1 if
and only if the state to its right is a 1, and 1 updates to 0 if and only if both
SIMD||DNA 225

Fig. 2. (a) The notation used to describe instructions. Domains are represented by
square boxes. We indicate complementarity of instruction strands to register domains
by vertical alignment. If a domain label is given explicitly, such as a and a∗ in this
figure, the domain is orthogonal to the other vertically aligned domains. A strand
can be described by listing the constituent domains in a bracket <> from 5’-end to
3’-end. Strands with solid lines are complementary to the corresponding domains in
the bottom strand. Strands with dashed lines are complementary to the corresponding
domains in the top strand. The blue dot represents the magnetic bead. (b) The three
instruction reactions. Attachment: instruction strands attach to the register without
releasing any other strands. Displacement: instruction strands attach to the register
and displace pre-existing strands on the register. Toehold-mediated strand displace-
ment (left), toehold-exchange strand displacement (right), and cooperative strand dis-
placement (bottom) mechanisms are allowed. Detachment: instruction strands fully
complementary to previously bound top strands pull strands off the register. (Color
figure online)
226 B. Wang et al.

neighbors are 1. This characterization is useful for proving correctness of the


program.
The instructions implementing one timestep evolution are shown in Fig. 3.
Each state-0 cell is fully covered by two strands, one of length three and one
of length two. Each state-1 cell is partially covered by a length-five top strand
and has an open toehold at the leftmost domain. The program consists of six
instructions. The program first marks the string “01” (Instruction 1)—here, the 0
will change to 1 later. Then it erases the internal 1’s in any string of at least three
consecutive 1’s (Instructions 2 and 3). These are the 1’s with two neighboring
1’s, which should be updated to 0, so the program fills in the empty cells with 0
(Instruction 4). Finally it removes the markers from Instruction 1 and changes
previously marked 0’s to 1’s (Instructions 5 and 6).
We claim that this program enforces the two-rule characterization of Rule
110. We first argue that 1 updates to 0 if and only if both neighbors are 1. Then
we argue that 0 updates to 1 if and only if the state to its right is a 1. Let ik
denote the kth domain on cell i (from left to right). All cells can share the same
sequences, but we assume that each domain within a cell is orthogonal.

Claim. A cell i initially in state 1 updates to a 0 if cells i + 1 and i − 1 are


initially 1.

Proof. During Instruction 1, the instruction strands cannot displace the strands
in state-1 cells. In Instruction 2, the strand on cell i is displaced cooperatively
only if the toeholds on both the left and the right side of the strand are open.
By assumption, cell i + 1 is a 1, so the toehold immediately to the right of
cell i, (i + 1)1 , is free. Since cell i − 1 is in state 1, domain i1 is not covered
after Instruction 1 (i1 would be covered if cell i − 1 were 0). Thus the strand
on cell i can be displaced by the instruction 2 strands. In Instruction 3, the
instruction 2 strands in cell i are detached, so every domain in cell i is free. Then
in Instruction 4 we attach the strands corresponding to a state 0, updating cell
i to 0. Instructions 5 and 6 do not introduce any instruction reaction on cell i,
so cell i remains in state 0.

Claim. A cell i initially in state 1 stays in state 1 if either cell i + 1 or i − 1 is


initially 0.

Proof. During Instruction 1, the instruction strands cannot displace the strands
in state-1 cells. In Instruction 2, the strand on state-1 cells is displaced cooper-
atively only if the toeholds on both the left and the right side of the strand are
open. By assumption that the left or right cell is a 0, the toeholds required for
this, i1 or (i + 1)1 , will be covered: First consider that cell i − 1 is a 0. Then
in Instruction 1, the instruction strand displaces one strand at cell i − 1 and
covers the toehold i1 . On the other hand, if cell i + 1 is 0, then domain (i + 1)1
is covered since strands for the 0 state cover all the domains in that cell. So if
either neighbor state is 0, Instruction 2 does not displace the strand on cell i.
Then note that Instructions 3 and 4 do not introduce any instruction reaction
at cell i. The instruction 5 strands detach the instruction 1 strands if cell i − 1
SIMD||DNA 227

Fig. 3. The program implementing one timestep of Rule 110 shown on an example
register. The top register shows the initial state of each cell. After 6 instructions, the
register updates to the state shown at the bottom. Strand colors have three information
categories: state 1 (dark blue), state 0 (light blue), intermediates (other colors). Solid
boxes show the instruction strands and the state of the register before the strands are
applied. Dashed boxes explain the logical meaning of the instructions. The overhang
domains a and b are orthogonal to their vertically aligned domains. (Color figure online)
228 B. Wang et al.

is 0, freeing the toehold at i1 and recovering the state-1 cell. Instruction 6 does
not change the state-1 cell.

Claim. A cell i initially in state 0 updates to a 1 if cell i + 1 is initially a 1.

Proof. Since cell i + 1 is in state 1, the toehold at domain (i + 1)1 is available


for the instruction strand in Instruction 1 to bind, and the rightmost strand on
cell i is displaced. Then note that Instructions 2 through 4 do not introduce
any instruction reaction at cell i. In Instruction 5, the instruction strand from
Instruction 1 is detached, freeing domains i4 and i5 . In Instruction 6 the instruc-
tion strand binds at domains i4 and i5 and displaces the strand at cell i. So after
Instruction 6, cell i is in state 1.

Claim. A cell i initially in state 0 stays in state 0 if cell i + 1 is initially a 0.

Proof. Simply note that for any instruction, no instruction reaction on cell i
occurs. So cell i stays in state 0.

These four claims combined verify that the two-rule characterization given
at the beginning of this section is satisfied, so the instructions implement one
timestep evolution of Rule 110.
Note that the Rule 110 simulation invokes two sources of parallelism. Instruc-
tion strands are applied to all registers in parallel, and every cell within a register
can update concurrently.
Also note that Rule 110 is defined only for an infinite set of cells or a circular
arrangement of finitely many cells. For a finite set of cells arranged linearly, one
must define boundary conditions for updating the leftmost and rightmost cells.
Boundary conditions can be constant or periodic. For space-bounded computa-
tion by Rule 110, it suffices to set periodic boundary conditions based on the
periodic initial condition of the CA given in [6]. These periodic boundary states
can be implemented by periodic instructions.

3.2 Counting

The counting program computes f (s) = s + 1. Binary counting is captured by


changing all the 1s to 0 from the least significant bit to more significant bits
until the first 0, and changing that 0 to 1. All the bits more significant than the
rightmost 0 remain the same. For example, f (1011) = 1100, and f (1000) = 1001.
In the case of overflow, we rewrite the register to all 0s. In other words, on inputs
of all 1s, we output all 0s: f (1111) = f (0000).
The full program is in Fig. 4. Each state-0 cell is fully covered by two strands,
with one covering the first three domains and the other one covering the last
two domains. Each state-1 cell is fully covered by two strands, with one covering
the first two domains and the other one covering the last three domains. One
extra domain is included to the right of the rightmost cell which is used to
initiate displacement. The program contains seven instructions. It erases all the
1’s in between the rightmost cell and the rightmost state-0 cell at Instructions
SIMD||DNA 229

1 and 2, and changes those cells to 0 at Instructions 4 and 5. It marks the


rightmost state-0 cell at Instruction 3, and change the marked state-0 cell to
state 1 at Instructions 6 and 7.
To prove correctness, we first argue that all the 1’s from the least significant
bit to the rightmost 0 update to 0. Then we argue that rightmost 0 updates to

Fig. 4. The program implementing addition by 1 of a binary string on an example


register. The top register shows the initial state of each cell. After 7 instructions, the
register updates to the state shown at the bottom. Strand colors have three information
categories: state 1 (purple), state 0 (pink), intermediates (other colors). Solid boxes
show the instruction strands and the state of the register before the strands are applied.
Dashed boxes explain the logical meaning of the instructions. The overhang domains
a and b are orthogonal to their vertically aligned domains. (Color figure online)
230 B. Wang et al.

1. Assume the bit string has length n and the least significant bit is at cell n
and the rightmost 0 is at cell m (m  n). As in the Rule 110 simulation proof,
we let jk denote the kth domain on cell j (from left to right). All cells can share
the same sequences, but we assume that each domain within a cell is orthogonal.
Additionally, the extra domain to the right of the rightmost cell is orthogonal
to all other domains.

Claim. All state 1 cells to the right of the rightmost 0 cell change to a 0.

Proof. Instruction 1 initiates a series of sequential reactions from the least sig-
nificant bit n to the rightmost 0. First the instruction strand with overhang
domain a displaces the strand covering domains n4 and n5 . If the least signifi-
cant bit is 1 (m < n), the domain n3 becomes unbound after this displacement
reaction. Then the domain n3 serves as an open toehold to initiate another dis-
placement reaction with the instruction strand with overhang domain b. Similar
displacement reactions proceed until cell m. By assumption, cell m is a state-0
cell, so the domain m3 will not be open after the displacement step, thus the
displacement cascade stops. Then the strands added in Instruction 2 detach the
strands from Instruction 1, leaving the cells from the (m + 1)th bit to the nth
bit free. In Instruction 3, every applied instruction strand from cell m + 1 to n
attaches to the register. Instruction 4 shifts those strands added in Instruction
3 one domain to the left, which opens toeholds for the cooperative displacement
in Instruction 5. After those cells change to state-0 in Instruction 5, the strands
added in Instruction 6 and 7 do not change them, so they remain in state 0.

Claim. The rightmost state 0 cell changes to a 1.

Proof. Instruction 1 initiates a series of sequential reactions from the least sig-
nificant bit to the rightmost 0 at cell m. The domain m3 will not be open after
the instruction strand displaces the strand covering domains m4 and m5 and
no more strand displacement cascade can proceed to the left. Then the strands
added in Instruction 2 detach the strands from Instruction 1, leaving the domains
m4 and m5 free. The strands added in Instruction 3 serve as two purposes: (1)
They correspond to one of the strands representing state 1, thus they help cell
m to transition to state 1 and they partially displace the strand at domain m3 .
(2) They serve as a place holder by binding at domains m4 and m5 to prevent
cell m from being modified in Instructions 4 and 5. Instruction 6 detaches the
strand originally bound from domain m1 to m3 , leaving the domains m1 and m2
open. In Instruction 7, the instruction strand attaches to the register at domain
m1 and m2 , which completes the state changing from 0 to 1.

Claim. The cells to the left of the rightmost state 0 cell stay the same.

Proof. Note that no open toeholds are exposed at cells to the left of cell m, and
the displacement cascade does not pass to the left of cell m, thus no changes are
made to the states of those cells.
SIMD||DNA 231

4 Discussion and Future Work


4.1 Data Preparation

If we do not try to reuse domain sequences, the registers could be prepared by


topologically modifying naturally occurring DNA at desired locations through
nicking enzymes6 [20]. If the distance between two nicks is short (for example
the length of one domain), the strand in between will spontaneously dissociate,
forming a toehold. After the registers with different information are prepared
separately and attached to magnetic beads, they are mixed into one solution.
If we reuse domains between cells, the initial preparation of registers requires
different techniques. For example, all registers can be initialized to 0 in separate
test tubes, and then separate programs executed which move the registers to the
desired initial state.

4.2 Experimental Feasibility and Error Handling

Toehold-mediated strand displacement and elution through magnetic beads are


well-established techniques, which supports the feasibility of experimental imple-
mentation of SIMD||DNA. Other than attaching registers to magnetic beads,
registers can also be affixed to the surface of a microfluidic chip. Further, since
the instruction strands are added at high concentration and we do not rely on
slow mechanisms such as 4-way branch migration, each instruction should finish
quickly. However, strand displacement systems can be error prone, and our con-
structions make several assumptions, the violation of which could lead to various
errors.
The first assumption is that waste products from reactions between the
instruction strands and registers do not react further with the system. Reg-
isters and instruction strands should be allowed to react for a short amount of
time before elution such that the high concentration instruction strands interact
with the registers, but the low concentration waste products do not. Violating
this assumption can cause undesired displacements to occur, leading to possible
error in the computation. Interestingly, we conjecture that, besides the reverse
of the intended reaction (in the case of toehold exchange), the waste products
and registers cannot react in the two programs given here, and therefore our
programs are robust to this type of error.
The next assumption is that of a perfect washing procedure where only
species with magnetic beads remain after elution. Imperfect washing can result
in previous instruction strands reacting with registers undergoing subsequent
instructions. In practice, the remains of imperfect washing would appear in low
concentration so as to have a low probability of affecting the system.
The final assumption is that there is no leak (only toehold-mediated displace-
ments occur). The registers contain nicks where strands could fray and undesired

6
For example, Cas9 nickase or restriction enzyme Pf Ago, uses an RNA or DNA strand
as a guide and can nick at a desired location.
232 B. Wang et al.

toeholds could open, resulting in strands being mistakenly displaced or incorrect


strands binding. Our programs are not robust to leak, raising the question of
whether leakless design principles [21–23] can be imposed on the constructions.
Leak could also limit the longevity of information stored in our scheme: (toehold-
less) four-way branch migration can result in bit exchange errors between differ-
ent registers.
It remains to be seen whether freezing or other means of stabilizing the DNA
complexes suffices to ensure long term storage of information encoded in nicked
registers.
In addition to preventing errors at the experimental level, it remains open
to address errors at the “software level” by employing error correction codes in
the data and employing error correction schemes in the instructions.

4.3 Data Density

Unlike storing data in the DNA sequence itself, which has a data density of
2 bits per nucleotide, our schemes sacrifice data density. In our schemes, a bit
is encoded in a cell, which contains 5 domains. If a domain is composed of 6
consecutive nucleotides, it gives a data density of 0.033 (1/30) bit per nucleotide.
It is not obvious that the current construction with 5 domains per cell achieves
the highest possible data density for these programs. In practice, there is a
tradeoff between the strand binding stability and data density. Here we assume
that the minimal number of domains required for two strands to stably bind is
two, however in practice the binding strength is affected by experimental buffer
(salt concentration) and temperature. Given different experimental conditions,
it may be necessary to increase the number of domains in a cell, which could
reduce the data density further. However, one gram of DNA can still encode
exabytes of information. In principle, data density may also be increased by
using different encoding schemes, such as allowing overhangs on the top strands
to encode information.

4.4 Uniform Versus Non-uniform Instructions

We can identify instructions as uniform or non-uniform. Uniform instructions


have the property that the same type of instruction strands are added to every
cell, as is the case in our programs. Non-uniform instructions allow strands
to be added to particular cells and not others (e.g., add strands to every sev-
enth cell, or cells 42 and 71). The difference in computational power between
uniform and non-uniform instructions remains open, and non-uniform instruc-
tions could reduce the number of instructions required for some programs.
However, non-uniform instructions could require each cell to be orthogonal in
sequence. In contrast, uniform instructions allow every cell to consist of the same
sequence, requiring only the domains within the cells to be orthogonal. Shar-
ing the sequences between the cells reduces the number of different instruction
strands that need to be synthesized.
SIMD||DNA 233

4.5 Determinism and Nondeterminism

Our programs are designed with deterministic instructions: given one state of
the register, after adding the instruction strands, the register changes to one
specific state. Deterministic instructions make it easy to design, predict, rea-
son about, and compose the programs. In contrast to deterministic instructions,
one could also construct nondeterministic instructions by introducing nondeter-
minism to the updates of the cells. For example, consider an empty cell with
domains 3∗ , 2∗ , 1∗ , and add instruction strands 1, 2 and 2, 3. Either the
first or second strand can bind, but since they displace each other, only one will
remain after elution. The probability of which strand remains depends on its rel-
ative concentration. In principle, applying nondeterministic instructions allows
for implementation of randomized algorithms and simulation of nondeterministic
computing machines.

4.6 Running Time

The running time of a program depends on two factors: running time per instruc-
tion and the number of instructions. The running time per instruction depends
on whether the instruction updates the cells through parallel or sequential reac-
tions. In general, instructions are capable of acting on each cell within each
register in parallel. Yet, Instruction 1 of the binary counting program does not
have this source of parallelism. A first reaction (displacement) must occur on
the rightmost cell prior to a second reaction occurring on the second cell, which
must occur prior to a third reaction on the third cell, and so on. Thus, this
instruction with sequential reactions loses the speedup given by independent
instruction reactions occurring in parallel on each cell within a register. Besides
the running time per instruction, the larger the number of instructions per pro-
gram, the more complex is the experimental procedure. This motivates studying
the smallest number of instructions required to achieve a computational task.

4.7 Universal Computation

Our registers as proposed are restricted to a finite number of cells. So although


Rule 110 on an infinite arrangement of cells can simulate an infinite-tape Turing
machine, our scheme is only capable of space-bounded computation. To claim
that a system is capable of universal computation, it is required that the data
tape—in our case, the number of cells—can be extended as needed as com-
putation proceeds. Since our program consists of uniform instructions, domain
orthogonality is only required within a cell. Therefore, in principle, the register
can be extended indefinitely during computation without exhausting the space of
orthogonal domains. The register’s length could perhaps be extended by merging
bottom strands with top strand “connectors”.
234 B. Wang et al.

4.8 Space-Efficient Computation

Although Rule 110 is Turing universal, computing functions through simula-


tion of a Turing machine by Rule 110 does not make use of the full power of
SIMD||DNA. First of all, while simulation of a Turing machine by Rule 110
was shown to be time-efficient [10], it is not space-efficient. Precisely, simulating
a Turing machine on an input which takes T time and S ≤ T space requires
p(T ) time and p(T ) space (where p(T ) is some polynomial in T ). However, Tur-
ing machines can be simulated time- and space-efficiently by one-dimensional
CA if the automaton is allowed more than two states [19]. Simulating larger
classes of CA is a promising approach to space-efficient computation in this
model, since our Rule 110 simulation suggests that CA are naturally simulated
by SIMD||DNA programs.

4.9 Equalizing Encodings

Our two programs use different schemes for encoding binary information in a reg-
ister. Using some universal encoding would allow applying different consecutive
computations to the same registers. Alternatively, we could design programs to
inter-convert between different encodings. The reason for suggesting this alter-
native is that unlike classical machines acting on bits, in SIMD||DNA the way
a bit is encoded affects how it can be changed by instruction reactions. For
example, in the binary counting program, the encoding ensures that no toeholds
except for the rightmost domain are open on the register, which is used to argue
correctness. Alternatively, in the Rule 110 program, toeholds must be available
throughout the register to achieve the parallel cell updates required by CA.
Therefore having one encoding which implements these two different functions
seems difficult.

Acknowledgements. The authors were supported by NSF grants CCF-1618895 and


CCF-1652824, and DARPA grant W911NF-18-2-0032. We thank Marc Riedel for sug-
gesting the analogy to Single Instruction, Multiple Data Computers. We thank Marc
Riedel and Olgica Milenkovic for discussions.

References
1. Adleman, L.M.: Molecular computation of solutions to combinatorial problems.
Science 266(5187), 1021–1024 (1994)
2. Beaver, D.: A universal molecular computer. DNA Based Comput. 27, 29–36 (1995)
3. Boneh, D., Dunworth, C., Lipton, R.J., Sgall, J.: On the computational power of
DNA. Discret. Appl. Math. 71(1–3), 79–94 (1996)
4. Braich, R.S., Chelyapov, N., Johnson, C., Rothemund, P.W.K., Adleman, L.: Solu-
tion of a 20-variable 3-SAT problem on a DNA computer. Science 296(5567), 499–
502 (2002)
5. Church, G.M., Gao, Y., Kosuri, S.: Next-generation digital information storage in
DNA. Science 337(6102), 1628 (2012)
SIMD||DNA 235

6. Cook, M.: Universality in elementary cellular automata. Complex Syst. 15(1), 1–40
(2004)
7. Flynn, M.J.: Some computer organizations and their effectiveness. IEEE Trans.
Comput. 21(9), 948–960 (1972)
8. Freund, R., Kari, L., Păun, G.: DNA computing based on splicing: the existence
of universal computers. Theory of Comput. Syst. 32(1), 69–112 (1999)
9. Liu, K., et al.: Detecting topological variations of DNA at single-molecule level.
Nat. Commun. 10(1), 3 (2019)
10. Neary, T., Woods, D.: P-completeness of cellular automaton rule 110. In: Bugliesi,
M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4051, pp.
132–143. Springer, Heidelberg (2006). https://doi.org/10.1007/11786986 13
11. Organick, L., et al.: Random access in large-scale DNA data storage. Nat. Biotech-
nol. 36(3), 242–248 (2018)
12. Qian, L., Soloveichik, D., Winfree, E.: Efficient turing-universal computation with
DNA polymers. In: Sakakibara, Y., Mi, Y. (eds.) DNA 2010. LNCS, vol. 6518, pp.
123–140. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-18305-
8 12
13. Qian, L., Winfree, E.: Scaling up digital circuit computation with DNA strand
displacement cascades. Science 332(6034), 1196–1201 (2011)
14. Qian, L., Winfree, E.: Parallel and scalable computation and spatial dynamics with
DNA-based chemical reaction networks on a surface. In: Murata, S., Kobayashi, S.
(eds.) DNA 2014. LNCS, vol. 8727, pp. 114–131. Springer, Cham (2014). https://
doi.org/10.1007/978-3-319-11295-4 8
15. Rothemund, P.W.K.: A DNA and restriction enzyme implementation of turing
machines. DNA Based Comput. 27, 75–119 (1995)
16. Roweis, S., et al.: A sticker-based model for DNA computation. J. Comput. Biol.
5(4), 615–629 (1998)
17. Scalise, D., Schulman, R.: Emulating cellular automata in chemical reaction-
diffusion networks. Nat. Comput. 15(2), 197–214 (2016)
18. Seelig, G., Soloveichik, D., Zhang, Y., Winfree, E.: Enzyme-free nucleic acid logic
circuits. Science 314(5805), 1585–1588 (2006)
19. Smith III, A.R.: Simple computation-universal cellular spaces. J. ACM 18(3), 339–
353 (1971)
20. Tabatabaei, S.K., et al.: DNA punch cards: encoding data on native DNA sequences
via topological modifications. bioRxiv, 10.1101/672394
21. Thachuk, C., Winfree, E., Soloveichik, D.: Leakless DNA strand displacement sys-
tems. In: Phillips, A., Yin, P. (eds.) DNA 2015. LNCS, vol. 9211, pp. 133–153.
Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21999-8 9
22. Wang, B., Thachuk, C., Ellington, A.D., Soloveichik, D.: The design space of strand
displacement cascades with toehold-size clamps. In: Brijder, R., Qian, L. (eds.)
DNA 2017. LNCS, vol. 10467, pp. 64–81. Springer, Cham (2017). https://doi.org/
10.1007/978-3-319-66799-7 5
23. Wang, B., Thachuk, C., Ellington, A.D., Winfree, E., Soloveichik, D.: Effective
design principles for leakless strand displacement systems. Proc. Nat. Acad. Sci.
115(52), E12182–E12191 (2018)
24. Wolfram, S.: Statistical mechanics of cellular automata. Rev. Mod. Phys. 55, 601–
644 (1983)
25. Zhang, D.Y., Seelig, G.: Dynamic DNA nanotechnology using strand-displacement
reactions. Nat. Chem. 3(2), 103 (2011)
Author Index

Alumbaugh, John Calvin 140 Patitz, Matthew J. 140

Behera, Abhishek 54 Regnault, Damien 120


Bouchard-Côté, Alexandre 80 Reif, John 21
Brailovskaya, Tatiana 174 Richa, Andréa W. 140

Chalk, Cameron 219 Schmidt, Mark 80


Condon, Anne 80, 197 Seelig, Georg 159
Shah, Shalin 21
Dannenberg, Frits 80 Singh, Abhinav 54
Daymude, Joshua J. 140 Soloveichik, David 219
Demaine, Erik D. 140 Song, Tianqi 21
Song, Xin 21
Furcy, David 100 Summers, Scott M. 100

Gopalkrishnan, Manoj 54 Tai, Allison 197


Gowri, Gokul 159, 174
Wang, Boya 219
Huang, Xiang 37 Wendlandt, Christian 100
Winfree, Erik 1, 80, 174
Klinge, Titus H. 37 Wiuf, Carsten 54

Lathrop, James I. 37 Yang, Ming 21


Lopez, Randolph 159 Yu, Sean 174

Meunier, Pierre-Étienne 120 Zolaktaf, Sedigheh 80

You might also like