Analysis of the Emergence in Swarm Model Based on Largest Lyapunov Exponent

Emergent behaviors of collective intelligence systems, exemplified by swarm model, have attracted broad interests in recent years. However, current research mostly stops at observational interpretations and qualitative descriptions of emergent phenomena, and is essentially short of quantitative analysis and evaluation. In this paper, we conduct a quantitative study on the emergence of swarm model by using chaos analysis of complex dynamic systems. This helps to achieve a more exact understanding of emergent phenomena. In particular, we evaluate the emergent behaviors of swarm model quantitatively by using the chaos and stability analysis of swarm model based on largest Lyapunov exponent. It is concluded that swarm model is at the edge of chaos when emergence occurs, and whether chaotic or stable at the beginning, swarm model will converge to stability with the elapse of time along with interactions among agents.


Introduction
Collective intelligence brings up a bottom-up approach, which is essentially different from the top-down one as in conventional systems.The bottom-up approach incites complex global behaviors through local interactions among agents 1 .Collective intelligence provides an effective approach to solving complex problems including adaptation to dynamic environments.
Prediction and control are two main concerns with emergent behaviors.In order to predict emergent behaviors, the first thing is analysis and evaluation of dynamic behaviors of systems.Wolf et al. presented an "equation-free" method to analyze and evaluate the trends of systems 2 .Zhu presented a formal theory, called Scenario Calculus, to reason about the emergent behaviors of multiagent systems 3 .Gazi and Passino simulated and observed the characteristics of behaviors under different conditions to analyze the stability of social foraging swarm 4 .Pedrami and Gordon used an additional controllable variable to study the changes of interior energy of swarm system 5 .
On the control of emergent behaviors, chaos analysis was employed to study the behaviors of swarming.Qu et al. utilized nonlinear chaos time series to control emergent behaviors 6 .Ishiguro et al. presented an immunological approach to controlling the behavior of self-organized robots 7, 8 .Meng et al. presented an algorithm integrating ant colony optimization and particle swarm optimization to build distributed multiagent systems 9 .Waltman and Kaymak studied multiagent Q-learning for deciding how to behave in an unknown environment 10 .
Generally speaking, current research mainly uses theoretical analysis or simulation method to study the emergent behaviors of swarm model and mostly stops at observational interpretations and qualitative descriptions of emergent phenomena.The main limitation of observational approach lies in that it is hard to cover all scenarios and operating conditions possible of swarm model, including critical phenomena.Moreover, gaps often exist unavoidably between practical situations, which are very complicated, and theoretical analysis.Therefore, identifying appropriate system characteristics is very important for quantitative study on the emergence of swarm model.Given that the emergence of swarm model is nonlinear, it is our belief that it is relevant and necessary to look at the potential relationships between the emergence of swarm model and the fundamental system characteristics as we would normally do to complex dynamic systems, particularly, chaos, stability, and so forth.
As to emergent behaviors of swarm model, our earlier work simulated the swarm model on Matlab and used a rough-set-based data mining method to select its kinetic parameters.The results show that the kinetic parameters do affect the shapes of swarm model 11 .Built upon that, in this paper, we will present a quantitative study on the emergent behaviors under different shapes of swarm model.There are various system characteristics usable to evaluate complex dynamic systems.Lyapunov exponent plays an important role relating to chaos.The largest Lyapunov exponent LLE of a dynamic system can be obtained from the time series of any observable variable through phase space reconstruction.A system is chaotic when it has a positive LLE, while a system is stable when it has a negative LLE 12 .
The purpose of this paper is to study the causes for and governing laws of the emergent behaviors in general collective intelligence systems, but not to be confined to specific algorithms.For this purpose, we need to adopt a representative and universal model for our study.We find that swarm model is of natural affinity to social insects and animal colonies and is subject to least subjective effects from designers.Therefore, we adopt swarm model for our theoretical study on the emergence of collective intelligence systems.We envisage that once proper theoretic methods can be formed for the emergent behaviors of swarm model, it is then possible to expand such generic methods to specific algorithms and application models, such as particle swarm optimization, granular swarm, vicsek fractal, and so forth.This paper will present a quantitative study on the emergence of swarm model, which will help achieve a more exact understanding of emergent phenomena.For this purpose, we will reconstruct phase space, and calculate best time delay, embedding dimension and average period for the time series of agents in swarm model.Then, LLE of swarm model is calculated using small data set algorithm, and the relationships between chaos and stability and the emergence of swarm model are analyzed based on LLE.Finally, a quantitative evaluation will be conducted on the emergence of swarm model through calculating LLE at the emergent time and the evolution of LLE over time.

Swarm Model
A typical model for studying emergence in swarm 13, 14 is inspired from flocks of flying birds.An individual in a swarm is called an agent.Agents interact according to specified interaction rules.Through interactions among agents, the whole system is getting selforganized, which is adaptable to the environment.The relationship from local interactions to global behaviors is intrinsically nonlinear and emergent.
The swarm model used here was proposed by Spector and Klein 13 based on Craig Reynolds' classic "boids" model 14 .The local environments and each agent's parameters determine the directions and speeds of their flights.At each time step of the simulation, an agent's instant acceleration vector A is calculated as follows:

2.1
where c i i 1, 2, 3, 4, 5 is the weight of vector V i i 1, 2, 3, 4, 5 , which is determined by the state of the simulated world; d is the desired distance that an agent tries to maintain with its neighbors; V 1 is a vector that points to the neighbors within a distance of d; V 2 is a vector describing the center of the simulated world; V 3 is the average of the neighbors' velocities; V 4 is a vector toward the center of gravity of the neighbors; V 5 is a random unit-length vector; V is the summation of behavioral tendencies with weights; A is an agent's instant acceleration vector at each time step | A| < A max , and A max is the maximum acceleration of an agent.

Reconstruction of Phase Space
In 1980, Package alleged that it was possible to rebuild the dynamic law of a system by reconstructing an "equivalent" space with a one-dimension observable variable.Takens established a mathematical basis for this theory.The basic idea is that the trajectory of the reconstructed phase space reflects the dynamic law of the system.Although this method builds the phase space by only using the data of one variable over time, the couplings of this variable with the other variables manifest that the evolution of this variable over time could represent the dynamic law of the global system 15 .An m-dimension phase space can be reconstructed from the time series of one observable variable in system {x i | i 1, 2, . . ., N} to obtain a set of vectors:

Best Delay Time and Embedding Dimension
To reconstruct the phase space from time series, appropriate interval of sampling τ should be given in addition to embedding dimension m .τ can be arbitrary theoretically.However, in practice, τ should be determined by fail and trial method 16 .In 1986, Fraser and Swinney pointed out that the autocorrelation function only considered the linear relationship of variables.In order to consider the general interdependency between two variables, the best delay time to reconstruct the phase space should be the delay time by which the mutual information function between the two reconstructed variables reaches its first minimum 17 .
We will use the C-C algorithm 18 to calculate the best delay time and the embedding dimension.After the reconstruction of phase space by 2.2 , the correlative integral of each time series can be computed from a cumulative distribution function which describes the probability by which the distance between any two points is within radius r:

Small Data Set Method
There are two main approaches to calculating LLE, including Wolf method and Jocobian method 19 .Wolf method is suitable for the circumstance where the time series is with no noise and the small vectors in the cut space are highly nonlinear.Jocobian method fits to the circumstance where the time series is with heavy noise and the small vectors in the cut space are nearly linear.In 1993, Rosenstein et al. proposed a small data set-based approach to calculating LLE 20 .
A chaotic system is described by the strange attractors on the irregular trajectories in the phase space.One of the major characteristics of strange attractors is that exponents of nearby points are isolated.This means that a system whose initial state is entirely certain could inevitably change away.Such a behavior reflects that the system is sensitive to initial conditions.Lyapunov exponent quantitatively describes the dynamic property of strange attractors 19 .
Lyapunov exponent represents the divergence rate λ i > 0 or convergence rate λ i < 0 on average.LLE λ max determines the speed of trajectories surrounding a strange attractor.The small data set method proposed by Rosenstein for calculating LLE is better than Wolf method.Rosenstein method does not need to be standardized.It reduces the subjective effects and has improved efficiency and precision of prediction.Rosenstein small data set algorithm can be outlined as follows 20 .
Firstly, for each point Y j , find the nearest neighbor Y j under a confined transient separation for phase space reconstruction where p is the average period of the time series.Then, for each point Y j at time i, calculate the distance d j i among neighbors

2.10
For every j, at each i, the average of ln d j i can be calculated as below where q is the number of positive d j i 's.The regressed line be fitted, the slope is then the desired LLE.

Overall Scheme
The scheme for calculating LLE is based on the chaos analysis of complex dynamic systems. is reconstructed to obtain the LLE of swarm model.The process is depicted in Figure 1.The experiment data are used to evaluate chaos and stability of the system quantitatively.Since the time series of each variable represents the global evolution of the whole system, it is possible to study the chaotic behaviors of the system according to the time series of a single variable.
The time series in our study are the positions of the 20 agents during 3000 seconds.The initial parameters are the thirteen groups of model parameters from Kwong and Jacob 21 , and the additional seventeen groups of model parameters were derived from them 11 .In summary, 15 model parameter groups will bring forth emergent phenomena, referred to as cluster shape, circle shape, and line shape, five groups each, respectively, and the other 15 groups will not, referred to as scatter shape.The corresponding LLEs are calculated to analyze the chaos and stability of swarm model, which will be used to evaluate the emergence of swarm model quantitatively.The model parameter groups are shown in Table 1.

Reconstruction of Phase Space
Reconstruction of phase space is the key step for phase map analysis, fractal dimension, and Lyapunov exponent calculation.For each shape of swarm model, the phase space is reconstructed according to the method as presented in Section 2. Figure 2 shows the results of reconstruction of phase space for each shape of swarm model.
Figure 2 a shows that there is no attractor in scatter shape.Figures 2 b , 2 c , and 2 d show that the attractors do occur during the processes.Here only 3-dimension phase maps are provided.In practice, the actual dimensions for reconstruction of phase space will depend upon the delay time and the embedding dimension.

Best Delay Time and Embedding Dimension
According to the methods as presented in Section 2, particularly 2.3 -2.8 , best delay time and embedding dimension are calculated by C-C method for each shape of swarm model, as shown in Table 2.
Figure 3 illustrates, for one case in each shape of swarm model, how best delay time and embedding dimension are obtained by C-C method.Illustrations in Figure 3 are detailed in Table 3. Full results for all other shapes should refer back to Table 2.

Average Period
The average period of time series can be calculated by Fast Fourier Transform FFT .Firstly, FFT is applied to the time series of swarm model Then, the power spectrum power and frequency f are obtained as below  Finally, the average period p is readily the inverse of the frequency

Mathematical Problems in Engineering
Swarm is a typical model in which emergence occurs.The time series i.e., agent's positions of swarm model show that the system is not necessarily periodic depending on the initial parameters.The results are shown in Table 4, where the simulation span is T 3000 s.Scatter shapes of swarm model with different initial parameters, which bring forth no emergence, all have their average periods of 3000 s.This means that the system is not periodic.The other shapes of swarm model, which bring forth emergence, are aperiodic, or their average periods approximate to the whole simulation time.All of these are consistent with the emergent property of swarm model.Figure 4 illustrates time series, power spectrum, and periodogram for one case in each shape of swarm model.The average period corresponds to the peak spectrum in periodogram.

Calculation of Largest Lyapunov Exponent (LLE)
LLE of swarm model can be calculated using the small data set algorithm as described in Section 2, which integrates together the algorithms described above for reconstruction of phase space, best delay time and embedding dimension, and average period.

Output:
LLE of swarm model.

3.4
Step 2. After reconstruction of phase space, find the nearest neighbor for each point on the trajectory.The nearest neighbor Y j can be found by searching for the point that minimizes the distance to point Y j .This can be formulated as follows: where d j 0 is the initial distance from the jth point to its nearest neighbor, and || • • • || denotes the Euclidean norm.The additional constraint imposed is that the nearest neighbor should have a transient separation greater than the average period of the time series.This allows considering each pair of neighbors as nearby initial conditions for different trajectories.
Step 3. LLE can be estimated as the mean divergence rate of the nearest neighbors 22 : where k is a constant, Δt the sampling period of the time series, and d j i the distance between the jth pair of nearest neighbors after i discrete-time steps, that is, i * Δt seconds.In terms of geometric meaning, LLE is a factor that quantifies the exponential divergence at which the initial trajectory evolves.A random vector of initial conditions may evolve to a most unstable manifold, because exponential growth in this direction quickly dominates the growths or contractions along the other Lyapunov directions.Thus, LLE can be defined by the following formula: where d t is the mean divergence at time t, and C is a constant that normalizes the initial divergence.The discrete form is where C j is the initial divergence.By taking logarithm to both sides of 3.8 , we have ln d j i ln C j λ 1 iΔt , j 1, 2, . . ., M. 3.9 Step 4. Equation 3.9 represents a set of approximately parallel lines for j 1, 2, . . ., M , each with a slope roughly proportional to λ 1 .LLE can be obtained using the "average" line of least-square fitting as below.
where q is the number of nonzero d j i .
The system is chaotic when LLE is positive.Otherwise, when LLE is negative, the system is stable or convergent.It is observed that the line fittings in the scatter and cluster shapes of swarm model are poor because they are not chaotic or stable distinctly.The systems in circle and line shapes are chaotic.They have greater LLEs than the scatter and cluster shapes, and the line fittings are better.Table 5 presents LLE calculated for each shape of swarm model with different initial parameters.Figure 5 illustrates, for one case in each shape of swarm model, how the lines are least square fitted for LLE.The slope of the fitted line is LLE.

Emergence Analysis Based on Largest Lyapunov Exponent (LLE)
LLE is the key factor to characterize whether the time series is chaotic or stable.The chaotic system is sensitive to initial parameters.For a chaotic system with fixed model parameters, LLE is invariant.However, different initial parameters determine different shapes of swarm model.So, LLEs for different shapes of swarm model will vary.How LLEs at the emergent time vary can be used to study the relationships between chaos and stability and the emergence of swarm model quantitatively.

Emergent Time: The Time When Emergence Occurs in Swarm Model
Emergence describes the evolving process from local interactions among agents to global behaviors.Once this process goes beyond a critical point, new global properties and structures will emerge.This phenomenon is called emergence, and the time is called emergent time.As to cluster shape, the emergent time is when agents fly very closely to one another.As to circle shape, when agents locally form a circle or the trajectories of agents overall cluster and form a circle, it is emergent time.As to line shape, the emergent time is when agents arrange themselves into a line.From the trajectories of agents in swarm model as illustrated in Figure 3, the emergent time is about 200 or 400.Table 6 shows the results.With the parameters for scatter shape, agents are still at a scattered state after 3000 s.So, it is believed that emergence will not occur in scatter shape.

Chaos Analysis of Swarm Model at the Emergent Time
LLE of swarm model at the emergent time is very important for the state of swarm model.Is the system stable or is there chaotic phenomenon at the emergent time?According to the definition of critical points as stated above, LLEs of swarm model at the emergent time with different initial parameters can be calculated using the methods as described in Section 3. The results are shown in Table 7.
In Table 7, the bold and italic numbers are LLEs at the emergent times, which are all positive except Group 5 loose cluster .This means that chaos occurs when emergence occurs.However, at the points same as the emergent times, LLE of the scatter shape, which has no emergence, is almost near to zero.
Figure 6 depicts LLEs of swarm model after 3000 s and at the emergent time, respectively.In Figure 6 a , the graph depicts that the swarm model with the parameters for circle, cluster, or line shapes, which will bring forth emergence, is more chaotic, while the scatter shape, which will bring forth no emergence, is more stable.Figure 6 b depicts LLE of each model parameter group at the emergent time.The shapes of swarm model which will bring forth emergence, including cluster, circle, and line, are virtually at the state of chaos Lyapunov > 0 , while the scatter shapes of swarm model, which bring forth no emergence, are stable Lyapunov < 0 .Figure 7 shows the states of model parameter group 5 loose cluster at given times, whose LLE is negative at the emergent time.By contrasting to the state of cluster shape in Table 6 with parameter group 5 loose cluster , it can be seen that the agents in Figure 7 a cluster less closely.Its emergent phenomenon is not obvious.This may be because the choice of emergent time is improper.Therefore, LLE at the emergent time may not be conclusive.However, in Figure 6 a , LLE of parameter group 5 loose cluster is a positive number, which means that there is obvious chaotic phenomenon.
Generally speaking, by analyzing the chaos and LLEs of swarm model at the emergent time, the following conclusions can be drawn.For shapes of swarm model which bring forth  emergence, that is, when model parameter settings are within the ranges for cluster, circle, and line shapes, around the critical time for emergence to occur, its LLEs are positive when emergence occurs, which manifests that the system is at the state of weak chaos the LLEs are all under 0.1 .If emergence is unapparent, the emergent time may be misjudged, which may lead to erroneous calculation of LLE.However, the LLE at a longer time is still positive, which manifests that chaos exists.For shapes of swarm model which bring forth no emergence, that is, when model parameter settings are within the range for scatter shape, during the time of sampling, it is weakly stable.After the emergence has occurred, it may well be that the system gradually forms a certain structure in which the chaos disappears and instead a temporary stability appears, with LLE smaller than 0. This is illustrated by parameter Groups 5 and 15 in Table 7.

Evaluation of the Emergence of Swarm Model
In order to better reveal how LLEs of swarm model at different durations evolve, the time series is divided into 15 fractions in a time increment of 200.LLEs of each fraction of time series can be calculated and their trends on cluster, circle, line, and scatter shapes can be contrasted.LLEs in different initial parameters are shown in Figure 8.In Figure 8, it can be seen that at the beginning, LLEs are apparently positive or negative, which show that the swarm model with different initial parameters is chaotic or stable.However, with elapse of time along with the interactions among agents, LLEs converge to zero or near zero under some rules.With these results, conclusions can be drawn as follows.
Firstly, there are weakly chaotic phenomena in swarm model at the emergent time, except that there are weakly stable phenomena in swarm model with initial parameters for scatter shape.With elapse of time along with the interactions among agents, the weakly chaotic phenomena will wear off, and emergence will get more and more apparent.In the Mathematical Problems in Engineering swarm model with the parameters for cluster, circle, and line shapes, agents continue flying in the formed shapes.The system will converge to a globally stable state.
Secondly, Figure 9 contrasts evolution of LLEs of swarm model with emergence to that of the swarm model in scatter shape.Evolution of LLEs of swarm model with emergence is different from that of swarm model in scatter shape.Figure 9 a shows the swarm model with emergent phenomenon.LLEs evolve apparently with elapse of time along with the interactions among agents.Moreover, the swarm model, which is chaotic but with no emergence before the emergent time LLEs are positive , gradually converges to stability with emergence.One of the best examples is Line 2. In Figure 9 b , the scatter shape with no emergence is shown.LLEs evolve the same way as Figure 9 a at the beginning.The difference is that LLE evolves more quickly.In this case, swarm model arrives at the stable state more quickly as a whole, and while agents are at a scattered state, they as a whole remain within a relatively stable zone.
Thirdly, LLEs are generally very small.This means that the chaos is not quite strong and the systems are not far from stability so that no organization can be formed, or organization, if any, is inclined to dissolve at any time but are not too near any equilibrium, either, so to lose diversity and run into quiescent stability.This is the so called "critical state of self-organization" 23 and "at the edge of chaos" 24 .
As the key factor to determining whether the time series of a nonlinear system is a chaotic one, LLE reflects the chaos and stability of swarm model with different initial parameters.By using LLE, relationships between chaos and stability and the emergence of swarm model can be established to evaluate the emergence quantitatively.Agents in swarm model interact locally in simple rules to induce global self-organization.Swarm model may be chaotic or stable at the beginning.However, along with the interactions among agents, which lead the systems to stability gradually, LLEs converge to zero or negative fluctuations.When emergent phenomenon grows stronger, the chaotic phenomenon gets weaker.With elapse of time, the swarm model evolves to a stable state.

Conclusions
According to the chaos analysis of complex dynamic systems, through integrating methods for best delay time and embedding dimension, reconstruction of phase space, and average periods, this paper has presented a small data set scheme for calculating the largest Lyapunov exponents LLEs of swarm model in different initial parameters.By this way, we have analyzed the relationships between chaos and stability and the emergence of swarm model at the emergent time and evaluate the emergence of swarm quantitatively in terms of evolution of LLEs of swarm model.We have reached two conclusions.Firstly, the swarm model is at the edge of chaos.Secondly, the chaos in swarm model becomes weaker while the emergence becomes stronger and with elapse of time along the interactions among agents, the swarm model will converge to stability.
We see future works mainly in the following aspects.
About system characteristics for quantitative study on the emergence of swarm model, this paper only uses Lyapunov exponent to analyze the emergence of swarm model.In the future, i other system characteristics may be covered, for example, correlation dimension, Kolmogorov entropy, Poincare section, and so forth; ii the effects of these system characteristics upon emergent behaviors need to be established, and data mining method may be employed to explore the relationships between these system characteristics and the emergent behaviors of swarm model.
In the future, relationships between these system characteristics and the emergence of swarm model will be explored via data mining.In particular, the relevant system characteristics will be analyzed via data mining to obtain the rules that affect the emergent phenomenon of swarm model.Furthermore, quantitative evaluations and interpretations on why, how, and when emergence occurs need to be established.
Observability and controllability of emergent behaviors are most challenging for swarm model.Questions may include, for example, how to analyze the system characteristics of time series in certain duration and explain its observability.On controllability, relevant system characteristics need to be defined for analysis of emergent behaviors; for example, how to formulate the system characteristics as the parameters of emergent behaviors of swarm model and establish the relevant rules via data mining to study the effect of each parameter and the controllability of emergent behaviors.

MathematicalFigure 1 :
Figure 1:The process of calculating LLE from small data sets.

Figure 2 :
Figure 2: Reconstruction of phase space in 3-dimention for each shape of swarm model.

6 ∆SFigure 3 :
Figure 3: Illustration of C-C method for best delay time and embedding dimension for one case in each shape of swarm model.

Figure 4 :
Figure 4: Illustration of time series, power spectrum and periodogram for one case in each shape of swarm model.

Figure 6 :
Figure 6: LLEs of swarm model with different initial parameters.
agents at 400 (s) c The state of parameter group 5 loose cluster after 400 s

Figure 7 :
Figure 7: The states of model parameter group 5 loose cluster at given times.

Figure 8 :
Figure 8: Evolution of LLEs of swarm model with different initial parameters.

b
Evolution of LLEs of swarm model with no emergence

Table 2 :
Best delay time τ and embedding dimension m calculated by C-C method.

Table 3 :
Illustration of C-C method.

Table 4 :
Average periods for shapes of swarm model on different initial parameters.

Table 5 :
LLEs with different initial parameters.

Table 6 :
Emergent time for each shape of swarm model.