# Dynamical Recovery of Complex Networks under a Localised Attack
## 2 Model and Results  
Here, we assume that the \(p\) fraction of nodes subject to localised failure at each time, which means that these inactive \(p\cdot N\) nodes are independent of other inactive nodes. This is assumed as the internal failure, and the external failure is dependent on nodes' active neighbours. For the case of external failure, we assume that if a node \(i\) has no more than \(m\) active neighbours, it will fail with probability \(r\). Meanwhile, different from the normal dynamics, the inactive nodes suffering internal or external failure will spontaneously conduct internal or external recovery after a period of time \(\tau\) or \(\tau^{{}^{\prime}}\). For example, an ecological network is damaged by extreme weather (internal failure) and influences deterioration of the surrounding environment (external failure). Additionally, the inactive nodes triggered by different failure mechanisms will have different internal and external recovery times. Imagining that on each failed node, a small clock is activated to measure the time \(l\) passed since the last failure of the node. As the time \(l\) reaches value \(\tau\) or \(\tau^{{}^{\prime}}\), the node completely internally or externally recovers. The schematic illustration is shown in Figure 1, and for simplicity, we set that there will be two nodes internally failing, and \(m=1,r=1,\tau=2\), and \(\tau^{{}^{\prime}}=1\). The network system will go through four procedures, in turn, at each step: internal failure, external failure, internal recover, and external recover. As shown in Figure 1, a blue node represents an active node. A red (Purple) node is in an internal (external) failure state, and the lighter the colour, the larger the \(l\). We perform numerical simulations for random regular (RR) networks with a Kronecker delta degree distribution (\(P(k)=\delta_{k<k>}\)), Erdos-Renyi (ER) networks with a Poissonian degree distribution (\(P(k)=\frac{\epsilon^{-ck>}-\frac{<k>}{k}}{E^{2}}\)) [26], and Scale-Free (SF) networks with a power law degree distribution (\(P(k)\sim k^{-\lambda}\)) [27]. Here, \(<k>\) is the average degree of the network, and \(\lambda\) is the power law index of SF network. In simulations, without a loss of generality, we adopt the recovery times \(\tau=100\) and \(\tau^{{}^{\prime}}=1\). In view of the relationship between \(p\) and \(\tau\) in ref. [12], we define the parameter \(p^{*}=1-e^{-p\tau}\) as representing the internally failed nodes. Figure 2 shows a fraction \(z(t)\) of the average active nodes for the RR network with an average degree \(<k>=10\) as a function of \(t\) at the same \(p^{*}\) but a different dynamic process. We set \(m=4,r=0.78\), and a fraction \(p=0.3\) of nodes are initially localised failure. Since the system dynamically alternates between localised failure and spontaneous recovery at every step, this dynamic process with memory means the previous stable state will affect the next system state. \(p^{*}\) denotes the the average fraction of internally failed nodes, and it can change from 0 to 1 and then turn to change from 0 to 1. Since the initial state under each \(p^{*}\) depends on the final stable state of the previous \(p^{*}\), the same \(p^{*}\) at a different direction may have a different result. As shown in Figure 2, we simulated the results of the RR network for all \(p^{*}\) with a step size of 0.01. In Figure 2a, \(p^{*}\)= 0.3 (\(p^{*}\) changes from 0 to 1) depends on the final stable state of \(p^{*}\)= 0.29, but the second \(p^{*}\)= 0.3 (\(p^{*}\) changes from 1 to 0) shown in Figure 2b depends on the final stable state of \(p^{*}\)= 0.31. The result in this figure shows that the active nodes changed over time in the increasing direction, and the eventually stable fraction is close to 0.69. However, for the decreasing direction, \(z(t)\) tends to be stable at around 0.17, and it is very different from the previous one. Due to the memory nature during system failure and recovery, the same \(p^{*}\) value at different directions leads to different states, respectively.