1 Introduction

Evolutionary dynamics models enable us to study how populations change over time under natural selection and neutral random drift among other factors. Over the past two decades, the population structure, particularly those represented by networks (i.e., graphs), has been shown to significantly alter the spread of mutant types (Lieberman et al. 2005; Nowak 2006; Nowak et al. 2010; Shakarian et al. 2012; Perc et al. 2013). Mutants may have a fitness that is different from the fitness of a resident type, which makes the mutants either more or less likely to produce offsprings. The fitness of each type may vary depending on the type of the neighboring individuals’ types as in the case of evolutionary games on networks. On the other hand, the simplest assumption on the fitness is to assume that the fitness of each type is constant over time. This latter case, which we refer to as constant selection, has also been studied as biased voter models, modeling stochastic opinion formation in networks (and well-mixed populations) (Durrett 1999; Antal et al. 2006; Sood et al. 2008; Castellano et al. 2009).

Networks on which real-world dynamical processes approximated by evolutionary dynamics occur may be time-varying. Temporal (i.e., time-varying) networks and dynamical processes on them have been extensively studied (Holme and Saramäki 2012, 2013; Holme 2015; Masuda and Holme 2017; Karsai et al. 2018; Holme and Saramäki 2019; Masuda and Lambiotte 2020). Evolutionary game dynamics on time-varying networks are no exception. It has been shown that temporal networks enhance the evolution of cooperation as compared to static networks (Cardillo et al. 2014; Li et al. 2020; Johnson and Smirnov 2021; Sheng et al. 2023; Su et al. 2023). It has also been known for a longer time that coevolutionary dynamics of a social dilemma game and network structure, in which the dynamics of the network structure depend on the state of the nodes (e.g., cooperator or defector), enhance overall cooperation if players tend to avoid creating or maintaining edges connecting to defectors (Santos et al. 2006; Pacheco et al. 2006; Fu et al. 2009; Perc et al. 2013; McAvoy et al. 2020).

In this study, we investigate constant-selection evolutionary dynamics on temporal networks to clarify how the time dependence of the network structure impacts evolutionary processes. In particular, a key question in studies of constant-selection evolutionary dynamics on networks is the fixation probability, defined as the probability that a single mutant type introduced to a node in the network eventually fixates, i.e., occupies all the nodes of the network. The fixation probability depends on the fitness of the mutant type relative to the fitness of the resident type, denoted by r. A network is called an amplifier of selection if it has a higher fixation probability than the complete graph, which corresponds to the Moran process, when \(r>1\) and a lower fixation probability when \(r<1\); conversely, a network is called a suppressor of selection if the fixation probability is smaller than for the Moran process on \(r>1\) and larger for \(r<1\) (Lieberman et al. 2005; Adlam et al. 2015). In Fig. 1, we show hypothetical examples of the fixation probability as a function of r for three networks: the complete graph (i.e., Moran process), an amplifier, and a suppressor. Under the so-called birth-death updating rule and uniform initialization, most static networks are amplifiers of selection (Hindersin and Traulsen 2015; Allen et al. 2021). In fact, there is only one suppressing static network with six nodes among the 112 connected six-node networks (Cuesta et al. 2017).

Fig. 1
figure 1

Concept of amplifier and suppressor of selection. The fitness of the resident and mutant type is equal to 1 and r, respectively. A value of \(r>1\) indicates that a mutant node is more likely to be selected for reproduction than a resident node. A value of \(r<1\) indicates vice versa. The fixation probability of a single mutant type for an amplifier is smaller than that for the Moran process when \(r<1\) and larger than that for the Moran process when \(r>1\). Conversely, the fixation probability for a suppressor is larger than that for the Moran process when \(r<1\) and smaller than that for the Moran process when \(r>1\). The Moran process, amplifier, and suppressor have the same fixation probability at \(r=1\), which is equal to 1/N. In the figure, the fixation probabilities for the Moran process are given by Eq. (24) with \(N=5\), and those for the amplifier and suppressor are hypothetical ones for expository purposes

Furthermore, various families of amplifiers of selection have been found (Giakkoupis 2016; Galanis et al. 2017; Pavlogiannis et al. 2017, 2018; Goldberg et al. 2019), whereas suppressors of selection still remain elusive (Cuesta et al. 2017, 2018). On these grounds, we ask the following two main questions in the present study. First, as in the case of static networks, are many temporal networks comprised of sequences of unweighted networks amplifiers of selection under the same condition (i.e., birth-death updating rule and uniform initialization)? Second, if we combine amplifying static networks, \(G_1\) and \(G_2\), into a temporal network, can the obtained temporal network be a suppressor of selection or a less amplifying temporal network than both \(G_1\) and \(G_2\)?

2 Model

Let G be a static weighted network with N nodes. We assume undirected networks for simplicity although extending the following evolutionary dynamics to the case of directed networks is straightforward. We assume that each node takes either the resident or mutant type at any discrete time. The resident and mutant have fitness 1 and r, respectively. The fitness represents the propensity with which each type is selected for reproduction in each time step. The mutant type initially occupies just one node, which is selected uniformly at random among the N nodes. The other \(N-1\) nodes are occupied by the resident type. We then run the birth-death process, which is a generalization of the Moran process to networks (Lieberman et al. 2005; Ohtsuki et al. 2006; Olfati-Saber 2007; Nowak et al. 2010; Shakarian et al. 2012; Perc et al. 2013). Specifically, in every discrete time step, we select a node v to reproduce with the probability proportional to its fitness value. Next, we select a neighbor of v, denoted by \(v'\), with the probability proportional to the weight of the undirected edge (v, \(v'\)). Then, the type at v (i.e., either resident or mutant) replaces that at \(v'\). We repeat this process until the entire population is of a single type, either resident or mutant, which we call the fixation.

In this study, we extend this birth-death process to temporal networks in which two static networks \(G_{1}\) and \(G_{2}\), both having N nodes, alternate with constant intervals \(\tau \). We call this temporal network model the switching network and denote it by \((G_1, G_2, \tau )\). Switching networks have been used for studying various dynamics on temporal networks including synchronization (Porfiri et al. 2006; Stilwell et al. 2006; Olfati-Saber 2007; Masuda et al. 2013; Hasler et al. 2013a, b; Masuda 2016), random walk (Perra et al. 2012; Rocha and Masuda 2014; Alessandretti et al. 2017), epidemic processing (Valdano et al. 2015; Speidel et al. 2016; Onaga et al. 2017; Somers and Manchester 2023), network control (Li et al. 2017), and reaction-diffusion systems (Petit et al. 2017). Specifically, we first run the birth-death process on \(G_{1}\) for \(\tau \) time steps. Then, we switch to \(G_{2}\) and run the same birth-death process on \(G_2\) for \(\tau \) time steps. Then, we switch back to \(G_{1}.\) We keep flipping between \(G_{1}\) and \(G_{2}\) every \(\tau \) time steps until the fixation of either type occurs.

3 Computation and theoretical properties of the fixation probability in switching networks

In this section, we describe the methods for calculating the fixation probability of a single mutant, i.e., the probability that the mutant type of fitness r fixates when there is initially just one node of the mutant type that is selected uniformly at random. We extend the methods for static networks (Hindersin et al. 2016) to our model. We also state some mathematical properties of the fixation probability in switching networks.

3.1 Fixation probability in static networks

We first explain the known procedure for calculating the fixation probability of the mutant type, which we simply refer to as the fixation probability in the following text, in any static weighted network using Markov chains (Lieberman et al. 2005; Hindersin et al. 2016). We describe the state of the evolutionary dynamics by an N-dimensional binary vector \({\varvec{s}} = (s_1, \ldots , s_N)\), where \(s_i \in \{0, 1\}, \forall i \in \{1, \ldots , N\}\). For each i, let \(s_i = 0\) or \(s_i = 1\) indicate that node i is occupied by a resident or a mutant, respectively. Let S be the set of all states. Note that S has cardinality \(2^{N}\), that is, there are \(2^{N}\) states and that there are \(\left( {\begin{array}{c}N\\ m\end{array}}\right) \) states with m mutants. We label the states by a bijective map, denoted by f, from S to \(\{1,\dots ,2^N\}\). The transition probability matrix of the Markov chain, denoted by \(T = (T_{ij})\), is a \(2^N\times 2^N\) matrix. Its entry \(T_{f({\varvec{s}}),f({\varvec{s'}})}\) represents the probability that the state changes from \({\varvec{s}}\) to \({\varvec{s'}}\) in one time step. It should be noted that \(T_{f({\varvec{s}}),f({\varvec{s'}})}\) can be non-zero if and only if vectors \({\varvec{s}}\) and \({\varvec{s'}}\) differ in at most one entry. Therefore, each row of T has at most \(N+1\) non-zero entries.

Let \({\varvec{s}}\) be a state with m mutants, \(s_i = 1\) for \(i \in \{g(1), \ldots , g(m)\}\), and \(s_i = 0\) for \(i \in \{g(m+1), \ldots , g(N)\}\), where g is a permutation on \(\{1, \ldots , N \}\). Let \({\varvec{s'}}\) be the state with \(m+1\) mutants in which \(s'_i = 1\) for \(i \in \{g(1), \ldots , g(m), g(m+1)\}\) and \(s'_i = 0\) for \(i\in \{g(m+2), \ldots , g(N)\}\). Note that \({\varvec{s}}\) and \({\varvec{s'}}\) differ only at the \(g(m+1)\)th node, where \({\varvec{s}}\) has a resident and \({\varvec{s'}}\) has a mutant. We obtain

$$\begin{aligned} T_{f({\varvec{s}}),f({\varvec{s'}})} = \frac{r}{rm + N-m}\sum _{m'=1}^{m}\frac{ A_{g(m'), g(m+1)} }{w(g(m'))}, \end{aligned}$$
(1)

where A denotes the weighted adjacency matrix of the network, i.e., \(A_{ij}\) is the weight of edge (ij), and \(w(i) \equiv \sum _{j=1}^N A_{ij}\) represents the weighted degree of the ith node, also called the strength of the node. Next, consider a state \({\varvec{s''}}\) with \(m-1\) mutants such that \(s_i'' = 1\) for \(i \in \{ g(1), \ldots , g(\tilde{m}-1), g(\tilde{m}+1), \ldots , g(m)\}\) and \(s''_i = 0\) for \(i \in \{ g(\tilde{m}), g(m+1), g(m+2), \ldots , g(N) \}\), where \(\tilde{m} \in \{ 1, \ldots , m \}\). We obtain

$$\begin{aligned} T_{f({\varvec{s}}),f({\varvec{s''}})}=\frac{1}{rm+N-m}\sum _{m'=m+1}^{N}\frac{A_{g(m'),g(\tilde{m})}}{w(g(m'))}. \end{aligned}$$
(2)

The probability that the state does not change after one time step is given by

$$\begin{aligned} T_{f({\varvec{s}}), f({\varvec{s}})}&= 1 - \frac{r}{rm+N-m}\sum _{\ell =m+1}^{N}\sum _{m'=1}^{m}\frac{A_{g(m'),g({\ell )}}}{w(g(m'))}\\ \nonumber&\quad -\frac{1}{rm+ N-m}\sum _{\tilde{m}=1}^{m}\sum _{m'={m+1}}^{N}\frac{A_{g(m'),g(\tilde{m})}}{w(g(m'))}. \end{aligned}$$
(3)

Let \(x_{f({\varvec{s}})}\) denote the probability that the mutant fixates when the evolutionary dynamics start from state \({\varvec{s}}\). Because

$$\begin{aligned} x_{f({\varvec{s}})}=\sum _{{\varvec{s'}}\in S}T_{f({\varvec{s}}),f({\varvec{s'}})}x_{f({\varvec{s'}})}, \end{aligned}$$
(4)

we obtain \(T{\varvec{x}}={\varvec{x}}\), where \({\varvec{x}}= \left( x_1, \dots ,x_{2^N} \right) ^{\top }\), and \({}^\top \) represents the transposition. Because \(x_{f(\left( 0, \ldots , 0\right) )}=0\) and \(x_{f(\left( 1, \ldots , 1\right) ) }=1\), we need to solve the set of \(2^{N}-2\) linear equations to obtain the fixation probabilities starting from an arbitrary initial state.

3.2 Fixation probability in switching networks

We now consider the same birth-death process on switching network \((G_1, G_2, \tau )\). To calculate the fixation probability in \((G_1, G_2, \tau )\), we denote by \(T^{(1)}\) and \(T^{(2)}\) the transition probability matrices for the birth-death process on static network \(G_1\) and \(G_2\), respectively. Let \(x_i(t)\) be the fixation probability when the evolutionary dynamics start from the ith state (with \(i\in \{1, \ldots , 2^N\}\)) at time t. We obtain

$$\begin{aligned} {\varvec{x}}(t) = {\left\{ \begin{array}{ll} T^{(1)} {\varvec{x}}(t+1) &{} \text { if } 2n\tau \le t< \left( 2n+1\right) \tau , \\ T^{(2)} {\varvec{x}}(t+1) &{}\text { if } (2n+1)\tau \le t < \left( 2n+2\right) \tau , \end{array}\right. } \end{aligned}$$
(5)

where \({\varvec{x}}(t) = \left( x_1(t), \ldots , x_{2^N}(t) \right) ^{\top }\) and \(n\in \{0,1, \ldots \}\). We recursively use Eq. (5) to obtain

$$\begin{aligned} {\varvec{x}}\left( 0\right) =&T^{(1)}{\varvec{x}}\left( 1\right) =\cdots =\left( T^{(1)}\right) ^{\tau }{\varvec{x}} \left( \tau \right) =\left( T^{(1)}\right) ^{\tau } \left( T^{(2)}\right) {\varvec{x}}\left( \tau +1\right) =\cdots \nonumber \\ =&\left( T^{(1)} \right) ^{\tau } \left( T^{(2)} \right) ^{\tau } {\varvec{x}}\left( 2\tau \right) . \end{aligned}$$
(6)

Because of the periodicity of the switching network, we obtain \({\varvec{x}}\left( 0\right) = {\varvec{x}}\left( 2\tau \right) \). Therefore, the fixation probability is given as the solution of

$$\begin{aligned} {\varvec{x^*}} = \left( T^{(1)}\right) ^{\tau } \left( T^{(2)}\right) ^{\tau } {\varvec{x^*}}. \end{aligned}$$
(7)

Let \(\tilde{S}^{(1)}\) be the set of the N states with just one mutant. Then, the fixation probability when there is initially a single mutant located on a node that is selected uniformly at random is given by

$$\begin{aligned} \rho \equiv \frac{1}{N} \sum _{{\varvec{s}}\in \tilde{S}^{(1)}} x^*_{f({\varvec{s}})}. \end{aligned}$$
(8)

Note that \(\rho \) is a function of r and depends on the network structure. Because \(\left( T^{(1)}\right) ^{\tau } \left( T^{(2)}\right) ^{\tau }\) is a stochastic matrix with two absorbing states, it has a unique solution (Broom and Rychtář 2008; Taylor and Karlin 1998).

The birth-death process on switching networks has the following property.

Theorem 1

(Neutral drift) If \(r=1\), then \(\rho =\frac{1}{N}\) for arbitrary \(G_1\), \(G_2\), and \(\tau \in \mathbb {N}\).

Proof

We imitate the proof given in Liu and Masuda (2023). Assume a switching network \((G_1, G_2, \tau )\) on N nodes and that each node is initially occupied by a mutant of distinct type, i.e., node i is occupied by a mutant of type \(A_i\). We also assume that each mutant has fitness 1. We denote the probability that mutant \(A_i\) fixates by \(q_i\). Note that \(\sum _{i=1}^{N}q_i=1\). Now we reconsider our original evolutionary dynamics with \(r=1\), in which there are only equally strong two types, i.e., resident type and mutant type, with the initial condition in which the mutant type occupies the ith node and the resident type occupies all the other \(N-1\) nodes. Then, the fixation probability of the mutant is equal to \(q_i\) because this model is equivalent to the previous model if we identify \(A_i\) with the mutant type and the other \(N-1\) types with the resident type. Therefore, the fixation probability for the original model with \(r=1\) and the uniform initialization is given by \(\sum _{i=1}^{N} q_i / N = 1/N\). \(\square \)

Remark 1

We acknowledge that a recent study proved a more general version of this theorem and provided extensive discussion on neutral drift (Su et al. 2023).

Remark 2

The theorem holds true even if we switch among more than two static networks or if the switching intervals, \(\tau \), deterministically change from one switching interval to another. The proof remains unchanged.

3.3 Initialization at random time

In this section, we discuss the case in which the initial mutant arises in the switching network \(\left( G_1,G_2,\tau \right) \) at a time selected uniformly at random. Without loss of generality, we assume that the initial mutant arises at time \(t_0\), where \(t_0\in \{0,1,\dots , 2\tau -1\}\). If the initial mutant appears at time \(t \ge 2\tau \), then we can set \(t_0 = t \mod 2\tau \). Similar to Eq. (5), we obtain

$$\begin{aligned} { {\varvec{x}}(t_0) = {\left\{ \begin{array}{ll} T^{(1)} {\varvec{x}}(t_0+1) &{} \text { if } 0\le t_0< \tau , \\ T^{(2)} {\varvec{x}}(t_0+1) &{}\text { if } \tau \le t_0 < 2\tau . \end{array}\right. } } \end{aligned}$$
(9)

We use Eq. (9) to obtain

$$\begin{aligned} { {\varvec{x}}\left( t_0\right) = }&\, { T^{(1)}{\varvec{x}}\left( t_0+1\right) =\cdots } \nonumber \\ {=}&\,{\left( T^{(1)}\right) ^{\tau -t_0}{\varvec{x}} \left( \tau \right) } \nonumber \\ { =}&\,{\left( T^{(1)}\right) ^{\tau -t_0} \left( T^{(2)}\right) {\varvec{x}}\left( \tau +1\right) =\cdots \nonumber } \\ { =}&\,{ \left( T^{(1)} \right) ^{\tau -t_0} \left( T^{(2)} \right) ^{\tau } {\varvec{x}}\left( 2\tau \right) } \nonumber \\ {=}&\, {\left( T^{(1)} \right) ^{\tau -t_0} \left( T^{(2)} \right) ^{\tau }\left( T^{(1)} \right) ^{t_0} {\varvec{x}}\left( 2\tau +t_0\right) } \end{aligned}$$
(10)

when \(0\le t_0 <\tau \) and

$$\begin{aligned} { {\varvec{x}}\left( t_0\right) = }&\, { T^{(2)}{\varvec{x}}\left( t_0+1\right) =\cdots } \nonumber \\ {=}&\, {\left( T^{(2)} \right) ^{2\tau -t_0} \left( T^{(1)} \right) ^{\tau }\left( T^{(2)} \right) ^{t_0-\tau } {\varvec{x}}\left( 2\tau +t_0\right) } \end{aligned}$$
(11)

when \(\tau \le t_0 <2\tau \). Because of the periodicity of the switching network, we obtain \({\varvec{x}}\left( t_0\right) = {\varvec{x}}\left( 2\tau +t_0\right) \). Therefore, the fixation probability, which depends on \(t_0\) in the present case, is given as the solution of

$$\begin{aligned} {\varvec{x^*}}(t_0) = {\left\{ \begin{array}{ll} \left( T^{(1)} \right) ^{\tau -t_0} \left( T^{(2)} \right) ^{\tau }\left( T^{(1)} \right) ^{t_0} {\varvec{x^*}}(t_0) &{} \text { if } 0\le t_0< \tau , \\ \left( T^{(2)} \right) ^{2\tau -t_0} \left( T^{(1)} \right) ^{\tau }\left( T^{(2)} \right) ^{t_0-\tau } {\varvec{x^*}}(t_0) &{}\text { if } \tau \le t_0 < 2\tau . \end{array}\right. } \end{aligned}$$
(12)

Equation (12) yields

$$\begin{aligned} {\varvec{y^*}} \equiv&\, {T^{\left( 1\right) }{\varvec{x^*}}\left( t_0\right) } \nonumber \\ {=}&\,{ \left( T^{(1)} \right) ^{\tau -t_0+1} \left( T^{(2)} \right) ^{\tau }\left( T^{(1)} \right) ^{t_0-1}T^{(1)} {\varvec{x^*}}\left( t_0\right) } \nonumber \\ {=}&\, {\left( T^{(1)} \right) ^{\tau -(t_0-1)} \left( T^{(2)} \right) ^{\tau }\left( T^{(1)} \right) ^{t_0-1} {\varvec{y^*}} .} \nonumber \\ \end{aligned}$$
(13)

Therefore, we obtain \({\varvec{y^*}} = {\varvec{x^*}}\left( t_0 -1\right) \) when \(1\le t_0<\tau \). Using this relationship recursively, we obtain

$$\begin{aligned} {{ {\varvec{x^*}}\left( \tau -1-k\right) =} \left( T^{\left( 1\right) }\right) ^{k}{\varvec{x^*}}\left( \tau -1\right) } \end{aligned}$$
(14)

for \(0\le k <\tau -1\). Similarly, we obtain

$$\begin{aligned} {{ {\varvec{x^*}}\left( 2\tau -1-k\right) =} \left( T^{\left( 2\right) }\right) ^{k}{\varvec{x^*}}\left( 2\tau -1\right) } \end{aligned}$$
(15)

for \(0\le k <\tau -1\). By combining Eqs. (14) and (15), we obtain

$$\begin{aligned} {\varvec{x^*}} = \frac{1}{2\tau } \left\{ \left[ \sum _{k=0}^{\tau -1}\left( T^{\left( 1\right) }\right) ^{k}\right] {\varvec{x^*}}\left( \tau -1\right) + \left[ \sum _{k=0}^{\tau -1}\left( T^{\left( 2\right) }\right) ^{k} \right] {\varvec{x^*}}\left( 2\tau -1\right) \right\} , \end{aligned}$$
(16)

where \({\varvec{x^*}}\) is the fixation probability vector when the initial mutant appears at a uniformly randomly drawn time.

As in Eq. (8), let \(\tilde{S}^{(1)}\) be the set of the N states with just one mutant. Then, the fixation probability for a single mutant when the initial mutant appears at a uniformly randomly drawn time is given by

$$\begin{aligned} \rho = \frac{1}{N} \sum _{{\varvec{s}}\in \tilde{S}^{(1)}} {{\varvec{x}}^*}_{f({\varvec{s}})}. \end{aligned}$$
(17)

3.4 Stochastic switching

In this section, we formulate the fixation probability for stochastic switching networks. We adapt the methods proposed for epidemic spreading (Ogura and Preciado 2016a, b) and evolutionary games (Su et al. 2023) to the case of constant-selection dynamics. We assume that the network switches with probability p at every time step. In other words, if the network is \(G_{1}\) at time t, then it switches to \(G_2\) at time \(t+1\) with probability p and remains \(G_1\) with probability \(1-p\). Likewise, if the network is \(G_2\) at time t, then it switches to \(G_1\) at time \(t+1\) with probability p and remains \(G_2\) with probability \(1-p\). The duration of \(G_1\) and that of \(G_2\) before switching to the other network, \(\tau \), obeys the geometric distribution with \({\displaystyle \Pr (\tau )=(1-p)^{\tau -1}p}\), where \(\Pr \) denotes the probability.

We can write the state of the dynamics at any time t as \(\left( {\varvec{s}}, G_{i}\right) \), where \({\varvec{s}}\) is one of the \(2^{N}\) states (i.e., \({\varvec{s}} \in S\)) as in the deterministic switching case, and \(i \in \{ 1, 2 \}\). Let \(x_{\left( {\varvec{s}}, G_{i}\right) }\left( t\right) \) denote the probability that the dynamics attains fixation when starting in state \({\varvec{s}}\) at time t. We obtain

$$\begin{aligned} {x_{\left( {\varvec{s}}, G_{i}\right) }\left( t\right) =\sum _{{\varvec{s'}} \in S} T_{{\varvec{s}} \rightarrow {\varvec{s'}}}^{(i)}\left[ p\cdot x_{\left( {\varvec{s'}}, G_{i'}\right) }\left( t+1\right) +\left( 1-p\right) \cdot x_{\left( {\varvec{s'}}, G_{i}\right) }\left( t+1\right) \right] ,} \end{aligned}$$
(18)

where \(i' = 2\) if \(i=1\) and \(i' = 1\) if \(i = 2\). Let \(\tilde{T}\) be the \(\left( 2^{N}\times 2\right) \times \left( 2^{N}\times 2\right) \) transition probability matrix defined by \(\tilde{T}_{\left( \left( {\varvec{s}}, G_{i}\right) ,\left( {\varvec{s'}}, G_{i'}\right) \right) }=pT_{{\varvec{s}} \rightarrow {\varvec{s'}}}^{(i)}\) and \(\tilde{T}_{\left( \left( {\varvec{s}}, G_{i}\right) ,\left( {\varvec{s'}}, G_{i}\right) \right) }=\left( 1-p\right) T_{{\varvec{s}} \rightarrow {\varvec{s'}}}^{(i)}\) for \(i \in \{1, 2 \}\). Matrix \(\tilde{T}\) is the following block matrix:

$$\begin{aligned} \tilde{T}=\begin{bmatrix}pT^{(1)} &{} \left( 1-p\right) T^{(1)}\\ pT^{(2)} &{} \left( 1-p\right) T^{(2)} \end{bmatrix}. \end{aligned}$$
(19)

Using \(\tilde{T}\), we rewrite Eq. (18) as

$$\begin{aligned} {{\varvec{x}}\left( t\right) =\tilde{T}{\varvec{x}}\left( t+1\right) ,} \end{aligned}$$
(20)

where

$$\begin{aligned} {\varvec{x}}\left( t\right) \equiv \begin{bmatrix}x_{\left( \left( 0,\ldots ,0\right) ,G_{1}\right) }\left( t\right) \\ \vdots \\ x_{\left( \left( 1,\ldots ,1\right) ,G_{1}\right) }\left( t\right) \\ x_{\left( \left( 0,\ldots ,0\right) ,G_{2}\right) }\left( t\right) \\ \vdots \\ x_{\left( \left( 1,\ldots ,1\right) ,G_{2}\right) }\left( t\right) \end{bmatrix}. \end{aligned}$$
(21)

In fact, \({\varvec{x}}\left( t\right) \) does not depend on t. Therefore, to find the fixation probability, we need to solve

$$\begin{aligned} {{\varvec{x^*}}=\tilde{T}{\varvec{x^*}}.} \end{aligned}$$
(22)

Similar to the derivation of Eq. (8), we find that the fixation probability when there is initially just one mutant on a node selected uniformly at random and the initial network is selected uniformly at random is given by

$$\begin{aligned} {\rho =\frac{1}{2N} \sum _{i=1}^2 \sum _{{\varvec{s}} \in \tilde{S}^{(1)}}x_{\left( {\varvec{s}}, G_i\right) }.} \end{aligned}$$
(23)

3.5 Identifying amplifiers and suppressors of selection

We operationally define amplifiers and suppressors of selection as follows; similar definitions were used in the literature (Lieberman et al. 2005; Voorhees 2013). For a given switching or static network, we computed the fixation probability for several values of r. We say that the network is amplifier of selection if the fixation probability is larger than for that for the complete graph with the same number of nodes, or equivalently, the Moran process, at six values of \(r>1\), i.e., \(r \in \{ 1.1,1.2,1.3,1.4,1.6,1.8 \}\) and a smaller than that for the Moran process at three values of \(r<1\), i.e., \(r \in \{ 0.7,0.8,0.9 \}\). Note that the fixation probability for the Moran process with N individuals is given by (see e.g.  Nowak (2006))

$$\begin{aligned} \rho = \frac{1-\frac{1}{r}}{1-\frac{1}{r^{N}}}. \end{aligned}$$
(24)

Similarly, we say that a network is suppressor of selection if the fixation probability is smaller than for the Moran process at the same six values of r larger than 1 and larger than for the Moran process at the three values of r smaller than 1. It is known that some static networks are neither amplifier nor suppressor of selection (Cuesta et al. 2018).

We note that the Moran process is equivalent to the switching network in which both \(G_1\) and \(G_2\) are the complete graph. In this manner, one can regard that the comparison between a general switching network and the Moran process is that between two temporal networks instead of that between a temporal network and a static network.

3.6 Isothermal theorem

A network is called isothermal if its fixation probability is the same as that for the Moran process, i.e., if Eq. (24) holds true (Lieberman et al. 2005). A static undirected network, which may be weighted, is isothermal if and only if all the nodes have the same (weighted) degree (Lieberman et al. 2005; Allen et al. 2019; Broom and Rychtář 2022). One can easily construct isothermal switching networks as follows.

Theorem 2

If \(G_1\) and \(G_2\) are isothermal networks, then the switching network \(\left( G_1,G_2,\tau \right) \) is an isothermal network.

Proof

The proof is exactly the same as in the static network case as shown in Lieberman et al. (2005); Nowak (2006). We denote by \(p_{m,m-1}\) the probability that the state of the network moves from a state with m mutants to a state with \(m-1\) mutants in one time step. Similarly, we denote by \(p_{m,m+1}\) the probability that the state moves from one with m mutants to one with \(m+1\) mutants in one time step. We observe that \(p_{m,m-1}/p_{m,m+1}=1/r\) at every time step t because the static network at any t, which is either \(G_1\) or \(G_2\), is isothermal. Therefore, the fixation probability for \(\left( G_1, G_2, \tau \right) \) is given by Eq. (24). \(\square \)

Remark 3

The theorem including the present proof holds true both when we initially use \(G_1\) for time \(\tau \) and when the mutant arises at a time selected uniformly at random.

4 Fixation probability in various switching networks

In this section, we analyze the fixation probability in three types of switching networks, i.e., networks with six nodes, larger switching networks in which \(G_1\) and \(G_2\) have symmetry (i.e., complete graph, star graph, and bipartite networks), and empirical networks.

4.1 Six-node networks

We first analyzed the fixation probability in switching networks that are composed of two undirected and unweighted connected networks with 6 nodes. There are 112 non-isomorphic undirected connected networks on 6 nodes. We switched between any ordered pair of different networks, giving us a total of \(112\times 111=12432\) switching networks. It should be noted that swapping the order of \(G_1\) and \(G_2\) generally yields different fixation probabilities. We randomly permuted the node labels in \(G_2\). We did not consider all possible labeling of nodes because there would be at most \(112\cdot 111\cdot 6!=8951040\) switching networks on 6 nodes if we allow shuffling of node labeling, although the symmetry reduces this number.

In Fig. 2a, we show two arbitrarily chosen static networks on six nodes, \(G_1\) and \(G_2\), which are amplifiers of selection as static networks. In Fig. 2b, we plot the fixation probability as a function of the fitness of the mutant, r, for the switching network \((G_1, G_2, \tau =1)\), the static networks \(G_1\) and \(G_2\), the aggregate weighted static network generated from \(G_1\) and \(G_2\), and the Moran process (i.e., complete graph on six nodes). The aggregated weighted static network is the superposition of \(G_1\) and \(G_2\) such that the weight of the edge is either 1 or 2. It is equivalent to the average of \(G_1\) and \(G_2\) over time. All these static and switching networks yield \(\rho = 1/N = 1/6\) at \(r=1\), as expected (see Theorem 1). In addition, there exist differences in \(\rho \) between the different networks and the Moran process although the difference is small. In fact, \(G_1\) and \(G_2\) are amplifiers of selection, with their fixation probability being larger than that for the Moran process when \(r>1\) and vice versa when \(r<1\), confirming the known result (Hindersin and Traulsen 2015; Cuesta et al. 2017). Figure 2b also indicates that the aggregate network is an amplifier of selection. However, the switching network is suppressor of selection.

We reconfirm these results in Fig. 2c, in which we show the difference in the fixation probability between a given static or switching network and the Moran process. If the difference is negative for \(r<1\) and positive for \(r>1\), then the network is an amplifier of selection. If the difference is positive for \(r<1\) and negative for \(r>1\), then the network is a suppressor of selection. Figure 2c shows that \(G_1\) is a stronger amplifier than \(G_2\) and that \(G_2\) is a stronger amplifier than the aggregate network. In contrast, the switching network \((G_1, G_2, 1)\) is a suppressor of selection, while \((G_1, G_2, 10)\) and \((G_1, G_2, 50)\) are amplifiers of selection. The result for \((G_1,G_2, 50)\) is close to that for static network \(G_1\), which is because the evolutionary dynamics on \((G_1, G_2, \tau )\) is equivalent to that on \(G_1\) in the limit \(\tau \rightarrow \infty \). In practice, fixation for networks on six nodes occurs within 50 time steps in many cases, which renders \((G_1,G_2, 50)\) close to \(G_1\). However, we have included the results for \(\tau =50\) because fixation does not occur within 50 time steps in many other cases. When the number of nodes, N, is large, \((G_1, G_2, \tau )\) is a genuine switching network because the fixation times are typically much longer than N (Hindersin et al. 2016). We conclude that switching networks composed of two amplifiers can be a suppressor, in particular when \(\tau \) is small. We emphasize that this counterintuitive result is not due to the property of the aggregate network because the aggregate network, which is the time average of \(G_1\) and \(G_2\), is also an amplifier.

We show the results for the switching network with the order of \(G_1\) and \(G_2\) reversed and those for random initialization time in Appendix A. We find that both \((G_2,G_1,1)\) and the switching network with \(\tau =1\) and random initialization time are suppressors of selection. The fixation probability for the switching network with \(\tau =1\) and random initialization time is the average of that for \((G_1,G_2,1)\) and \((G_2,G_1,1)\). Therefore, the fixation probability for the former lies between that for \((G_1, G_2, 1)\) and \((G_2, G_1, 1)\) at each value of r. Switching networks \((G_2, G_1, \tau )\) and those with random initialization time are amplifiers of selection when \(\tau \) is larger (i.e., \(\tau \in \{ 10, 50 \}\)); this result is qualitatively the same as that for \((G_1,G_2,\tau )\).

To investigate the generality of this finding to other six-node networks, we calculated the fixation probability for the switching networks derived from all possible pairs of six-node networks. Table 1 shows the number of switching networks on six nodes that are amplifiers of selection, that of suppressors of selection, and that of networks that are neither amplifier or suppressor, for four values of \(\tau \). The table indicates that a majority of the six-node switching networks investigated are suppressors of selection when \(\tau = 1\) and \(\tau =3\). This result is in stark contrast to the fact that there is only 1 suppressor of selection among 112 six-node static unweighted networks under the birth-death process (Cuesta et al. 2017; Hindersin and Traulsen 2015). Out of the 111 static networks that are not suppressor, 100 networks are amplifiers, five are isothermal, and the other six networks are neither amplifier, suppressor, nor isothermal (Cuesta et al. 2018, 2017). Most switching networks are amplifiers when \(\tau =50\), which is presumably because most static networks are amplifiers and the birth-death process on \((G_1, G_2, \tau )\) converges to that on \(G_1\) in the limit \(\tau \rightarrow \infty \), as we discussed above.

We also examined the fixation probability for six-node stochastic switching networks introduced in Sect. 3.4. As in the case with deterministic switching, we considered \(112\times 111\) ordered pairs of networks and permuted the node labels of \(G_2\) uniformly at random. We show in Table 2 the number of amplifier of selection, suppressor of selection, and neither type, assuming random initialization time, for \(p \in \{0.3, 0.5, 0.8 \}\). We find that a substantial fraction of these stochastic switching networks is suppressors of selection for each of the three p values (i.e., 36.5% for \(p=0.3\); 47.3% for \(p=0.5\); 24.3% for \(p=0.8\)). These results suggest that the abundance of suppressing switching networks among six-node switching networks is not due to the periodic switching nature of our switching network model.

Fig. 2
figure 2

A suppressing switching network composed of two amplifying static networks on six nodes. a A switching network composed of six nodes. Both \(G_1\) and \(G_2\) are amplifiers of selection. b Fixation probability in the static and switching networks as a function of r. Moran refers to the Moran process. Note that \(G_1\), \(G_2\), the aggregate network, and the Moran process represent static networks. c Difference between the fixation probability for the given network and that for the Moran process

4.2 Larger symmetric switching networks

In this section, we assume symmetry in \(G_1\) and \(G_2\) to calculate the fixation probability for larger switching networks. Specifically, we set \(G_1\) to be the star graph and \(G_2\) to be either the complete graph or complete bipartite graph.

Table 1 Number of amplifiers and suppressors of selection among \(112\cdot 111= 12432\) periodically switching networks on six nodes
Table 2 Number of amplifiers and suppressors of selection among \(112\cdot 111= 12432\) stochastically switching networks on six nodes

4.2.1 Combination of the star graph and the complete graph

Consider switching networks in which \(G_1\) is the star graph and \(G_2\) is the complete graph. For this switching network, we can reduce the dimension of the transition probability matrix from \(2^N \times 2^N\) to \(2N\times 2N\) by exploiting the symmetry in \(G_1\) and \(G_2\). Therefore, one can reduce the number of equations from \(2^N -2\) to \(2N-2\). Specifically, one can uniquely describe the state of the network by (ij), where \(i\in \{0, 1\}\) and \(j \in \{0, \ldots , N-1\}\). We set \(i=0\) and \(i=1\) when the hub node of \(G_1\) is occupied by a resident or mutant, respectively. We set \(j \in \{ 0, 1, \ldots , N-1 \}\) to the number of mutants in the other \(N-1\) nodes, which we refer to as the leaves. Tuple (ij) is a valid expression of the state of the network because the \(N-1\) leaves are structurally equivalent to each other in both \(G_1\) and \(G_2\). Tuples (0, 0) and \((1, N-1)\) correspond to the fixation of the resident and mutant type, respectively.

The transition probability from state \(\left( i,j\right) \) to state \(\left( i',j'\right) \) in a single time step of the birth-death process is nonzero if and only if \((i', j') = (i, j + 1)\) and \(i=1\), \((i', j') = (i, j-1)\) and \(i=0\), \((i', j') = (1-i, j)\), or \((i', j') = (i, j)\). Let \(T^{(1)}\) denote the transition probability matrix for the star graph. We obtain

(25)

where \(C_1= rj+N-j \) and \( C_2 = r(j+1)+N-\left( j+1\right) \) (Lieberman et al. 2005). The first line of Eq. (25) represents the probability that the type of the hub changes from the resident to mutant. For this event to occur, one of the j leaf nodes occupied by the mutant must be chosen as parent, which occurs with probability \(rj/\left( rj+N-j\right) \). Because every leaf node is only adjacent to the hub node, the hub node is always selected for death if a leaf node is selected as parent. Therefore, the probability of i changing from 0 to 1 is equal to \(rj/\left( rj+N-j\right) \), which is shown in the first line of Eq. (25). As another example, consider state \(\left( 1,j\right) \), in which the hub has a mutant, j leaf nodes have mutants, and the other \(N-1-j\) leaf nodes have residents. For the state to change from \(\left( 1,j\right) \) to \( \left( 1,j+1\right) \), the hub node must be selected as parent with probability \(r/\left[ r\left( j+1\right) +N-\left( j+1\right) \right] \), and a leaf node of the resident type must be selected for death, which occurs with probability \((N-1-j)/(N-1)\). The fourth line of Eq. (25) is equal to the product of these two probabilities. One can similarly derive the other lines of Eq. (25).

The transition probability matrix for \(G_2\), which is the complete graph, is given by

(26)

For example, for the transition from state \(\left( 0,j\right) \) to \( \left( 1,j\right) \) to occur, one of the j mutant leaf nodes must be first selected as parent, which occurs with probability \(rj/\left( rj+N-j\right) \). Then, the hub node must be selected for death, which occurs with probability \(1/\left( N-1\right) \). The first line of Eq. (26) is equal to the product of these two probabilities. As another example, for the state to change from \( \left( 1,j\right) \) to \( \left( 1,j+1\right) \), one of the mutant nodes, which may be the hub or a leaf, must be first selected as parent, which occurs with probability \( r\left( j+1\right) /\left[ r\left( j+1\right) +N-\left( j+1\right) \right] \). Then, a leaf node of the resident type must be selected for death, which occurs with probability \( \left( N-1-j\right) /\left( N-1\right) \). The right-hand side on the sixth line of Eq. (26) is equal to the product of these two probabilities. One can similarly derive the other lines of Eq. (26). It should be noted that single-step moves from \(\left( 1,j\right) \) to \(\left( 1,j-1\right) \) and those from \(\left( 0,j\right) \) to \(\left( 0,j+1\right) \) are possible in \(G_2\), whereas they do not occur in \(G_1\).

In Fig. 3a, we plot the fixation probability as a function of r for switching network \((G_1, G_2, \tau )\) in which \(G_1\) is the star graph and \(G_2\) is the complete graph on four nodes. In this figure, we compare \((G_1, G_2, \tau )\) with \(\tau =1\), 10, and 50, the static star graph, the aggregate network, and the Moran process. Figure 3a indicates that \((G_1, G_2, 10)\) and \((G_1, G_2, 50)\) are amplifiers of selection and that \((G_1, G_2, 1)\) is a suppressor. We plot the difference in the fixation probability between the switching networks and the Moran process in Fig. 3b. When \(\tau =1\), the difference is positive for \(r<1\) and negative for \(r>1\), which verifies that \((G_1, G_2, 1)\) is a suppressor. This result is surprising because \(G_1\) is an amplifier of selection and \(G_2\) is equivalent to the Moran process and therefore not a suppressor of selection. In contrast, when \(\tau =10\) and \(\tau =50\), the difference from the Moran process is negative for \(r<1\) and positive for \(r>1\), which verifies that \((G_1, G_2, 10)\) and \((G_1, G_2, 50)\) are amplifiers of selection. The result for \(\tau =50\) is close to that for the star graph. This is presumably because the first \(\tau =50\) steps with \(G_1\) are sufficient to induce fixation with a high probability given the small network size (i.e., \(N=4\)).

Figure 3a and b also indicate that the aggregate network is a weak suppressor of selection. However, the aggregate network is a considerably weaker suppressor of selection than \((G_1, G_2, 1)\). Therefore, we conclude that the suppressing effect of the switching network mainly originates from the time-varying nature of the network rather than the structure of the weighted aggregate network.

We show in Fig. 3c and d the fixation probability and its difference from the case of the Moran process, respectively, as a function of r for \(N=50\). We observe that the switching network is an amplifier of selection for all the values of \(\tau \) that we considered, i.e., \(\tau =1\), 10, and 50. In contrast, the aggregate network is a suppressor of selection albeit an extremely weak one. The amplifying effect of the switching network is stronger for a larger value of \(\tau \). Unlike in the case of four nodes (see Fig. 3a and b), the switching networks with 50 nodes are far less amplifying than the star graph even with \(\tau =50\). This phenomenon is expected because fixation in a static network with 50 nodes usually needs much more than 50 steps.

These results for the switching networks with \(N=4\) and \(N=50\) nodes remain similar for \((G_2, G_1, \tau )\), i.e., when we swap the order of \(G_1\) and \(G_2\) (see Fig. 6a and b).

The present switching network is a suppressor of selection when \(N=4\) and \(\tau =1\) and an amplifier of selection when \(N=50\) or \(\tau \in \{10, 50\}\). To examine the generality of these results with respect to the number of nodes, N, we show in Fig. 3e and f the fixation probability relative to that for the Moran process at \(\tau =1\) and \(\tau =50\), respectively, as a function of N. In both figures, we show the fixation probabilities at \(r=0.9\) and \(r=1.1\). Figure 3e indicates that the switching network is a suppressor of selection for \(N \le 4\) and an amplifier of selection for \(N \ge 5\) when \(\tau = 1\). We have confirmed that this switching network with \(N=3\) nodes is a suppressor of selection by calculating the fixation probability across a range of r values (see Fig. 7a in Appendix B). Figure 3f indicates that \((G_1, G_2, 50)\) is an amplifier of selection for any N.

Fig. 3
figure 3

Fixation probability for switching networks in which \(G_1\) is the star graph and \(G_2\) is the complete graph. a Fixation probability for \(N=4\). b Difference in the fixation probability from the case of the Moran process for \(N=4\). c Fixation probability for \(N=50\). d Difference in fixation probability from the case of the Moran process for \(N=50\). In ad, we also show the results for \(G_1\) (i.e., star graph) and the aggregate network, and the vertical lines at \(r=1\) are a guide to the eyes. The insets magnify selected ranges of \(r<1\). e and f: Difference in the fixation probability for the switching network relative to the Moran process as a function of N at \(r=0.9\) and 1.1. We set \(\tau =1\) in e and \(\tau =50\) in f. In e and f, the smallest value of N is three

4.2.2 Combination of the star graph and the complete bipartite graph

In this section, we analyze the switching network in which \(G_1\) is the star graph and \(G_2\) is the complete bipartite graph \(K_{N_{1},N_{2}}\). By definition, \(K_{N_{1}, N_{2}}\) has two disjoint subsets of nodes \(V_1\) and \(V_2\), and \(V_1\) and \(V_2\) contain \(N_1\) and \(N_2 \) nodes, respectively. Every node in \(V_1\) is adjacent to every node in \(V_2\) by an edge. Therefore, every node in \(V_2\) is adjacent to every node in \(V_1\). Without loss of generality, we assume that the hub node in \(G_1\) is one of the \(N_1\) nodes in \(V_1\).

Because of the symmetry, we do not need to distinguish among the \(N_1 - 1\) nodes that are leaf nodes in \(G_1\) and belong to \(V_1\) in \(G_2\), or among the \(N_2\) nodes that belong to \(V_2\) in \(G_2\). Therefore, one can specify the state of this switching network by a tuple (ijk), where \(i \in \{0,1 \}\) represents whether the hub is occupied by a resident, corresponding to \(i=0\), or mutant, corresponding to \(i=1\); variable \(j \in \{0, \ldots , N_1 - 1\}\) represents the number of mutants among the \(N_1 - 1\) nodes that are leaves in \(G_1\) and belong to \(V_1\) in \(G_2\); variable \(k \in \{0, \ldots , N_2 \}\) represents the number of mutants among the \(N_2\) nodes in \(V_2\). Tuples (0, 0, 0) and \((1, N_1-1, N_2)\) correspond to the fixation of the resident and mutant type, respectively. Using this representation of the states, we reduce the \(2^N \times 2^N\) transition probability matrix to a \(2N_{1}\left( N_{2}+1\right) \times 2N_{1}\left( N_{2}+1\right) \) transition probability matrix. We show the transition probabalities \(T^{(1)}\) and \(T^{(2)}\) in Appendix C.

In Fig. 4a and b, we show the fixation probability and its difference from the case of the Moran process, respectively, for the switching network in which \(G_1\) is the star on \(N=4\) nodes and \(G_2\) is the complete bipartite graph \(K_{N_1, N_2} \) with \(N_1 = N_2 = 2\). We set \(\tau =1,10\), and 50, and varied r. We also show the results for \(G_1\), \(G_2\), and the aggregate network in these figures for comparison. We find that \((G_1, G_2, 1)\) is a suppressor of selection. In contrast, \(G_1\) is an amplifier of selection, and \(G_2\) is neutral (i.e., equivalent to the Moran process). In fact, no static unweighted network with five nodes or less is a suppressor of selection (Cuesta et al. 2017). Because the aggregate network is an amplifier of selection, albeit a weak one, the suppressing effect of \((G_1, G_2, 1)\) owes to the time-varying nature of the switching network. Similar to the case in which \(G_2\) is the complete graph shown in Fig. 3, \((G_1, G_2, 10)\) and \((G_1, G_2, 50)\) are amplifiers of selection, and the behavior of \((G_1, G_2, 50)\) is close to that for \(G_1\), i.e., the star graph.

In Fig. 4c and d, we show the fixation probability and its difference from the case of the Moran process, respectively, for \(N_1 = N_2 = 20\). We have set \(N = N_1 + N_2 = 40\) as opposed to \(N = 50\), which we used for the switching network analyzed in Sect. 4.2.1, because of the computational cost. In contrast to the case of \(N_1 = N_2 = 2\), the switching network with \(N_1 = N_2 = 20\) is an amplifier of selection for the three values of \(\tau \). Furthermore, in contrast to when \(N_1 = N_2 = 2\), the fixation probabilities for the switching networks are closer to those for the Moran process than to those for the star graph. To explore the case \(N_1 \ne N_2\), we show the results for \(\left( N_1,N_2\right) =\left( 4,2\right) \) and \(\left( N_1,N_2\right) =\left( 30,10\right) \) in Appendix D. The switching network with \(\left( N_1,N_2\right) =\left( 4,2\right) \) is neither amplifier or suppressor of selection. However, its fixation probabilities are close to those for the Moran process than to those for the star or bipartite complete graph. The switching network with \(\left( N_1,N_2\right) =\left( 30,10\right) \) is an amplifier of selection and behaves similarly to the switching network with \(\left( N_1, N_2\right) = \left( 20, 20 \right) \).

These results for the switching networks with \(N=4\) and \(N=40\) nodes remain similar for switching networks \((G_2, G_1, \tau )\), as we show in Fig. 6c and d.

To examine the dependence of the fixation probability on the number of nodes, we show in Fig. 4e the difference between the fixation probability for the present switching network and that for the Moran process as we vary N. We set \(\tau =1\) and \(N_1=N_2 = N/2 \ge 2\), and compute the fixation probability at \(r=0.9\) and \(r=1.1\). Figure 4e indicates that the switching network is a suppressor of selection only when \(N_1=N_2=2\) (i.e., \(N=4\)) and amplifier of selection for any larger N. When we allow \(N_1 \ne N_2\), we found just one additional suppressor of selection apart from \((N_1, N_2) = (2, 2)\) under the constraints \(\tau =1\) and \(2\le N_1, N_2 \le 10\), which is \((N_1, N_2) = (3, 2)\) (see Fig. 7b in Appendix B). With \(\tau = 50\), this switching network is amplifier of selection for any N (see Fig. 4f).

Fig. 4
figure 4

Fixation probability for switching networks in which \(G_1\) is the star graph and \(G_2\) is the complete bipartite graph. a Fixation probability for \(N_1=N_2=2\). b Difference in the fixation probability from the case of to the Moran process for \(N_1=N_2=2\). c Fixation probability for \(N_1=N_2=20\). d Difference in the fixation probability from the case of the Moran process for \(N_1=N_2=20\). e and f: Difference in the fixation probability for the switching network relative to the Moran process as a function of N at \(r=0.9\) and 1.1. We set \(\tau =1\) in e and \(\tau =50\) in f. In e and f, the smallest value of N is four

4.3 Empirical temporal networks

4.3.1 Construction of switching networks

Finally, we numerically simulate the birth-death process on four switching networks informed by empirical temporal network data. We split each of the temporal network data set into two static networks \((V_1, E_1)\) and \((V_2, E_2)\), where \((V_1, E_1)\) contains the first half of the time-stamped edges in terms of the time, \((V_2, E_2)\) containing the second half of the time-stamped edges, \(V_1\) and \(V_2\) are sets of nodes, and \(E_1\) and \(E_2\) are sets of edges. For simplicity, we regard \((V_1, E_1)\) and \((V_2, E_2)\) as unweighted networks. We note that the purpose of studying these empirical networks is not to examine how fixation occurs in real contact sequences but to explore the generality of the results obtained in the previous sections in asymmetric and large switching networks.

For two of the four empirical switching networks, both \(V_1\) and \(V_2\) contain all nodes. In this case, we switch between \(G_1 \equiv (V_1, E_1)\) and \(G_2 \equiv (V_2, E_2)\). For the other two empirical switching networks, either \(V_1\) or \(V_2\) misses some nodes in the original temporal network. In this case, we construct switching networks in the following two manners. With the first method, we only use the nodes in \(V_1 \cap V_2\) and the edges that exist between pairs of nodes in \(V_1 \cap V_2\) as \(G_1\) and \(G_2\). For each of the two empirical data sets for which \(V_1\) or \(V_2\) misses some nodes, we have confirmed that the first and second halves of the static networks induced on \(V_1\cap V_2\) created with this method are connected networks. With the second method, we use all nodes for both \(G_1\) and \(G_2\). In other words, we set \(G_1 = (V_1 \cup V_2, E_1)\) and \(G_2 = (V_1 \cup V_2, E_2)\). Therefore, if \(v \in V_1\) and \(v \notin V_2\), for example, then v is an isolated node in \(G_2\). Except with special initial conditions, the fixation of either type never occurs in a static network with isolated nodes. However, the fixation does occur in the switching network if the aggregate network is connected, which we have confirmed to be the case for all our empirical data sets.

4.3.2 Simulation procedure

As the initial condition, we place a mutant on one node selected uniformly at random and all the other \(N-1\) nodes are of the resident type. Then, we run the birth-death process until all nodes were of the same type. We carried out \(2 \times 10^5\) such runs in parallel on 56 cores, giving us a total of \(112 \times 10^5\) runs, for each network and each value of r. We numerically calculated the fixation probability as the fraction of runs in which the mutant fixates. We simulated the switching networks with \(\tau \in \{1, 10, 50\}\) and \(r \in \{0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7\}\) for all the networks except the hospital network of 75 nodes. For the hospital network, we omitted \(r=1.6\) and 1.7 due to high computational cost.

4.3.3 Data

The ants’ colony data, which we abbreviate as ant (Quevillon et al. 2015), has 39 nodes and 330 time-stamped edges. Each node represents an ant in a colony. An edge represents a trophallaxis event, which was recorded when the two ants were engaged in mandible-to-mandible contact for greater than one second. The first and second halves of the data have 34 nodes each.

The second data is the contacts between members of five households in the Matsangoni sub-location within the Kilifi Health and Demographic Surveillance Site (KHDSS) in coastal Kenya (Kiti et al. 2016). A household was defined as the group of individuals who ate from the same kitchen (Kiti et al. 2016). Each participant in the study had a wearable sensor that detected the presence of another sensor within approximately 1.5 ms. Each node is an individual in a household. An edge represents a time-stamped contact between two individuals. There were 47 nodes. There were 219 time-stamped edges representing contacts between pairs of individuals in different households and 32, 426 time-stamped edges between individuals of the same households. Both the first and second halves contain all the 47 nodes and are connected networks as static network owing to the relatively large number of time-stamped edges.

The third data is a mammalian temporal network based on interaction between raccoons (Reynolds et al. 2015). A node represents a wild raccoon. The time-stamped events were recorded whenever two raccoons came within approximately 1 to 1.5 ms for more than one second, using proximity logging collars that were placed on raccoons. The recording was made in Ned Brown Forest Preserve in suburban Cook County, Illinois, USA, from July 2004 to July 2005. There are 24 nodes and 2, 000 time-stamped edges. Both the first and second halves of the data contain all the 24 nodes and are connected networks as static network.

The fourth data is a contact network in a hospital (Vanhems et al. 2013). The data were recorded in a geriatric unit of a university hospital in Lyon, France, from December 6, 2010 at 1 pm to December 10, 2010 at 2 pm. The unit contained 19 out of the 1, 000 beds in the hospital. During the recording period, 50 professionals worked in the unit, and 31 patients were admitted. Fourty-six among the 50 professionals and 29 among the 31 patients participated in the study. Therefore, the network had 75 nodes in total. The professionals comprised of 27 nurses or nurses’ aides, 11 medical doctors, and 8 administrative staff members. An edge represents a time-stamped contact between two individuals; there are 32, 424 time-stamped edges. The first and second halves of the data contain 50 nodes each.

We obtained the ant, raccoon, and hospital data from https://networkrepository.com/ (Rossi and Ahmed 2015). We obtained the Kilifi data from http://www.sociopatterns.org/.

4.3.4 Numerical results

We investigate the fixation probability on the switching networks with \(\tau =1\), 10, and 50, static networks \(G_1\) and \(G_2\), and the aggregate network. We remind that the aggregate network is a static weighted network, whereas \(G_1\) and \(G_2\) are unweighted networks. For the ant and hospital data, the switching networks constructed with the second method are different from those constructed with the first method. For these two data sets, fixation does not occur on \(G_1\) and \(G_2\) because they miss some nodes. Therefore, we do not analyze the fixation probability on \(G_1\) and \(G_2\) for these data sets.

We show in Fig. 5a and b the fixation probability on the ant switching networks constructed with the first and second methods, respectively. Because we are interested in whether the switching networks are amplifiers or suppressors of selection, we only show the difference between the fixation probability on the given network and that for the Moran process in Fig. 5. Figure 5a indicates that the switching networks are amplifiers of selection but less amplifying than each of its constituent static networks, \(G_1\) and \(G_2\). Another observation is that the fixation probability on the static aggregate network is close to that on the switching networks. In this sense, the switching networks do not yield surprising results. The switching networks are more strongly amplifying when \(\tau \) is larger. Moreover, the fixation probability on the switching network is closer to that on \(G_1\) when \(\tau \) is larger. This result is expected because the evolutionary dynamics is the same between the switching networks and \(G_1\) in the first \(\tau \) time steps. For the switching networks constructed with the second method, Fig. 5b shows that the switching networks are amplifiers and more amplifying than the static aggregate network. This result is qualitatively different from that for the switching networks constructed with the first method shown in Fig. 5a.

We show the results for the Kilifi networks in Fig. 5c. Because the first and second methods yield the same \(G_1\) and \(G_2\) for the Kilifi data, we only present the results for the first method for this data set and also for the next one (i.e., racoon networks). The figure indicates that the switching networks are amplifiers but less amplifying than \(G_1\) and \(G_2\) and similarly amplifying compared to the aggregate network. These results are similar to those for the ant networks shown in Fig. 5a.

We show the results for the raccoon networks in Fig. 5d. We find that the switching networks are amplifiers but less amplifying than \(G_1\) and \(G_2\), similar to the case of the ant and Kilifi networks. We also find that the switching networks are more amplifying than the aggregate network.

We show the results for the hospital switching networks in Fig. 5e and f. The results for the switching networks constructed with the first method (see Fig. 5e) are similar to those for the raccoon networks shown in Fig. 5d. The switching networks constructed with the second method (see Fig. 5f) are more amplifying than the aggregate network, similar to the case of the ant networks generated by the same method (see Fig. 5b).

In sum, for these empirical temporal networks, we did not find a surprising result that the fixation probability for the switching networks is not an interpolation of those for the two static networks \(G_1\) and \(G_2\). However, the fixation probability for the empirical switching networks depends on the \(\tau \) value and deviates from the prediction from the aggregate network in multiple ways.

Fig. 5
figure 5

Fixation probability on empirical switching networks. In each panel, we show the difference in the fixation probability from the case of the Moran process as a function of r. a Ant networks constructed with the first method. b Ant networks constructed with the second method. c Kilifi switching networks. d Raccoon networks. e Hospital networks constructed with the first method. f Hospital networks constructed with the second method. We compared the fixation probability on switching networks with \(\tau \in \{1, 10, 50\}\), \(G_1\), \(G_2\), and the aggregate network

5 Discussion

We have shown that, under the birth-death updating rule and uniform initialization, a majority of the switching networks on six nodes are suppressors of selection. This result contrasts with the case of static networks, for which there exists only one suppressor of selection on six nodes (Cuesta et al. 2017). We also found that switching networks alternating between the star graph and the complete graph and those alternating between the star graph and the complete bipartite graph are suppressors of selection when the number of nodes, N, is small. When N is larger, the same switching networks are amplifiers of selection but less amplifying than the star graph. Among the empirical networks that we analyzed, we did not find any suppressors. However, these switching networks were notably less amplifying than the constituent static networks \(G_1\) and \(G_2\). In fact, the less amplifying nature of switching networks is largely explained by the aggregate weighted network, or the static network obtained by the superposition of \(G_1\) and \(G_2\). Therefore, our results for the empirical switching networks are not surprising. The result that the switching network composed of two amplifying static networks can be suppressor is our main finding. Because all the instances that we have found are small networks, searching suppressing switching networks with larger N including systematically constructing such instances remains future work.

Our choices of the larger networks are primarily driven by computational feasibility. The complete graph, star graph, and complete bipartite graph are convenient families of networks owing to their highly symmetric nature, which drastically reduces the number of the unknowns to be determined. Similarly, all the empirical networks that we used had at most 75 nodes due to computational cost. Additionally, we avoided disconnected and sparse networks because fixation requires a network to be connected, and splitting a sparse network into two networks often resulted in disconnected components. Nevertheless, by studying small networks, larger symmetric networks, and the empirical examples, we tried to provide a broader picture of the evolutionary dynamics on switching networks. However, there remains ample room for future work. For instance, faster algorithms for approximate computation for larger switching networks, such as those assuming weak selection (Allen et al. 2021), remain to be explored. We could also attempt to reduce simulation times. In Chatterjee et al. (2017), instead of sampling every time step of the evolutionary dynamics, only ‘effective’ steps are sampled. Effective steps are defined as those in which the network state changes. The steps in which a resident replaces a resident or a mutant replaces a mutant are deemed as ineffective steps, which one does not sample in their algorithm, hence accelerating the overall simulation time. Additionally, we studied switching networks with only two snapshots. It is straightforward to extend the present computational framework to the case of switching networks with more than two snapshots. Last, many temporal network data are provided as a list of time-stamped events between pairs of nodes. Evolutionary dynamics driven by such event-based temporal network data is also worth studying.

We considered exogenous changes of the network over time in this study. Another opportunity of research is to assume that the change of the network structure over time is driven by the state of the system, which is referred to as adaptive networks (Gross and Blasius 2008; Sayama et al. 2013). The recent modeling framework inspired by biological examples in which the residents and mutants use different static networks defined on the same node set (Tkadlec et al. 2021; Melissourgos et al. 2022) can be interpreted as an example of fixation dynamics on adaptive networks. Allowing nodes to stochastically sever and create edges they own as the node’s type flips from the resident to mutant and vice versa may lead to new phenomena in fixation dynamics. Such models have been extensively studied for evolutionary games on dynamic networks (Santos et al. 2006; Pacheco et al. 2006; Fu et al. 2009).

We recently found that most hypergraphs are suppressors of selection under the combination of a birth-death process and uniform initialization, which are the conditions under which most of conventional networks are amplifiers of selection (Liu and Masuda 2023). It has been longer known that most undirected networks are suppressors of selection under the death-birth process (Hindersin and Traulsen 2015), and in directed networks under various imitation rules including birth-death processes (Masuda 2009). The degree of amplification and suppression also depends on the initialization (Adlam et al. 2015; Pavlogiannis et al. 2018). For example, non-uniform initializations can make the star, which is a strong amplifier of selection under the birth-death process and uniform initialization, a suppressor of selection (Adlam et al. 2015). Furthermore, it has been shown that the amplifiers of selection are transient and bounded (Tkadlec et al. 2020). Our results suggest that small temporal networks are another major case in which suppressors of selection are common. These results altogether encourage us to explore different variants of network models and evolutionary processes to clarify how common amplifiers of selection are. This task warrants future research.