Reachability in Deletion-Only Chemical Reaction Networks
Abstract
For general discrete Chemical Reaction Networks (CRNs), the fundamental problem of reachability – the question of whether a target configuration can be produced from a given initial configuration – was recently shown to be Ackermann-complete. However, many open questions remain about which features of the CRN model drive this complexity. We study a restricted class of CRNs with void rules, reactions that only decrease species counts. We further examine this regime in the motivated model of step CRNs, which allow additional species to be introduced in discrete stages. With and without steps, we characterize the complexity of the reachability problem for CRNs with void rules. We show that, without steps, reachability remains polynomial-time solvable for bimolecular systems but becomes NP-complete for larger reactions. Conversely, with just a single step, reachability becomes NP-complete even for bimolecular systems. Our results provide a nearly complete classification of void-rule reachability problems into tractable and intractable cases, with only a single exception.
Keywords and phrases:
CRN, Chemical Reaction Network, Reachability, Void ReactionsCopyright and License:
2012 ACM Subject Classification:
Theory of computation Models of computation ; Theory of computation Problems, reductions and completenessFunding:
This research was supported in part by National Science Foundation Grant CCF-2329918.Editors:
Josie Schaeffer and Fei ZhangSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Background.
In molecular programming, Chemical Reaction Networks [5, 6] have become a staple model for abstracting molecular interactions. The model consists of a set of chemical species (formal symbols) as well as a set of reactions that dictate how these species interact. As an example, the reaction describes chemical species and reacting to form species and . While chemical kinetics are commonly modeled continuously using ordinary differential equations, this approximation breaks down for systems with relatively small volumes where species are present in very low amounts. Such systems are better modeled as discrete Chemical Reaction Networks (which we will hereby be referring to simply as CRNs), where the system state consists of non-negative integer counts of each species and state transitions occur stochastically as a continuous time Markov process [13]. It turns out that this model of chemistry has deep connections to several other well-studied mathematical objects. In fact, CRNs are equivalent [9] to Vector Addition Systems (VASs) [16] and Petri-Nets [23] which were independently introduced to represent and analyze concurrent and distributed processes. This underlying object also appears in the form of commutative semigroups when only fully reversible reactions are considered [17, 22], and as Population Protocols [4] when reactions must have exactly two input and two output elements.
Perhaps the most fundamental problem within these models is that of reachability which asks: given an initial configuration and target configuration for a particular system, can the target configuration be reached from the initial configuration by following some sequence of legal transitions [20, 21, 25]? Although interest in this problem dates back to the 1970s and 1980s, it was only recently resolved with a flurry of new results over the past few years [10, 11, 12, 18, 19], which conclude that reachability is Ackermann-complete for these models. Over the course of this 40+ year-long quest to determine the complexity of reachability, scientists also began to discover the centrality of this problem. Several other important problems from seemingly unrelated areas have been reduced to reachability, from system liveness to language emptiness problems and more [14, 26], emphasizing the significance of succinctly classifying reachability.
Despite the closure of this problem for general CRNs, and in fact due to how complicated these systems can be, there is a natural motivation to explore reachability for more restricted systems. Many papers have emerged that investigate reachability in restricted versions of the model [7, 8, 15, 26, 31], but one of the most elementary restrictions is that of [1] and [2]. There, the authors consider deletion-only systems (called void rules) where reactions only ever consume species and reduce the size of the system. The interaction rules for these systems can be thought to convert some chemical reactants into inert waste species, or cause system agents to “go offline” and become inactive. Similar work has also investigated reachability in a slightly different version of size-reducing chemical reaction networks whose stoichiometric matrices are totally unimodular [28, 29]. This limited class of systems permits tractable and intractable problems, placing it along an interesting complexity boundary.
| Reachability Results | ||||
|---|---|---|---|---|
| Basic CRNs (1-step) | 2-Step CRNs | |||
| Void Rules | Complexity | Ref. | Complexity | Ref. |
| NL | Thm. 11 | NPC | Thm. 12 | |
| Thm. 21 | NPC | Cor. 22 | ||
| [1] | NPC | Thm. 9 | ||
| , | Thm. 18 | NPC | Thm. 9 | |
| NPC | Cor. 24 | NPC | - | |
Related Work.
In [1], the authors studied reachability for this restricted class of CRNs that use (deletion-only) void rules (e.g., or ). Under this restriction, they prove NP-completeness for reachability using void rules of size (3,0) (3 reactants, no products) and provide a polynomial time algorithm for reachability using void rules of size (2,0) (2 reactants, no products) for unary inputs. In this paper, we continue this line of work by considering reachability in CRNs with void rules of varying numbers of reactants and products. Since void rules arguably constitute the simplest type of reaction, one may wonder what computationally interesting behavior can be achieved with them – and this exact idea is investigated in [2].
The authors of [2] and [3] combine void rules with an experimentally motivated model extension called step CRNs. Ideally, experimental scientists use the CRN model to design molecular systems and predict the molecular interactions and possible end-states of those systems. However, contrary to the CRN model in which all the molecules are ready to interact from the start, many experimental designs rely on a progressive addition of molecules that allow some interactions to occur first before moving forward with the experiment. Furthermore, the ability of reactions to add molecules that interact with the rest of the system is precisely what makes experimental applications of theoretical concepts difficult to realize with minimal error at a practical scale [27, 32]. Thus, the step CRN model was introduced which incorporates a sequence of discrete steps, where, at each step, new species are added to the existing CRN and react until no further reactions can occur. This augmentation more closely reflects a laboratory setting in which chemicals are incrementally added in a test tube and left to interact. The work of [2] and [3] shows that, surprisingly, extremely simple void rules are capable of simulating threshold formulas and threshold circuits when steps are added. In this paper, we show that adding even a single step drastically changes the computational complexity of the reachability problem, moving from (and even ) to NP-complete in many cases.
Our Contributions and Paper Organization.
In this paper we present several results for the various types of deletion-only interaction rules. We show that bimolecular deletion-only systems are solvable in polynomial time, with or without catalysts for basic (single-step) CRNs, while they are NP-complete even with one additional step. On the other hand, we show that larger void rules (with reactants and products) are NP-complete even for basic CRNs unless all but one reactant is a catalyst, in which case we show the problem is in P. These results are outlined in Table 1, and we visualize the complexity landscape in Figures 1(a), 1(b), and 1(c). When taken together, these results yield the following theorems, which provide a nearly complete characterization of reachability with void rules in CRNs with and without steps.
Theorem.
Reachability for basic CRNs uniformly using size void rules is NP-complete, and is in P when uniformly using any other size void rule.
Theorem.
Reachability for 2-step CRNs with only void rules that use exactly one reactant is in P, and is NP-complete otherwise.
Theorem.
Reachability for basic CRNs that use a combination of void rule types is in P for combinations of (2,0) + (2,1) rules as well as rules, and is NP-complete for any combination that uses rules.
We begin the paper by defining void rules, Step Chemical Reaction Networks, and the reachability problem in Section 2. Sections 3-6 establish the complexity of reachability based on the size of rules used by a given system: Section 3 shows membership in NP for all deletion-only systems. Section 4 considers bimolecular rule sets that are either all catalytic or non-catalytic, and shows membership in P in either case. It also shows that, in contrast, the problem becomes NP-complete with the inclusion of a second step. Section 5 expands this to bimolecular systems with mixed catalytic and non-catalytic rules, and Section 6 considers larger size rules which are polynomially solvable if all but a single reactant serve as catalysts, and NP-complete otherwise.
2 Preliminaries
2.1 Chemical Reaction Networks
Basics.
Let denote some ordered alphabet of species. A configuration is a length- vector of non-negative integers where denotes the number of copies of species . For a species , we denote the configuration consisting of a single copy of and no other species as . A rule or reaction is represented as an ordered pair . contains the minimum counts of each reactant species necessary for reaction to occur, where reactant species are either consumed by the rule in some count or leveraged as catalysts (not consumed); in some cases a combination of the two. The product vector has the count of each species produced by the application of rule , effectively replacing vector . The species corresponding to the non-zero elements of and are termed reactants and products of , respectively.
The application vector of is , which shows the net change in species counts after applying rule once. For a configuration and rule , we say is applicable to if for all , and we define the application of to as the configuration . For a set of rules , a configuration , and rule applicable to that produces , we say , a relation denoting that can transition to by way of a single rule application from . We further use the notation to signify the transitive closure of and say is reachable from under , i.e., can be reached by applying a sequence of applicable rules from to initial configuration . Here, we use the following notation to depict a rule : . For example, a rule turning two copies of species and one copy of species into one copy of species would be written as .
Definition 1 (Discrete Chemical Reaction Network).
A discrete chemical reaction network (CRN) is an ordered pair where is an ordered alphabet of species, and is a set of rules over .
A configuration is called terminal with respect to a CRN if no rule can be applied to it. An initial configuration and CRN is said to be bounded if a terminal configuration is guaranteed to be reached within some finite number of rule applications starting from . We denote the set of reachable configurations of a CRN as . We define the subset of reachable configurations that are terminal as .
2.2 Void Rules
A void rule is any rule that does not create any new copies of any species types (only deletes). Thus, a void rule either has no products or has products that are a subset of its reactants (in which case these products are termed catalysts). The formal definitions of void rules and rule size are as follows.
Definition 2 (Void rules).
A rule is a void rule if has no positive entries and at least one negative entry. There are two classes of void rules, catalytic and true void. In catalytic void rules, one or more reactants remain and one or more reactant is deleted after the rule is applied. In true void rules, there are no products remaining.
Definition 3.
The size/volume of a configuration is . When is an initial configuration of a CRN, we refer to .
Definition 4 (size- rules).
A rule is said to be a size- rule if . A reaction is trimolecular if , bimolecular if , and unimolecular if .
2.3 Step CRNs
A step CRN is an augmentation of a basic CRN in which a sequence of additional copies of some system species are added after a terminal configuration is reached. Formally, a step CRN of steps is an ordered pair , where the first element of the pair is a normal CRN , and the second is a sequence of length- vectors of non-negative integers denoting how many copies of each species type to add after each step. We define a step-configuration for a step CRN as a valid configuration over along with an integer that denotes the configuration’s step. We denote the initial volume of step CRN as and total volume as . Figure 2 illustrates a simple step CRN system.
Given a step CRN, we define the set of reachable configurations after each sequential step. To start off, let be the set of reachable configurations of with initial configuration , which we refer to as the set of configurations reachable after step 1. Let be the subset of configurations in that are terminal. Note that after a single step we have a normal CRN, i.e., 1-step CRNs are just normal CRNs with initial configuration . For the second step, we consider any configuration in combined with as a possible starting configuration and define to be the union of all reachable configurations from each possible starting configuration attained by adding to a configuration in . We then define as the subset of configurations in that are terminal. Similarly, define to be the union of all reachable sets attained by using initial configuration plus any element of , and let denote the subset of these configurations that are terminal. The set of reachable configurations for a -step CRN is the set , and the set of terminal configurations is . A classical CRN can be represented as a step CRN with steps and an initial configuration of .
Note that our definitions assume only the terminal configurations of a given step are passed on to seed the subsequent step. This makes sense if we assume we are dealing with bounded systems, as this represents simply waiting long enough for all configurations to reach a terminal state before proceeding to the next step. In this paper, we only consider bounded void rule systems; we leave more general definitions to be discussed in future work.
2.4 Reachability
The computational problem studied in this paper is reachability. Informally, reachability asks if a given initial configuration can be turned into a target configuration by applying a sequence of rules from the given CRN . The precise problem statement is as follows.
Definition 5 (Reachability Problem).
Given an initial configuration , a destination (target) configuration , and a step CRN , determine if , i.e., is configuration reachable for the given step CRN. In the case of basic CRNs, this simplifies to: given configurations and , and basic CRN , determine if .
3 Membership in NP for void rule systems
We initiate our study of deletion-only systems by observing that reachability stays within the class NP with only void rules, even with step-CRNs. This is straightforward to see in the case of polynomial bounded volume (unary encoded species counts) as each rule reduces the system volume by at least 1. But in the case of binary encoded species counts, the argument is more subtle as such deletion sequences could be exponentially long. To deal with this issue, we use the following rearrangement lemma that states that any order of void rule applications can be rearranged such that all applications of a given rule occur in a contiguous sequence. Given this lemma, any sequence of void rule applications can be rearranged into a sequence that can be encoded and verified in polynomial time.
Lemma 6 (Rearrangement Lemma).
For any sequence of applicable void rules , there exists a sequence that is a permutation of such that all applications of a given rule type occur contiguously.
Proof.
Consider a sequence of applicable void rules that is not contiguous. Suppose rule occurs at positions and in , , and there is at least one non- rule in between them. Construct a new sequence by shifting the rule at position up to position , and shifting all rules in between down one position. This new sequence must be applicable as the only rule that moved to a higher index in the sequence is of type , and we know that is still applicable at position since is known to be applicable at position . As this swapping preserves the applicability of the sequence while reducing the number of non-contiguous blocks of one rule type in the sequence, we can repeat this process of swapping rule positions until the sequence is contiguous.
This lemma implies the existence of a polynomial-time verifiable certificate for “yes” instances of the reachability problem for step-CRNs, giving us membership in NP.
Theorem 7.
The reachability problem for step-CRNs with void rules is in NP.
Proof.
As a certificate, we utilize a contiguous sequence of applicable rules for each step of the CRN, which must exist by Lemma 6. This sequence, while potentially exponential in length, can be encoded with a sequence of rule types accompanied by a count on the number of applications of each rule type. The result of such a sequence can be computed in polynomial time and therefore can serve as a certificate for the reachability problem.
4 Bimolecular Rules of Uniform-type: With or Without Catalysts
In this section, we focus on bimolecular systems with either all size- rules (non-catalytic) or rules (catalytic). Recently, size- rule reachability in a single step was proven to be polynomial [1]. For size- -step systems, we present polynomial-time algorithms for reachability. In contrast, we show that in either scenario the problem becomes NP-complete with the addition of a second step. Later in Section 5, we consider the scenario of CRNs that use both and rules together.
4.1 Bimolecular Void Rules Without a Catalyst:
In [1], the authors proved that reachability in a CRN system with only size- rules is in P by reducing from the perfect -matching problem, which is a generalization of matching. This takes the form of a traditional matching when all -values are 1, and an uncapacitated -matching occurs when all edge capacities are assigned .
Theorem 8 ([1]).
Reachability for basic CRNs with binary encoded species with only rules of size (2, 0) is solvable in time.
We now look at the problem with only one additional step, and show that it becomes NP-complete by reducing from the graph 3-colorability (3-COL) problem. Given an instance , where is an undirected graph, 3-COL asks if each vertex of can be assigned one of three colors such that no adjacent vertices share the same color. An instance of 3-COL can be converted into a (2,0) 2-step CRN as follows.
Species.
For each vertex , we create the species , , , and . represents an assignment of color to vertex ; the species will be used to represent assigning only one color to vertex through specific reactions. We also create the species to verify that a corresponding color assignment of in has no adjacent vertices that share a color.
Steps and Rules.
In step one (or ), for each , we add two copies of and one copy of , , and . We also create the assignment rule for each . Two of the three assignment rules created for are applied to its respective species copies, consuming all copies and two of the three copies of . The remaining copy then corresponds to assigning vertex the color . Additionally, for each edge and , we create the edge rule . If the remaining copy of both and share a color , they will be deleted by one of the edge rules.
In the second step (), we introduce copies of the species . We also construct the verification rule for each and . All existing copies of will be consumed by a species. Thus, any remaining copies of in the terminal configuration indicates that some copies were deleted by an edge rule.
Theorem 9.
Reachability for 2-step CRNs with only rules of size- is NP-complete, even for unary encoded species counts.
Proof.
We reduce from the graph 3-colorability problem. Given an instance of 3-COL , we convert into a -step CRN , following the construction outlined above, and set and to the empty configuration .
Forward Direction.
Assume there exists a color assignment in where no adjacent vertices share a color. By the construction of , a sequence of assignment rules can be applied in that results in a configuration of one copy of for each vertex that matches the color assignment in . Denote this new configuration . Since no adjacent vertices share a color in , no edge rule will be applied in , keeping the count of the copies to . then transitions to , introducing the copies. Since copies were preserved, all and copies are deleted by verification reactions to reach the final configuration .
Reverse Direction.
Assume there exists a sequence of applicable rules in that reaches from . First, removing all species can only be accomplished by applying a sequence of assignment rules. The resulting configuration is copies. Assume no edge rule can be applied in . By the construction of , this implies that the matching color assignment in also does not have adjacent vertices sharing colors. We then add copies at the second step, resulting in the deletion of all and copies in the system by the verification rules, resulting in a final terminal configuration of . If an edge rule was applied in , at least two copies were removed, causing the final count of to be greater than . Note that applying an edge rule before an assignment rule also guarantees cannot be reached, as either 1) the assignment rules for the affected copies are then applied, removing those copies and consequentially preventing some copies from being deleted, or 2) more edge rules are applied on the affected copies, which prevents all copies from being deleted. Therefore, the only way for to reach is for a color assignment to exist on all vertices in where no adjacent vertices share a color.
Theorem 7 shows reachability with void step CRN systems to be in NP.
4.2 Bimolecular Void Rules with Catalyst:
In this section, we first show that reachability for size- void rules resides in the class .
Lemma 10.
Let the implication graph of a CRN with size- void rules be the graph where each node is a species and each reaction implies a directed edge from to . A configuration is reachable from if and only if for each species there exists a path to a node that holds one of the following properties:
-
1.
,
-
2.
where , or
-
3.
and
Proof.
We will refer to a node which satisfies one of these conditions as a root node. A path from species to a root node means that we can delete enough copies of to reach the target configuration. We will prove this recursively, inducing over the length of the path from to , to create a reaction sequence through this process with our base case being the end of the sequence.
For our base case, any node can reach the target amount if it satisfies a condition in the Lemma statement. In Case 1, the number of species in the starting configuration is already the target amount so the claim is trivially true. In Case 2, we may use copies of the species to delete using the leftover species in the target configuration. In Case 3, the species may delete itself to reach the target amount.
For our inductive case, assume that there exists a reachable configuration such that any species with a shortest path of length to a node can be reduced to the target amount . For a species with a shortest path of length , there exists an edge to a species with length . We can use the reaction to decrease to copies at the start of the current sequence. It remains to prove that removing these copies does not affect anything later in the sequence. If the closest node falls under case 1 or 3 then removing does not affect it. If the closest node is case 2 and , the species is the one used to remove ; thus, the condition means that we leave at least a single copy in the configuration that can be used to delete .
If a node does not have a path to a root node, then it either does not have any outgoing edges, or all of its outgoing edges are part of some cycle where all nodes along each cycle have a target count of . As a result, if the node does not fall into case 1, there is no way of reducing the respective species to its target count without leaving some other species unsatisfied.
Theorem 11.
Reachability for basic CRNs with size (2, 1) void rules is in NL.
Proof.
We will show that we can decide whether a node has no path to a root in log space; thus reachability is in coNL NL. We non-deterministically check a species , then for every node reachable from in the implication graph, we check if satisfies any of the conditions in Lemma 10. If we do not find such a node , then we reject.
If any node does not have a path to a root node, then some branch of this algorithm will reject. Checking each path can be done in NL as this is a directed graph. Checking if a node is a root node can be done in log space as it only involves edge queries and queries to the target configuration.
We now show that adding an extra step turns the problem NP-complete, as with CRN systems. Here, we reduce from the classic 3SAT problem. Given an instance of 3SAT , we construct a -step CRN as follows.
Species.
For each variable , we create a pair of species and , which represents assigning a value of true or false, respectively. Additionally, for each clause , we create the species . The presence of a copy of in a configuration of indicates has yet to be satisfied by one of its assigned variables. Finally, we create the species for “clean-up” procedures.
Steps and Rules.
In the first step , for each variable , we introduce one copy of and . We also create a pair of assignment rules, one to represent assigning true to () and one for assigning false (). One of two assignment reactions will be applied to the copies of and ; the non-deleted copy represents assigning the corresponding boolean value.
In the second step , we add a single copy of a clause species for each clause and a single copy of . Additionally, given a clause and a variable of the clause , separate verification rules created of the form (for non-negated variables) or (for negated variables). If / is still present in , then will be consumed by that species. Finally, for each variable , we create the cleaning rules and to consume all present copies of and . Any species remaining in after the application of the cleaning rules indicates that it could not be deleted by a verification rule.
Theorem 12.
Reachability for 2-step CRNs with only rules of size (2, 1) is NP-complete, even for unary encoded species counts.
Proof.
We reduce from 3SAT. Given an instance of 3SAT , we convert into a -step CRN via the reduction from above. Let and be a single copy of ().
Forward Direction.
Assume there exists an assignment of variables that satisfies to true. A sequence of assignment reactions can be then performed in that results in a configuration with only one copy for each variable that matches the variable assignment. In the second step, by the construction of , since the assignment satisfies , each introduced copy of can be deleted with a verification reaction. Finally, the added copy deletes all remaining literal species. The final configuration of is then .
Reverse Direction.
Assume there exists a sequence of applicable rules in that reaches from . First, a sequence of assignment reactions can be performed in that consumes one of the and copy for each variable. We then add one copy of each species and one copy of in the second step. Assume all copies can be consumed by a verification reaction. By the construction of , this implies that there exists an assignment of variables in that evaluates the formula to true. The copy can delete the remaining copies with cleanup rules to reach the final configuration . If a copy could not be removed, this implies that the variable assignment couldn’t satisfy the corresponding clause. Therefore, the only way for to reach is for an assignment of variables in to exist that satisfies all clauses of the formula.
Theorem 7 shows reachability with void step CRN systems to be in NP.
5 Bimolecular Rules of Mixed Type: (2,0) and (2,1)
In this section, we show that the reachability problem for general single-step bimolecular void rules systems that include a mix of non-catalytic rules and catalytic rules is in P. We show this via a reduction to the perfect -matching problem in an undirected graph.
Definition 13 (Perfect -matching Problem).
Given a graph , to be edge capacities, and to be the number of matchings a vertex can take, does there exists an assignment to the edges such that and for all ?
Unlike reducing from reachability to perfect -matching with only rules in [1], the inclusion of catalyst rules requires a substantially more involved reduction. We therefore begin with a brief overview of our reduction and then describe each step in greater detail. Finally, we follow with a proof of correctness and a runtime analysis for the entire result.
Overview
Our reduction transforms an instance of CRN reachability into an instance of the perfect -matching problem. The key idea is to identify which species involved in catalytic rules can be fully deleted using just catalytic rules and which must be further deleted using non-catalytic rules. If this distinction were known in advance, it would be straightforward to construct a corresponding graph and solve reachability via a matching instance.
To infer this structure, we first construct a directed graph , which we refer to as the catalytic deletion graph, where each vertex corresponds to a species and each directed edge represents a rule that catalytically deletes using . We then compute the strongly connected components (SCC’s) of and build a condensation graph whose nodes each represent a component of . The structure of allows us to identify which catalytic species must be completely deleted via a non-catalytic rule.
Using this information, we construct an undirected graph whose nodes effectively represent species that must be deleted via or rules and whose edges represent those corresponding rules. We then formulate a perfect b-matching instance on where a perfect matching exists exactly when there exists a valid sequence of and rules that complements the catalytic deletions to reach the target configuration .
Creating Catalytic Deletion Graph
Given a CRN , we construct the directed graph as follows. For each catalyst void rule , if , we create vertices and and the directed edge .
The intuition of is that an edge from to represents the species being deleted by the catalyst species . It then follows that a species whose respective vertex in has an out-degree of can only be deleted by a rule. We label these vertices as mandatory vertices. We also consider cycles in in which each vertex (species) only has an out-going edge to another vertex in the cycle. If the count of all represented species in the cycle in is zero, then regardless of the application of rules corresponding to the edges of the cycle, there is guaranteed to be at least one remaining species left that can only be completely removed by a rule. We label these cycles as mandatory cycles.
Definition 14 (Mandatory Vertices).
A vertex in with an out-degree of .
Definition 15 (Mandatory Cycles).
A cycle in in which each vertex 1) only has an out-going edge to another vertex in the cycle, and 2) has a corresponding species count of in .
Creating SCC Condensation Graph
Given a directed graph , we construct the directed graph as follows. First, we run Tarjan’s Strongly Connected Component Algorithm on , which returns a partition of ’s vertices of strongly connected components [30]. For each component , we create the vertex . For each directed edge from to another component , we create the directed edge .
Observation 16.
A vertex in represents a mandatory vertex if it is not a condensed component of and it has an out-degree of 0.
Observation 17.
A vertex in represents a mandatory cycle if it is a condensed component of in which all corresponding species have final counts of 0, and it has an out-degree of 0.
Creating -matching Instance Graph
Given a CRN , configurations and , and directed graphs and , we create an instance of the perfect -matching problem with the graph as follows. Let the difference configuration .
Creating and .
For each species , if , we create the vertices and and set both and to . These vertices represent the number of copies of that must be removed from by the void rules. Additionally, if , we create the vertices and and set both and to . These vertices exist just to “set aside” the final configuration for matchings, hence the bar labels.
We now consider species that can be deleted by catalyst void rules. For each catalytic rule , if and its corresponding edge in is not part of a cycle, we create the vertices and , if not already created, and set both and to . Additionally, given a vertex of , if represents a condensed cycle , we create the vertices and . If the cycle is mandatory, we assign and the value ; else they are assigned , where is a non-mandatory vertex of . These vertices represent a choice to delete a species using a catalytic species.
Let the vertices with -values from be the sub-graph , and the vertices with -values from be the sub-graph .
Creating and .
For each rule , if the vertices for both species were created in , we create the edges and . Performing a matching on these edges corresponds to deleting and by a rule.
For each rule , if and were created in and the rule is not part of a cycle in , we create the edges and . For each vertex of that represents a condensed cycle , if the cycle is mandatory, we create the edges and for all . Otherwise, we only create and for the non-mandatory vertices of . Matching the edges represents deleting a species with a catalyst rule.
We finally create the following edges: for all and vertices, create the edge , for all and vertices, create the edge , and for all and vertices, create the edge . Matching on these edges does not represent a rule application, but rather ensures a perfect -matching can be performed on these vertices even if they were not perfectly matched by other (2,1) edges. For all edges , assign .
Result
The overall effect is that has a perfect -matching exactly when configuration is reachable from configuration which yields our main theorem from this section.
Theorem 18.
Reachability in void rule systems with (2,0) and (2,1) rules is solvable in time.
Due to space, the full proof can be found in Appendix A.
6 Larger Void Rules
Our next results involve CRNs with reactions that require more than two reactants. If a system’s rules have all but one reactant serving as catalysts (i.e., void rules), then reachability remains polynomial-time solvable. In contrast, reachability for systems with any other form of void rule (with 3 or more reactants) becomes NP-complete.
6.1 Mostly-Catalytic Large Void Rules of Mixed-type:
We provide a polynomial-time dynamic programming algorithm to decide reachability for CRNs that use mostly-catalytic void rules of the form . We further argue that reachability remains in P, even for CRNs that use a combination of various size . For simplicity, we refer to void rules of sizes , where all , as , meaning there is one or more rule of this type.
Lemma 19.
Reachability for basic CRNs with only void rules of size requires at most distinct rules.
Proof.
For simplicity, let . Assume there exists a sequence of reactions for a CRN with set of species and set of rules that takes some initial configuration to configuration , where are positive integers (denoting how many times to apply each rule) and are rules in . There must then exist some species that gets consumed by 2 rules and , where . Let , and denote the initial, intermediate and final counts of species , where reduces from to and reduces from to . Since , any rule , where , that uses with count can also use with count . Thus, rule is not needed.
Theorem 20.
Reachability for basic CRNs with only void rules of size is solvable in .
Proof.
Let denote the set of rules. We can use a dynamic programming approach to solve the problem. Construct an table of boolean entries, where each row represents a different species. Reduce the count of each species to , where represents the final count of species , if there exists a rule that can do so. Starting from the first column , place a if the respective species is already in its final count. Then, for each entry , place a if is a or if there exists a reaction that reduces to its final count, where all the reactants of have either reached their final counts or will not prevent the reaction from occurring once they do. If column contains all 1’s, then reachability is possible. Otherwise, it is not.
By Lemma 19, a solution to the problem requires at most unique reactions, where each reaction directly reduces each species from its initial counts to its final counts. Thus, finding a solution to the problem takes at most steps since we are implicitly selecting at least one reaction per column. This results in columns, with the first column representing the initial configuration.
Since every rule is a catalytic void rule, there must exist an ordering of reactions such that some reactions can occur first without impeding other species from getting reduced to their final counts. A bottom-up approach can be used to find this ordering, starting with the reactions that can be put off until later and working up to the reactions that must occur first. In table , this ordering is implicitly represented between columns, with the reactions between the rightmost columns being the ones we do first. Any species with final count greater than is reduced before the algorithm is run if there exists an applicable rule, as reducing this species count does not prevent any other rule from occurring. Filling takes at most steps. Hence, reachability is solvable in polynomial time.
Theorem 21.
Reachability for basic CRNs with only void rules of size is solvable in .
Proof.
This follows from Theorem 20. Since we are considering a rule set where the size of each rule is , reducing each initial species count to guarantees that any that needs will be able to occur. The algorithm remains the same.
Corollary 22.
Reachability for 2-step CRNs with only void rules of size is NP-complete, even for unary encoded species counts.
Proof.
Follows from Theorem 12.
6.2 Large Void Rules of Uniform-type:
Here we show that reachability for CRNs using any void rules with at least three reactants, and which remove at least two species, becomes NP-complete. To achieve this result, we show that reachability is NP-complete for CRNs using only void rules via a reduction from the Hamiltonian path problem for directed graphs. Since it was previously shown that reachability is NP-complete for CRNs using only rules [1], this implies Corollary 24.
We reduce from the Hamiltonian path problem in directed graphs. For simplicity, we reduce from the variation where each vertex has max in-degree and out-degree of two, which is still NP-complete [24]. Given an instance of the problem , we outline the species and the reactions for the reduction, and show correctness in the proof.
Species.
We create a species for every path through a vertex (unless it starts at or goes back to ). For example, looking at Figure 3, for vertex , we create two species and , where the notation denotes the vertex it came from, the vertex itself, and the vertex it goes to. With a maximum in/out degree of two, for each vertex, there are at most 4 paths through the vertex. In general, for each vertex , we create the species where and , . For , we just have and . We also create a species for each where . Thus, we have of these species.
Reactions.
There are two main types of reactions: those that pick which path through a vertex and those that walk the Hamiltonian path.
-
Since there are at most 4 species per vertex, we will create rules that create a tournament to choose one of the species for each vertex. Assuming 3 species for ease of explanation, we create the rules , , and . With only two species, we can create a dummy species that is not used as a catalyst. With 4 species, we augment the case of 3 species with another reaction that must occur with a dummy species () and the previous choice. For each choice with , we create the rules and .
-
We create rules that walk the Hamiltonian path with valid connecting species and a “fuel” species () so that we can only visit a vertex one time. We create each of the rules + where and . This rule indicates a walk from to along a valid edge and removes the token to mark the vertex as visited.
Example.
For Figure 3, we give the full reduction as follows. The final configuration (just a single copy of ) is only reachable if there is a Hamiltonian path.
-
The main species are , , , , , , , , , , , , , and . We also create a single copy each of dummy species , , .
-
The tournament reactions for each vertex are (d has only one path)
-
–
a) and ,
-
–
b) and ,
-
–
c) and .
-
–
-
The walking reactions for each vertex are
-
–
a) and ,
-
–
b) and ,
-
–
c) and ,
-
–
d) and ,
-
–
t) and .
-
–
Theorem 23.
Reachability for CRNs with only void rules of size is NP-complete, even for unary encoded species counts.
Proof.
We reduce from the directed Hamiltonian path problem. Given an instance , we convert this to an instance of the reachability problem, as outlined above, for CRN and target configuration . We show that is true iff the configuration is reachable in .
Forward Direction.
Assume there exists a Hamiltonian path in from to . Then it is possible that the tournament for every vertex correctly produces the species that represents the Hamiltonian path through the vertex. If this does occur, all species have been removed from the system except species for the path and species. Then, the walking reactions can occur successively by destroying the previous path vertex and the “fuel” species, which will only leave one copy of .
Reverse Direction.
Assume there exists a sequence of applicable rules in that reaches from . The only way to remove an species is through the tournament and the walking reactions. The tournament will always leave at least one for each vertex, meaning the walking reactions must be used to delete the other . Along with this, the vertices ensure that each vertex can only be visited once. Thus, the walk can not occur before the tournament and take multiple paths to reach a vertex. Thus, reaching a configuration with only ensures that a walk through the graph occurred starting at , ending at , and that every vertex was visited.
All void CRN systems are in NP with the certificate being the sequence of rules to apply, and the number of times to apply them [1].
Corollary 24.
Reachability for CRNs with only void rules of size () is NP-complete, even for unary encoded species counts.
Proof.
7 Primary Results
We restate the primary results formally with the corresponding proofs. Although not discussed, for completeness, we also include the following lemma.
Lemma 25.
Reachability for step CRNs (including basic CRNs) uniformly using size void rules is in P.
Proof.
Simply decrease each species to the desired count. Since each step must become terminal, all species in rules will be removed before the subsequent step. Thus, there must exist a step that adds counts greater than or equal to the target counts. Then treat that step as a basic CRN. If no such step exists, the target configuration is not reachable.
The collection of results presented, as a whole, yields the following main theorems of this work that characterize void rules within CRNs and step CRNs.
Theorem 26.
Reachability for basic CRNs uniformly using size void rules is NP-complete, and is in P when uniformly using any other size void rule.
Proof.
Theorem 27.
Reachability for 2-step CRNs with only void rules that use exactly one reactant is in P, and is NP-complete otherwise.
Proof.
Theorem 28.
Reachability for basic CRNs that use a combination of void rule types is in P for combinations of (2,0) + (2,1) rules as well as rules, and is NP-complete for any combination that uses rules.
Proof.
8 Conclusion and Future Work
This paper presents a nearly complete classification of the computational complexity of reachability for CRNs and step CRNs that consist of deletion-only rules. We provide polynomial-time algorithms for most combinations of void rules in basic CRNs and show NP-completeness for rules of size greater than for . Additionally, we prove that with the addition of a single step, these problems become NP-complete. We include some natural open directions to explore:
-
Mixed-size Void Rule Systems. What is the complexity of reachability when you consider void rules of size and together? This combination of void rule types is the missing piece that would complete the picture for the entire complexity landscape of void rule reachability.
-
Staged CRNs. The step CRN model augments the basic CRN model with steps that add species once reactions are completed. A generalization of this model could have multiple “stages”, where CRNs are left to react and the results of these stages are combined. How do stages affect reachability?
-
Model Variants. What is the complexity of reachability in deletion-only extensions of CRNs, petri-nets, and vector addition systems?
References
- [1] Robert M. Alaniz, Bin Fu, Timothy Gomez, Elise Grizzell, Andrew Rodriguez, Robert Schweller, and Tim Wylie. Reachability in restricted chemical reaction networks, 2022. doi:10.48550/arXiv.2211.12603.
- [2] Rachel Anderson, Alberto Avila, Bin Fu, Timothy Gomez, Elise Grizzell, Aiden Massie, Gourab Mukhopadhyay, Adrian Salinas, Robert Schweller, Evan Tomai, and Tim Wylie. Computing threshold circuits with void reactions in step chemical reaction networks. In 10th conference on Machines, Computations and Universality (MCU 2024), 2024.
- [3] Rachel Anderson, Bin Fu, Aiden Massie, Gourab Mukhopadhyay, Adrian Salinas, Robert Schweller, Evan Tomai, and Tim Wylie. Computing threshold circuits with bimolecular void reactions in step chemical reaction networks. In International Conference on Unconventional Computation and Natural Computation, pages 253–268. Springer, 2024. doi:10.1007/978-3-031-63742-1_18.
- [4] Dana Angluin, James Aspnes, Zoë Diamadi, Michael J. Fischer, and René Peralta. Computation in networks of passively mobile finite-state sensors. Distributed Computing, 18(4):235–253, March 2006. doi:10.1007/s00446-005-0138-3.
- [5] Rutherford Aris. Prolegomena to the rational analysis of systems of chemical reactions. Archive for Rational Mechanics and Analysis, 19(2):81–99, January 1965. doi:10.1007/BF00282276.
- [6] Rutherford Aris. Prolegomena to the rational analysis of systems of chemical reactions ii. some addenda. Archive for Rational Mechanics and Analysis, 27(5):356–364, January 1968. doi:10.1007/BF00251438.
- [7] Michael Blondin, Matthias Englert, Alain Finkel, Stefan Göller, Christoph Haase, Ranko Lazić, Pierre Mckenzie, and Patrick Totzke. The reachability problem for two-dimensional vector addition systems with states. Journal of the ACM (JACM), 68(5):1–43, 2021. doi:10.1145/3464794.
- [8] Adam Case, Jack H Lutz, and Donald M Stull. Reachability problems for continuous chemical reaction networks. Natural Computing, 17(2):223–230, 2018. doi:10.1007/S11047-017-9641-2.
- [9] Matthew Cook, David Soloveichik, Erik Winfree, and Jehoshua Bruck. Programmability of Chemical Reaction Networks, pages 543–584. Springer Berlin Heidelberg, Berlin, Heidelberg, 2009. doi:10.1007/978-3-540-88869-7_27.
- [10] Wojciech Czerwiński, Sławomir Lasota, Ranko Lazić, Jérôme Leroux, and Filip Mazowiecki. The reachability problem for Petri nets is not elementary. Journal of the ACM (JACM), 68(1):1–28, 2020. doi:10.1145/3422822.
- [11] Wojciech Czerwiński, Sławomir Lasota, and Łukasz Orlikowski. Improved Lower Bounds for Reachability in Vector Addition Systems. In 48th International Colloquium on Automata, Languages, and Programming (ICALP 2021), volume 198 of Leibniz International Proceedings in Informatics (LIPIcs), pages 128:1–128:15, Dagstuhl, Germany, 2021. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2021.128.
- [12] Wojciech Czerwiński and Łukasz Orlikowski. Reachability in vector addition systems is Ackermann-complete. In 62nd Annual Symposium on Foundations of Computer Science, FOCS’21, pages 1229–1240. IEEE, 2021.
- [13] Daniel T Gillespie. Stochastic simulation of chemical kinetics. Annu. Rev. Phys. Chem., 58(1):35–55, 2007.
- [14] Michel Henri Théodore Hack. Decidability questions for Petri Nets. PhD thesis, Massachusetts Institute of Technology, 1976.
- [15] John Hopcroft and Jean-Jacques Pansiot. On the reachability problem for 5-dimensional vector addition systems. Theoretical Computer Science, 8(2):135–159, 1979. doi:10.1016/0304-3975(79)90041-0.
- [16] Richard M. Karp and Raymond E. Miller. Parallel program schemata. Journal of Computer and System Sciences, 3(2):147–195, 1969. doi:10.1016/S0022-0000(69)80011-5.
- [17] Ulla Koppenhagen and Ernst W Mayr. Optimal algorithms for the coverability, the subword, the containment, and the equivalence problems for commutative semigroups. Information and Computation, 158(2):98–124, 2000. doi:10.1006/INCO.1999.2812.
- [18] Jérôme Leroux. The reachability problem for Petri nets is not primitive recursive. In 62nd Annual Symposium on Foundations of Computer Science, FOCS’21. IEEE, 2021.
- [19] Jérôme Leroux and Sylvain Schmitz. Reachability in vector addition systems is primitive-recursive in fixed dimension. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 1–13. IEEE, 2019. doi:10.1109/LICS.2019.8785796.
- [20] Richard J. Lipton. The reachability problem requires exponential space. Technical Report 62, Yale University, 1976.
- [21] Ernst W. Mayr. An algorithm for the general Petri net reachability problem. In Proceedings of the Thirteenth Annual ACM Symposium on Theory of Computing, STOC ’81, pages 238–246, New York, NY, USA, 1981. Association for Computing Machinery. doi:10.1145/800076.802477.
- [22] Ernst W Mayr and Albert R Meyer. The complexity of the word problems for commutative semigroups and polynomial ideals. Advances in mathematics, 46(3):305–329, 1982.
- [23] Carl Adam Petri. Kommunikation mit Automaten. PhD thesis, Rheinisch-Westfälischen Institutes für Instrumentelle Mathematik an der Universität Bonn, 1962.
- [24] Ján Plesník. The np-completeness of the hamiltonian cycle problem in planar diagraphs with degree bound two. Information Processing Letters, 8(4):199–201, 1979. doi:10.1016/0020-0190(79)90023-1.
- [25] George S Sacerdote and Richard L Tenney. The decidability of the reachability problem for vector addition systems (preliminary version). In Proceedings of the ninth annual ACM symposium on Theory of computing, pages 61–76, 1977. doi:10.1145/800105.803396.
- [26] Sylvain Schmitz. The complexity of reachability in vector addition systems. ACM SigLog News, 2016. doi:10.1145/2893582.2893585.
- [27] David Soloveichik, Matthew Cook, Erik Winfree, and Jehoshua Bruck. Computation with finite stochastic chemical reaction networks. natural computing, 7(4):615–633, 2008. doi:10.1007/S11047-008-9067-Y.
- [28] Gergely Szlobodnyik and Gábor Szederkényi. Polynomial time reachability analysis in discrete state chemical reaction networks obeying conservation laws. MATCH-Communications in Mathematical and in Computer Chemistry, 89(1):175–196, 2023.
- [29] Gergely Szlobodnyik, Gábor Szederkényi, and Matthew D Johnston. Reachability analysis of subconservative discrete chemical reaction networks. MATCH-Communications in Mathematical and in Computer Chemistry, 81(3):705–736, 2019.
- [30] Robert Tarjan. Depth-first search and linear graph algorithms. SIAM journal on computing, 1(2):146–160, 1972. doi:10.1137/0201010.
- [31] Chris Thachuk and Anne Condon. Space and energy efficient computation with dna strand displacement systems. In International Workshop on DNA-Based Computers, 2012.
- [32] Boya Wang, Chris Thachuk, Andrew D Ellington, Erik Winfree, and David Soloveichik. Effective design principles for leakless strand displacement systems. Proceedings of the National Academy of Sciences, 115(52):E12182–E12191, 2018.
Appendix A Proof Details for (2,0) and (2,1) Mixed rules
Here we show the full details for the proof of correctness and runtime for the Lemmas and Theorems from Section 5.
A.1 Proof of Correctness
Lemma 29.
A species represented by a mandatory vertex must use void rules to be completely deleted, and mandatory cycles must have at least one species represented by a mandatory vertex to completely delete the cycle.
Proof.
We first consider the case of trying to delete a non-zero amount of a species represented by a mandatory vertex. We thus know that cannot be deleted by any catalytic rules. Thus, it can only be deleted with void rules, which means we must have as many matchings with as the number of deletions required to remove the species.
To show that completely deleting a mandatory cycle requires at least one species to be represented by a mandatory vertex, recall that the definition of a mandatory cycle is a cycle of void rules where the only catalytic rules that can delete each vertex is within the cycle. This means to completely delete the species in the cycle only using the rules of the cycle will always leave at least one species in the cycle with a non-zero amount of copies. Since we can always perform catalytic rules in the cycle such that every species in the cycle has a count of , then no matter what order the catalytic rules are applied in the cycle, there is always at least one species with a count of one. Thus, to completely delete all species of the cycle, a matching from a rule must be performed on .
Lemma 30.
A perfect b-matching in G implies we have a set of rules that, if applied, can delete and only .
Proof.
We represent configurations and in disjoint subgraphs in as and , respectively. If a perfect matching exists, then for all , which holds for all vertices in . Since every edge represents a deletion either from a void rule or a catalytic void rule, this implies that if all rules are applied that are represented in , this would delete at least because , and is equal to the count of in . Since this is true for all , we can delete the entirety of and completely remove only if we have a perfect matching.
Lemma 31.
A perfect -matching in contains (2,0) void rule matchings for all species represented by mandatory vertices in .
Proof.
If a species is represented in , there exists a non-zero count of that must be deleted to reach . By definition, a species represented by a mandatory vertex can only be completely deleted by a rule. Thus, if we have a perfect matching, we have matched all of the species represented by mandatory vertices through these void rule edges.
Lemma 32.
If there exists a perfect b-matching in , then there exists a vertex in each mandatory cycle that is matched to a rule.
Proof.
A perfect matching contains the property that for all vertices, . Let be a collection of vertices that compose a mandatory cycle. By the construction of , for all , there exists an edge from to or to , where is the node representing catalytic rules among the vertices in the cycle. The vertex has -value , which means there is at most matchings with the vertices in the cycle. This implies at least one matching must occur without the catalytic rules represented by , and since the matching is perfect, this matching must exists. Furthermore, since this a mandatory cycle, no species in this cycle can be deleted through a catalytic rule not represented in the cycle. Thus, there is at least one rule matching with some vertex in this cycle when we have a perfect matching.
Theorem 33.
has a perfect b-matching if and only if is reachable from .
Proof.
Forward Direction.
Assume there exists a sequence of applicable rules in that reaches from . It thus follows that all species with non-zero counts in can be completely deleted by following this sequence. Then, by the construction of , a perfect -matching can be performed in the graph. Recall that our graph has two disjoint subgraphs and . In our construction, will always form a perfect matching since we have two vertices with equal -values attached by one edge of infinite capacity. Thus, these vertices can always match with each other, and we only need to show how to create a perfect matching in . Every vertex in must be perfectly matched to create a perfect -matching, and we can think of matching as a deletion of the deleted species for void rules and deletion of both species in void rules. We then make the assignment on each edge the number of times we used that respective or rule, which perfectly matches all . However, if our catalytic vertices are not perfectly matched through its respective edge, this means that we deleted using more than the catalytic rule corresponding with , which means we have excess . We thus use the edge so that any excess matchings can be assigned along that edge, and thus create a perfect -matching in .
Reverse Direction.
Assume there exists a perfect -matching in . Then is reachable from if there exists a valid sequence of and void rules to get from to . Recall that a perfect -matching means that we have an assignment of edges such that for every . Through Lemma 30, this perfect matching implies we can delete and only . Now we must show that there exists a valid sequence of rules that can be applied to delete . This is done through Lemmas 31 and 32, where we show that all mandatory vertices and mandatory cycles have void rules to match with. This means we can apply all void rules the correct number of times ( times) without worrying about deleting a catalytic species needed for a later catalytic rule. We can then execute all void rules their respective times to successfully delete , and thus reach from .
A.2 Runtime Analysis
We first construct , which creates vertices and edges since it creates a vertex for each unique species involved in a rule and an edge for each unique rule. Thus, this step takes time, where and . We then run Tarjan’s Strongly Connected Component Algorithm on to produce graph , which has a runtime of [30]. Finally, we create the graph and functions and . It takes time to create , and since we create at most 6 vertices per species when creating the vertex set for , this takes time. Additionally, since we create one edge for every valid void rule in our CRN and an edge for every species in our final configuration, we create edges. We then assign a -value for each vertex in , and since assigning a -value to a vertex requires a look-up in that takes time, we assign all the -values in time. Finally, we assign all edge capacities to infinity, which takes time per edge with a runtime of . This results in an overall runtime of for the construction of . Finally, the runtime of the maximum -matching algorithm is proven to be strictly polynomial with a runtime of . This results in a total polynomial runtime for the algorithm of .
Theorem 34.
The reachability problem in CRNs with only and rules is solvable in time.
Proof.
Subsection 5 shows how to convert any instance of the and reachability problem into an instance of the perfect -matching problem in time (Subsection A.2), with Subsection (A.1) proving its correctness.