An Adaptive Optimization Spiking Neural P System for Binary Problems

Optimization Spiking Neural P System (OSNPS) is the ﬁrst membrane computing model to directly derive an approximate solution of combinatorial problems with a speciﬁc reference to the 0/1 knapsack problem. OSNPS is composed of a family of parallel Spiking Neural P Systems (SNPS) that generate candidate solutions of the binary combinatorial problem and a Guider algorithm that adjusts the spiking probabilities of the neurons of the P systems. Although OSNPS is a pioneering structure in membrane computing optimization, its performance is competitive with that of modern and sophisticated metaheuristics for the knapsack problem only in low dimensional cases. In order to overcome the limitations of OSNPS, the present paper proposes a novel Dynamic Guider algorithm which employs an adaptive learning and a diversity based adaptation to control its moving operators. The resulting novel membrane computing model for optimization is here named Adaptive Optimization Spiking Neural P System (AOSNPS). Numerical result shows that the proposed approach is effective to solve the 0/1 knapsack problems and outperforms multiple various algorithms proposed in the literature to solve the same class of problems even for a large number of items (high dimensionality). Furthermore, case studies show that a AOSNPS is effective in fault sections estimation of power systems in different types of fault cases: including a single fault, multiple faults and multiple faults with incomplete and uncertain information in the IEEE 39 bus system and IEEE 118 bus system.


Introduction
Artificial neural networks (ANNs), also referred to as neural networks (NNs) or connection mod-els, are computational models consisting of interconnected neurons 10; 17 that mimic the behavioral characteristics of biological neural networks and perform distributed parallel information processing.ANNs have been extensively investigated and widely used in various fields, such as signal and image processing 13; 15; 82 , classification 4 , pattern recognition 7; 37 , earthquake prediction 1; 51; 52 , epilepsy and seizure detection 27; 28 , medical diagnostics 47 , and optimization 2; 3; 5; 12; 11 .
In the last decades, ANNs have passed three developmental generations with notable characteristics.
• The fundamental feature of the first generation is McCulloch-Pitts neurons 55 (perceptrons or threshold gates), where only Boolean functions 41 can be processed and output digital results.• The salient feature of the second generation is the presence of an activation function with weighted learning ability and the fact that analog input and output can be processed 41 .• The introduction of time 18 (single action spiking of the neuron) concept when neurons encode information is a prominent feature of the third generation of ANNs.
Spiking Neural Networks (SNNs) present a successful ANN structure belonging to the second 40 and third generations 23; 56; 60; 26; 24 .The success of SNNs is due to the fact that they are both computationally powerful and biologically plausible models of neuronal processing 53; 16; 81; 45; 79 .Some successful implementations of SNN are reported in Ref. 42; 57; 20; 22; 80 while a successful implementation in the medical domain is presented in Ref. 25 .
Over the past two decades, in parallel with the development of ANNs, other computational devices attracted attention.Specifically, Membrane Computing 54 increased significantly its popularity, gaining relevance as a computational paradigm.Membrane computing is a branch of natural computing which designs computing models, called P systems, inspired from the structure and the functioning of the biological cells.Most of P systems can be viewed as a general purpose automaton equivalent to the Turing Machine 74 .Due to their general purpose nature, P Systems can be used in a broad range of real-world applications, such as computer graphics 21 , cryptography 74 and robot control 8; 64 .
Membrane computing models can be divided into three categories on the basis of their structure: • cell-like P systems, inspired by the intracellular communication 54 ; • tissue-like P systems, inspired by intercellular communication 44 ; • neural-like P systems, inspired by the communication among neurons 44 , just like an ANN.
Hence, at the conceptual level, neural-like P systems can be viewed as an intersection between ANN and Membrane Computing.Although the conceptual definitions of neural P systems have been given in Ref 44 , one of their greatest success stories leading to practical use is due to the Spiking Neural P Systems (SNPS) 35 , which integrate the SNN logic within Membrane Computing.Unlike the other P systems 14; 21; 74 which use multiple symbols to encode the pieces of information required, SNPS 35; 50; 71 usually deal with a unique symbol, namely spike, that is repeated multiple times, see also Ref. 49; 34 .The name "spike" is due to the analogy with electrical impulses sent from a neuron to another one along the synapses.Among the various membrane computing models, SNPS is one of the most promising and studied 9; 48; 59; 58 .The SNPS consists of a set of neurons placed in the nodes of a graph and sending signals (spikes) along synapses (edges of the graph), under the control of firing and forgetting rules 68; 69; 70; 73 .One neuron is designated as the output neuron of the system and its spikes can be sent out into the environment, thus producing a different interpretations of the result, including: 1) the number of spikes sent out into the environment in total, along the computation; 2) the number of steps between the first two spikes sent to the environment; 3) a so-called spike-train, as the sequence of spikes sent out all along the computation (in every step, 0 or more spikes are sent out into the environment.).
This paper focuses on SNPS and in particular on its use for addressing optimization problems.The first study of solving combinatorial optimization problems by means of SNPS was proposed in Ref. 78 where the 0/1 Kanpsack Problem was ad-dressed.In Ref. 78 an Extended SNPS (ESNPS) was obtained by introducing two additional neurons, the probabilistic selection of evolution rules and the output (spike train) collection from multiple neurons.In such work, multiple ESNPS are arranged in parallel, each of them generating a candidate solution.Furthermore, in Ref. 78 a Guider algorithm has been introduced to adjust probabilities of the spiking rules (by continuous learning generation by generation).The resulting computational model, namely Optimization Spiking Neural P System (OS-NPS), appeared to be promising and displayed a performance competitive in comparison with that of six optimization algorithms taken as a reference.
As indicated in Ref. 78 , one of the main limitations of OSNPS lies in the fact that the learning rate is constant, while the search may require a different learning rate in different moments of the search.Due to this limitation, it was observed in Ref. 78 that the probability variation operated by the Guider algorithm does not always allow an effective learning of the family of SNPS.Thus the performance of the OSNPS is not as good as that of some modern metaheuristics, especially when a large number of items is considered in the knapsack problem.For the sake of clarity, it must be remarked that unlike membrane-inspired evolutionary algorithms (MIEAs) 32; 38; 76; 77 that combine a P system framework with metaheuristic algorithms to solve optimization problems, OSNPS uses only SNPS to generate the candidate solutions of the combinatorial optimization problems.
The present paper extends the work of Ref. 78 and proposes a novel algorithm, namely Adaptive Optimization Spiking Neural P System (AOSNPS) to solve combinatorial problems with binary encoding.More specifically, a novel adaptive learning rate and adaptive mutation are proposed and integrated within OSNPS.In addition, the proposed AOSNPS includes a mutation operator governed by two dynamic parameters that estimate the accuracy of the candidate solution and diversity of probability matrices.The proposed mutation enhances upon the balance between exploration and exploitation features of OSNPS.Finally, the real application of AOS-NPS to fault section estimation of power systems.This is the first time to use AOSNPS to solve real application problems.When the status information of protective relays and circuit breakers read from a supervisory control and data acquisition system is input, AOSNPS can automatically search and output fault sections.Case studies show that AOSNPS is effective in fault sections estimation of power systems in different types of fault cases including single fault, multiple faults and multiple faults with incomplete and uncertain information.
The remainder of this study is organized as follows: Section 2 briefly introduces the used notation, the basics of SNPS theory used in this article as well as the OSNPS as in its original implementation 78 .Section 3 presents the proposed AOSNPS consisting adaptive learning rate, adaptive mutation and the novel guider.The numerical results obtained by the algorithm proposed when applied to the 0/1 knapsack problem are shown in Section 4, while an application to power systems, is given in Section 5. Finally, conclusion and future work are given in Section 6.

Background: Problem and Optimization by Spiking Neural P Systems
In this section, we briefly introduce the notation and analyse the basic concepts of optimization by SNPS.We address the minimisation/maximisation of a function f (x) where x = (x 1 , x 2 , . . .x m ) is a vector of binary numbers.The SNPS 35 is an automaton.The distinguishing feature of SNPS is that the sequence of configurations can associate a spike train 36; 43; 78 .If the output neuron spikes, then we have 1 and otherwise we have 0. Hence, the spike train can be represented by the sequence of ones and zeros.Here, we give an extended definition of SNPS.

Extended Spiking Neural P System
Formally, an extended spiking neural P system (abbreviated as ESNPS), of degree (m, q) with m, q ≥ 1, is a tuple of the form Π = (O, σ 1 , . . ., σ m , σ m+1 , . . ., σ m+q , syn, I out ) where: (1) O = {a} is the singleton alphabet (a is called spike); (2) σ i , 1 ≤ i ≤ m + q, is an ordered tern (n i , R i , P i ) such that: P m+1 , . . ., P q are the identically one functions. ( An ESNPS, Π, of degree (m, q), with m, q ≥ 1 can be viewed as a set of neurons {σ 1 , . . ., σ m , σ m+1 , . . ., σ m+q } placed in the nodes of a directed graph G Π , where the set syn specifies the arcs of the graph which are labeled by natural numbers representing the delays associated with synapses: D syn (σ i , σ j ) will denote the label associated with the arc (σ i , σ j ).If (σ i , σ j ) ∈ syn then we say that σ i is a pre-synaptic neuron of σ j or σ j is a postsynaptic neuron of σ i .In these systems there are two kind of neurons: σ 1 , . . ., σ m are called working neurons, some of them can also act as output neurons, whereas σ m+1 , . . ., σ m+q are supplier neurons that can send spikes to each working neuron.For each neuron σ i , n i is the number of spikes initially contained in that neuron, R i is a finite set of (spiking and/or forgetting) rules with probabilities associated by means of functions P i .
The semantics of such an ESNPS, Π, is defined as follows.A configuration C t at a moment t (a natural number, t ≥ 0) of an ESNPS of degree (m, q) is a tuple (p 1 , . . ., p m+q ) where p i , 1 ≤ i ≤ m + q, describes the number of spikes present in the neuron σ i at instant t.The initial configuration of Π, that is, the configuration at moment t = 0, is (n 1 , . . ., n m+q ), being σ i = (n i , R i , P i ), for 1 ≤ i ≤ m + q.
A spiking rule E/a c → a; d ∈ R i is applicable to a configuration C t , at the moment t, if the neu-ron σ i contains exactly k ≥ c spikes at instant t and a k ∈ L(E).By applying such a rule, c spikes are consumed from the neuron σ i , it is fired and all postsynaptic neurons σ j from the neuron σ i would receive p spikes from neuron σ i , at step t + D syn (i, j) + 1, that is, if D syn (i, j) = 0, then the spikes are received by such postsynaptic neuron σ j immediately, otherwise the spikes are received after D syn (i, j) steps.A forgetting rule a s → λ ∈ R i is applicable to a configuration C t at the moment t if the neuron σ i contains exactly s spikes at instant t.By applying such a rule, s spikes are removed from the neuron σ i .
In each time unit, if neuron σ i is enabled (i.e., one of its rules can be used), then one rule from R i (and only one) must be applied, chosen nondeterministically among all possible rules applicable to σ i .That is, each neuron processes sequentially its spikes by using, at most, one rule in each time unit.Let us recall that a spiking rule and a forgetting rule cannot be simultaneously applied to a neuron.The rules are used in a maximally parallel way at the level of the system: at each step, all neurons which can use some rule, must evolve using one rule.
Using the rules of the system in the way described before, a configuration C t+1 can be reached from another configuration C t ; such a step is called a transition step, and we denote it by C t =⇒ C t+1 .Any (finite or infinite) sequence of transitions is a computation if the following holds: (a) the first term of the sequence, C 0 , is the initial configuration of the system; (b) for each n, the (n+1)-th term of the sequence is obtained from the n-th term in one transition step; and (c) if the sequence is finite (called halting computation) then the last term C r , r ∈ N, of the sequence is called a halting configuration, that is, a configuration where no rule of the system is applicable to it.
In order to propose a novel algorithm, AOS-NPS, to solve combinatorial optimimization problems, a specific ESNPS (where q = 2 and n i = 1), is considered with the following syntactical restrictions: where (1) O = {a} is the singleton alphabet, a is called spike (2) σ 1 , . . ., σ m are neurons of the form Further comments on the neurons are (a) in each neuron σ i , there is only 1 initial spike, i.e.

Optimization Spiking Neural P System
The OSNPS is composed of multiple parallel ES-NPSs and a Guider algorithm, that supervises the family of ESNPSs, as shown in Fig. 2. Each ESNPS i , with 1 ≤ i ≤ H, has the structure shown in Fig. 1.The Guider algorithm in Fig. 2 is used to adjust the probabilities P i of each ESNPS i .The input of the Guider algorithm is a spike train T s , that is a set of H binary strings/candidate solutions of length m (a binary matrix of H × m elements) produced by each ESNPS i .The output of the Guider algorithm is the rule probability matrix P R = [p 1 ij ] H×m (the apex 1 indicates the probability of the bit to be 1), which is composed of the spiking rule probabilities of H ESNPSs, i.e.,

21:
else 22: 26: Fig. 3 provides the details of the Guider algorithm used in OSNPS 78 .The basic idea is that one current best solution (binary vector) is stored in memory and two candidate solutions x k1 and x k2 are randomly selected, with a certain probability p a j , and compared on the basis of a fitness (objective function) f .If appropriate, the constraints are handled.
If x k1 and x k2 are generated, for each design variable x j , the current solution is perturbed (x inherits the design variable of the winning candidate solution).Then, the probability associated with the most successful solution is increased by a constant learning rate ∆.Conversely, the probability associated with the candidate solution displaying a lower performance is reduced.If x k1 and x k2 are not generated, the binary variable of x j is directly used to affect the probability, see lines 19-24 of the pseudocode in Fig. 3.More details on OSNPS can be found in Ref. 78 .

Adaptive Optimization Spiking Neural P System
The proposed AOSNPS employs the same structure of OSNPS depicted in Fig. 2 but makes use of a novel Dynamic Guider algorithm to manipulate the probability matrix P R .More specifically, the Guider algorithm contains two novel adaptive mechanisms: 1) an adaptive learning rate ∆; 2) an adaptive mutation.The novel mechanisms are described in Subsections 3.1 and 3.2, respectively.The new Dynamic Guider algorithm embedding these two elements is outlined in Subsection 3.3.

Adaptive Learning Rate
The learning rate ∆ is the step size of probability adjustment for the elements of the probability matrix P R : is a random number between 0.005 and 0.02 set at the beginning of the optimization and kept constant throughout the OSNPS execution.
We propose here a variable and adaptive learning rate ∆.In order to better explain the rationale of the proposed adaptation, let us revisit the role of p 1 i of ESNPS presented in Section ??.
The term p 1 i is the selection probability of rule r 1 i while r 1 i is the spiking rule in each neuron.If the value of p 1 i is large, the rule r 1 i has a high probability of execution and the rule r 2 i has a low probability of execution since p 1 i + p 2 i = 1.If the output neuron spikes, a 1 is written as a bit of the candidate solution, otherwise a 0 is written.Thus, if we want to get 1, p 1 i should be large (ideally ) and if we want to get 0, p 1 i should be small (ideally p 1 i = 0).This paper proposes an adaptive probability adjustment step size for each neuron.At each time unit, the adaptive updating rule of probability is where ∆ a ij (a stands for "adaptive") is the step size and is defined as ∆ a ij is designed to take the middle point of the distance between the current probability p 1 ij and the ideal probability.The ideal probability P b = {0, 1} is the lower or upper bound of the probability of p 1 ij (the pedex b stands for "bound").For P b = 1, the update rule is while for P b = 0 the update rule is Compared with the learning rate ∆ defined in OSNPS, the adaptive learning rate ∆ a ij proposed in this paper presents the following advantages.
• ∆ a ij changes for each neuron at each time unit during the algorithm execution by following the learning needs.If the distance between the current probability p 1 ij and the ideal probability P b is big, the learning rate ∆ a ij is big.On the other hand, if the distance between the current probability p 1 ij to the ideal probability P b is small, the learning rate is also small.
• The adaptive learning rate allows a quick achievement of the desired probability.For example, if we want to get 1 from a neuron, from an initial probability p 1 ij = 0.1 the proposed adaptive learning rate ∆ a ij enables to reach 0.9 < p 1 ij < 1 after four steps whereas with a constant ∆ over 40 steps are needed.
• The probability of p 1 ij does not overflow.In OSNPS, it may result p 1 ij > 0 or p 1 ij < 0. In this case, an extra mechanism is required.The use of the proposed adaptive learning rate ensures that the probability overflow never occurs.

Adaptive Mutation
The proposed AOSNPS makes also use of an adaptive mutation strategy.Two dynamic parameters P m1 and P m2 are defined to characterise and monitor the learning (evolutionary state) of AOSNPS.The parameter P m1 is the first mutation probability which varies between 0 and 1 and is defined as follows: where G bf (gen) is the best fitness value ever computed at the generation time of the execution and G bf (0) is the best fitness at the initialization.The parameter N max determines a stopping criterion: if the global best fitness does not improve for consecutive N max generations the algorithm stops.
The parameter P m2 is the second mutation probability and is defined as follows: where DP a (gen) is an aggregated metric representing the diversity (of probabilities) at the current generation gen, see 46 .This value is calculated as: The value DP a (0) is the average probability at the initialization.
P m1 and P m2 are two independent dynamic parameter.P m1 is used to describe the trend of improvement of the optimal solution.P m2 is used to describe the diversity of probability sample matrix between rows in the current generation.N max is the parameter of when the algorithm should stop running.The value of N max affect the standard deviation between the results of multiple runs of AOS-NPS for the same issue.In order to make the results of multiple runs more concentrated, we should choose a larger N max .The logic of the mutation probabilities P m1 and P m2 is summarised in the following points.
• If a new current best solution has been detected at the current generation (G bf (gen) > G bf (gen − 1)), then the mutation is not triggered (P m1 = 0).Conversely, if the current best solution has not been updated (G bf (gen) = G bf (gen − 1)), the probability of triggering the mutation is increased (P m1 = P m1 + 1 Nmax ).• If the diversity DP a (gen) is larger than that at initialization DP a (0)), the probability for the mutation to be triggered is low.• If the current best solution is not updated for many generations ((G bf ) remains the same), and the diversity DP a (gen) of the probability matrix P R is low, the mutation is performed with a high probability (P m1 is large, P m2 is small).
When triggered the mutation of the matrix P R is performed in the following way: where rand 3 () and rand() are two random numbers in the range [0, 1].The mutation probability P m j is a parameter sampled in the range [0, 0.1] at the beginning of the Dynamic Guider algorithm's execution.R bestf it ∈ [1, H] is the row coordinate of the best candidate solution found at the current generation.This means that the best candidate solution, in an elitist fashion, does not participate in the mutation.
Based on the adaptive learning rate and the adaptive mutation rule, the Dynamic Guider algorithm is an algorithm operating on the learning probabilities to support the generation of successful solution for the binary combinatorial problem.
One current best solution x is stored in memory and modified by crossover with other candidate solutions.The candidate solutions are generated by the parallel ESNPSs (one solution by each ESNPS j ) and processed in pairs by the evolutionary Dynamic Guider algorithm that evaluates and compare their fitness values.The evaluation of these candidate solutions are used to modify the probability matrix P R and hence generate solutions with a higher performance.Like for OSNPS, the constraint is handled by means of the random chromosome repair technique, see 29; 30; 75 .
The evolution of the P R matrix is handled by two mechanisms: the update of the adaptive learning rate which happens every time two candidate solutions are sampled as described in Subsection 3.1, the re-initialisation of the neuron probability which is triggered only by the satisfaction of the conditions described in Subsection 3.2.

The Dynamic Guider Algorithm of AOSNPS
Hence, we may consider AOSNPS as a co-evolution where the (binary) candidate solutions of the optimization problem evolve with the probabilities of the neurons in each of the P systems.The pseudocode of the proposed evolutionary Dynamic Guider is shown in Fig. 4.

Numerical Results: 0/1 knapsack problem
Given a group of items, each item with its own weight and price, and a knapsack of limited capacity, the problem consists of selecting the items to make the total price of the knapsack as high as possible without violating its maximum capacity.
If we indicate with m the total number of items available and we label each item with a number j = 1, 2, . . ., m, we can represent the selection of the items as a binary vector x.

49:
end if 50:  where p j and ω j are price and weight of the j th item, respectively and C is the capacity of the knapsack.The parameters of the problem have been set in following way.The weights ω j have been sampled from the interval [1, Ω], with Ω = 50, p j = ω j + 1 2 Ω and the average knapsack capacity C is applied: In order to validate the proposed AOSNPS, we tested it against the following algorithms designed/used in the literature For each algorithm we used the recommended parameter setting used in the original paper.The proposed AOSNPS has been run with H = 50 ESNPS.
Regarding the evolutionary Guider algorithm, the learning probability p a j (j = 1, . . ., m) uses the same value used in OSNPS (a random number in the range [0.05, 0.2]), the mutation probabilities p m j = 0.01 (j = 1, . . ., m) and N max = 500.
The 0/1 knapsack problem has been run in different scenarios (problem instances), i.e. m = 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000.Each algorithm in this paper has been run for 30 independent runs.When the total weight of all selected items exceeds the capacity C (constraints violation), we implemented the random chromosome repair technique suggested in Ref. 29; 30; 75 .Table 1 displays the numerical results in terms of mean value µ ± standard deviation σ of the knapsack cost f (x).The best results for each problem instance are highlighted in bold.
Furthermore, the statistical significance of the results has been enhanced by the application of the Wilcoxon rank sum test, see 66 .A "+" indicates that AOSNPS significantly outperforms its competitor, a "-" indicates that the competitor significantly outperforms AOSNPS, and a "=" indicates that there is no significant difference in performance.
Numerical results in Table 1 show that the proposed AOSNPS is very efficient to address the 0/1 knapsack problem since it achieves the best results in nine cases out of the ten considered.In only one scenario (with the smallest number of items m = 1000) NQEA achieves slightly better results than AOSNSP.The effectiveness of the novel Dynamic Guider algorithm appears from the direct comparison against OSNPS: AOSNPS systematically outperforms OSNPS.
In order to further strengthen the statistical analysis of the presented results, we performed the Holm-Bonferroni 31 procedure for the eight algorithms (N A = 4) and ten problem instances (N p = 10).The rank R k for k = 1, . . ., N A by assigning, for each problem instance has been calculated.For each problem instance, a score N A is assigned to the best algorithm, a score N A − 1 to the second best, . .., 1 to the worst algorithm.The ranks R k are the scores averaged over all the problem instances.Let us indicate with R 0 the ranking of AOSNPS.For the remaining N A − 1 algorithm the score z k is calculated as the values z k have been calculated as: .
By means of the z k values, the corresponding cumulative normal distribution values p k have been calculated, see 19 : These p k values have then been compared with the corresponding δ/k where δ is the level of confidence, set to 0.05 in this case.
These p k values have then been compared with the corresponding δ/k where δ is the level of confidence, set to δ = 0.05 in this case.Table 2 displays the ranks, z k values, p k values, and corresponding δ/k obtained.Moreover, it is indicated whether the null-hypothesis (that the two algorithms have indistinguishable performances) is "Rejected", i.e. the algorithms have statistically different performance, or "Accepted" if the distribution of values can be considered the same (there is no outperformance).
The Holm-Bonferroni procedure in Table 2 shows that AOSNPS achieves the best performance over all the algorithms taken into account.It can be observed that AOSNPS achieves the best ranking and significantly outperforms GQA and OSNPS.

Comparative Analysis of AOSNPS and OSNPS
In this subsection, we highlight the effectiveness of the new Dynamic Guider algorithm by comparing the behaviour of OSNPS and AOSNPS.The analysis involves the following five indicators 75 .
(1) G bf : performance trend.This is the objective function value of the current best solution at each generation gen.
(2) D hbw : Hamming distance between the best and worst binary individuals in a population.
where, x bi and x wi are the ith bits in the best and worst binary solutions, respectively; m is the number of bits in a binary solution; the symbol ⊕ represents the OR operator.
(3) D hm : average Hamming distance of all binary individuals in a population.
where, x ik and x jk are the kth bits in the ith and jth binary solutions, respectively; m is the number of bits in a binary solution; n is the number of individuals in a population; the symbol ⊕ represents OR operator.(4) DP bw : distance between the best and worst probability column vectors in P R corresponding to the best and worst fitness values in a population, respectively.Figures 5 -9 depicts the trends of these five metrics for = 1000 items for OSNPS and AOS-NPS, respectively.The algorithms have been run with the same starting random initial probability matrices P R50×1000 .Both OSNPS and AOSNPS have been run 8000 generations respectively.Figure 5 shows that AOSNPS outperforms OSNPS throughout the entire run.Figures 6 and 7 show that AOS-NPS exhibits better transient convergence:the diversity metrics D hbw and D hm of AOSNPS drop more rapidly than that of OSNPS in the early stages of the run.However, subsequently AOSNPS achieves and maintains a better diversity than OSNPS.This is the result of the joint contributions of the adaptive learning rate (the rapid decline of diversity in early stage is mainly due to the improved learning efficiency using ∆ adaptive ij ) and the adaptive mutation (better diversity obtained in the middle and late stages is due to the frequent triggering of mutation rule).In order to better display the behavior of adaptive mutation, Fig. 11 displays the interval generations, i.e. the number of generations gen between two consecutive triggered mutations.When the interval generation is one, then the mutation has occurred for two consecutive generations.At this time, the global optimal solution may have not been improved for many generations (P m1 is large), and the difference between the populations is small (P m2 is small), which could correspond to a convergence to a suboptimal solution.In this situation, mutations are needed to explore possible new promising search directions.If the interval generation of mutation is large, either AOSNPS is likely to have recently detected a new global optimal solution (P m1 is reset to zero) or the difference between the populations is large (P m2 is large).

AOSNPS for Power System Fault Diagnosis
Power system fault diagnosis is the identification of location and causes of a fault on a power system.In this subsection, AOSNPS is applied to solve this fault diagnosis problem.We considered the power system represented in Fig.The operational rules of the protective relays of buses and lines are described in Ref. 63 as follows.1) Protective relays of buses.If the main protective relays of a bus operate, all breakers connected to the bus are tripped.
2) Protective relays of lines.If the main protective relays of a line operate, all breakers connected to the line are tripped.Likewise, when the main protective relays of a bus fail to operate, the first backup protective relays operate to trip all breaker connected to the line.When adjacent regions of a line fail and their main protective relay and first backup relay fail to operate, the second backup relay of a line operates.
Six fault cases in the IEEE 39 bus system and IEEE 118 bus system have been considered: case 1 is a single fault, case 2 is multiple faults, case 3 and case 4 are multiple faults with incompleteness and uncertainty in the IEEE 39 node electric power system.Case 5 is multiple faults and case 6 is multiple faults with incompleteness and uncertainty in the IEEE 118 node electric power system 6 .The network data for the four cases are listed in Table 3.
In order to identify a fault, the engineer is usually informed about the real status of protective relays and circuit breakers.We represent this piece as information as two binary vectors r and c for relays and circuit breakers, respectively where for every value of i, 1) r i = 1 and r i = 0 represent the operation and non-operation of the protective relay i; 2) c i = 1 and c i = 0 represent the operation (the circuit breakers trips) and non-operation of the circuit breaker.Let us now define the binary vector s, s = (s 1 , s 2 , . . ., s n ) where s i represents the status of section: s i =1 and s i =0 represent the fault status and normal status of section i, respectively.
On the basis of these pieces of information, the expected values of the protective relays and circuit  4 displays the results of the fault diagnosis estimation obtained by AOSNPS and compare them with those obtained by the ad-hoc expert based methods presented in Ref. 61 and 72 .It can be observed that for case 1 the three meathods reach the same results.Regarding case 2, the estimation result of AOSNPS is the same as 72 , but is different to 72 .In case 3, case 4, case5 and case 6, we may observe that the results of AOSNPS are different from those in 61 and 72 .However, our results agree with those achieved by a more recent study that considers only complex scenarios, see Ref. 67 .

Conclusions
This paper proposes a novel Adaptive Spiking Neural P System, indicated as AOSNPS, for solving the 0/1 knapsack problem.The proposed method uses multiple neural P systems, each of them generating a candidate solution and a Dynamic Guider algorithm that supervises the search.The proposed scheme includes two novel adaptive mechanisms within the Dynamic Guider algorithm: an adaptive learning rate and an adaptive mutation based on the estimation of the diversity of the sampling rules.
Numerical results demonstrate that thanks to their adaptive learning rate and adaptive mutation, the proposed AOSNPS overcomes the diversity loss limitation of its predecessor OSNPS.The novel adaptive mechanism enhances upon the behaviour of the Dynamic Guider algorithm: the search operators, through the probabilities of the spiking neural P system, react to the temporary diversity loss of the population by suggesting fresh search directions.The proposed AOSNPS outperforms two popular metaheuristics and OSNPS on the 0/1 knapsack problem in all the scenarios considered.Furthermore, the application of AOSNPS to a power distribution problem shows that AOSNPS behaves like

Figure 1 .
the output is a spike train formed by concatenating the outputs of σ 1 , σ 2 , . . ., σ m .The structure of the specific ESNPS is shown in Fig.1.Logical and functioning scheme of the specific ESNPS

Figure 4 .
Figure 4.The Dynamic Guider algorithm of AOSNPS

Figure 5 .
Figure 5. Performance trend G bf of OSNPS and AOS-NPS

Figure 6 .
Figure 6.Plot of Hamming distance between the best and worst binary individuals D hbw : OSNPS vs AOSNPS
breakers re = (re 1 , re 2 , . . ., re N r ) ce = (ce 1 , ce 2 , . . ., ce N c ) are represented as functions of r and s and computed as shown in Ref. 65 .We used AOSNPS to optimise the following objective function 62 e (s) = N r i=1 |r i − re i (s)| + N c j=1 |c j − ce j (s, r)| Table

Table 1 .
Mean value ± standard deviation of the knapsack cost for the algorithms and problem instances under consideration