1 Introduction

Reaction systems have been introduced by Ehrenfeucht and Rozenberg (2004, 2007) as an abstract computation model inspired by the biochemical reactions happening inside living cells. The model consists of a finite set of entities, modelling the different chemical substances that might be present inside a cell, and a finite set of rules, modelling the reactions that might happen. A reaction is expressed as a subset of entities called reactants, another subset of entities called inhibitors, and a third subset of entities called products. Any subset of entities defines a state of a reaction system.

The model of computation provides that all reactions whose set of reactants is fully included in the current state and whose set of inhibitors has an empty intersection with it happen at the same time and the union of the products of such reactions define the next state of the system.

This formulation is particularly simple, as it assumes that reactions sharing some reactants can always happen simultaneously; and yet, it is known that this model can be used to simulate several biological processes, including heat shock response, gene regulatory networks and oncogenic signalling: see Corolli et al. (2012); Azimi et al. (2014); Barbuti et al. (2021); Ivanov and Petre (2020).

The sequence of reactions happening inside a reaction system defines a dynamical process; the computational complexity of several aspects of such process has been the object of several studies, including Formenti et al. (2015); Azimi et al. (2016); Barbuti et al. (2016); Nobile et al. (2017); Dennunzio et al. (2019). While the standard formulation of reaction systems does not constraint the size of the set of reactants and inhibitors that define the reactions, a different line of research investigates resource-bounded reaction systems, in which either the number of reactants or the number of inhibitors in each reaction is bounded: Ehrenfeucht et al. (2011) studied how limiting the number of reactants and inhibitors can affect the kinds of functions that a reaction system can define; Dennunzio et al. (2016) studied the complexity of the reachability problem when limiting the maximum number of reactants and inhibitors involved in each reaction; Azimi (2017) proposed an algorithm to list all steady states of reactant systems whose reactions have a small number of reactants and inhibitors; Ascone et al. (2024) investigated the computational complexity of deciding on the occurrence of behaviors related to fixed points and attractors in the special classes of reactantless and inhibitorless reaction systems, in which the set of reactants (respectively, the set of inhibitors) is empty.

Constraining the resources that each reaction can use also allows characterizing better the complexity of the dynamics that real systems—modelled as reaction systems—can exhibit. In fact, elementary chemical reactions are often unimolecular or bimolecular, i.e., they involve only one or two molecules; trimolecular reactions are already considered non-elementary and reactions involving four or more molecules are not observed due to the very low probability of the simultaneous interaction of four or more molecules (Steinfeld et al. 1999). Hence, any reaction system involving reactions with a large number of reactants is not a realistic representation of real-world reactions.

It is, therefore, useful to understand the complexity of deciding if a certain dynamical behaviour occurs in reaction systems with reactions using a small number of reactants and, in particular, in systems where each reaction has at most one reactant and no inhibitors, that are the most constrained systems in which interesting dynamical behaviors can still be observed. Questions related to fixed points and attractors for this class of reaction systems, which we call additive reaction systems, were left open in Ascone et al. (2024). The main results presented in this paper are summarized in Table 1.

All the considered problems, which are almost always hard for reactantless and inhibitorless reaction systems, become polynomial in the class of additive reaction systems. Although this might be not entirely unexpected due to the relative simplicity of the dynamics of these severely constrained systems, it is worth noticing that, e.g., the problem of deciding whether a given state is a fixed point attractor was proved to remain \({{\textbf {NP}}}\)-hard even for the class of inhibitorless reaction systems whose reactions involve up to two reactants each.

Table 1 Computational complexity of the problems studied in this work for different classes of reaction systems. NP-c, coNP-c, \(\mathbf {\Sigma }_2^{{{\textbf {P}}}}\)-c and \(\mathbf {\Pi }_2^{{{\textbf {P}}}}\)-c are shorthands for NP-complete, coNP-complete, \(\mathbf {\Sigma }_2^{{{\textbf {P}}}}\)-complete and \(\mathbf {\Pi }_2^{{{\textbf {P}}}}\)-complete, respectively; \(\mathcal{R}\mathcal{S}(\infty ,\infty )\), \(\mathcal{R}\mathcal{S}(0,\infty )\), \(\mathcal{R}\mathcal{S}(\infty ,0)\), and \(\mathcal{R}\mathcal{S}(1,0)\) denote unconstrained, reactantless, inhibitorless and additive reaction systems, respectively (see Sect. 2). Light-blue cells contain the results proved in this paper

The key tool our results rely on a variation of the so-called influence graph, a graph representation of the reactions of a system that was first introduced by Brijder et al. (2011). In particular, we determine the computational complexity of the considered problems by designing highly non-trivial polynomial-time reductions to various problems on the influence graph and by then providing polynomial-time solutions to these problems.

The rest of this paper is organized as follows. In Sect. 2, we provide basic notions on reaction systems and introduce the notation and tools we use throughout. In Sect. 3, we study problems related to the existence of fixed points. In Sect. 4, we study problems related to the existence of fixed points that are either attractors or not attractors. Finally, in Sect. 5 we discuss the obtained results and the problems left open.

2 Basics notions

This section introduces the basic notions about reaction systems and the notation used in this paper. Given a finite set S of entities, a reaction a over S is defined by a triple \(( R_a,I_a,P_a)\) of subsets of S: \(R_a\) is the set of reactants, \(I_a\) is the set of inhibitors, and \(P_a\) is the set of products (note that the set of reactants and the set of inhibitors are allowed to be empty as in the original definition by Ehrenfeucht and Rozenberg (2004)). The set of all reactions over S is denoted by \(\text {rac}(S)\).

A reaction system (RS) is a pair \(\mathcal {A}= (S,A)\) consisting of a finite set of entities S, called the background set, and a set \(A \subseteq \text {rac}(S)\) of reactions over S.

Given a state \(T \subseteq S\) (i.e., a set of entities present in the system at a certain moment), a reaction a is said to be enabled in T when \(R_a \subseteq T\) and \(I_a \cap T = \varnothing\). The result function \(\text{res}_a: 2^S \rightarrow 2^S\) of a, where \(2^S\) denotes the power set of S, is defined as

$$\begin{aligned} \text{res}_a(T) :={\left\{ \begin{array}{ll} P_a &{} \hbox {if } a \hbox { is enabled in } T\\ \varnothing &{} \text {otherwise}. \end{array}\right. } \end{aligned}$$

The definition of \(\text{res}_a\) naturally extends to sets of reactions: given any state \(T \subseteq S\) and any set of reactions \(B\subseteq \text {rac}(S)\), we define \(\text{res}_{B} (T):=\bigcup _{b \in B} \text{res}_b(T)\). The result function \(\text{res}_{\mathcal {A}}\) of a reaction system \(\mathcal {A}= (S, A)\) is \(\text{res}_A\), i.e., the result function on the whole set of reactions. Any reaction system \(\mathcal {A}= (S, A)\) thus induces a discrete dynamical system where the state space is \(2^S\) and the next state function is \(\text{res}_{\mathcal {A}}\). Such a dynamical system can be represented with a directed graph with vertex set \(2^S\) and with edges \((T,\text{res}_\mathcal {A}(T))\) for all \(T\in 2^S\). See Fig. 1 for an example. The subsequent states of a reaction system \(\mathcal {A}\) under the action of the result function \(\text{res}_{\mathcal {A}}\) starting from some initial state constitute the dynamics of the system. The orbit or state sequence of a given state T of a system \(\mathcal {A}\) is defined as the sequence of states obtained by iterating \(\text{res}_{\mathcal {A}}\) starting from T, namely, the sequence \((T,\text{res}_{\mathcal {A}}(T),\text{res}_{\mathcal {A}}^2(T), \dots )\). Note that since S is finite, for any state T the sequence \((\text{res}_{\mathcal {A}}^n(T))_{n \in \mathbb {N}}\) is ultimately periodic. A fixed point \(T\subseteq S\) is a state such that \(\text{res}_{\mathcal {A}}(T) = T\). A fixed point attractor is a fixed point T for which there exists a state \(U\ne T\) such that \(\text{res}_{\mathcal {A}}(U) = T\). A fixed point not attractor is a fixed point that is not an attractor, i.e., it is not reachable from any state other than T itself. Note that fixed points of \(\mathcal {A}\) correspond to self-loops in the graph representation of its dynamical system.

Remark 1

It is important to clarify that the results obtained in this work are limited to reaction systems where there is no interaction with an external environment (i.e., they are closed). Formally, we deal only with context-independent reaction systems, where the next state of the system is entirely determined by the current state. This is different from reaction systems with context, where additional entities could be added at each time step according to a given sequence \(C_0, C_1, \ldots \subseteq S\) of contexts.

Given \(i,r\in \mathbb {N}\), the class \(\mathcal{R}\mathcal{S}(r,i)\) consists of all RS having at most r reactants and at most i inhibitors for each reaction; we also define the (partially) unbounded classes \(\mathcal{R}\mathcal{S}(\infty ,i) = \bigcup _{r = 0}^\infty \mathcal{R}\mathcal{S}(r,i)\), \(\mathcal{R}\mathcal{S}(r,\infty ) = \bigcup _{i = 0}^\infty \mathcal{R}\mathcal{S}(r,i)\), and \(\mathcal{R}\mathcal{S}(\infty , \infty ) = \bigcup _{r= 0}^{\infty }\bigcup _{i = 0}^\infty \mathcal{R}\mathcal{S}(r,i)\). We remark that these classes do not have the number of products as a parameter. This is because a RS can always be assumed to be in singleton product normal form (Brijder et al. 2011): any reaction \((R, I, \{p_1,\dots , p_m\})\) can be replaced by the set of reactions \((R, I, \{p_1\}),\dots ,(R, I, \{p_m\})\), since they produce the same result.

In this work, we will consider problems over the class \(\mathcal{R}\mathcal{S}(1,0)\). Given S a finite set, a function \(f: 2^S \rightarrow 2^S\) is additive (or an upper-semilattice endomorphism) if \(f(X \cup Y ) = f(X) \cup f(Y)\) for all \(X,Y \in 2^S\). In particular, a function \(f: 2^S \rightarrow 2^S\) is additive if and only if \(f = \text{res}_{\mathcal {A}}\) for some \(\mathcal {A}\in \mathcal{R}\mathcal{S}(1,0)\) (Manzoni et al. 2014, Proposition 23). We will thus refer to systems in class \(\mathcal{R}\mathcal{S}(1,0)\) as the additive reaction systems.

We also remark that if a function \(f: 2^S \rightarrow 2^S\) is additive then it is also monotone, i.e., \(X\subseteq Y\subseteq S\) implies \(f(X)\subseteq f(Y)\). Therefore, since \(\varnothing \subseteq T\) holds for every state \(T\subseteq S\), it always holds \(f(\varnothing )\subseteq f(T)\). In the example of Fig. 1, the fact that \(\text{res}_{\mathcal {A}}(\varnothing ) = \{a\}\) implies that the endpoint of every edge in the graph must be a state containing the entity a and therefore the states \(\varnothing ,\{b\},\{c\},\{b,c\}\) have in-degree zero.

Fig. 1
figure 1

Graph representation of the dynamical system of \(\mathcal {A}=(S,A)\) with background set \(S=\{a,b,c\}\) and set of reactions \(A = \{ (\varnothing , \varnothing , \{a\}), (\{a\}, \varnothing , \{b,c\}), (\{c\},\varnothing ,\{c\})\}\)

Definition 1

Let \(\mathcal {A}= (S,A)\in \mathcal{R}\mathcal{S}(1,0)\). The influence graph of \(\mathcal {A}\) is the directed graph \(G_{\mathcal {A}} = (V_\mathcal {A}, E_\mathcal {A})\) such that \(V_\mathcal {A}:= S \cup \{\varnothing _G\}\), where \(\varnothing _G \notin S\) is a vertex representing the empty state, and there is a directed edge \((x,y)\in E_\mathcal {A}\) if and only if one of the following holds: (i) \(x,y \in S\) and \(y \in \text{res}_{\mathcal {A}}(\{x\})\); or (ii) \(x\in S\) with \(\text{res}_{\mathcal {A}}(\{x\}) = \varnothing\) and \(y=\varnothing _G\); or (iii) \(x=\varnothing _G\) and \(y\in \text{res}_{\mathcal {A}}(\varnothing )\).

Remark 2

Constructing \(G_{\mathcal {A}}\) requires a time polynomial in the number of entities and reactions. In contrast, computing the graph representation of the dynamical system associated with \(\mathcal {A}\) requires evaluating the result function \(\text{res}_{\mathcal {A}}\) over all possible states, i.e., all the subsets of S, thus requiring exponential time.

Note that Definition 1 is a slight variation of the definition of influence graph given in (Brijder et al. 2011). The difference is that, in this paper, reactions may have an empty set of reactants, thus \(G_\mathcal {A}\) has the extra vertex \(\varnothing _G\).

Fig. 2
figure 2

Influence graph \(G_{\mathcal {A}}\) of the RS \(\mathcal {A}\) from Fig. 1

We denote by \(V_{u}\subseteq V_\mathcal {A}\) the set of vertices that are reachable from u in the influence graph \(G_{\mathcal {A}}\): clearly, \(V_{u}\) can be computed in linear time with a breadth-first search starting from u. In the following sections, we will sometimes treat \(V_{u}\) as a state of the RS given by the union of the entities represented by its vertices; since \(\varnothing _G\) represents the empty set, whenever \(\varnothing _G\in V_{u}\), when interpreting \(V_{u}\) as a subset of S we can simply ignore this vertex.

Remark 3

Additive reaction systems, while conceptually simple, do not only exhibit trivial dynamics. For example, the construction in (Dennunzio et al. 2016, Theorem 4) that proves that sup-reachability is \({{\textbf {NP}}}\)-complete even for additive reaction systems includes a way of iterating over all possible assignments of a Boolean formula and verifying its satisfiability, constructing an additive system whose dynamics can arguably be considered non-trivial.

3 Fixed points of additive reaction systems

In this section, we study the complexity of deciding on the existence of fixed points of different kinds in an additive system \(\mathcal {A}\). To this aim, we make use of the influence graph \(G_{\mathcal {A}}\): recall that any subset of vertices of \(G_{\mathcal {A}}\) represents a single state of the reaction system. Let \(C\subseteq V_\mathcal {A}\) be the set of vertices that are in some cycle of \(G_\mathcal {A}\): since u is in a cycle if and only if it is reachable from itself, we formally define \(C:=\{u\in V_\mathcal {A}\mid u\in V_{u}\}\). We begin noticing the following.

Lemma 1

Let \(\mathcal {A}\in \mathcal{R}\mathcal{S}(1,0)\) and let \(G_\mathcal {A}=(V_\mathcal {A},E_\mathcal {A})\) be the influence graph of \(\mathcal {A}\). For any vertex \(u\in V_\mathcal {A}\), if \(u \in C\) then \(V_{u}\) is a fixed point of \(\mathcal {A}\).

Proof

Let \(u= \varnothing _G\). If \(\varnothing _G \in C\), then it must be \(\text{res}_{\mathcal {A}}(\varnothing ) = \varnothing\), as otherwise, if it was \(\text{res}_{\mathcal {A}}(\varnothing ) = X\ne \varnothing\), X would be produced from any state and \(\varnothing _G\) would have no incoming edges by Definition 1. Thus if \(\varnothing _G\in C\) it must be \(V_{\varnothing _G} = \{\varnothing _G\}\). Let us now suppose \(u \ne \varnothing _G\). We need to show that \(\text{res}_\mathcal {A}(V_{u})=V_{u}\). Consider \(v \in V_{u}\), thus v is reachable from u: let n be the length of a path from u to v. This implies that there is a path of length at most \(n+1\) from u to any vertex \(w\in \text{res}_{\mathcal {A}}(\{v\})\), and thus \(\text{res}_{\mathcal {A}}(\{v\})\subseteq V_{u}\) for all \(v \in V_{u}\). By additivity, we obtain \(\text{res}_{\mathcal {A}}(V_{u}) = \bigcup _{v\in V_{u}}\text{res}_{\mathcal {A}}(\{v\})\subseteq V_{u}\).

To show the other inclusion, let \(v\in V_{u}\), \(v\ne u\). Since there exists a path from u to v, there exists a vertex \(w\in V_{u}\) such that \((w,v)\in E_\mathcal {A}\), and thus \(v \in \text{res}_{\mathcal {A}}(\{w\})\). Therefore \(V_{u}{\setminus } \{u\}\subseteq \text{res}_{\mathcal {A}}(V_{u})\). Since \(u\in C\), there also exists a vertex \(z\in V_{u}\) such that \((z,u)\in E_\mathcal {A}\), thus \(u\in \text{res}_{\mathcal {A}}(V_{u})\). Collecting all together, \(V_{u}\subseteq \text{res}_{\mathcal {A}}(V_{u})\). \(\square\)

In other words, Lemma 1 states that when a vertex u belongs to a cycle, the vertices that are reachable by u give rise to a fixed point in the dynamic of the reaction system.

In particular, since \(\text{res}_{\mathcal {A}}\) is additive, the union of multiple \(V_{u}\)’s that are fixed points is a fixed point. In the next proposition, we show that the converse is also true. To do so, for any fixed point \(T{\ne \varnothing }\) of a RS \(\mathcal {A}\) we define the set \(C_{T}:=T\cap C\). In other words, \(C_{T}\) is the subset of elements of T that are part of some cycle in the influence graph, although they are not necessarily all part of the same cycle. For instance, inspect Fig. 3 and let \(T=\{u_1,u_2,u_3\}\). Then \(C_{T}=\{u_1,u_2,u_3\}\), \(u_1\) is in a distinct cycle from \(u_2\) and \(u_3\) and their union does not induce a cycle in \(G_\mathcal {A}\).

Proposition 2

Given \(\mathcal {A}=(S,A)\in \mathcal{R}\mathcal{S}(1,0)\) and \(\varnothing \subsetneq T\subseteq S\) a fixed point, then

$$\begin{aligned} T = \bigcup _{u \in {C_{T}}} V_{u}. \end{aligned}$$

Proof

Given any \(u \in T\) we have, by monotonicity and by the definition of fixed point, \(\text{res}_{\mathcal {A}}^n(\{u\})\subseteq T\) for all \(n \in \mathbb {N}\). Note that since \(\text{res}_{\mathcal {A}}^n(\{u\})\) corresponds to all the vertices of the influence graph \(G_\mathcal {A}\) that are reachable from u in n steps, we have \(V_{u} \subseteq T\). In particular, we also have

$$\begin{aligned} \bigcup _{u \in {C_{T}}} V_{u} \subseteq T. \end{aligned}$$

Now, suppose for a contradiction that

$$\begin{aligned} W:=\bigcup _{u \in {C_{T}}} V_{u} \subsetneq T. \end{aligned}$$

Let \(x \in T \setminus W\). Since \(x \in T\), there exists \(y \in T\) such that \(x \in \text{res}_{\mathcal {A}}(\{y\})\). If \(y \in W\) then \(y\in V_{u}\) for some \(u \in {C_{T}}\), so y is reachable from u and x too, which implies \(x \in V_{u} \subseteq W\), a contradiction. Then \(y \notin W\). Furthermore, if \(y = x\) then \(x\in C_T\), and so \(x \in W\), a contradiction. Putting all together, for all \(x\in T \setminus W\) there exists an edge \((y,x)\in E_\mathcal {A}\) for some \(y \ne x\) and \(y \in T\setminus W\). It follows that every vertex in the subgraph \(T \setminus W\) has a positive indegree, therefore it must contain a cycle (Farbey 1966, Corollary 3.8c); in turn, this means that there exists a vertex \(z \in T\setminus W\) such that \(z \in V_{z}\), so \(z\in W\), a contradiction. The statement follows. \(\square\)

Given \(\mathcal {A}\in \mathcal{R}\mathcal{S}(1,0)\), let us define

$$F_{\mathcal {A}}:=\begin{array}{ll} \{V_{u} \mid u\in C, u \neq \varnothing_G\} & \text{if } \text{res}_{\mathcal{A}}(\varnothing) \neq \varnothing \\ \{V_{u} \mid u\in C, u \neq \varnothing_G\}\cup \{\varnothing\} & \text{otherwise} \end{array}$$

An example of set \(F_\mathcal {A}\) is in Fig. 3. Proposition 2 and Lemma 1 imply the following theorem.

Theorem 3

Let \(\mathcal {A}= (S,A) \in \mathcal{R}\mathcal{S}(1,0)\) and \(T\subseteq S\), then T is a fixed point of \(\mathcal {A}\) if and only if \(T = \cup _{V_{u} \in W} V_{u}\) for some non-empty subset W of \(F_{\mathcal {A}}\). In particular, \(\mathcal {A}\) has a fixed point if and only if \(F_{\mathcal {A}}\ne \varnothing\).

Since computing sets \(V_{u}\) requires polynomial time, it immediately follows that computing \(F_{\mathcal {A}}\) and thus deciding on the existence of a fixed point is in \({{\textbf {P}}}\). Note that the last statement also follows directly from the Knaster-Tarski Theorem (Granas and Dugundji 2003), since \(\text{res}_{\mathcal {A}}\) is additive (and therefore monotonic) for \(\mathcal {A}\in \mathcal{R}\mathcal{S}(1,0)\).

Fig. 3
figure 3

The influence graph of the RS \(\mathcal {A}\) with background set \(S=\{u_1, u_2, \ldots , u_8\}\) and set of reactions \(A=\{(\{u_1\},\varnothing ,\{u_1,u_2\})\), \((\{u_2\},\varnothing ,\{u_3\})\), \((\{u_3\},\varnothing ,\{u_2\})\),\((\{u_4\},\varnothing ,\{u_3\})\),\((\{u_5\},\varnothing ,\{u_6,u_7\})\),\((\{u_6\},\varnothing ,\{u_7\})\),\((\{u_7\},\varnothing ,\{u_8\})\),\((\{u_8\},\varnothing ,\{u_5\})\}\). In this case \(F_{\mathcal {A}}=\{V_{u_1},V_{u_2},V_{u_5},\varnothing _G\}\); note that \(V_{u_2}=V_{u_3}\) and \(V_{u_5}=V_{u_6}=V_{u_7}=V_{u_8}\); \(u_4\notin V_{u_4}\) thus \(V_{u_4}\notin F_\mathcal {A}\)

Remark 4

If \(V_{u} \in F_{\mathcal {A}}\) then \(V_{u}\) cannot be obtained as a union of other elements of \(F_{\mathcal {A}}\). Indeed, suppose for a contradiction that \(V_{u} = \bigcup _{i = 1}^{n} V_{u_i}\) with \(V_{u_i}\in F_\mathcal {A}\), \(V_{u_i}\ne V_{u}\) for all \(i=1,\ldots , n\). If \(u \in V_{u_i}\subseteq V_{u}\) for some i, then there exists a path from \(u_i\) to u, implying that for every \(v \in V_{u}\) there exists a path from \(u_i\) to v, i.e., \(v \in V_{u_i}\), therefore \(V_{u_i} = V_{u}\), a contradiction. Thus \(u \in V_{u}\) (because \(u\in C\)) but \(u \notin \cup _{i = 1}^{n} V_{u_i}\), hence the thesis.

Corollary 4

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, it is in \({{\textbf {P}}}\) to decide whether \(\mathcal {A}\) and \(\mathcal {B}\) share all fixed points.

Proof

It suffices to construct the influence graphs \(G_{\mathcal {A}}\) and \(G_{\mathcal {B}}\) in polynomial time and to compute \(F_{\mathcal {A}}\) and \(F_{\mathcal {B}}\) with a breadth-first visit of the graphs. To decide if \(\mathcal {A}\) and \(\mathcal {B}\) share all the fixed points it is then enough to check whether \(F_{\mathcal {A}}= F_{\mathcal {B}}\), as by Theorem 3 they generate all fixed points of \(\mathcal {A}\) and \(\mathcal {B}\), respectively. \(\square\)

By Theorem 3, deciding on the existence of a common fixed point for \(\mathcal {A}\) and \(\mathcal {B}\) reduces to the problem of deciding whether there exists a nonempty subset of elements of \(F_{\mathcal {A}}\) and a nonempty subset of elements of \(F_{\mathcal {B}}\) such that their respective unions give the same set of entities. Formally, we introduce the following problem, that we coin Maximum Common Subset Union (MCSU):

Input::

a finite set H and two collections of subsets of H: \(\{A_i\}_{i\in I}\) and \(\{B_j\}_{j \in J}\)

Output::

subsets of indices \(I'\subseteq I\) and \(J'\subseteq J\) such that \(\bigcup _{i \in I'} A_i=\bigcup _{j \in J'} B_j\subseteq H\) is of maximum size

MCSU can be solved in polynomial time using the simple Algorithm 1, in which we denote \(A^{I'}: = \bigcup _{i \in I'} A_i\). In the beginning, Algorithm 1 computes the union of all the subsets in the respective collections and takes the intersection of the two unions. Clearly, any subset \(A_i\) containing an element which is not in this intersection cannot be part of a solution, and likewise for subsets \(B_j\): this condition is checked at lines 5 and 7, where subsets containing elements outside the intersection are removed from the respective collections.

This process is then iterated by taking the union of the survived subsets in each collection and again the intersection of these unions (line 8). The algorithm terminates when there are no longer elements outside the intersection of the unions, i.e., the two unions are the same (line 3). Theorem 5 proves the correctness of this procedure.

figure a

Theorem 5

Algorithm 1 is correct.

Proof

Keeping track of the set of indices at each iteration, we obtain two sequences

$$\begin{aligned} I&= I_1 \supseteq I_2 \supseteq I_3 \supseteq \cdots \supseteq I_n \\ J&= J_1 \supseteq J_2 \supseteq J_3 \supseteq \cdots \supseteq J_n \end{aligned}$$

with n the number of iterations made by the algorithm. We remark that at each iteration \(\bar{A}\cup \bar{B} = A^{I'}\triangle B^{J'}\), therefore the algorithm stops at iteration n if and only if \(A^{I_n}\triangle B^{J_n} = \varnothing\), i.e., \(A^{I_n} = B^{J_n}\). Since at each iteration either \(|I_n|\) or \(|J_n|\) decreases, the sequences will eventually stop when \(I_n=J_n=\varnothing\). To prove correctness, we first verify that if the algorithm stops when \(I'=J'=\varnothing\) then there does not exist a nonempty solution to MCSU. Suppose for a contradiction that \(I_n=J_n=\varnothing\), and yet there exist \(I\supseteq {\widetilde{I}}\ne \varnothing\) and \(J\supseteq {\widetilde{J}}\ne \varnothing\) such that \(A^{{\widetilde{I}}} = B^{{\widetilde{J}}}\). Let then k be the last iteration such that \(I_k \supseteq {\widetilde{I}}\) and h the last iteration such that \(J_h \supseteq {\widetilde{J}}\).

Without loss of generality, suppose \(k\le h\). We note that going from \(I_{k}\) to \(I_{k+1}\) we lose at least an index that was in \({\widetilde{I}}\), i.e. \(I_k \supseteq {\widetilde{I}}\nsupseteq I_{k+1}\), otherwise k would not be the last iteration such that \(I_{k}\supseteq {\widetilde{I}}\). So there exists \(i \in {\widetilde{I}}\subseteq I_k\) such that \(i \notin I_{k+1}\) and thus, by line 5, there exists \(x \in A_i \subseteq A^{{\widetilde{I}}}\) that is not in the current intersection, thus, in particular, \(x\notin B^{J_k}\). Thus \(x \notin B^{J_h}\), since \(k \le h \Rightarrow J_k\supseteq J_h\). On the other hand, \(J_h\supseteq {\widetilde{J}}\) then \(B^{J_h}\supseteq B^{{\widetilde{J}}}=A^{{\widetilde{I}}}\) so \(x \in A^{{\widetilde{I}}} \subseteq B^{J_h}\), which is a contradiction.

Similarly, we can prove that the size of the unions of the two output collections is maximum. Suppose there exists \({\widetilde{I}}\subseteq I\) and \({\widetilde{J}}\subseteq J\) such that \(A^{\widetilde{I}} = B^{\widetilde{J}}\) and \(|B^{\widetilde{J}} |=|A^{\widetilde{I}}|> |B^{J_n}|=|A^{I_n}|\). As above, let k the maximum such that \(I_k \supseteq {\widetilde{I}}\) and h the maximum such that \(J_h \supseteq {\widetilde{J}}\). If \(k=n\), then \(I_n\subseteq {\widetilde{I}}\), thus \(A^{{\widetilde{I}}} \subseteq A^{I_n}\), a contradiction since \(|A^{{\widetilde{I}}}|> |A^{I_n}|\). In a similar manner, if \(h = n\) we get a contradiction. Therefore \(k<n\) and \(h < n\), and we can conclude as in the first part of this proof. \(\square\)

A naive implementation of Algorithm 1 applied to S, \(F_\mathcal {A}\) and \(F_\mathcal {B}\) requires time \(O(|S |^3)\), as \(F_\mathcal {A}\) and \(F_\mathcal {B}\) each consist of at most \(|S |\) subsets, each containing at most \(|S |\) entities, and the algorithm performs at most \(|I|+ |J|\le 2|S|\) iterations. This implies the following result.

Corollary 6

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, it is in \({{\textbf {P}}}\) to decide whether \(\mathcal {A}\) and \(\mathcal {B}\) have a common fixed point.

4 Fixed points attractors and not attractors

In this section, we focus on the problem of deciding on the existence of (common) fixed points that are either attractors or not attractors. We start by giving a characterization of the fixed points attractors of an additive function from the power set of a finite set into itself.

Lemma 7

Let \(f:2^H\rightarrow 2^H\) be an additive function, H a finite set, and T a fixed point for f. If T is an attractor then there exists \(T'\subseteq H\) such that either \(T'\subseteq T\) or \(T'\supseteq T\) and \(f(T')=T\).

Proof

Let \(T''\subseteq {H}\) such that \(f(T'')=T\). If \(T''\subseteq T\), we have the statement, so consider \(T''\nsubseteq T\). Define \(T':=T \cup T''\supsetneq T\) and by additivity of f we get \(f(T') = f(T'') \cup f(T) = T\). \(\square\)

Definition 2

If a fixed point T is reachable from a state \(T' \subsetneq T\) (resp. from \(T' \supsetneq T\)), we say that T is reachable from below (resp. reachable from above).

The following lemma applies the characterization of Lemma 7 to additive reaction systems in each of the two possible cases.

Lemma 8

Let T be a fixed point for \(\text{res}_{\mathcal {A}}\), where \(\mathcal {A}= (A,S) \in \mathcal{R}\mathcal{S}(1,0)\). If T is reachable from below (resp. from above) then there exists \(x \in T\) (resp. \(x\notin T\)) such that T is reachable from \(T\setminus \{x\}\) (resp. from \(T \cup \{x\}\)).

Proof

If there exists \(T'\subsetneq T\) such that \(\text{res}_{\mathcal {A}}(T') = T\), then for all \(x \in T\setminus T'\)

$$\begin{aligned} T = \text{res}_{\mathcal {A}}(T') \subseteq \text{res}_{\mathcal {A}}(T \setminus \{x\}) \subseteq \text{res}_{\mathcal {A}}(T) = T, \end{aligned}$$

i.e., T is reachable from \(T\setminus \{x\}\). The proof for when T is reachable from above can be obtained entirely analogously. \(\square\)

Corollary 9

Given \(\mathcal {A}\in \mathcal{R}\mathcal{S}(1,0)\), it is in \({{\textbf {P}}}\) to decide whether a given state T is a fixed point attractor.

Proof

Deciding whether a given state T is a fixed point requires polynomial time (see Ascone et al. (2024)). By Lemmas 7 and 8 it then just suffices to check if the states \(T\setminus \{x\}\) for any \(x\in T\) or \(T\cup \{y\}\) for any \(y\notin T\) are attracted by T. \(\square\)

Lemma 10

Given a fixed point T of an additive function \(f: 2^H \rightarrow 2^H\), for all \(X\subseteq T\) we have that \(T{\setminus } f(X) \subseteq f(T{\setminus } X)\).

Proof

Since \(T = f(T) = f(X \cup {(T{\setminus } X)}) = f(X) \cup f(T{\setminus } X)\) we have the thesis. \(\square\)

The following lemma provides a sufficient condition for the union of two fixed points to be an attractor: an example is given in Fig. 4.

Lemma 11

Let \(f:2^H\rightarrow 2^H\) be an additive function, H a finite set, and \(T_1\ne T_2\) two fixed points for f. If there exists \(x \in T_1\), \(x \notin T_2\) such that

$$\begin{aligned} f(T_2 \cup \{x\}) = T_2 \end{aligned}$$

then \(T_1 \cup T_2\) is a fixed point attractor reachable from below.

Proof

Consider \(T_2 \cup (T_1\setminus \{x\})\subsetneq T_1 \cup T_2\). Using Lemma 10 and the additivity of f, we obtain

$$\begin{aligned} T_1 \cup T_2 = f(T_1 \cup T_2)&\supseteq f(T_2 \cup (T_1\setminus \{x\})) \\&= T_2 \cup f(T_1\setminus \{x\}) \\&\supseteq T_2 \cup (T_1\setminus \underbrace{f(\{x\})}_{\subseteq T_2})= T_1 \cup T_2\,. \end{aligned}$$

We conclude that \(T_1 \cup T_2\) is reachable from \({(}T_2 \cup T_1{)}{\setminus }\{x\}\). \(\square\)

Fig. 4
figure 4

Example for Lemma 11 with \(T_1=\{e,f\}\), \(T_2=\{a,b,c,d\}\) and \(x = e\). In this case, we can also switch the role of \(T_1\), \(T_2\) and choose \(x = d\) since \(T_1 \cup \{d\}\) reaches \(T_1\). Note that \(T_1\) corresponds to \(V_{f} = \{e,f,\varnothing _G\}\) and \(T_2\) corresponds to \(V_{a}=\{a,b,c,d,\varnothing _G\}\)

The next proposition gives another sufficient condition for a fixed point to be an attractor.

Proposition 12

Let \(f:2^H\rightarrow 2^H\) be an additive function, H a finite set, and \(T'\) a fixed point. If there exists a fixed point attractor \(T\subseteq T'\) then \(T'\) is also an attractor.

Proof

We consider two cases.

Case (i). T is reachable from below, i.e., there exists \(x \in T\) such that \(f(T\setminus \{x\}) = T\). Then we can write

$$\begin{aligned} T'\setminus \{x\} = T'\setminus \{x\} \cup T\setminus \{x\} \end{aligned}$$

and then, using the additivity of f and Lemma 10,

$$\begin{aligned} T' \supseteq f(T'\setminus \{x\}) = f(T'\setminus \{x\}) \cup T \supseteq (T' \setminus \underbrace{f(\{x\})}_{\subseteq T}) \cup T = T', \end{aligned}$$

therefore \(f(T'\setminus \{x\}) = T'\).

Case (ii). T is reachable from above, i.e., there exists \(x \notin T\) such that \(f(T\cup \{x\}) = T\). If \(x \in T'\) then \(T' \cup T = T'\) is an attractor by Lemma 11. If instead \(x \notin T'\), then \(f(\{x\})\subseteq T \subseteq T'\) and we obtain

$$\begin{aligned} f(T'\cup \{x\}) = T' \cup f(\{x\}) = T', \end{aligned}$$

i.e., \(T'\) is reachable from \(T'\cup \{x\}\). \(\square\)

Inspect Fig. 3 for an example: \(V_{u_2}\) is an attractor from above, as well as \(V_{u_1}\supset V_{u_2}\), since it contains a fixed point attractor (Proposition 12); \(V_{u_5}\) is an attractor from below; and \(\varnothing\) is the only fixed point which is not an attractor. The next lemma provides a simple sufficient condition for all fixed points to be attractors.

Lemma 13

Let H be a finite set and \(f:2^H\rightarrow 2^H\) an additive function. If \(\varnothing\) is not a fixed point, then every fixed point is an attractor.

Proof

Let T be a fixed point. By monotonicity, \(f^n(\varnothing ) \subseteq T\) for all \(n\in \mathbb {N}\). If \(T = f^{k}(\varnothing )\) for some k (\(k\ge 1\) by hypothesis), then T is reachable from \(f^{k-1}(\varnothing )\). Otherwise, if \(f^n(\varnothing ) \subsetneq T\) for all \(n\in \mathbb {N}\), let \(m\in \mathbb {N}\) be the minimum index for which the following sequence stabilizes:

$$\begin{aligned} \varnothing \subsetneq f(\varnothing ) \subsetneq \dots \subsetneq f^{m-1}(\varnothing ) \subsetneq f^m(\varnothing ) = f^{m+1}(\varnothing ). \end{aligned}$$

Let \(T':=T{\setminus } f^m(\varnothing ) \cup f^{m-1}(\varnothing )\subsetneq T\), then \(f(T')\subseteq T\) and by additivity and Lemma 10 we obtain

$$\begin{aligned} f(T') = f(T\setminus f^m(\varnothing )) \cup f^{m}(\varnothing ) \supseteq T\setminus f^{m+1}(\varnothing ) \cup f^{m}(\varnothing ) = T. \end{aligned}$$

Therefore T is reachable from \(T'\). \(\square\)

Given any \(\mathcal {A}=(S,A)\in \mathcal{R}\mathcal{S}(1,0)\), we can draw the following observations on the existence of a fixed point \(T\subseteq S\) which is not an attractor. First, a direct implication of Proposition 12 is that T cannot contain any fixed point attractor and in particular, in the decomposition \(T=\bigcup _{u\in {C_{T}}}V_{u}\) given by Proposition 2 each \(V_{u}\) must be not an attractor; moreover, by Lemma 13, \(\varnothing\) must be a fixed point and, by Proposition 12, it must not be an attractor as well.

If we now define \(F_{\mathcal {A}}^{\text{NA}}:= \{V_{u} \in F_{\mathcal {A}} \mid V_{u}\text { not attractor}\}\), we have obtained a way to decide in polynomial time on the existence of fixed points that are not attractors, summarized by the following result.

Corollary 14

Given \(\mathcal {A}=(S,A)\in \mathcal{R}\mathcal{S}(1,0)\), it is in \({{\textbf {P}}}\) to decide if there exists a fixed point which is not an attractor.

Proof

We just need to check whether \(F_{\mathcal {A}}^{\text{NA}} \ne \varnothing\). \(\square\)

The next result provides a sufficient condition to rule out the existence of fixed points which are not attractors.

Proposition 15

Let H be a finite set and \(f:2^H\rightarrow 2^H\) an additive, non-injective function. If H is a fixed point for f, then it is also an attractor.

Proof

Since f is not injective, there exist \(X_1, X_2 \subseteq H\) such that \(f(X_1) = f(X_2)\) and \(X_1\ne X_2\). We can suppose \(X_2\ne \varnothing\). Let \(H' :=H{\setminus } (X_1 \cup X_2)\), then \(H' \cup X_1 = H {\setminus } X_2 \subsetneq H\). Furthermore, by Lemma 10 we have that \(f(H' \cup X_1) = f(T {\setminus } X_2) \supseteq H{\setminus } f(X_2)\), and \(f(X_1) \subseteq f(H' \cup X_1)\) since \(X_1 \subseteq H' \cup X_1\). Collecting all together, we obtain

$$\begin{aligned} f(H' \cup X_1) \supseteq H\setminus f(X_2) \cup f(X_1) = H\setminus f(X_2) \cup f(X_2) = H, \end{aligned}$$

thus \(f(H'\cup X_1) = H\), i.e., H is reachable from \(H' \cup X_1 = H {\setminus } X_2\). \(\square\)

Proposition 16

Given H a finite set and \(f: 2^H \rightarrow 2^H\) additive and bijective, then \(|f(\{x\})|= 1\) for all \(x \in H\).

Proof

Suppose for a contradiction that there exists \(x\in H\) such that \(k :=|f(\{x\})|> 1\). Given any subset \(T\supsetneq \{x\}\), since f is injective then \(f(\{x\})\subsetneq f(T)\subseteq H\). Therefore we obtain a bijection between the subsets of H containing \(\{x\}\) and the ones containing \(f(\{x\})\). This is a contradiction because there are \(2^{|H|-1}\) subsets of the first type and only \(2^{|H|-k}<2^{|H|-1}\) of the second type. \(\square\)

We remark that given an additive function \(f:2^H\rightarrow 2^H\) and \(T\subseteq H\) a fixed point for f, if the restriction of f to T \(f|_{T}: 2^T \rightarrow 2^T\) is not injective then T is an attractor by Proposition 15. Therefore, given any additive reaction system \(\mathcal {A}\), for every \(V_{u}\in F_{\mathcal {A}}^{\text{NA}}\), \(V_{u}\ne \varnothing\), the restriction \(\text{res}_{\mathcal {A}}|_{V_{u}}\) must be injective, which means that \(|\text{res}_{\mathcal {A}}(\{x\})|= 1\) for all \(x\in V_{u}\) by Proposition 16. Since \(V_{u}\) is weakly connected by definition, we obtain the following.

Lemma 17

Given any \(V_{u}\in F_{\mathcal {A}}^{\text{NA}}\), the vertices of \(V_{u}\) form a cycle in \(G_{\mathcal {A}}\). Furthermore, for any \(V_{u_1}, V_{u_2}\in F_{\mathcal {A}}^{\text{NA}}\), it holds \(V_{u_1} \cap V_{u_2} = \varnothing\).

We further remark that, although the single elements of \(F_{\mathcal {A}}^{\text{NA}}\) are not attractors by definition, unions of its elements might be. To find out which unions of elements of \(F_{\mathcal {A}}^{\text{NA}}\) are fixed points attractors it suffices to check, for each entity \(x \notin \bigcup _{V_{u}\in F_{\mathcal {A}}^{\text{NA}}} V_{u}\), whether

$$\begin{aligned} \text{res}_{\mathcal {A}}(\{x\}) \subseteq \bigcup _{V_{u}\in F_{\mathcal {A}}^{\text{NA}}} V_{u}, \end{aligned}$$

and if so, consider the smallest subset \(W\subseteq F_{\mathcal {A}}^{\text{NA}}\) such that \(\text{res}_{\mathcal {A}} (\{x\}) \subseteq \bigcup _{V_{u}\in W} V_{u}\). Since the elements of \(F_{\mathcal {A}}^{\text{NA}}\) are disjoint by Lemma 17, W simply consists of the \(V_{u} \in F_{\mathcal {A}}^{\text{NA}}\) that can be reached with an edge outgoing from x and can thus clearly be computed in polynomial time.

Then \(V^x:=\bigcup _{V_{u}\in W} V_{u}\) is a fixed point attractor reachable from \(V^x \cup \{x\}\). It follows that deciding whether two reaction systems share all fixed points that are not attractors requires polynomial time, as stated by the following corollary.

Fig. 5
figure 5

Example of union of elements in \(F_{\mathcal {A}}^{\text{NA}}=\{V_{u_2}, V_{u_5}, \varnothing \}\) that gives a fixed point attractor \(V^{u_1}=V_{u_2}\cup V_{u_5}=\{u_2, u_3, u_4, u_5, u_6\}\) reachable from \(\{u_1\}\cup V^{u_1}\)

Corollary 18

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, it is in \({{\textbf {P}}}\) to decide whether \(\mathcal {A}\) and \(\mathcal {B}\) share all fixed points which are not attractors.

Proof

It suffices to check whether \(F_{\mathcal {A}}^{\text{NA}} = F_{\mathcal {B}}^{\text{NA}}\) and whether the fixed points attractors given by unions of elements of \(F_{\mathcal {A}}^{\text{NA}}\) (resp. of \(F_{\mathcal {B}}^{\text{NA}}\)) are the same. \(\square\)

We next consider the problem of deciding whether two additive reaction systems have a common fixed point which is not an attractor.

Proposition 19

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, it is in \({{\textbf {P}}}\) to decide whether \(\mathcal {A}\) and \(\mathcal {B}\) have a common fixed point which is not an attractor.

Proof

The first step of a polynomial-time procedure to solve the problem is to verify the following necessary condition: there exist a nonempty set of fixed points that are not attractors of \(\mathcal {A}\) and a set of fixed points that are not attractors of \(\mathcal {B}\) such that the respective union gives the same set of entities. This condition gives rise to an instance of the MCSU problem and can thus be verified in polynomial time using Algorithm 1 with input S, \(F^{\text{NA}}_{\mathcal {A}}\) and \(F^{\text{NA}}_{\mathcal {B}}\). Then, either the output is the empty set (in which case the two reaction systems do not have any common fixed points which are not attractors) or we obtain two subsets \(\{V_{i}^{\mathcal {A}}\}_{i \in I} \subseteq F^{\text{NA}}_{\mathcal {A}}\) and \(\{V_{j}^{\mathcal {B}}\}_{j \in J} \subseteq F^{\text{NA}}_{\mathcal {B}}\) such that

$$\begin{aligned} V:=\bigcup _{i \in I} V_{i}^{\mathcal {A}} = \bigcup _{j \in J} V_{j}^{\mathcal {B}} \end{aligned}$$

and V is the maximal common state given by the union of fixed points that are not attractors.

The next step is to check whether V contains a common fixed point which is not an attractor. Any common fixed point that is potentially not an attractor is given by a subset of the elements of \(\{V_{i}^{\mathcal {A}}\}_{i \in I}\) whose union is the same as the union of a subset of the elements of \(\{V_{j}^{\mathcal {B}}\}_{j \in J}\). Computing these sets naively would require time exponential in the number of elements in \(\{V_{i}^{\mathcal {A}}\}_{i \in I}\) and \(\{V_{j}^{\mathcal {B}}\}_{j \in J}\); however, we can compute them in polynomial time by making use of an auxiliary graph constructed as follows (recall that the elements of \(\{V_{i}^{\mathcal {A}}\}_{i \in I}\) and \(\{V_{j}^{\mathcal {B}}\}_{j \in J}\) are disjoint cycles by Lemma 17).

Let us denote by \(u_{\mathcal {A}}\) and \(u_{\mathcal {B}}\) the vertices corresponding to entity u in \(G_\mathcal {A}\) and in \(G_\mathcal {B}\), respectively; and let \(V^\mathcal {A}:=\{u_\mathcal {A}\mid u\in \bigcup _{i \in I} V_{i}^{\mathcal {A}}\}\) and \(V^\mathcal {B}:=\{u_\mathcal {B}\mid u\in \bigcup _{j \in J} V_{j}^{\mathcal {B}}\}\). We construct an auxiliary undirected graph \(G_C=(V^{\mathcal {A}} \cup V^{\mathcal {B}},E)\) whose vertices are connected as follows: for each element \(u \in V\) there is an edge connecting the corresponding element in \(u_{\mathcal {A}} \in V^{\mathcal {A}}\) and \(u_{\mathcal {B}} \in V^{\mathcal {B}}\). Furthermore, connect the elements of \(V^{\mathcal {A}}\) (resp. \(V^{\mathcal {B}}\)) replacing the directed edges of the cycles in \(\{V_{i}^{\mathcal {A}}\}_{i \in I}\) (resp. in \(\{V_{j}^{\mathcal {B}}\}_{j \in J}\)) with undirected edges. An example is in Fig. 6.

Fig. 6
figure 6

The graph \(G_c\) in the construction of the proof of Proposition 19. The solid edges are those corresponding to the edges in the cycles of \(\{V_{i}^{\mathcal {A}}\}_{i \in I}\) and \(\{V_{j}^{\mathcal {B}}\}_{j \in J}\); the dashed edges connect the pairs of corresponding entities

Consider then the connected components of \(G_C\). We observe that any union of cycles \(T'_\mathcal {A}\) of the \(\mathcal {A}\)-side of \(G_C\) which is in a bijection with a union of cycles of the \(\mathcal {B}\)-side \(T'_\mathcal {B}\) is such that \(T'_{\mathcal {A}} \cup T'_{\mathcal {B}}\) is a union of connected components of \(G_C\); and conversely, by construction, given any connected component T, there is a bijection between the vertices in the \(\mathcal {A}\)-side of T and those in its \(\mathcal {B}\)-side, and both the \(\mathcal {A}\)-side \(T_{\mathcal {A}}\) and the \(\mathcal {B}\)-side \(T_{\mathcal {B}}\) of T are unions of cycles.

It follows that the connected components of \(G_C\) correspond to minimal subsets of elements of \(\{V_{i}^{\mathcal {A}}\}_{i \in I}\) and \(\{V_{j}^{\mathcal {B}}\}_{j \in J}\) whose unions are in a bijection; and thus to determine whether there is a common fixed point which is not an attractor it suffices first to compute the connected components of \(G_C\), which can be done in linear time; and then to check whether there exists a connected component \(T_{\mathcal {A}} \cup T_{\mathcal {B}}\) of \(G_C\) such that \(T_{\mathcal {A}}\) (resp. \(T_{\mathcal {B}}\)) does not contain any fixed point attractor of the form \(V^x\).\(\square\)

Proposition 20

Given \(\mathcal {A}=(S,A)\in \mathcal{R}\mathcal{S}(1,0)\) and T a fixed point attractor then either (i) there exists \(V_{u}\subseteq T\) attractor or (ii) there exists \(x \notin \bigcup _{V_{u}\in F_{\mathcal {A}}^{\text{NA}}} V_{u}\) such that \(V^x \subseteq T\).

Proof

Consider the decomposition \(T = \bigcup _{u \in {C_{T}}} V_{u}\) of T given by Proposition 2. By Proposition 12, if any of the \(V_{u}\)’s in this decomposition is an attractor, then we are in case (i) of the statement. Suppose then that for all \(u \in {C_{T}}\), it holds \(V_{u}\in F^{\text{NA}}_{\mathcal {A}}\). Then T cannot be reached from below since for every \(x \in T\), there exists exactly one \(V_{\tilde{u}}\) such that \(x\in V_{\tilde{u}}\), as the \(V_{u}\)’s are disjoint by Lemma 17, and thus, since \(V_{\tilde{u}}\) is not an attractor, implying that \(\text{res}_{\mathcal {A}}(V_{\tilde{u}} {\setminus } \{x\}) \subsetneq V_{\tilde{u}}\), it holds

$$\begin{aligned} \text{res}_{\mathcal {A}}(T \setminus \{x\}) = \bigcup _{u \in {C_{T}}} \text{res}_{\mathcal {A}}(V_{u} \setminus \{x\}) \subsetneq \bigcup _{u \in {C_{T}}} V_{u} = T. \end{aligned}$$

By Lemma 7 it follows that T must be reachable from above. Let thus \(x\notin T\) be such that \(\text{res}_{\mathcal {A}}(\{x\}) \subseteq T\). We need to show that we are in case (ii), i.e., \(x \notin \bigcup _{V_{u}\in F_{\mathcal {A}}^{\text{NA}}} V_{u}\) and \(V^x \subseteq T\). To prove that \(x \notin \bigcup _{V_{u}\in F_{\mathcal {A}}^{\text{NA}}} V_{u}\), suppose for a contradiction that there exists a \(V_{\tilde{u}} \in F_{\mathcal {A}}^{NA}\) such that \(x \in V_{\tilde{u}}\), and thus \(\text{res}_{\mathcal {A}}(\{x\}) \subseteq V_{\tilde{u}}\). There are two possible cases. If \(V_{\tilde{u}}\subseteq T\) then \(x\in T\), which is a contradiction. Otherwise, if \(V_{\tilde{u}}\nsubseteq T\), it must be \(V_{\tilde{u}}\cap T = \varnothing\), because by Lemma 17 the elements of \(F_{\mathcal {A}}^{\text{NA}}\) are disjoint; it thus follows that \(\text{res}_{\mathcal {A}}(\{\tilde{x}\}) \cap T = \varnothing\), which is again a contradiction. Thus \(x \notin \bigcup _{V_{u}\in F_{\mathcal {A}}^{\text{NA}}} V_{u}\) and \(\text{res}_{\mathcal {A}}(\{\tilde{x}\}) \subseteq \bigcup _{u \in {C_{T}}} V_{u} \subseteq \bigcup _{V\in F_{\mathcal {A}}^{\text{NA}}} V\); by the minimality of \(V^x\), we finally obtain \(V^{\tilde{x}} \subseteq \bigcup _{u \in {C_{T}}} V_{u} = T\). \(\square\)

Given any additive reaction system \(\mathcal {A}\), let \(F_{\mathcal {A}}^{\text{A}}:=\{V_{u} \in F_{\mathcal {A}}\mid V_{u} \text { attractor}\} \cup \{V^x\mid x \notin \cup _{V\in F_{\mathcal {A}}^{\text{NA}}} V\}.\) By Proposition 20, any fixed point attractor of \(\mathcal {A}\) contains at least an element from \(F_{\mathcal {A}}^{\text{A}}\). Since the latter can be computed in polynomial time, we obtain the following corollaries.

Corollary 21

Given \(\mathcal {A}\in \mathcal{R}\mathcal{S}(1,0)\), it is in \({{\textbf {P}}}\) to decide if there exists a fixed point which is not an attractor.

Proof

We just need to check whether \(F_{\mathcal {A}}^{\text{A}} \ne \varnothing\). \(\square\)

Corollary 22

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, it is in \({{\textbf {P}}}\) to decide whether \(\mathcal {A}\) and \(\mathcal {B}\) have a common fixed point attractor.

Proof

For every pair \(V \in F_{\mathcal {A}}^{\text{A}}\) and \(W \in F_{\mathcal {B}}^{\text{A}}\) we can check in polynomial time, using Algorithm 1, if there exists a common fixed point attractor containing V and W. \(\square\)

Corollary 23

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, it is in \({{\textbf {P}}}\) to decide whether \(\mathcal {A}\) and \(\mathcal {B}\) share all fixed points attractors.

Proof

For all fixed points attractors to be shared, it must hold \(F_{\mathcal {A}}^{\text{A}} = F_{\mathcal {B}}^{\text{A}}\); and furthermore, since adding any fixed point (be it attractor or not) to a fixed point attractor results in a fixed point attractor, it must also hold \(F_{\mathcal {A}}^{\text{NA}} = F_{\mathcal {B}}^{\text{NA}}\). Both these conditions can be checked in polynomial time. \(\square\)

From the proof of Corollary 23 and Corollario 4, we finally obtain the following result.

Corollary 24

Given \(\mathcal {A}, \mathcal {B}\in \mathcal{R}\mathcal{S}(1,0)\) with a common background set S, if they share all fixed point attractors then they share all fixed points.

5 Conclusions

We have considered all the problems related to fixed points and attractors that were studied by Formenti et al. (2014) and Ascone et al. (2024) for unconstrained, reactantless and inhibitorless reaction systems, and we have fully determined their computational complexity in the context of additive reaction systems. In doing so, we have provided several reductions from these problems to problems on a polynomially computable graph representation of reaction systems that might be useful in the future for investigating other problems related to reaction systems.

With this work, the picture of the computational complexity of fixed-points and attractors problems in the classes \(\mathcal{R}\mathcal{S}(\infty ,0), \mathcal{R}\mathcal{S}(0,\infty )\) and \(\mathcal{R}\mathcal{S}(1,0)\) is almost complete: only the complexity of deciding on the existence of a fixed point attractor in inhibitorless reaction systems is still to be unveiled. Other open problems include studying fixed-points and attractors problems in other constrained classes of reaction systems (e.g., in \(\mathcal{R}\mathcal{S}(2,0)\)) and studying other objects related to the dynamics of resource-bounded reaction systems like cycles and global attractors.