1 Introduction

A Boolean network (BN) with n components is a discrete dynamical system described by the successive iterations of a function

$$ f:\{{ \texttt {0}},{ \texttt {1}}\}^n\rightarrow \{{ \texttt {0}},{ \texttt {1}}\}^n,\qquad x=(x_1,\dots ,x_n)\mapsto f(x)=(f_1(x),\dots ,f_n(x)). $$

The structure of the network is often described by a signed digraph G, called signed interaction digraph (SID) of f, catching effective positive and negative dependencies among components: the vertex set is \([n]:=\{1,\dots ,n\}\) and, for all \(i,j\in [n]\), there is a positive (resp. negative) arc from i to j if \(f_j(x)-f_j(y)\) is positive (resp. negative) for some \(x,y\in \{{ \texttt {0}},{ \texttt {1}}\}^n\) that only differ in \(x_i>y_i\). The SID provides a very rough information about f. Hence, given a SID G, the set F(G) of BNs f whose SID is G, is generally huge.

BNs have many applications. In particular, since the seminal papers of Kauffman [14, 15] and Thomas [30, 31], they are very classical models for the dynamics of gene networks. In this context, the first reliable experimental information often concern the SID of the network, while the actual dynamics are very difficult to observe [18, 32]. One is thus faced with the following question: What can be said about the dynamics described by f according to G only?

Among the many dynamical properties that can be studied, fixed points are of special interest, since they correspond to stable patterns of gene expression at the basis of particular cellular phenotypes [3, 31]. As such, they are arguably the property which has been the most thoroughly studied. The number of fixed points and its maximization in particular is the subject of a stream of work, e.g. in [4,5,6,7, 11, 12, 24, 26].

From the complexity point of view, previous works essentially focused on decision problems of the following form: given f and a dynamical property P, what is the complexity of deciding if the dynamics described by f has the property P. For instance, it is well-known that deciding if f has a fixed point is \(\textsf {NP}\)-complete in general (see [17] and the references therein), and in \(\textsf {P}\) for some families of BNs, such as monotone or non-expansive BNs [10, 13]. However, as mentioned above, in practice, f is often unknown while its SID is well approximated. Hence, a much more natural question is: given a SID G and dynamical property P, what is the complexity of deciding if the dynamics described by some \(f\in F(G)\) has the property P. Up to our knowledge, there is, perhaps surprisingly, no work concerning this kind of questions.

In this paper, we study this class of decision problems, focusing on the maximum number of fixed points. More precisely, given a SID G, we denote by \(\phi (G)\) the maximum number of fixed points in a BN \(f\in F(G)\), and we study the complexity of deciding if \(\phi (G)\ge k\).

After the definitions in Sect. 2, we first study the problem when the positive integer k is fixed. We prove in Sect. 3 that, given a SID G, deciding if \( \phi (G)\ge k\) is in \(\textsf {P}\) if \(k=1\). We also prove in Sect. 4 that the same problem is \(\textsf {NP}\)-complete if \(k\ge 2\). Furthermore, these results remain true if the maximum in-degree \(\varDelta (G)\) is bounded by any constant \(d\ge 2\). The case \(k=2\) is of particular interest since many works have been devoted to finding necessary conditions for the existence of multiple fixed points, both in the discrete and continuous settings, see [16, 24, 25, 28] and the references therein. Section 5 considers the case where k is part of the input. We prove that, given a SID G and a positive integer k, deciding if \(\phi (G)\ge k\) is \( \textsf {NEXPTIME}\)-complete, and becomes \(\textsf {NP}^\textsf {\#P}\)-complete if \( \varDelta (G)\) is bounded by a constant \(d\ge 2\). Note that, from these results, we immediately obtain complexity results for the dual decision problem \(\phi (G)<k\). A summary is given in Table 1.

In the case where k is fixed, while proving that the problem \( \phi (G)\ge k\) belongs to \(\textsf {NP}\), we study a decision problem of independent interest, called extension or consistency problem [2, 8, 9]. Here, the property P consists of a partial BN, that is, a function \(h:X\rightarrow \{{ \texttt {0}},{ \texttt {1}}\}^n\) where \(X\subseteq \{{ \texttt {0}},{ \texttt {1}}\}^n\). This partial BN may represent some experimental observations about the dynamics. Given a SID G, we prove that we can check in \(\mathcal {O}(|X|^2n^2)\) time if there is a BN \(f\in F(G)\) which is consistent with h, that is, such that \(f(x)=h(x)\) for all \(x\in X\). Thus, the task consists in extending h to a global BN f under the constraint that the SID of f is G.

Table 1. Complexity results.

2 Definitions and Notations

Let V be a finite set. A Boolean network (BN) with component set V is defined as a function \(f : \{{ \texttt {0}},{ \texttt {1}}\}^V \rightarrow \{{ \texttt {0}},{ \texttt {1}}\}^V\). A configuration \(x\in \{{ \texttt {0}},{ \texttt {1}}\}^V\) assigns a state \(x_i\in \{{ \texttt {0}},{ \texttt {1}}\}\) to each component \(i\in V\). During an application of f, the state of component i evolves according to the local function \(f_i:\{{ \texttt {0}},{ \texttt {1}}\}^V \rightarrow \{{ \texttt {0}},{ \texttt {1}}\}\), which is the coordinate i of f, i.e. \(f_i(x)=f(x)_i\) for all \(x\in \{{ \texttt {0}},{ \texttt {1}}\}^V\). When \(V=[n]\), we write \(x=(x_1,\dots ,x_n)\) and \(f(x)=(f_1(x),\dots ,f_n(x))\).

Given a configuration \(x \in \{{ \texttt {0}},{ \texttt {1}}\}^V\) and \(I\subseteq V\), we denote by \(x_I\) the configuration \(y\in \{{ \texttt {0}},{ \texttt {1}}\}^I\) such that \(y_i=x_i\) for all \(i\in I\). Given \(i\in V\), we denote the i-base vector \(e_i\), that is, \((e_i)_i={ \texttt {1}}\) and \((e_i)_j={ \texttt {0}}\) for all \(j\ne i\). If \(x,y\in \{{ \texttt {0}},{ \texttt {1}}\}^V\) then \(x\,{\oplus }\,y\) is the configuration \(z\in \{{ \texttt {0}},{ \texttt {1}}\}^V\) such that \(z_i=x_i\,{\oplus }\,y_i\) for all \(i\in V\), where the addition is computed modulo two. Hence, \(x\,{\oplus }\,e_i\) is the configuration obtained from x by flipping component i only.

A signed digraph \(G=(V,A,\sigma )\) is a digraph (VA) with an arc-labeling function \(\sigma \) from A to \(\{-1,0,1\}\), that gives a sign (negative, null or positive) to each arc (ij), denoted \(\sigma _{ij}\). We say that G is simple if it has no null sign. Given a vertex i and \(s\in \{-1,0,1\}\), we denote by \(N^s_G(i)\) the set of in-neighbors j of i such that \(\sigma _{ij}=s\), and we drop G in the notations when it is clear from the context. We call \(N^1(i)\) (resp. \(N^{-1}(i)\)) the set of positive (resp. negative) in-neighbors of i. We also simply denote N(i) the set of all in-neighbors of i. In the following, it is very convenient to set \( \tilde{\sigma }_{ij}=0\) if \(\sigma _{ij}\ge 0\) and \(\tilde{\sigma }_{ij} =1\) otherwise.

The signed interaction digraph (SID) of a BN f with component set V is the signed digraph \(G_f=(V,A,\sigma )\) defined as follows. First, given \(i,j \in V\), there is an arc \((i,j) \in A\) if and only if there exists a configuration x such that \(f_j(x\,{\oplus }\,e_i) \ne f_j(x)\) (i.e. the state of component i influences the state of component j). Second, the sign \(\sigma _{ij}\) of an arc \((i,j)\in A\) depends on whether the state of j tends to mimic or negate the state of i, and is defined as

$$ \sigma _{ij}=\left\{ \begin{array}{rl} 1 &{}\quad \text {if } f_j(x\,{\oplus }\,e_i)\ge f_j(x) \text { for all } x\in \{{ \texttt {0}},{ \texttt {1}}\}^n \text { with } x_i={ \texttt {0}},\\ -1 &{}\quad \text {if } f_j(x\,{\oplus }\,e_i)\le f_j(x) \text { for all } x\in \{{ \texttt {0}},{ \texttt {1}}\}^n \text { with } x_i={ \texttt {0}},\\ 0 &{}\quad \text {otherwise.} \end{array}\right. $$

Given \(j\in V\), we say that \(f_j\) is the AND (resp. OR) function if it is the ordinary logical and (resp. or) but inputs with a negative sign are flipped, i.e

$$ f_j(x)=\bigwedge _{i\in N(j)} x_i\,{\oplus }\,\tilde{\sigma }_{ij}\qquad \text {(resp.}~ f_j(x)=\bigvee _{i\in N(j)} x_i\,{\oplus }\,\tilde{\sigma }_{ij}\text {)}. $$

Given a signed digraph G, we know that G is a SID (i.e. there exists a BN f with \(G_f=G\)), if and only if there is no vertex i such that \(|N(i)|\le 2\) and \(|N^0(i)|=1\) [23]. In particular, a simple signed digraph is always a SID.

A fundamental remark regarding the present work is that multiple BNs may have the same SID. Given a SID G with vertex set V, we denote by F(G) the set of BNs admitting G as SID:

$$ F(G)=\{f:\{{ \texttt {0}},{ \texttt {1}}\}^V\rightarrow \{{ \texttt {0}},{ \texttt {1}}\}^V\mid G_f=G\}.$$

The size of F(G) is generally huge. If a component i has in-degree d in G, then the number of possible local functions \(f_i\) is doubly exponential according to d, thus it scales as the number of Boolean functions on d variables, \(2^{2^d}\). Hence, |F(G)| is at least doubly exponential according to its maximum in-degree, denoted \(\varDelta (G)\). The precise value of |F(G)| is not trivial, see A006126 on the OEIS [1].

A fixed point of f is a configuration x such that \(f(x)=x\), which is equivalent to \(f_i(x)=x_i\) for all \(i \in [n]\). We denote by \(\varPhi (f)\) the set of fixed points of f and \(\phi (f)=|\varPhi (f)|\). We are interested in a decision problem related to the maximum number of fixed points of BNs within F(G), denoted

$$ \phi (G)=\max \left\{ \phi (f) \mid f \in F(G)\right\} . $$

More precisely, we will study the complexity of deciding if \( \phi (G)\ge k\), where k is a positive integer, fixed or not. This gives the two following decision problems.

figure a
figure b

Cycles of interactions (in the SID) are known to play a fundamental role in the dynamical complexity of BN (the cycles we consider are always directed and without repeated vertices). Indeed, if \(G_f\) is acyclic then \(\phi (f)=1\) [26]. The sign of a cycle or a path in a signed digraph is the product of the signs of its arcs. It is well-known that if all the cycles of \(G_f\) are positive (resp. negative) then \(\phi (f)\ge 1\) (resp. \(\phi (f)\le 1\)), see [4, 25]. Hence, if all the cycles of a SID G are negative, then \( \phi (G)\le 1\). The previous notions are illustrated in Fig. 1.

Fig. 1.
figure 1

Example of simple signed digraph G with two BNs \(f,g\in F(G)\). BN f has no fixed point, and g has one fixed point (), which is the maximum for BNs in F(G), that is \(\phi (G)=1\). Note that G has two positive cycles and two negative cycles.

3 k-Maximum Fixed Point Problem for \(k = 1\)

A strongly connected component H in a signed digraph G is trivial if it has a unique vertex and no arc, and initial if G has no arc (ij) where j is in H but not i. We first have a lemma to concentrate on simple signed digraphs.

Lemma 1

For any SID G, there is a simple SID \(G'\) such that \(\phi (G) \ge 1 \iff \phi (G') \ge 1\), and \(G'\) is computable from G in constant parallel time.

Proof

From G, the construction of \(G'\) is made component by component, independently, by removing incoming arcs. For \(j \in [n]\),

  • If \(|N^0(j)|\ge 2\) then we delete all incoming arcs of j. If there exists \(f \in F(G)\) and \(y \in \varPhi (f)\), then we can take \(f' \in F(G')\) equal to f, except for \(f'_j(x)=y_j\) (a constant). Conversely, if there exists \(f' \in F(G')\) and \(y \in \varPhi (f')\), then we can take \(f \in F(G)\) equal to \(f'\), except for

    $$ f_j(x) = ( b_j \oplus \bigoplus \limits _{i \in N^0(j)} x_i ) \wedge \bigwedge \limits _{i \in N(j) \setminus N^0(j)} (x_i {\oplus }\tilde{\sigma }_{ij}) $$

    with \(b_j=\bigoplus _{i \in N^0(j)} y_i\), in the case \(y_j={ \texttt {0}}\) (the case \(y_j={ \texttt {1}}\) is symmetric, with OR instead of AND function). We have \(f'_j(y) = f_j(y) = y_j\) hence \(y \in \varPhi (f)\).

  • If \(|N^0(j)| = 1\), then we delete this arc. One can check that, if \(y \in \varPhi (f)\) with \(f \in F(G)\) (resp. \(y\in \varPhi (f')\) with \(f' \in F(G')\)), then there exists \(i \in N(j)\setminus N^0(j)\) such that \(y_i\,{\oplus }\,\tilde{\sigma }_{ij} = y_j\). Consequently, if there exists \(f \in F(G)\) and \(y \in \varPhi (f)\) then we can take \(f' \in F(G')\) equal to f, except that \(f'_j\) is the AND function if \(y_j=0\) and the OR function otherwise. Conversely, suppose there exists \(f' \in F(G')\) and \(y \in \varPhi (f')\), and let \(\{k\} = N^0(j)\). In the case \(y_j = { \texttt {0}}\), we can construct a function \(f \in F(G)\) equal to \(f'\), except for

    $$ f_j(x)= \bigl ( (x_i\,{\oplus }\,\tilde{\sigma }_{ij}) \vee ( x_k\,{\oplus }\,y_k) \bigr ) \wedge \bigwedge \limits _{ \ell \in N(j) \setminus \{i,k\} } \bigl ( (x_\ell \,{\oplus }\,\tilde{\sigma }_{\ell j}) \vee (x_k\,{\oplus }\,\lnot y_k ) \bigr ). $$

    We have \(f_j(y) = { \texttt {0}} = y_j\) because the left hand side of the conjunction is false, thus \(y \in \varPhi (f)\) (the case \(y_j = { \texttt {1}}\) is symmetric by switching OR and AND functions, and replacing \(y_k\) with \(\lnot y_k\)).    \(\square \)

Lemma 2

Let G be a simple SID. Then \(\phi (G)\ge 1\) if and only if each non-trivial initial strongly connected component of G contains a positive cycle.

Proof

The left to right implication has been proved by Aracena [4, Corollary 3]. For the converse, suppose that \(G=(V,A,\sigma )\) has p initial strongly connected components \(H_1,\dots ,H_p\). For all \(k\in [p]\), if \(H_k\) is trivial then \(i_k\) denotes the unique vertex it contains, and otherwise we select a positive cycle \(C_k\) in \(H_k\) and an arc \((j_k,i_k)\) inside. Then, G can be spanned by a forest of p vertex disjoint trees \(T_1,\dots ,T_p\) rooted in \(i_1,\dots ,i_p\) such that if \(H_k\) is not trivial then the path from \(i_k\) to \(j_k\) contained in \(T_k\) is the one contained in \(C_k\). For all \(k\in [p]\) and all vertices j in \(T_k\), we denote by \(P_{kj}\) the path from \(i_k\) to j contained in \(T_k\) (if \(j=i_k\) this path is of length zero and positive by convention).

Now, we define \(f\in F(G)\) as follows. First, for all \(k\in [p]\), if \(H_k\) is trivial then \(f_{i_k}\) is the constant \({ \texttt {0}}\) function, and otherwise \(f_{i_k}\) is the AND function. Second, for all \(k\in [p]\) and all vertices \(j\ne i_k\) in \(T_k\), \(f_j\) is the AND function if \(P_{kj}\) is positive and the OR function otherwise. Next, we define \(x\in \{{ \texttt {0}},{ \texttt {1}}\}^V\) as follows: for all \(j\in V\), \(x_j={ \texttt {0}}\) if and only if \(P_{kj}\) is positive (thus \(x_{i_k}={ \texttt {0}}\) for all \(k\in [p]\)).

We claim that \(x\in \varPhi (f)\). Indeed, given \(k\in [p]\) and a vertex \(j\ne i_k\) in \(T_k\), it is easy to prove that \(f_j(x)=x_j\) by induction on the length of \(P_{kj}\). Next, if \(H_k\) is trivial then \(f_{i_k}(x)={ \texttt {0}}\). Otherwise, \((j_k,i_k)\) is an arc of \(H_k\). Let s be the sign of the path \(P_{kj_k}\), which is in \(C_k\) by construction. Since \(C_k\) is positive, \(s=\sigma _{j_ki_k}\). So if \(\sigma _{j_ki_k}=1\) then \(x_{j_k}={ \texttt {0}}\) and thus \(f_{i_k}(x)={ \texttt {0}}\), and if \(\sigma _{j_ki_k}=-1\) then \(x_{j_k}={ \texttt {1}}\) and thus \(f_{i_k}(x)={ \texttt {0}}\). In all cases, \(f_{i_k}(x)={ \texttt {0}}=x_{i_k}\). We deduce that \(x\in \varPhi (f)\).    \(\square \)

Thus, to decide if \(\phi (G)\ge 1\), it is sufficient to compute the non-trivial initial strongly connected components of G (this can be done in linear time [29]) and to check if they contain a positive cycle. As described below, this checking can be done in polynomial time using the following difficult theorem independently proved by Robertson, Seymour and Thomas [27] and McCuaig [20].

Theorem 1

([20, 27]). There exists a polynomial time algorithm for deciding if a given digraph contains a cycle of even length.

Let G be a signed digraph with n vertices, and let \(\tilde{G}\) be obtained from G by replacing each positive arc by a path of length two, with two negative arcs, where the internal vertex is new. Then \(\tilde{G}\) has at most \(n+n^2\) vertices, and it is easy to see that G has a positive cycle if and only if \(\tilde{G}\) has a cycle of even length [21]. We then deduce the following theorem.

Theorem 2

\(1\)-MFPP is in \(\textsf {P}\).

4 k-Maximum Fixed Point Problem for \(k \ge 2\)

Theorem 3

For any \(k \ge 2\), \(k\)-MFPP is \(\textsf {NP}\)-complete, even with \(\varDelta (G)\le 2\).

Theorem 3 is obtained from Lemmas 3, 5 and 6.

Lemma 3

For any \(k \ge 2\), \(k\)-MFPP is in \(\textsf {NP}\).

Proof

(sketch, see details in Appendix ??). First, consider the case where \(\varDelta (G)\le d\) for some constant d. Then a certificate of \(\phi (G) \ge k\) could consist in a network \(f \in F(G)\) and k distinct fixed points \(x^{(1)}, \dots , x^{(k)}\). The fact that \(f \in F(G)\), and \(f(x^{(i)})=x^{(i)}\) with distinct \(x^{(i)}\) for all \(i \in [k]\), is checked in polynomial time.

However, when \(\varDelta (G)\) is not bounded, \(F(G)\) can be of doubly exponential size in n. Thus, some functions f require an exponential space to be encoded. Instead, one can give as a certificate a partial function \(h:X \rightarrow \{{ \texttt {0}},{ \texttt {1}}\}^n\) with \(X \subseteq \{{ \texttt {0}},{ \texttt {1}}\}^n\) such that \(f(x) = h(x)\) for any \(x \in X\). In the set X, we put k fixed points and configurations which assert the effectiveness of the arcs. To check the certificate it is sufficient to ensure that there are no inconsistencies (independently for each local function). As a result, the problem is in \(\textsf {NP}\).    \(\square \)

A shorter certificate (only the k fixed points) is possible when G is simple (see Appendix ??). This result from the following theorem. Note that the extending partial Boolean functions is a well established topic [8, 9].

Theorem 4

Let G be a simple SIG with vertex set V and consider a partial BN \(h:X\rightarrow \{{ \texttt {0}},{ \texttt {1}}\}^V\) with \(X\subseteq \{{ \texttt {0}},{ \texttt {1}}\}^V\). There is a \(\mathcal {O}(|X|^2|V|^2)\)-time algorithm to decide if there exists an extension of h in F(G).

We now prove that \(2\)-MFPP is \(\textsf {NP}\)-hard. We will use observations from [4].

Lemma 4

([4]). Let \(G = (V,A,\sigma )\) be a simple signed digraph, \(f \in F(G)\) and xy two distinct fixed points of f. Then there exists a positive cycle C in G such that, for any arc (ij) in C, we have \(x_i\,{\oplus }\,\tilde{\sigma }_{ij} = x_j \ne y_j = y_i\,{\oplus }\,\tilde{\sigma }_{ij}\).

Remark 1

If the positive cycle C in Lemma 4 has only positive arcs, then either \(x_i<y_i\) for all vertex i in C, or \(x_i>y_i\) for all vertex i in C.

Remark 2

Given \(f \in F(G)\) and xy two distinct fixed points of f, for any feedback vertex set I of G we have \(x_{I} \ne y_{I}\).

Lemma 5

The problem \(2\)-MFPP is \(\textsf {NP}\)-hard, even with \(\varDelta (G) \le 2\).

Proof

We reduce 3SAT to our problem. Let us consider a 3SAT instance \(\psi \) with n variables \(\lambda _1, \dots , \lambda _n\) and m clauses \(\mu _1, \dots , \mu _m\). We define the signed digraph \(G_\psi = (V,A,\sigma )\), where \(|V| = 4n+2m+1\), as follows (see Fig. 2).

First, \(V = R \cup P \cup L \cup \bar{L} \cup S \cup T\) with \(R=\{r_i\ |\ i\in [n]\}\), \(P = \{ p_i\ |\ i \in [0,n] \}\), \(L = \{ \ell _i\ |\ i \in [n] \}\), \(\bar{L} = \{ \bar{\ell }_i\ |\ i \in [n] \}\), \(S = \{ s_i\ |\ i \in [m] \}\), and \(T = \{ t_i\ |\ i \in [m] \}\). To simplify the notation let \(s_0 = p_0\) and \(s_{m+1} = p_n\). Second,

$$\begin{aligned} A:=&\bigcup \nolimits _{i \in [n] } \{ (p_{i-1}, \ell _{i} ), (p_{i-1}, \bar{\ell }_{i} ),(\ell _{i}, p_{i} ), (\bar{\ell }_{i}, p_{i} ),(r_i, \ell _{i} ),(r_i, \bar{\ell }_{i} ) \}\\ \cup&\bigcup \nolimits _{j \in [m] } \{ (t_i, s_i), (s_i, s_{i-1}) \} \cup \{ (p_n, s_m)\} \\ \cup&\{ (\ell _i, t_j)\ |\ i \in [n],\ j \in [m] \text { if } \lambda _i \text { appears positively in } \mu _j \} \\ \cup&\{ (\bar{\ell }_i, t_j) \mid i \in [n],\ j \in [m] \text { if } \lambda _i \text { appears negatively in } \mu _j \}. \end{aligned}$$

Arcs in \(\{ (s_i, t_i) \mid i \in [m] \} \cup \{ (r_i, \ell _i) \mid i \in [n] \}\) are negative, all others are positive.

Let us first prove that if \(\psi \) is satisfiable then there exists a BN \(f \in F(G_\psi )\) with has at least two fixed points. Consider a valid assignment \(v:\{\lambda _1, \dots \lambda _n\} \rightarrow \{\bot ,\top \}\). Let \(I^{\bot } = \{ i \in [n] \mid v(\lambda _i) = \bot \} \) and \(I^{\top } = \{ i \in [n] \mid v(\lambda _i) = \top \} \). We define \(f\in F(G_\psi )\) as follows.

  • For all \(i \in I^{\bot }\) (resp. \(I^\top \)), \(f_{r_i}\) is the constant \({ \texttt {0}}\) (resp. \({ \texttt {1}}\)) function.

  • For all \(i \in [n]\), \(f_{\ell _i}\) and \(f_{\bar{\ell }_i}\) are both AND functions.

  • For all \(i \in [0,n]\), \(f_{p_i}\) is the OR function.

  • For all \(i \in [m]\), \(f_{s_i}\) and \(f_{t_i}\) are the AND functions.

The two following configurations x and y are distinct fixed points of f, and therefore \(\phi (G_\psi ) \ge 2\): for all \(j\in V\),

$$ \begin{array}{l} x_j=\left\{ \begin{array}{ll} { \texttt {1}} &{} \text { if } j \in \{ r_i \mid i \in I^{\top } \}\\ { \texttt {0}} &{} \text { otherwise} \end{array}\right. \\ ~\\ y_j=\left\{ \begin{array}{ll} { \texttt {1}} &{} \text { if } j \in \{ r_i \mid i \in I^{\top } \} \cup P \cup S \cup \{ \ell _i \mid i \in I^{\bot } \} \cup \{ \bar{\ell }_i \mid \in I^{\top }\}\\ { \texttt {0}} &{} \text { otherwise}. \end{array}\right. \end{array} $$

Now, we prove that if \(\phi (G_\psi )\ge 2\) then \(\psi \) is satisfiable. Consider a BN \(f \in F(G_\psi )\) with two distinct fixed points x and y. Remark that \(\{ {p_0} \}\) is a feedback vertex set of \(G_\psi \). In other words, all cycles of \(G_\psi \) contain \(p_0\). We deduce from Remark 2 that \(x_{p_0} \ne y_{p_0}\) and that \(\phi (G_\psi )\le 2\). Without loss of generality, suppose that \(x_{p_0} < y_{p_0}\). Remark also that any cycle containing one of the vertices \(t_1, \dots , t_m\) is negative, and that no positive cycle in \(G_\psi \) contains any negative arc. Thus, according to Remark 1, there exists a cycle C such that \(x_j<y_j\) for every vertex j in C. In other words, \(x_P < y_P\) and \(x_S < y_S\) and for every \(i \in [n]\) either C contains \(\ell _i\) and we have \(x_{\ell _i} < y_{\ell _i}\), or it contains \(\bar{\ell }_i\) and we have \(x_{\bar{\ell }_i} < y_{\bar{\ell }_i}\). We construct the following assignment v from C.

$$ v(\lambda _i)=\left\{ \begin{array}{ll} \bot &{} \text { if } C \text { contains } \ell _i,\\ \top &{} \text { if } C \text { contains } \bar{\ell _i}. \end{array}\right. $$

For the sake of contradiction, suppose that v does not satisfy the formula. As a consequence, there is a clause \(\mu _j\) which is false with assignment v. In other words, any variable which appears positively in the clause is assigned to false and any variable which appears negatively is assigned to true.

Let us prove that \(x_{t_j} < y_{t_j}\). Since any incoming arc of \(t_j\) is positive, and since x and y are fixed points, it is sufficient to prove that, for every in-neighbor \(\ell \) of \(t_j\), we have \(x_{\ell } < y_{\ell }\). By definition of \(G_\psi \), any in-neighbor of \(t_j\) corresponds to a variable \(\lambda _i\) of the clause. If \(\lambda _i\) appears positively (resp. negatively) in clause \(\mu _j\) then the in-neighbor of \(t_j\) corresponding to \(\lambda _i\) is \(\ell _i\) (resp. \(\bar{\ell }_i\)). Since \(v(\lambda _i)=\bot \) (resp. \(\top \)) because the clause is false then C contains \(\ell _i\) (resp. \(\bar{\ell }_i\)) and we have \(x_{\ell _i} < y_{\ell _i}\) (resp. \(x_{\bar{\ell }_i} < y_{\bar{\ell }_i}\)). As a result, \(x_{t_j} < y_{t_j}\).

Now, the vertex \(s_j\) has two in-neighbors. One of them is \(s_{j+1}\) and we have \(\sigma _{s_{j+1}s_j}=1\) and \(x_{s_{j+1}} < y_{s_{j+1}}\). The other is \(t_j\) with \(\sigma _{t_{j}s_j}=-1\) and \(x_{t_{j}} < y_{t_{j}}\). Hence, there are two possible local functions for \(f_{s_i}\):

  • \(f_{s_j}(z)=z_{s_{j+1}} \vee \lnot z_{t_j}\), and then \(x_{s_j} = f_{s_j}(x) = x_{s_{j+1}} \vee \lnot x_{t_j} = { \texttt {0}} \vee \lnot { \texttt {0}} = { \texttt {1}}\).

  • \(f_{s_i}(z)=z_{s_{i+1}} \wedge \lnot z_{t_j}\), and then \(y_{s_j} = f_{s_j}(y) = y_{s_{j+1}} \wedge \lnot y_{t_j} = { \texttt {1}} \wedge \lnot { \texttt {1}} = { \texttt {0}}\).

In both cases, we do not have \(x_{s_j} < y_{s_j}\), which is a contradiction since \(s_j\) is in C. As a result, the 3SAT instance \(\psi \) is satisfiable. Additionally, remark that \(\phi (G_\psi ) \ge 1\) because, with the constant \({ \texttt {1}}\) function for the vertices in R, and the OR local function everywhere else, the configuration \(z_i={ \texttt {1}}\) for all i is a fixed point. We can conclude that \(\phi (G_\psi )=1\) when \(\psi \) is unsatisfiable.

To get a bounded degree \(\varDelta (G_\psi )\le 2\), notice that only vertices in T have in-degree three, which can be decreased by adding an intermediate vertex (see the right picture in Fig. 2) while preserving the correctness of the reduction.

   \(\square \)

We can extend the \(\textsf {NP}\)-hardness reduction to any \(k \ge 2\).

Fig. 2.
figure 2

Example of construction in the reduction from 3SAT to \(k\)-MFPP (Lemma 5). This signed digraph \(G_\psi \) implements the following 3SAT instance \(\psi \): \((\lambda _1 \vee \lambda _2 \vee \lambda _3) \wedge (\lnot \lambda _1 \vee \lambda _2 \vee \lambda _4) \wedge (\lambda _1 \vee \lnot \lambda _2 \vee \lnot \lambda _3) \wedge (\lnot \lambda _1 \vee \lnot \lambda _2 \vee \lambda _3) \wedge (\lambda _1 \vee \lambda _3 \vee \lnot \lambda _4)\) which is satisfiable if and only if \(\phi (G_\psi ) \ge 2\), otherwise \(\phi (G_\psi )=1\).

Lemma 6

For any \(k \ge 2\), \(k\)-MFPP is \(\textsf {NP}\)-hard, even with \(\varDelta (G) \le 2\).

Proof

Let \(\ell = \lfloor \log _2( k-1) \rfloor \), i.e. \(2^\ell < k \le 2^{\ell +1}\). Given a formula, consider the digraph G from Lemma 5, and add \(\ell \) new isolated vertices with positive loops. Then 1 or 2 fixed points on \(G_\psi \) become respectively \(2^\ell \) or \(2^{\ell +1}\) fixed points.    \(\square \)

Remark 3

For \(\varDelta (G) \le 1\), \(|F(G)|=1\) since each local function is the identity or the negation, and computing \(\phi (G)\) is in \(\mathcal {O}(|G|)\), hence \(k\)-MFPP \(\in \textsf {P}\).

5 Maximum Fixed Point Problem

Theorem 5

When \(\varDelta (G)\le d\), MFPP is \(\textsf {NP}^\textsf {\#P}\)-complete.

In this first part of the section, we prove Theorem 5, from Lemmas 7 and 8.

Lemma 7

When \(\varDelta (G)\le d\), MFPPis in \(\textsf {NP}^\textsf {\#P}\).

Proof

An algorithm in \(\textsf {NP}^\textsf {\#P}\) to solve MFPP is, on input Gk:

  1. 1.

    guess local functions \(f_i\) for \(i \in [n]\) (polynomial from \(\varDelta (G) \le d\)),

  2. 2.

    construct \(\psi =(f_1(x)=x_1)\wedge \dots \wedge (f_n(x)=x_n)\) on variables \(x_1,\dots ,x_n\),

  3. 3.

    compute the number of solutions of \(\psi \) with the \(\textsf {\#P}\) oracle, that is \(\phi (f)\),

  4. 4.

    accept if and only if \(\phi (f) \ge k\).

A non-deterministic branch accepts if and only if \(\phi (G)\ge k\).    \(\square \)

Lemma 8

When \(\varDelta (G)\le d\), MFPPis \(\textsf {NP}^\textsf {\#P}\)-hard.

Proof

(sketch, see details in Appendix ??). We consider the following problem.

figure c

We know that E-Maj3SAT is \(\textsf {NP}^\textsf {PP}\)-complete [19] and that \(\textsf {NP}^\textsf {\#P}=\textsf {NP}^\textsf {PP}\) (direct extension of \(\textsf {P}^\textsf {\#P}=\textsf {P}^\textsf {PP}\) [22]). Consequently, it is sufficient to prove that we can reduce E-Maj3SAT to MFPP. To represent an instance \((\psi ,s)\) of E-Maj3SAT, we construct a digraph \(G_{\psi ,s}\) similar to the digraph \(G_\psi \) constructed in Lemma 5 except that we add a positive loop to the \(q= n-s\) vertices \(r_{s+1}, \dots , r_{n}\). We claim that \(\phi (G_{\psi ,s})=\alpha +2^{q}\), with

$$ \alpha =\max _{v: \{\lambda _1,\dots ,\lambda _s\}\rightarrow \{\bot ,\top \}} |\{ u: \{\lambda _{s+1},\dots ,\lambda _n\}\rightarrow \{\bot ,\top \} \mid v \cup u \text { satisfies } \psi \}|. $$

Indeed, consider \(f \in F(G_{\psi ,s})\) with \(\phi (f)=\phi (G_{\psi ,s})\). As in Lemma 5, the functions \(f_i\) for \(i \in \{\ell _1,\bar{\ell }_1,\dots ,\ell _s,\bar{\ell }_s\}\) correspond to an assignment v of \(\lambda _{1},\dots , \lambda _s\). Moreover, each valuation u of \(\lambda _{s+1},\dots ,\lambda _n\) corresponds to one (resp. two) fixed points if the assignment \(v \cup u\) makes \(\psi \) false (resp. true). As a consequence, the reduction is correct by setting \(k=\frac{3}{2}2^{q}\).    \(\square \)

In this second part, we study MFPP with unbounded maximum degree.

Theorem 6

When \(\varDelta (G)\) is unbounded, MFPP is \(\textsf {NEXPTIME}\)-complete.

Proof

(sketch, see details in Appendix ??). It is easy to see that the problem MFPP with unbounded degree is in \(\textsf {NEXPTIME}\). Indeed, to know if \(\phi (G) \ge k\) it is sufficient to guess a function \(f \in F(G)\) (encoded in exponential space), to compute \(\phi (f)\) (in exponential time) and then accept if \(\phi (f) \ge k\), reject otherwise. A non-deterministic branch accepts if and only if \(\phi (G)\ge k\).

For the hardness, we reduce from Succint-3SAT [22], which is 3SAT where \(\psi \) has \(n=2^{\tilde{n}}\) variables, \(m=2^{\tilde{m}}\) clauses, and is given by a circuit D with:

  • \(\tilde{m}\) input bits for the clauses, and 2 for the three literal positions,

  • \(\tilde{n}\) output bits to give the corresponding variable, and 1 for its polarity.

D is acyclic, has in-degree at most 2, and has simple OR, AND, NOT, identity or constant functions. The idea is to generalize the construction from the proof of Theorem 3, with one literal for each node of the circuit D (top part), and additional clauses implementing the circuit (bottom part). With non-trivial additional elements, choosing local functions correspond to choosing an assignment. There will be a maximum of one (resp. two) fixed point for each non-satisfied (resp. satisfied) clause. As a result, \(\psi \) is satisfiable if and only if \(\phi (G) \ge 2m\).    \(\square \)

6 Conclusion

This first work raises many open questions. First, is the problem \(1\)-MFPP \(\textsf {P}\)-complete? We proved that it is equivalent to the problem of finding an even cycle in a digraph, for which the \(\textsf {P}\) versus \(\textsf {NP}\)-complete status remained open until [20, 27]. Now we know that the problem is in \(\textsf {P}\), but is it a tight bound?

Several natural extensions of the present results may be addressed. What happens to the complexity when we study the minimum number of fixed points instead of the maximum? And for digraphs with only positive arcs? What about limit cycles of period greater than one instead of fixed points? Understanding the complexity of computing bounds on dynamical properties of BNs respecting a given interaction digraph is a new and promising approach, both on the theoretical and practical points of view.