network dynamical influence to drive

Consensus and decision(cid:486)making are often analysed in the context of networks(cid:481) with many studies focusing attention on ranking the nodes of a network depending on their relative importance to information routing(cid:484) Dynamical in(cid:426)uence ranks the nodes with respect to their ability to in(cid:426)uence the evolution of the associated network dynamical system(cid:484) In this study it is shown that dynamical in(cid:426)uence not only ranks the nodes(cid:481) but also provides a naturally optimised distribution of e(cid:417)ort to steer a network from one state to another(cid:484) An example is provided where the (cid:498)steering(cid:499) refers to the physical change in velocity of self(cid:486)propelled agents interacting through a network(cid:484) Distinct from other works on this subject(cid:481) this study looks at directed and hence more general graphs(cid:484) The (cid:420)ndings are presented with a theoretical angle(cid:481) without targeting particular applications or networked systems(cid:482)

Consensus and decision making are often analysed in the context of networks with many studies focusing attention on ranking the nodes of a network depending on their relative importance to information routing Dynamical in uence ranks the nodes with respect to their ability to in uence the evolution of the associated network dynamical system In this study it is shown that dynamical in uence not only ranks the nodes but also provides a naturally optimised distribution of e ort to steer a network from one state to another An example is provided where the steering refers to the physical change in velocity of self propelled agents interacting through a network Distinct from other works on this subject this study looks at directed and hence more general graphs The ndings are presented with a theoretical angle without targeting particular applications or networked systems however the framework and results o er parallels with biological ocks and swarms and opportunities for design of technological networks he investigation of collective behaviours and dynamics is oten carried out through networks.A network is a powerful means to model the interactions in biological and social groups where individuals are represented by nodes and their interactions by edges. he information routing amongst social individuals is responsible for group behaviour and can in some cases explain complex phenomena.he Trafalgar Efect in marine insects and the Chorus Line Hypothesis in bird locks are two biological examples of this kind 1,2 , where the information of a predator attacking is quickly and eiciently moved across the whole group, driving a coherent group response.he STARFLAG project represents one of the most dramatic examples of how mapping interactions in a biological group provides the basis for understanding their complexity [3][4][5] .In a time where physical, cultural and social distances are oten bridged by the internet, social sciences can also be abstracted from networks 6 .Engineering is also more oten facing the challenges of complex group dynamics, as opposed to complicated systems (see examples like the space system proposed by O'Neil and Weigel 7 or the discontinued DARPA F6 project 8 aimed at exploring highly responsive satellite formations).As such, understanding and leveraging the fundamental mechanisms of consensus have become a priority.Algorithms, analytic proofs and empirical studies have been widely reported, shedding new light on this matter [9][10][11][12][13][14][15][16] .
It is intuitively clear why the identiication of the most inluential nodes in a network, those that have a key role in leading and routing information, is of fundamental importance.As such, investigations have been conducted across diferent scientiic areas [17][18][19][20] with several measurements of node centrality being identiied.Node Degree 21,22 considers how many links are associated with a single node, while Betweenness Centrality 23 ranks the nodes based on the number of geodesic paths (paths of minimum length between any two nodes) that pass through the node.Eigenvector Centrality identiies the nodes best placed in the network as either having many connections or connected to nodes that have many connections 24 .An interesting application of Eigenvector Centrality was proposed by Allesina as a means to measure the species co-extinction through food webs 25 .Estrada considered several centrality measures to investigate the role of peer pressure 26 , obtaining comparable results but showing how diferent measures of inluence highlight alternative aspects of networks.
To understand the role of eigenvector-based analysis it is useful to describe the network as a matrix with binary entries, where nodes are indexed along the rows and columns.If there is a link between any two nodes, say i and j, meaning that node i observes node j, then the corresponding entry of the matrix is "1", otherwise, it is "0".Such a matrix is termed the adjacency matrix.he spectral properties of the adjacency matrix are fundamental to Eigenvector Centrality as well as other popular ranking methods such as Katz's centrality 27 and PageRank 28 .

SCIENTIFIC REPORTS DOI srep
Consider a general dynamical system based on N interconnected nodes.hese nodes pursue a inal state by observing their neighbours and trying to minimise the relative diferences.Such group dynamics are described through Here a ij is the ij entry of the adjacency matrix, where x i is the state of node i, and its evolution is described by the dynamical system.w is a target state that nodes perceive in terms of the diference with respect to their own state and c i is a gain relecting the inluence of the external driver towards the target state.If the system had no constraints, then a fast consensus to the target would be achieved by increasing the gain c i as much as possible, up to the point in which the social term of the agent dynamics could be neglected compared to the push towards the external signal.However, when c i is constrained, as in the present work, then c i should be cleverly assigned.his elementary form of network dynamical system can be put in vector form as where L is known as the Laplacian matrix and, by construction, has elements in all rows summing to 0. C is a diagonal matrix of size N containing the c i gains, and w is a vector with identical elements representing the target state of the system. he zero row sum of the Laplacian matrix implies 0 is an eigenvalue of L, and its irst let eigenvector (FLE) can be used to rank the nodes based on their ability to serve as initiators of some dynamics expressed through the Laplacian 29,30 .Such a measure was named Dynamical Inluence 31 and obtained with particular reference to the ability of a node to serve as initiator of some outbreak.Dynamical inluence looks at the irst let eigenvector of the Laplacian as opposed to Eigenvector Centrality, which concentrates on the FLE of the adjacency matrix.
A classiication of the nodes in the dynamical system context can consider several parameters.One is the ability to achieve consensus by iltering information out of a noisy signal investigated by, amongst others, Poulakakis et al. 32 and Fitch and Leonard 33 .Controllability can also be used as a measure to select nodes 34 .
he present study concentrates on the role of the FLE of the Laplacian to distribute tracking of the external driver across all the nodes so as to obtain the fastest convergence possible towards that driver.he tracking efort is considered to be globally limited, that is, only a ixed amount of attention can be paid to an external driver across the whole network (this constrains . Under this hypothesis, the best distribution of efort across the nodes is sought to drive the network towards rapid consensus without allowing additional resources to be required.In contrast, the scenario in which all the nodes apply the same amount of efort would not take advantage of the group.A natural environment analogy would be to identify the key individuals within a group that should focus their efort on keeping a lookout for predators, allowing others to focus most of their efort on foraging.By exploiting the connections in the group it is possible to allocate duties eiciently amongst all of the group members. We investigated and extended the concept of dynamical inluence to cover not only which nodes should be in charge to lead the dynamics, but also how much efort they should invest in doing so. he model in Eq. ( 1) is used to identify the gain matrix C that guarantees the nodes achieve consensus about the external driver, whilst doing so in the shortest time possible.
A change of coordinates (see Methods) can be applied to Eq. ( 2) to isolate the matrix L + C as his model is used to ind the diagonal matrix C that makes the dynamical system exponentially stable, with maximal rate and ixed efort.hat is, all node states converge towards the same value with time and do so in the fastest way possible given a limited amount of efort.In contrast to the empirical approach taken by Klemm et al. 31 , here we consider an analytic approach providing mathematical proof of fast convergence.We show that the problem posed is solved by selecting the diagonal entries of C proportional to the entries of the FLE of L. Shang and Boufanais 35 used an analytic approach as well, concentrating their work on the number of interacting neighbours in a consensus problem with no external inputs.Instead we consider an external input, similar to the work by Shi et al. 36 .However, unlike Shi et al. this work looks beyond node selection towards the share of attention paid to the external input. he FLE of L is hence fed back into the system dynamics as a diagonal matrix to weight the control inputs towards tracking a uniformly fed external signal.As an eigenvector can be arbitrarily scaled the entries of the C matrix are scaled so that their sum is unitary.his allows comparison of the distribution with any other distribution summing to the same total, relecting at the same time the global limitation considered.

Results
he irst result presented here guarantees that the nodes paying attention to the external signal are always able to drive the network to consensus.From a mathematical point of view this means proving that the eigenvalues of the matrix − (L + C) in Eq. (3) all have negative real part.A matrix with such characteristic is also known as a "Hurwitz matrix". he matrix − L, on its own, is not Hurwitz due to the presence of the zero eigenvalue.By adding weights to its diagonal entries some nodes are efectively put in charge of tracking the external driver; hence, inluencing the other nodes that observe them.It is then logical that the nodes in charge should be observed by all the others, or more generally are observed by some other nodes, which are in turn observed by the rest of the network.Nodes presenting this characteristic are called "globally reachable" or "globally observed".Putting these nodes in charge, that is, assigning positive diagonal elements of C corresponding to the indices of globally reachable nodes, makes − (L + C) Hurwitz and guarantees the network will converge towards the desired state.his characteristic is illustrated through two examples in the Supplementary Information S3.
Choosing the elements of C proportional to the FLE of L makes the system Hurwitz since the elements of the FLE are positive in the indices corresponding to the globally reachable nodes.We note that as long as even just a single globally reachable node is provided with tracking capabilities the network will achieve consensus.hus, any vector, having at least one positive component, where the same-indexed FLE entry is positive, would then produce a Hurwitz system matrix and a convergent system. he last statement is summarised and proven in heorem S1 in the Supplementary Information S2.
It is now possible to show that distributing signal pursuing abilities so that they are proportional to the FLE entries for each node also provides near maximal consensus speed (see Methods for details).he speed of consensus is governed by the eigenvalue of − (L + C) that is the smallest in magnitude.he larger the magnitude of this eigenvalue, the greater the consensus speed.Our choice of C is particularly efective when the strength of interactions amongst the nodes are dominant with respect to the strength of the external driver.his is captured by a diference in magnitude between the Laplacian matrix L representing inter-node interactions and the matrix C weighting the external driver, i.e., for  LC .To show this, consider again the system in Eq. ( 3) with an arbitrary diagonal matrix D with small nonnegative entries such that  LD : Let the matrix M be deined by adding a constant positive value to the diagonal entries of − L, such that M = − L + kI with k a real, positive scalar and I the identity matrix of appropriate dimension.As detailed in the Methods, the eigenvalues of M are equal to k added to each of the eigenvalues of − L, but the two matrices keep the same eigenvectors.For k large enough the matrix D that maximises the consensus speed also minimises the spectral radius ρ(M − D), which is the largest eigenvalue in magnitude of M − D. For  LD we get 37 T T where u and v are the right and let eigenvectors of M relative to the spectral radius of M, respectively.Since the eigenvectors of M are the same as those of − L and the spectral radius of M corresponds to the zero eigenvalue of − L, then u = 1, which is the vector of all ones, and v is the FLE of L. hus, Du = D1 is the vector of the diagonal elements of D and u T v is the L 1 norm of v. Now suppose the vector of the diagonal elements of D is restricted such that its L 1 norm is equal to a generic positive scalar α.Taking D = C = diag{v}, with the FLE v scaled such that its L 1 norm is α, all the eigenvalues of − (L + C) will be negative, and the dynamical system described by Eq. (4) will converge as per heorem S1.Moreover, since Du = C1 = v is in the direction of the gradient of the spectral radius of M, − v T , the choice of D = C provides a minimisation of the approximation (5) of the spectral radius of M − D and thus a near maximisation of the consensus speed of the system described by (4). he smallest eigenvalue in magnitude of he magnitude of the smallest eigenvalue of − (L + D) cannot, in general, be maximised for D = C = diag{v} if the relative magnitude of C is large with respect to the magnitude of L. he FLE represents a (near) optimal choice when its magnitude is considerably smaller than the magnitude of the Laplacian such that Eq. ( 5) is very good approximation.
Equation ( 6) is obtained under the hypothesis that the diagonal vector of D has ixed L 1 norm.If instead a ixed Frobenius matrix norm for the matrix D is assumed, a similar argument can be used to show that D = C = diag(v) maximises the spectral radius 38 of − (L + C). his is shown in the Supplementary Information S5.Finally, if the ixed trace of the diagonal matrix D, as opposed to ixed norm, is considered, the optimal solution can be found independent of the magnitude of D, as described in the Supplementary Information S10.his is not done here as the ixed trace optimisation includes the possibility of negative weights, which would not be compliant with the present framework.
Figures 1-4 illustrate the theoretically proven efectiveness of the FLE v as a means to distribute tracking resources.he illustrations are obtained by numerically integrating the network dynamical system. he evolution of the system is shown for three distributions of the tracking resources assigned through the matrix D. he networks used are a non-symmetric lattice, a periodic lattice (ring), a random network, and a small world network.hese are further illustrated in Methods.
In the igures, the distribution of resources proportional to the FLE is compared to a distribution obtained numerically, through a routine that searches for a distribution maximising the magnitude of the irst eigenvalue.A third, uniform distribution of the tracking resources is also compared.
In the case of a ring graph, the FLE, the numerically optimised distribution, and the uniform distribution coincide.Indeed, for normal graphs like the ring the optimal resource allocation is a uniform one, regardless of the total amount of resources.For all the other cases the numerical optimal and the FLE distribution are biased towards nodes being observed more than observing others, hence their capability to eiciently inluence the dynamics.In all these cases the convergence speed provided by a non-uniform distribution of the resources clearly surpasses that of the uniform distribution.In particular, the random network case presents only one globally reachable node.his is awarded all the resources by the FLE although the numerical optimiser inds a different resource allocation favouring two non-globally reachable nodes.However, both strategies quickly drive the network to converge.As shown in Table 1, the FLE achieves a consensus speed, measured by the smallest eigenvector in magnitude of − (L + D), comparable to the numerically optimised solution and signiicantly better then the uniform distribution.he resource distribution based on the FLE ofers performance independent of the number of nodes, when compared to a numerically optimised distribution.Figure 5 illustrates this.In the igure, the same kind of lattice network used in Fig. 1 is considered, and extended to 50 and 100 nodes.he average state, that is the average over the node states at each time step, is plotted against time.As for Fig. 1, this is done for the FLE and the optimised resource distribution.Scaling the time with the nodes shows how the behaviour is unafected by the size of the network.In particular the diference with respect to the numerically optimised result is small enough to observe that the plots are superimposed almost everywhere.
Extension to second order dynamics he prior results are extended to more closely replicate real world dynamics where the network nodes are agents moving in a three-dimensional space.he agents attempt to align their velocity with the external driver, whilst keeping relative spacing.Consensus happens on two variables for each agent: one is the velocity, the other is the relative position, which vary with the trajectory taken.It is then a second order system that describes the dynamics of the generic ith agent: he symbols are the same as those used for the irst order system and the coeicients c i of the irst order system are substituted by the constants w that weigh the relative importance of the terms of the equation.he parameter z i represents the goal for the actual position x i and d ij is a desired gap between the positions of any two agents i and j connected in the network.For cooperative agents, d ij should equal − d ji , although this is not strictly necessary.he second order system is evaluated using a numerical simulation of the dynamics, physical intuition, and an analysis of the spectral properties of the system matrix.
Equation (12), the vector form of Eq. ( 7), describes the evolution of the network of agents achieving consensus about relative position and velocity.For the extension to the second order system, only the regular lattice case is considered.For this case, the sharing of the inite amount of resources should include tracking an external driver, a desired velocity but not a desired position ( = C 0 i z for all i = 1, 2… .n,see Methods).Moreover, the sharing of resources should also include the social terms producing consensus about relative distances and velocities, that is C i d and C i v .Only one sharing ratio amongst C i d and C i v is considered, with the relative importance being quantiied by the parameter κ, as explained in the Methods.More cases are considered in the Supplementary Information S9.
he system behaviour is reported in Fig. 6, where the consensus about the common desired velocity along the three axes, the standard deviation about the targeted inter-agent distance for each agent, and a representation of the motion in three-dimensional space are shown.he rise time and the settling time were considered as well.hese are reported in Table 2.Note that the change in y and z velocities are the same and are hence combined together in the plot and the Table. he state space description provides a uniied matrix for the relative positions and velocities.his gives a measure of the system convergence speed, as for the irst order system.Unlike the irst order system, the second order matrix keeps the zero eigenvalue as a consequence of the indeinite agent positions, which are set only in terms of relative distances.Consensus speed is again evaluated through the smallest in magnitude, non-zero eigenvalue of matrix S (See Eq.S14 in the Supplementary Information).his is reported in Table 3 while the efects on stability properties and the existence of the zero eigenvalue are covered in the Supplementary Information S6-S8.

Discussion
Assigning tracking resources proportionally to the entries of the FLE enhances the pursuit of an external signal and nearly maximises the speed of consensus about it.In proposing and investigating this resource allocation strategy the present work reveals features of this method and makes a comparison with classical optimization techniques. he comparison can be made in terms of time, computational efort and accuracy.
While the efort in computing the FLE is a function of the number of nodes and their connections, the eiciency of the numerical optimization process relies on the initial guess and the algorithm used.his is true in case of centralised computation and even more relevant when distributed strategies are adopted.Moreover, possible poor conditioning of the numerical optimisation problem should be taken into account.A resource assignment proportional to the FLE provides performance very close to the numerical optimal, with the advantage of not requiring an initial guess and achieving a guaranteed, near optimal consensus speed.
If the FLE were to be used in the context of distributed engineering systems (e.g.mobile robotic agents), then its calculation could be achieved in a distributed way. he distributed, on-line calculation of the FLE is beyond the scope of this paper.here are a number of methods proposed in the literature, which could be applied to computing the FLE on-line.hese methods are well suited for moderately sized distributed networks; however, they are not yet practical for implementation in large distributed systems.For example, the power iteration method has served as the basis for several algorithms [39][40][41][42][43] .hese algorithms, in most implementations, make the network nodes achieve a consensus about the FLE and the Fiedler value of the Laplacian matrix.hey require the graph connectivity, as in our case, and a network topology changing more slowly than the convergence time.In particular Di Lorenzo and Barbarossa 41 include the possibility of link failures through a stochastic approach.he algorithm proposed by Qu et al. 43 ofers good performance against the presence of possible communication delays.Finally, Bertrand and Moonen 40 provide a measure of the complexity of their algorithm with a number of loating point operations per node increasing linearly with the size of the node's neighbourhood.hese  1.First eigenvalues of the system matrix (L + D).L is the network graph Laplacian, D is a diagonal matrix whose nonzero entries are either the irst let eigenvector (FLE), a uniform vector or a vector numerically optimised to maximise the correspondent eigenvalue.All these have unitary L 1 norm.SCIENTIFIC REPORTS DOI srep algorithms, however, do not scale well in performance when the number of nodes increase beyond a few tens. he time needed to converge makes the distributed calculation not suitable for the time scales of many real world applications.he algorithm proposed by Salahi et al. 42 exploits the wave equation to extract the components of the FLE through a Fast Fourier Transform and this way provides a very fast algorithm.However the methods can easily be afected by noise, which cannot be disregarded in the context of real engineering systems.In this respect Di Lorenzo and Barbarossa 41 argue that the stochastic power iteration in their algorithm asymptotically reduces the noise variance, i.e. the detrimental efects of noise. he noise problem is a general one as this would afect all computations taking place over the network, including any optimization routine used in place of the FLE. he present study work considers nodes receiving an undisturbed external signal and communicating with their neighbours without any interference.As such, the problem considered does not take into account the efect of noise in communication on the dynamics.However, if noise were considered, the global limited resource framework is even more compelling.Suppose that each agent can only measure a noisy version of the true signal.Suppose further that the amount of noise agents receive is inversely proportional to their investment, or at least monotonically decreasing for an increasing investment, which could relate to power usage in the sensors or the sensor cost itself.In this case, agents with a higher investment (and higher cost) receive a better signal, and so can  SCIENTIFIC REPORTS DOI srep allocate a higher gain to tracking that signal.hen, to maximise the eiciency of the group, it is advisable to keep the total investment, i.e., the sum of the investments of each agent, as low as possible, or, alternatively (as is done here), achieve the maximum possible performance for a given level of total investment.In this scenario, having tracking gains sensibly smaller than the social term, where the FLE allocates them optimally, makes sense in the case of a very poor/noisy signal relative to the inter-agent communication.Collective migratory behaviours inluenced by noise have been analysed using graph theory 20 , while the complementary aspect of minimizing noise efects on the steady state variance of the group through leader selection has recently been tackled 33 .However, neither work considers the convergence speed as we do in the present paper.he second order system presented is a more compelling case for the problem of resource allocation as it presents, for the same agents, more dynamics to control and hence sets a limit on the amount of resources each agent can provide.he second order system, not surprisingly, shows how the optimization of the consensus speed about an externally fed velocity contrasts with the achievement of consensus about inter agent distances.Consequently, concentrating more social interaction towards the speed consensus, i.e. reducing κ, pushes the system behaviour towards that of the irst order system.κ = 0 would eliminate the oscillatory behaviour visible in Fig. 6a,b, but would also imply no control of inter-agent distances.he increase of the inter-agent distance social term makes the system more rigid as the lower let partition of the matrix in Eq. ( 16) prevails over the lower right partition.Considering the simpliied case of coupled damped oscillators, this would make the rigidity terms progressively larger with respect to the damping term, hence the faster, more oscillatory behaviour.
A general consideration emerges by comparing the performance of diferent graphs.Unbalanced graphs can have signiicantly improved performance in terms of convergence speed compared to balanced ones, which, aside from the biological motivation, demonstrates why directed, and unbalanced directed, graphs should be favoured for fast convergence.A noteworthy consequence is that the optimal diagonal matrix with ixed L 1 norm of a complete graph on N nodes will have entries 1/N, which is also the magnitude of the dominant eigenvalue of the resulting system.his leads to the associated dynamical system becoming slower in achieving the goal as the number of nodes increases.Conversely, reducing the number of connections and targeting just a few leading nodes can produce faster dynamics.he class of balanced graphs is not restricted to the circulant graphs (an Table 2. Rise time and settling time for the system in Eq. 7 subject to a step input along all three axes.he accuracy is ± 0.05 s. he inter-agent distance performance is evaluated through the time taken by the average of all the mean deviations of the agents from their intended inter-agent distances to stabilise within 5% of its peak value.In the "uniform" case, the relative distance does not reach the 5% of its maximum value because it is nearly constant as a result of all the agents being provided with the same input.At κ = 0.8 the rise time is short, but the system takes a long time to settle.In the numerical tests this was not achieved within the 80 seconds over which the system dynamics was simulated.Table 3. Smallest (in magnitude) eigenvalues of the system matrix for the second order system in its state space form.As for the irst order system the allocation of the tracking resources is considered according to the irst let eigenvector (FLE), a numerical optimised distribution and a uniform one.All these have unitary L 1 norm.example of which was also detailed in the Results section), nor to highly symmetric graphs.Other, less intuitive, balanced graphs produce the same slow convergence observed in the ring case whereas the uniform distribution indicated by the FLE remains the one maximising the convergence speed.
In limiting the amount of resources across the group, we take the perspective that it is costly for an agent to obtain information directly from the environment and considerably less costly to rely on social cues.his is consistent with studies in the literature on collective animal behaviour.For example, and Couzin used this perspective to study collective migration and the evolution of efort across the collective in obtaining information on a migratory direction; they assumed that to obtain the migratory direction, individuals pay for example in energy expenditure and reduced predator vigilance.We have shown that under the constraint of such a cost, fastest consensus is achieved with a non-uniform distribution of reactivity to the external signal.In the case of the second order, spatial system, for instance, a uniform distribution of signal pursuit duties over-constrains the swarm's ability to manoeuvre and results in slower responses to threats or manoeuvres towards a target.Instead, it is sensible to exploit the group dynamics so that the more reactive agents drive swarm manoeuvres.Such a targeted distribution of resources releases some agents from signal pursuit duties leaving them free to allocate resources to other tasks, such as predator vigilance or foraging.his consequently relaxes the constraints on the system while it results in faster responses to threats or manoeuvres towards a target.
In the present study, only time invariant networks have been considered.When looking at real systems, in particular those comprising mobile agents, these would continuously rewire their connections based on "who sees whom". he role of the changing network topology on system behaviour has been the subject of recent research; see the review by Gross and Blasius 45 .However, deriving analytical results on performance of a system determined by a changing network topology remains an open, challenging problem.In the present work, we account for a changing network topology by assuming a time scale separation in which the evolution of the network topology is slower than the time required to compute and update the resource allocation.In particular, we assume that the near-optimally of the FLE allocation remains during the period of time between allocation updates.his may be particularly true during collective manoeuvres.Consider, a ish school following a faint chemical plume or a warm subsea stream.When the school manoeuvres, the graph of interactions changes continuously, however, it is conceivable that from the time the manoeuvre is initiated to the time the school has engaged with it, the graph of interactions has not changed signiicantly.hat is the graph that matters may be the one that agents consider when weighting their attention towards the signal.In this respect a parallel with the biological world can be justiied in some cases.
he spectral approach proposed here lends itself well to engineering exploitation, although the challenges arising in real time applications must be addressed.On the other hand, this approach inds inspiration and mirroring in the natural world.While it is unlikely that biological locks rationally choose the amount of attention to pay to their neighbours, it is conceivable that evolution has provided good solutions.his has been veriied for the number of topologically interacting individuals in starling locks; analysis suggests that evolution may have produced a number maximising the robustness of consensus to noise 46 .In the same way, it would be interesting to compare the evolutionary solution to the limited resource allocation in the pursuit problem.

Methods
General Methods and First Order Dynamics Directed graphs (digraphs) with general typology, on N nodes, are considered.he network dynamics are expressed through the classical Laplacian matrix of the digraphs.With no external input the system would evolve reducing the diferences in the states of the connected nodes and, eventually, achieving a inal state, common to all the nodes.We consider the case in which a constant external input signal w is received by each node i with diferent magnitudes determined by the gains c i ≥ 0, i = 1, … , N. his is modelled by Eq. (1).For the sake of clarity, in the irst order system, a one-dimensional state is considered although the results can be extended to an n-dimensional state without loss of validity.
If a parallel was made with biological or engineering swarms, the allocation of a ixed amount of resources across the group is equivalent to electing individuals for signal pursuing and leaving others to look ater other tasks.Another fundamental assumption in this analysis is that ∑ c i i , known as the L 1 norm, is a ixed, given value.his implies that the signal pursuing duty is limited at the group level rather than the individual level.Since c i ≥ 0, the L 1 norm is equivalent to ∑ c i i . he Laplacian matrix is deined as where d i is the outdegree of node i, that is the number of edges that have origin in i. Eq. ( 2) is transformed to Eq. ( 3) through the change of coordinates 1 his eliminates the term Cw, or equivalently, sets the origin as the input.he results on the consensus speed are obtained by investigating the eigenvector corresponding to the spectral radius, that is the largest eigenvalue in magnitude, of a matrix M − D, where M = − L + kI, I is the identity matrix, and D is a diagonal matrix with nonnegative diagonal elements.he spectrum of any matrix is shited by the constant quantity k if a uniform, diagonal perturbation kI is added.Hence the spectrum of M is shited by k with respect to the spectrum of − L. he same applies to the matrices − L − D and M − D. he eignevectors, however, are not afected by the shiting.
holds, where u and v are the irst right and let eigenvector respectively of B associated to its spectral radius 37 .he entries of both and v are nonnegative.Using Eq. ( 10) the linearisation of the spectral radius of M − D can be expressed as a function of the matrix entries as in Eq. ( 5). he linearisation is a good approximation of the spectral radius of M − D when Further assume that the system has high coupling gains, that is  LC for some norm ||•||.hen, i ii In particular, as the rightmost eigenvalue of − L is zero, Eq. ( 11) implies Eq. ( 6).
Second order system.Eq. ( 7) can be written in vector form to evaluate the consensus speed of the second order system.Assume that agents do not have a preference, or a driving input for their positions in absolute terms, that is = C 0 i z , for all i = 1, 2… .N. hen, Eq. ( 7) can be written in vector form as dd vw 2 2 where, C d , C v and C w are diagonal matrices, w = w1 as before, with w a desired common speed.H is a matrix of the edge-weighted desired distances between any two connected agents.For illustrative purposes, H can be deined so that the physical distance between two agents tracks the topological distance, that is where a ij is the entry of the adjacency matrix, as previously stated.Note that H can have negative entries as this is the distance with sign between the indices of two connected nodes in the graphs (e.g. if there is an oriented edge from node 4 to node 1, then H(4, 1) = − 3).Matrices C d , C v and C w are chosen so as to comply with the bound on the total amount of resources allocated.Moreover, agents are forced to seek velocity consensus by ensuring that not all the resources are allocated to the inter-agent distance keeping task only.his is expressed by the relation Nodes at the let hand side have more outgoing than incoming edges, while nodes at the right hand side end have more incoming than outgoing edges.Note that an outgoing edge implies that the node where the edge is originated "observes" the node where the edge ends.
SCIENTIFIC REPORTS DOI srep vw dwd Using matrix notation, Eq. ( 15) becomes dv w wd where I is the identity matrix of appropriate dimension, while C d , C v and C w are diagonal matrices weighting the social and external contributions. he system matrix in Eq. ( 16) has one zero eigenvalue as a consequence of the fact that just the relative distances between the agents are ixed but not the positions in absolute terms.his is proved in the Supplementary Information S6. he stability analysis was performed numerically for the second order system and restricted to the case of an asymmetric lattice. he analysis includes an assessment of the inluence of the resource sharing between the social terms of position and velocity and is reported within the Supplementary Information S7 and S8.
For the rise time and the settling time considered in Table 2, the accuracy is ± 0.05 s. he inter-agent distance performance is evaluated through the settling time for the agents' mean deviations from their intended inter-agent distances.he inter-agent distances are considered settled when this value drops within 5% of the peak value achieved during the simulation.As the change in velocity requested in the motion along y and z axes is the same, their dynamical response is identical and are hence combined together in the plot and the Tables.
Graphs he graphs considered here are directed, "sensing graphs": an edge ij implies that node i senses, or gathers information on, the state of node j.Whilst the analytic development is independent of the graph and just based on the hypothesis of connectedness, the numerical simulations are run using four graphs of interactions.he irst one, on which the second order dynamics simulations are based too, is an asymmetric lattice.his can represent individuals all looking in the same directions (say forward), and focussing their attention on a restricted number of neighbours found in their ield of view.his inds justiication in the preferential direction of view found in animal groups and in the attention being concentrated on a restricted group of individuals in particular areas within their sensing range 46 .Here it was chosen to give preference to the forward sensing more than the backward sensing within a maximum sensing range of two subsequent individuals.A lattice is a plausible, though somewhat rigid, representation of the sensing links in groups where sensing range is limited.he sketch in Fig. 7 represents the linking scheme.
he ring graph and the small world graph are derived from the asymmetric lattice by either transforming the adjacency matrix of the asymmetric lattice into a circular one or rewiring, with probability 0.1, the links of the asymmetric lattice. he random graph is created by setting links between any two agents with a probability arbitrarily set to 0.15.
Numerical Simulations he dynamics are integrated using the Dormand-Prince method 47 .he numerically optimised resource distribution is obtained through a constrained nonlinear optimization, using an interior point method.he initial guess for the optimization is the irst let eigenvector, so that the optimizer cannot perform any worse than the result obtained through the FLE.In the second order system, to study the sensitivity of the outcome to a simple parametrization of the In test cases the system is allowed to relax, starting from random initial positions distributed on a sphere of radius N/2, with velocities on the unit sphere.he agents achieve uniform distances from their neighbours and uniform velocity along the positive x-axis, both set to be unitary in magnitude.he swarm is then subject to a step-like input in speed along the vector       ,, at time 0. he simulations are run for 200 s prior to time 0 during which the system evolves from random initial conditions to achieving a uniform velocity distribution along the x-axis and uniform spacing.hen the stimulus is fed to the system and the simulations are run for a further 80 s.
he rise time is deined as the time elapsed for the average group velocity to match the target value, regardless of the overshoot.he settling time is deined as the time to stabilise the average of either the group velocity or the inter-agent distance, both within 5% of their target value.
SCIENTIFIC REPORTS DOI srep

Figure 1 .
Figure 1.Consensus in a lattice and performance comparison.(a) Comparison among the values of the diagonal entries of matrix D for the matrix composed of the irst let eigenvector, a vector obtained through numerical optimisation and one obtained by distributing evenly the tracking characteristics.All these vectors are scaled to have a unitary L 1 norm.(b) Time evolution of the irst order system driven to consensus about x = 1 by the diagonal perturbation of the Laplacian.

Figure 2 .
Figure 2. Consensus in a ring and performance comparison.(a) Comparison among the values of the diagonal entries of matrix D for the matrix composed of the irst let eigenvector, a vector obtained through numerical optimisation and one obtained by distributing evenly the tracking characteristics.All these vectors are scaled to have a unitary L 1 norm.(b) Time evolution of the irst order system driven to consensus about x = 1 by the diagonal perturbation of the Laplacian.As the three distributions coincide the plots overlap.

Figure 3 .
Figure 3. Consensus in a Small World network and performance comparison.(a) Comparison among the values of the diagonal entries of matrix D for the matrix composed of the irst let eigenvector, a vector obtained through numerical optimisation and one obtained by distributing evenly the tracking characteristics.All these vectors are scaled to have a unitary L 1 norm.(b) Time evolution of the irst order system driven to consensus about x = 1 by the diagonal perturbation of the Laplacian.

Figure 4 .
Figure 4. Consensus in a random network and performance comparison.(a) Comparison among the values of the diagonal entries of matrix D for the matrix composed of the irst let eigenvector, a vector obtained through numerical optimisation and one obtained by distributing evenly the tracking characteristics.All these vectors are scaled to have a unitary L 1 norm.(b) Time evolution of the irst order system driven to consensus about x = 1 by the diagonal perturbation of the Laplacian.

Figure 5 .
Figure 5.Time history of the average node state for the irst order system driven to consensus about x = 1 by the diagonal perturbation of the Laplacian.50 and 100 node systems are considered.Scaling the integration time with the nodes returns very similar time histories, regardless the size of the systems.For each system both the dynamics given by the FLE and by a numerically optimised resource distribution are plotted.he blue curves refer to the 50 node system and are plotted against the blue horizontal axis at the top. he red curves are plotted against the red axis at the bottom.

Figure 6 .
Figure 6.Consensus in a lattice network, for a second order system for κ = 0.1 (see Methods).(a) Consensus about x velocity.(b) Consensus about y or z velocity.(c) Standard deviations of the agent relative distances over time showing consensus about common reciprocal separation.(d) Trajectories in a physical space of the agents from the initial random state (initial position in a sphere of radius N/2 and initial velocities in the unit sphere) to consensus about a common direction and relative distances.Step change in target velocity produces the bend and the alignment to the direction       ,, Assume that the matrix − (L + D) is Hurwitz, that is all its eigenvalues have negative real part, and that the scalar k is real, positive and larger than the largest eigenvalue in magnitude of − (L + D). his makes M− D = − L − D + kI a strictly positive matrix with the smallest eigenvalue in magnitude of − (L + D) corresponding to the spectral radius of − L − D + kI, namely ρ(M − D).Hence the D that minimizes ρ(M − D) corresponds to the D that maximizes the smallest eigenvalue in magnitude of − (L + D) and thus maximises consensus speed.In particular, given a generic N × N matrix B its spectral radius is an always increasing function of each entry of B, and in particular the expression  LD .Now let D = C = diag{v}, where v is the FLE of L with L 1 norm equal to positive scalar α.Let u = u1, u = β/N, then u is the irst right eigenvector of L with L 1 norm equal to positive scalar β.Let  u and  v be the same vectors scaled such that each has unitary L 1 norm, i.e.,

Figure 7 .
Figure 7. Sketch of the lattice network.Each node in the inner section has 3 outgoing and 3 incoming edges.Nodes at the let hand side have more outgoing than incoming edges, while nodes at the right hand side end have more incoming than outgoing edges.Note that an outgoing edge implies that the node where the edge is originated "observes" the node where the edge ends.
model can be translated into the state space using the variables r and s such that x = r and dx/dt = s. he resulting state space form is parameter κ ∈ [0, 1], which limits to unity the total amount of resource allocated to each single agent.