On fast-slow consensus networks with a dynamic weight

We study dynamic networks under an undirected consensus communication protocol and with one state-dependent weighted edge. We assume that the aforementioned dynamic edge can take values over the whole real numbers, and that its behaviour depends on the nodes it connects and on an extrinsic slow variable. We show that, under mild conditions on the weight, there exists a reduction such that the dynamics of the network are organized by a transcritical singularity. As such, we detail a slow passage through a transcritical singularity for a simple network, and we observe that an exchange between consensus and clustering of the nodes is possible. In contrast to the classical planar fast-slow transcritical singularity, the network structure of the system under consideration induces the presence of a maximal canard. Our main tool of analysis is the blow-up method. Thus, we also focus on tracking the effects of the blow-up transformation on the network's structure. We show that on each blow-up chart one recovers a particular dynamic network related to the original one. We further indicate a numerical issue produced by the slow passage through the transcritical singularity.


Introduction
A wide range of scientific disciplines, such as biochemistry [5,75], economics [67], social sciences [51,61,62], epidemiology [9,58], among many others, benefit from the progress in network theory. Network science represents an important paradigm for modeling and analysis of complex systems. In network theory, individuals are represented as vertices on a graph. These individuals, or agents, can be persons in a community, robots working in an assembly line, computers in an office building, particles of a chemical substance, etcétera. The interactions between such individuals are then represented as edges or links of the graph. For example, if two persons talk to each other, and one influences the other, we then associate an edge on the graph to such an activity. Similarly, interactions can be identified with edges in all other aforementioned examples. Thus, the individual's own dynamics (the nodes' dynamics) and the interaction it has with other individuals of the network (the topology of the network) will not only determine its own fate, but that of the entire group of individuals. This rather convenient way of describing complicated dynamic behavior is quite powerful and has attracted an enormous scientific interest [2,10,12,68].
From an applied mathematical perspective, topics such as stability, convergence rates, synchronization, connectivity, robustness, and many others can all be formally described and have important implications in other sciences. In a large part of the mathematical studies of networks, one considers that the interactions between the agents are fixed [11]; see also Section 2. In another large part of the theory one frequently assumes that the network structure evolves without dynamics at nodes [73]. In most cases, these assumptions are a simplification since it may be expected that there is coupled dynamics of and on the network, i.e., one has to deal with adaptive (or co-evolutionary) networks [27]. A crucial assumption to approximate an adaptive network by a partially static one with either just dynamics on or dynamics of the network is time scale separation [39]. Yet, if one assumes that either the dynamics on the nodes or the dynamics of the edges are infinitely slow, hence static, leads to a singular limit description. This limit is known to miss adaptive network dynamics effects induced by the interaction of dynamical variables for finite time scale separation [38]. Also from the viewpoint of applications, a finite but large time scale separation is far more reasonable. As an example, consider a group of people that communicate with each other daily but whose mutual influences shape the way they handle elections. One of such activities occurs in time scales of minutes or hours, while the other in time scales of years, yet both are interrelated in a complex manner. Similar examples where different sorts of relations occur at distinct time scales can be found in population dynamics, telecommunication networks, power grids, etcétera. So, although time scales add an extra level of difficulty to the analysis of networks, they may be useful for a more accurate representation of certain phenomenona. On the other hand, dynamical systems with two or more time scales have also been of interest from many perspectives, particularly in applied mathematics. The overall idea is to distinguish slow from fast subprocesses, analyze them separately, and then come up with an appropriate description of the problem [31,33,39,56,74]. This basic idea can be made rigorous, and has proven to be powerful. However, there are generic complex systems in which the time scale separation can no longer be clearly distinguished. Thus more advanced mathematical techniques are required to analyze multi-scale adaptive networks.
In this article we bring together network and multi-scale theories to study a class of adaptive networks. We are interested in networks whose agents communicate in a rather simple way, known as linear average consensus protocol (see the details in Section 2.2). This type of communication has been largely studied due to its relevance in all kinds of sciences [46,64]. On this class of networks we assume that there is one interaction or communication link that slowly changes over time and investigate the implications of it. We shall see that the aforementioned setting leads to a nontrivial problem from both, network and multi-scale, contexts. As a result we describe the overall behavior of the network by adequately incorporating techniques from consensus dynamics and geometric singular perturbation theory.
The forthcoming parts of this work are arranged as follows: in Section 2 we provide a short technical introduction to the main topics of this paper, namely fast-slow systems and consensus networks. In Section 3 we present our main contribution, which consists in the analysis of a simple network that has a dynamic weight and whose overall dynamics evolve in two time scales. Next, in Section 4 we show that, in qualitative terms, the analysis performed for the aforementioned simple network can be extended to arbitrary networks with one dynamic edge. We finish in Section 5 with concluding remarks and an outlook on future research.

Preliminaries
In this section we provide a brief recollection of the two mathematical areas that come together in this paper. We first state what a fast-slow system formally is, the concept of normal hyperbolicity, and two relevant geometric techniques of analysis. Afterwards, to place our work into context, we recall and provide appropriate references to some of the relevant results on dynamic networks.

Fast-slow systems
A fast-slow system is a singularly perturbed Ordinary Differential Equation (ODE) of the form εẋ = f (x, y, ε) y = g(x, y, ε), where x ∈ R m and y ∈ R n are, respectively, the fast and slow variables, and where 0 < ε 1 is a small parameter accounting for the time scale difference between the variables. The overdot denotes derivative with respect to the slow time τ . By defining the fast time t = τ /ε, one can rewrite (1) as where the prime denotes the derivative with respect to the fast time t. Observe that, for ε > 0, the only difference between (1) and (2) is their time-parametrization. Therefore, we say that (1) and (2) are equivalent.
Although there are several approaches [39] to the analysis of fast-slow systems, e.g. classical asymptotics [20,21,56,74], here we take a geometric approach [24,31], which is called Geometric Singular Perturbation Theory. The overall idea is to consider (1) and (2) restricted to ε = 0, understand the resulting systems, and then use perturbation results to obtain a description of (1) and (2) for ε > 0 sufficiently small. Therefore, two important subsystems to be considered are 0 = f (x, y, 0) y = g(x, y, 0), which are called the constraint equation [69] (or slow subsystem or reduced system) and the layer equation (or fast subsystem) respectively. It is important to note that the constraint and layer equations are not equivalent any more, there are even different classes of differential equations as the constraint equation is a differential-algebraic equation [42], while the layer equation is an ODE, where the slow variables y can be viewed as parameters. In some sense the time scale separation is infinitely large between two singular limit systems (3). However, a geometric object that relates the two is the critical manifold.
Definition 1. The critical manifold of a fast-slow system is defined by The critical manifold is, on the one hand, the set of solutions of the algebraic equation in the constraint equation, and on the other hand, the set of equilibrium points of the layer equation. There is an important property that critical manifolds may have, called normal hyperbolicity.
where D x denotes the total derivative with respect to x, have non-zero real part. The critical manifold C 0 is called normally hyperbolic if every point p ∈ C 0 is hyperbolic. On the contrary, if for a point p ∈ C 0 we have that D x f (p, 0) has at least one eigenvalue on the imaginary axis, we then call p non-hyperbolic.
In a general sense, whether a critical manifold has non-hyperbolic points or not, dictates the type of mathematical techniques that are suitable for analysis. For the case when the critical manifold is normally hyperbolic, Fenichel's theory [24] (see also [72] and [41,Chapter 3]) asserts that, under compactness of the critical manifold, the constraint and the layer equations give a good enough approximation of the dynamics near C 0 of the fast-slow system for ε > 0 sufficiently small. In the normally hyperbolic case for 0 < ε 1, there exists a slow manifold C ε , which can be viewed as a perturbation of C 0 ; see also [24,41].
The case when the critical manifold has non-hyperbolic points is considerably more difficult. One mathematical technique that has proven highly useful for the analysis in such a scenario is the blow-up method [19]. Briefly speaking, the blow-up method consists on a well-suited generalized polar change of coordinates. What one aims to gain with such a coordinate transformation is enough hyperbolicity so that the dynamics can be analyzed using standard techniques of dynamical systems. Nowadays, the blow-up method is widely used to analyze the dynamics of fast-slow systems having non-hyperbolic points in a broad range of theoretical contexts and applications. For detailed information on the blow-up technique the reader may refer to [19,30,36], [41,Chapter 7] and references therein.

Consensus networks
In this section we formally introduce the type of consensus problems on an adaptive network which we are concerned with in this work. Let us start by introducing some notation: we denote by G = {V, E, W} an undirected weighted graph where V = {1, . . . , m} denotes the set of vertices, E = {e ij } the set of edges and W = {w ij } the set of weights. We assume that the graph is undirected, that there are only simple edges, and that there are no self-loops, that is e ij = e ji and e ii / ∈ E. To each edge e ij we assign a weight w ij ∈ R and thus we identify the presence (resp. absence) of an edge with a nonzero (resp. zero) weight. Moreover, we shall say that a graph is unweighted if all the nonzero weights are equal to one. The Laplacian [44] of the graph G is denoted by L = [l ij ] and is defined by Remark 1. The majority of the scientific work regarding adaptive/dynamic networks considers non-negative weights. One of the reasons for such considerations is that the spectrum of the Laplacian matrix is well identified [10,48,54], which simplifies the analysis. When the weights are allowed to be positive and negative one usually refers to L as a signed Laplacian. Difficulties arise due to the fact that many of the convenient properties of non-negatively weighted Laplacians do not hold for signed Laplacians. In some part of the literature, see for example [3,60], the diagonal entries of the Laplacian matrix are rather defined by m j=1 |w ij |. In this case, however, the Laplacian matrix is positive semi-definite and the potential loss of stability due to dynamic weights (the main topic of this paper) is not possible. One the other hand, Laplacian matrices defined by (5) are relevant in many applications. For example, in [13,35,57] problems like agent clustering are studied while the stability of networks under uncertain perturbations is considered in [16,79].
We identify each vertex i of the graph G with the state of an agent x i . Here we are interested on scalar agents, that is x i ∈ R for all i = 1, . . . , m. We now have a couple of important definitions.

Definition 3.
• We say that the agents x i and x j agree if and only if x i = x j .
• Consider a continuous time dynamical system defined bẏ where x = (x 1 , . . . , x m ) ∈ R m is the vector of agents' states. Let x(0) denote initial conditions and χ : R m → R be a smooth function. We say that the graph G reaches consensus with respect to χ if and only if all the agents agree and x i = χ(x(0)) for all i ∈ V.
• We say that f (x) defines a consensus communication protocol over G if the solutions of (6) reach consensus.
We note that the above definition of consensus is rather general, in the sense that there can be "discrete consensus" if all agents only agree at discrete time points; "finite time consensus" if x i (T ) = χ(x(0)) for all i ∈ V and t > T with 0 ≤ T < ∞; "asymptotic consensus" if lim t→∞ x i (t) = χ(x(0)) for all i ∈ V; and so on. Similarly, several consensus protocols can be classified with respect to the function χ, see e.g. [54,55,66].
The appeal in studying consensus problems and protocols is due to their wide range of applications in, for example, computer science [71], formation control of autonomous vehicles [23,29,65], biochemistry [17,28], sensor networks [53], social networks [4,77], among many others. A simple example of consensus would be a group of people in which all agree to vote for the same candidate in an election. Another example would be a group of autonomous vehicles that are set to move with the same velocity.
In this paper we are interested in one of the simplest consensus protocols that leads to average consensus, that is χ(x(0)) = 1 m m i=1 x i (0) with the protocol defined by This communication protocol is particularly interesting since it is an instance of a distributed protocol. In other words, the time evolution of x i is solely determined by its interaction with other agents directly connected to it. This type of protocols are widely investigated in engineering applications, for example to design controllers that only require local information in order to achieve their tasks [43,49,63,76]. Alternatively, this linear average consensus protocol can be written aṡ where L denotes the Laplacian of G as defined by (5). It is then clear that the behaviour of the agents is determined by the spectral properties of the Laplacian matrix [44,48,78]. One of the most relevant results for systems defined by (8) is that, if the graph is connected and all the weights are positive, then (8) reaches average consensus asymptotically [54]. Although most of the scientific work has been focused on consensus protocols over unweighted graphs and with fixed topology, there is an increased interest in investigating dynamical systems defined on weighted graphs with varying and/or switching topologies [15,45,50,55,59,70].
In the main part of this article, Sections 3 and 4, we are going to consider linear average consensus protocols with a dynamic weight. This dynamic weight is assumed to have a slower time scale that that of the nodes. Therefore, it makes sense to approach the problem from a singular perturbation perspective. We will see that under generic conditions on the weight, the fact that the dynamics are defined on a network, induces the presence of a non-hyperbolic point. As we have described in Section 2.1, one suitable technique of analysis to describe the system is then the blow-up method. Since the blow-up method is a coordinate transformation, one should check whether such a transformation preserves the network structure or not. For general networks, this is a classical problem and it is known that for certain coordinate changes, network structure is not preserved [25,26]. Yet, sometimes symmetries help to gain a better understanding for certain classes such as coupled cell network dynamics [52]. As we will show, the blow-up method not only preserves the network structure for our consensus problem but the blown-up networks in different coordinate charts also have natural dynamical and network interpretations. In qualitative terms this tells us that the blow-up method is a suitable technique for the analysis of adaptive networks with multiple time scales.
Before proceeding to our main contribution, in the next section we present a first interconnection between the topics discussed above. We show that Fenichel's theory suffices to analyze statedependent linear consensus networks with two time scales, and for which the Laplacian matrix has just a simple zero eigenvalue.

State-dependent fast-slow consensus networks with a simple zero eigenvalue
In this section we show that Fenichel's theorem is enough to describe the dynamics of arbitrary fastslow consensus networks with state dependent Laplacian as long as λ 1 = 0 is a simple eigenvalue, i.e., we are going to show that the zero eigenvalue corresponds to a trivial parametrized direction and that for each parameter we have a normally hyperbolic structure. The result presented below is motivated by a similar claim that appears in [8,Section B]. However, here we are not concerned with the stability of the fast nor the slow dynamics, and the use of Fenichel's theorem appears more aligned to the contents of this paper. Let us then consider the fast-slow system where x ∈ R m , y ∈ R n , ε > 0 is a small parameter, and L(x, y, ε) is a state dependent Laplacian matrix.
Proof. Let X = (X,X) ∈ R × R m−1 be new coordinates defined by where the matrix Q is found via the Gram-Schmidt process after selecting the first component as indicated in (11). Although L(x, y, 0) cannot really be regarded as a fixed linear operator acting on R m as it depends upon (x, y), the choice of the eigenvector 1 m is justified due to the fact that λ 1 = 0 is a simple zero eigenvalue of the Laplacian matrix L(x, y, 0) if and only if L(x, y, 0)1 m = 0 for all (x, y) ∈ U x × U y . Note then thatX denotes the average of the nodes' states. It now follows that from the equation of x we have Therefore we have that (9) is conjugate tō whereL(X,X, y, ε) = QL(P −1 X, y, ε)Q andĝ(X,X, y, ε) = g(P −1 X, y, ε). One observes that, as expected,X has the role of a parameter. Furthermore, due to our hypothesis and definition ofL, we have that the matrixL(X,X, y, 0) is invertible within the compact region of interest.
Next we are going to consider a case study in which Fenichel's theory is not enough to describe the dynamics of a fast-slow network.

A triangle motif
In this section we study a motif [47]. Motifs can be seen as building blocks of more general and complex networks. Indeed, as we describe throughout this article, all the dynamic traits and properties that the triangle motif exhibits can be extended to arbitrary networks, see Section 4.
Let us consider the following network To each node i = 1, 2, 3 we assign a state x i = x i (t) ∈ R. We assume that the dynamics of each node are defined only by diffusive coupling. Moreover, we assume that w ∈ R is a dynamic weight depending on the vertices it connects and on an external state y ∈ R, which is assumed to have much slower time evolution than that of the nodes. Hence, we study the fast-slow system where w = w(x 1 , x 2 , y, ε) is a smooth function of its arguments and 0 < ε 1 is a small parameter. In this section we shall consider the simple case in which w is affine in the state variables, that is with α 0 , α 1 , α 2 , α 3 real constants. We further assume the non-degeneracy condition α 3 = 0 to ensure coupling between the slow and fast variables. By shifting and rescaling y → α 0 + α 3 y, and a possible a change of signs of the variables, we may also assume with α 1 ≥ 0 and α 2 ≥ 0.

Preliminary analysis (the singular limit)
The following transformation, which is simple to obtain, will be useful throughout this work.
Lemma 1. Consider the symmetric matrix L defined in (14). Then the orthogonal matrix Thus, applying the coordinate transformation defined by (X, Y ) = (T x, y) one obtains the conjugate diagonalized system where D(X, Y ) = diag {0, 3, 2W + 1} and Observe that the fast-slow system (18) has a conserved quantity given by X 1 = 0, which arises due the zero eigenvalue of the Laplacian matrix L of (14). Since this is a trivial eigenvalue, that is, independent of the dynamics, we shall assume that X 1 is a coordinate on the critical manifold and not in the fast foliation, see also Section 2.3.
The previous observations allow us to reduce the analysis of (18) to that of the planar fast-slow system where X 1 is regarded as a parameter. It follows that the corresponding critical manifold is It is now straightforward to see that, for fixed X 1 ,p = (X 3 , Y ) = 0, − 1 2 − β 1 X 1 is a nonhyperbolic point of the critical manifold.
Remark 3. Our goal will be to describe the dynamics of the network shown in Figure 1 as trajectories pass through the non-hyperbolic pointp. The reason to consider this will become clear below when we give an interpretation of the singular dynamics in terms of the network. Thus, we assume thatG(X 1 , 0, 0, − 1 2 − β 1 X 1 , 0) < 0. Singular dynamics in terms of the network: from the definition X = T x we have So, first of all, we have that the uniformly globally exponentially stable set A, previously defined by A = (X 1 , X 2 , X 3 , Y ) ∈ R 4 | X 2 = 0 (see Remark 2), is equivalently given by Naturally, the uniform global stability of A is still valid. Next, if we restrict (14) to A we obtain which is the model of a 2-node 1-edge fast-slow network as show in Figure 2. Figure 2: Reduced graph corresponding to (23). The dynamics of the triangle motif converge exponentially to the dynamics of this simpler graph.
Next, we note in (23) Therefore, just as in the diagonalized system above, we can reduce the analysis of the triangle motif to the analysis of the planar fast-slow system Now, it is straightforward to see that the critical manifold is given by Let us consider the lines which are subsets of the critical manifold since is the only non-hyperbolic point of the layer equation of (24), and that the stability properties of C 0 are as shown in Figure 3. For brevity let Next, suppose trajectories converge to N a 0 . This means that (x 1 (t), x 2 (t), x 3 (t)) → σ0 2 (1, 1, 1) as t → ∞. That is, the agents reach consensus, hence we call N 0 the consensus manifold. On the other hand, assume trajectories converge to M a 0 . For this it is necessary that α 1 −α 2 = 0, otherwise M 0 is tangent to the fast foliation. Then ( t → ∞. That is, for fixed values of y, agents converge to different values depending on their initial conditions. Therefore, we call M 0 the clustering manifold. Our goal will be to describe the dynamics of the network as agents transition from consensus into clustering. Thus, we also assume that g(p, 0) < 0.
Remark 4. Note that the sign of (α 1 − α 2 ) only changes the orientation of M 0 . In fact, if we denote (24) by X(x 1 , y, ε, ρ) with ρ = α 1 − α 2 ≥ 0, one can show that X(x 1 , y, ε, −ρ) = −X(−x 1 , y, ε, ρ). From this we shall further assume that α 1 − α 2 ≥ 0. For completeness we show the singular limit for the case (α 1 − α 2 ) < 0 in Figure 4, but shall not be further discussed. It should be clear up to this point that the main difficulty for the analysis of the fast-slow system (24) is given by the transition across a transcritical singularity [18,37]. Our goal is not to present a new analysis of this phenomenon but rather to study the effects of the blow-up transformation in a network. We shall show below that on each chart of the blow-up space, the resulting blow-up system can also be interpreted as a particular adaptive network. More importantly, it turns out that via the blow-up transformation one gains a clear distinction between the dynamics occurring at the different time scales. On a more technical matter, we will also show that the fact that the problem under study is defined on a graph results on a maximal canard, which in [18,37] is non-generic.

Main result
Since p is non-hyperbolic, the classical Fenichel theorem is not enough to conclude that for ε > 0 sufficiently small we have a qualitatively equivalent behaviour to the one in the limit ε = 0 described above. Therefore, a more detailed analysis is needed for our purposes. To state our main result, and for the analysis to be performed later, it will be convenient to move the origin of the coordinate system to the non-hyperbolic point p and to relabel the coordinates of the nodes. So, let us perform the following steps 1. Relabel the fast coordinates as x = (x 1 , x 2 , x 3 ) = (a, b, c). This will make our notations across the blow-up charts simpler.
With the above we now consider where w = − 1 2 + y + α 1 a + α 2 b. Next, let us define the sections where δ > 0 is of order O(1). We further define the map which is induced by the flow of (14). We prove the following.
is globally attracting.
(T2) The critical manifold of (27) is contained in A and is given by the union where (T3) Restriction to A is equivalent to the restriction to {b = −a, c = 0}.
Restricted to A and for ε > 0 sufficiently small: (T4) There exists a slow manifold N ε = (a, y) ∈ R 2 | a = 0 that is a maximal canard. Moreover, N ε is attracting for y > 0 and repelling for y < 0.
. Moreover, every trajectory with initial condition in Σ en with a = 0 diverges from N ε exponentially fast as t → ∞. where with D + denoting the Dawson function [1, pp. 219 and 235]. In this case, if (a − b)| Σ en > 0 then the map Π is well-defined and the corresponding trajectories converge towards M a ε as t → ∞. On the contrary, if (a − b)| Σ en < 0, then the corresponding trajectories diverge exponentially fast as t → ∞.
Proof. Items (T1) and (T2) have already been proven in our preliminary analysis of Section 3.1. Item (T3) readily follows from the relations a + b + c = 0 and c = a+b 2 , which are simultaneoulsy satisfied on A. The proof of items (T3)-(T6) is given in Section 3.3.4.
The claims of Theorem 2 are sketched in Figure 5.
Interpretation: In terms of the network, Theorem 2 tells us that: • The time evolution of the node c (the node that is not connected by the dynamic weight) can always be described as a combination of the dynamics of the nodes (a, b) (those connected to the dynamic weight). • The parameters α 1 , α 2 in the definition of the weight w = − 1 2 + y + α 1 a + α 2 b, play an essential role: i) if α 1 = α 2 then there is no "clustering manifold". Another way to interpret this degenerate case is that the nodes (or agents) have an equal contribution towards the value of the weight. This results in a zero net contribution of the nodes towards the dynamics of the weight. This is already noticeable in (24), where α 1 = α 2 results inw being independent on the nodes' state. In this case the dynamics are rather simple, trajectories are attracted towards consensus for y > 0 and repelled from consensus for y < 0; ii) if α 1 = α 2 , then the clustering manifold exists. For suitable initial conditions, the nodes first approach consensus, but then, when y < 0, the nodes tend towards a clustered state in which b = −a and c = 0.
• The consensus manifold N ε is a maximal canard, which implies that one observes a delayed loss of stability of N ε . In other words, one expects that trajectories exponentially near N ε stay close to it for time of order O(1) after they cross the transcritical singularity before being repelled from it. See also Appendix A.

Blow-up analysis
In this section we are going to study the trajectories of (27) in a small neighbourhood of the origin.
Remark 5. We could naturally perform the blow-up analysis restricted to the invariant and attracting subset A. However, since one of our goals is to investigate the effects of the blow-up on network dynamics, we shall proceed by blowing up (27) and track, on each chart, the resulting "blown-up network dynamics".
We define the charts Accordingly we define local coordinates on each chart by The following relationship between the local blow-up coordinates will be used throughout our analysis.
Lemma 2. Let κ ij denote the transformation map between charts K i and K j . Then Note that κ −1 ij = κ ji .
Let us now proceed with the blow-up analysis on each of the charts. We recall that on K 1 one studies orbits of (27) as they approach the origin, on K 2 orbits within a small neighborhood of the origin, and finally on K 3 orbits as they leave a small neighborhood of the origin.

Analysis in the entry chart K 1
In this chart the blow up map is given by We then obtain the blown up vector field where f 1 (a 1 , b 1 , c 1 , r 1 , ε 1 ) reads as Remark 6. In (39) and (40) the term −1 + O(r 1 ) stands for exactly the same function.
O(r 1 ε 1 ) Figure 6: Network interpretation corresponding to (39). The order O(1) terms in (39) correspond to a triangle motif with fixed weights. The particular values of the weights make such a network degenerate in the sense that the corresponding Laplacian has a kernel of dimension two. Next, the order O(r 1 ) terms in (39) correspond to two nodes connected by a dynamic weight. Finally, the O(r 1 , ε 1 ) correspond to internal node dynamics.
Let us interpret the equations in the first chart from a network dynamics perspective. We are interested in the dynamics of (39) for ε 1 small and with r 1 → 0. This is because r 1 → 0 is equivalent to y(t) approaching the origin in (27). Thus, we may regard (39) as a perturbation of a network with fixed weights as shown in Figure 6.
The order O(r 1 ) terms can be seen as a smaller network, only involving the nodes (a 1 , b 1 ) and with dynamic edge with weight r 1 (1 + α 1 a 1 + α 2 b 1 ). The order O(r 1 ε 1 ) can be interpreted as internal dynamics on each node.
Continuing with the analysis, it is straightforward to check (with the help of (17)) that for (39). We now proceed with a more detailed analysis of (39) as follows.
Proposition 1. System (39) has the following sets of equilibrium points.
Next, we show that the set defined by c 1 = a1+b1 2 is an attracting centre manifold.
Proposition 2. The system given by (39) has a local 4-dimensional centre manifold W c 1 and a local 1-dimensional stable manifold W s 1 . The centre manifold W c 1 contains the sets of Proposition 1. Furthermore, W c 1 is given by c 1 = a1+b1 2 , and the flow along it reads as Proof. We start by using the similarity transformation (17). Under such a transformation one rewrites (39) as where It is now straightforward to see that there is a 1-dimensional stable manifold W s 1 tangent to the B 1 -axis and a 4-dimensional centre manifold W c 1 containing the set of equilibrium points Remark 7. Observe that, due to the term (−1 + O(r 1 )), the vector field corresponding to B 1 is not decoupled from the center directions. However, we show below that W c 1 is indeed given by B 1 = 0. The centre manifold W c 1 can be expressed by B 1 = h 1 (r 1 , A 1 , C 1 , ε 1 ) satisfying h 1 (0) = 0, Dh 1 (0) = 0, where Dh 1 denotes the Jacobian of h 1 . Let h 1 be given as where σ ijkl denotes scalar coefficients. Substituting (45) into the equation for B 1 we get We now have the following observations: 1. All the monomials in the right hand side of (46) are of degree at least 3, therefore, all coefficients σ ijkl with i + j + k + l = 2 are zero.
2. Since the right hand side of (46) is of order O(r 1 ) we have that all coefficients σ ij0l are zero for all i + j + l ≥ 3. Naturally, we then have that h 1 ∈ O(r 1 ) and thus k ≥ 1.
3. The coefficients σ ijk0 , k ≥ 1, are computed from the equality where the last equation is introduced for simplicity. We readily see that all coefficients σ i0k0 with i + k ≥ 3 are zero. Next, for i + j + k = 3, the term h 1 C 1 ∂h1 ∂C1 does not play a role because its degree is at least 4. It follows from the first item that σ ijk0 = 0 for i + j + k = 3. Next, let us write (47) in a simplified form by i) expanding it, ii) writing all monomials in the exact same form A i 1 C j 1 r k 1 , iii) by omitting the monomial, and iv) omitting the 0 of the superscript σ ijk0 . We get Now, it suffices to note that for each monomial, the coefficient σ ijk , with i + j + k = n and n > 3, of the left-hand side depends exclusively on coefficients σ ijk with i + j + k < n. From the previous items, and by progressing at each degree n, it follows that σ ijk0 = 0 for all i + j + k ≥ 2.
4. The exact same argument as in item 3. applies for l ≥ 1.
Proof. It is easier to see the claim in (43) with ε 1 = 0, and where A 1 = √ 3 The previous observation is important since, as we will see, in W c 1 the set {a 1 = 0} is invariant. Note that we can now desingularize the dynamics restricted to W c 1 by dividing by r 1 in (42), as is usually the case when blowing up, to obtain Remark 9. Recall that a 1 (t 1 ) + b 1 (t 1 ) + c 1 (t 1 ) = 0 for all t 1 ≥ 0. Moreover, since in W c 1 we have c 1 = a1+b1 2 we further have a 1 (t 1 ) + b 1 (t 1 ) = 0 for all t 1 ≥ 0. Therefore, we can consider instead of (49) the 3-dimensional system Naturally, solutions of (50) give solutions of (49) by adding b 1 (t 1 ) = −a 1 (t 1 ). Therefore we proceed by studying (50). It is worth noting that on W c 1 , the set (a 1 , r 1 , ε 1 ) ∈ R 3 | a 1 = 0 is invariant. Therefore, it is important to keep track of the sign of a 1 as it approaches W c 1 . Such sign is given by Proposition 3. That is, if Finally, we recall that W c 1 coincides precisely with the invariant set A written in the coordinates of this chart (see the statement of Theorem 2).
To study the dynamics in this chart, we are going to be interested in the properties of the flow between the sections where δ 1 > 0, and µ 1 > 0 is sufficienlty small. The precise meaning of these sections becomes clear in Section 3.3.4 where we compute a transition map through al whole neighborhood of the origin of (27). For now it shall be enough to mention that the definition ∆ en 1 is motivated by the entry section Σ en (recall (28)), while ∆ ex 1 is a convenient section allowing us to transition towards the central chart K 2 .
In {a 1 = 0} we have the planar system which has a line of zeros (r 1 , ε 1 ) = (r 1 , 0) and an unstable invariant manifold (r 1 , ε 1 ) = (0, ε 1 ). Note that away from {ε 1 = 0} the flow of (52) is equivalent to that of a planar saddle. Next, we want to compute the time it takes to travel from ∆ en 1 to ∆ ex 1 . Therefore, assume initial conditions (r 1 , ε 1 ) = (δ 1 , ε * 1 ) and boundary conditions (r 1 , ε 1 ) = (r 1 (T 1 ), µ 1 ). From (52) we find that Then, one can estimate the transition time T 1 by integrating the equation for ε 1 , so that we get In {r 1 = ε 1 = 0} we have the 1-dimensional system where we recall that α 1 − α 2 ≥ 0. In this case we have, generically, two hyperbolic equilibrium points: one stable at a 1 = 0 and one unstable at a 1 = 1 α2−α1 . If α 1 = α 2 then only the stable equilibrium at the origin exists. It will be useful to integrate (55), that is where a * 1 denotes an initial condition for (55).
Then, we have two 1-dimensional centre manifolds: E a 1 is a centre manifold to the equilibrium point (a 1 , ε 1 ) = (0, 0) and E r 1 to (a 1 , ε 1 ) = 1 α2−α1 , 0 . The flow on both centre manifolds is given by ε 1 = 2ε 2 1 , and we have that E a 1 is tangent to the ε 1 -axis while E r 1 is tangent to the vector 1 −2(α 2 − α 1 ) . In fact, one can show that E a 1 is actually given by a 1 = 0 and that it is unique. On the other hand E r 1 is not unique and has the expansion a 1 = 1 α2−α1 + 1 2(α1−α2) ε 1 + O(ε 2 1 ). Since ε 1 ≥ 0, we have that in a small neighbourhood of (a 1 , ε 1 ) = (0, 0) the flow is equivalent to that of a saddle, while in a small neighbourhood of (a 1 , ε 1 ) = ( 1 α2−α1 , 0) the flow is equivalent to that of a source. From this analysis we conclude that the flow of (57) is as sketched in Figure 7.  In {ε 1 = 0} we have Therefore, the (a 1 , r 1 )-plane is foliated by lines parallel to the r 1 -axis. Along each leaf the flow is given by (55).
We can now summarize the previous analysis in the following Proposition, which completely characterizes the dynamics of (39). Proposition 4. The following statements hold for (39).
1. There exist a 1-dimensional local stable manifold W s 1 and a 4-dimensional local centre-stable manifold W c 1 , which is given by the graph of c 1 = a1+b1 2 . Restricted to W c 1 one has b 1 = −a 1 , which implies c 1 = 0, and: 2. There is an attracting 2-dimensional centre manifold C a 1 . The manifold C a 1 contains a line of zeros a 1 = (r 1 , a 1 , ε 1 ) ∈ R 3 | a 1 = ε 1 = 0 and a 1-dimensional centre manifold E a 1 = (r 1 , a 1 , ε 1 ) ∈ R 3 | r 1 = a 1 = 0 . On the plane {r 1 = 0}, the centre manifold E a 1 is unique. The flow along E a 1 is unstable, that is, it diverges from the origin; while the flow on C a 1 away from a 1 is locally equivalent to that of a saddle. 3. There is a repelling 2-dimensional centre manifold C r 1 . The manifold C r 1 contains a line of zeros r 1 = (r 1 , a 1 , ε 1 ) ∈ R 3 | a 1 = 1 α2−α1 , ε 1 = 0 and a 1-dimensional centre manifold E r 1 = (r 1 , a 1 , ε 1 ) ∈ R 3 | r 1 = 0, a 1 = 1 α2−α1 + O(ε 1 ) . The flow along E r 1 is unstable, that is, it diverges from the equilibrium point (a 1 , ε 1 ) = 1 α2−α1 , 0 ; while the flow on C r 1 away from r 1 is locally equivalent to that of a saddle.
Proof. The existence, graph representation and dimension of W c 1 is already proven in Proposition 2. The existence and dimension of C a 1 and of C r 1 follow from the linearization of (50). The flow on C a 1 and on C r 1 follow from (50) by noting that, up to leading order terms, the vector field restricted to either of the centre manifolds is given by We are now ready to describe the flow of (50). Let Π 1 : ∆ en 1 → ∆ ex 1 be a map defined by the flow of (50).
where the function h a1 = h a1 (a 1 , δ 1 , ε 1 ) is given by Proof. The proof follows our previous analysis. The term h a1 is obtained from (56) and evaluating the transition time (54). The higher order terms O(a 1 ε 2 1 ) follow from (57) with ε 1 > 0 small. For the expression of h a1 it is important to recall Proposition 3. This means that the initial condition a * 1 in (56) has the same sign as a 1 (0) − b 1 (0), and where a 1 (0), b 1 (0) are initial conditions of (39).
The analysis in this chart is sketched in Figure 8. Figure 8: Schematic representation of the flow of (39) restricted to the attracting centre manifold W c 1 . The wegde-like shape of the image of Π 1 (∆ en 1 ) (shaded in ∆ ex 1 ) is due to the contraction towards C a 1 .

Analysis in the rescaling chart K 2
In this chart we study the dynamics of (27) within a small neighbourhood of the origin. The corresponding blow-up map reads as The blown up vector field reads as In the rest of this section we omit the equation r 2 = 0 and just keep in mind that r 2 is a parameter in this chart. Before proceeding with the analysis, it is again very helpful to study the effect that the blow-up map has on the network's topology. Note that (62) can be regarded as the model of an O(r 2 ) graph preserving perturbation of a static network as shown in Figure 9. Roughly speaking, the blow-up separates two types of dynamics: the dynamics of order O(1) correspond to a consensus protocol on a degenerate static network. Here by degenerate we mean that the Laplacian of the static network has a kernel of dimension 2, as can be easily seen in (62)-(63) with r 2 = 0. Next, the dynamics of order O(r 2 ) occur in a slower time scale and correspond to the slowly varying edge with weight r 2w .
We proceed with the description of the flow of (62).
Next we show that (62) has an attracting 4-dimensional centre manifold W c 2 and a 1-dimensional stable manifold W s 2 . These objects, in fact, correspond respectively to W c 1 and W s 1 found in chart K 1 . In qualitative terms, reduction to W c 2 will correspond to representing the behaviour of the third node, with state c 2 , in terms of the other two nodes. Proof. The proof follows the same reasoning (and in fact it is simpler than) the proof of Proposition 2. The relation κ 12 (W c 1 ) = W c 2 is straightforward from (37).
Since the centre manifold W c 2 is attracting, and of codimension 1, the next step is to restrict the dynamics to it. However, the next observation is important (recall Proposition 3).
Lemma 3. The trajectories of (62) restricted to {r 2 = 0} have the asymptotic behaviour As it was the case in chart K 1 the previous lemma gives us the relevant sign of a 2 on the centre manifold W c 2 . The restriction of (62) to W c 2 results on a vector field of order O(r 2 ), which can be desingularized as is usual in the blow-up method by dividing by r 2 . By performing the aforementioned steps we obtain where we recall thatw = y 2 + α 1 a 2 + α 2 b 2 . From the fact that a + b + c = r 2 (a 2 + b 2 + c 2 ) = 0 for all r 2 ≥ 0 and due to the restriction to W c 2 , that is c 2 = a2+b2 2 , we further have that a 2 + b 2 = 0. Therefore, the analysis of (62) is reduced to the analysis of the planar system Note that in the restriction of (67) to {r 2 = 0}, one has that y 2 is essentially time in the reverse direction. To describe the flow of (67), let δ 2 > 0 and define the sections ∆ en 2 = (r 2 , a 2 , y 2 ) ∈ R 3 | y 2 = δ 2 , ∆ ex 2 = (r 2 , a 2 , y 2 ) ∈ R 3 | y 2 = −δ 2 .
Accordingly, let Π 2 : ∆ en 2 → ∆ ex 2 be the map defined by the flow of (67). We now show the following.
1. There exists a trajectory γ c given by No other trajectory of (67) converges to the y 2 -axis as t 2 → ±∞.
3. The transition map Π 2 : ∆ en 2 → ∆ ex 2 is well-defined if and only if and given by 4. If a 2 | ∆ en 2 ≤ − 1 4D+(δ2) then the corresponding orbit has asymptote y 2 = Γ 2 which is implicitly given by Proof. The first item follows from the invariance of a 2 = 0 and linear analysis along the y 2 -axis. For the second item, no distinction between the orbits is needed, one only needs to check that γ j Next, the asymptotic expansions for γ j 2 follow directly from [1], where one finds The fact that γ a 2 attracts all trajectories with the given initial conditions follows from: i) a 2 = 0 is invariant, ii) in the limit |y 2 | → ∞ the curve γ a 2 is asymptotic to y 2 + νa 2 = 0, and iii) the set {y 2 + νa 2 = 0} is attracting in the quadrant a 2 > 0, y 2 < 0.
For the transition map we have that (67) has an explicit solution given by where (a * 2 , y * 2 ) denotes an initial condition. Thus, for the map Π 2 to be well-defined we need to ensure that the denominator in (77) does not vanish. Let us substitute (a * 2 , y * 2 ) = (a * 2 , δ 2 ) with δ 2 > 0, and compute a 2 (−δ 2 ). For this it is useful to recall that D + is an odd function. So we get which indeed leads to (72) and the form of Π 2 also follows. Finally, the expression of the asymptote Γ 2 is obtained by solving the denominator of (77) equal to 0 and with initial condition (a * 2 , y * 2 ) = (a * 2 , δ 2 ).
• In particular, it follows from the third item of Proposition 7 that the map Π 2 (r 2 , a 2 , δ 2 ) is well defined for all a 2 ≥ 0.
We now relate the curves γ 2 and γ c with centre manifolds found in chart K 1 .
Proposition 8. The curves γ r 2 and γ c correspond, respectively, to the centre manifolds E r 1 and E a 1 of chart K 1 .
Proof. We detail the relation between γ 2 and E r 1 , the correspondence between γ c and E a 1 is trivial since they are given by {a 2 = 0} and {a 1 = 0} respectively. We can transform γ 2 into the coordinates of chart K 1 via the map κ 21 , which gives ε −1/2 1 Taking the limit ε 1 → 0 in (79) one gets a 1 = − 1 ν = 1 α2−α1 . Thus the claim follows from the analysis performed in chart K 1 particularly for r 1 = 0.
Remark 13. The trajectory γ c corresponds to a singular maximal canard of (27), while γ r 2 and γ a 2 correspond to the manifolds M r 0 and M a 0 . Accordingly, O(r 2 )-small perturbation of such orbits correspond to N ε , M r ε and M a ε for ε > 0 sufficiently small.
The analysis performed in this chart is sketched in Figure 10.

Analysis in the exit chart K 3
The analysis in this chart is similar to that in chart K 1 performed in Section 3.3.1. Therefore, we shall only point out the main information required from this chart, and omit the proofs. In this chart the blow up map is given by Figure 10: Flow of (62) along W c 2 . This flow is equivalent to that of (27) within a small neighborhood of the origin and for ε > 0 sufficiently small. We observe that trajectories starting at ∆ en 2 are first attracted to the invariant set {a 2 = 0}, which in terms of the network means consensus. Then, once the trajectories pass through the origin, they are repelled from consensus. All trajectories with initial condition a * 2 > 0 are eventually attracted towards γ a 2 , which in terms of the original coordinates corresponds to the clustering manifold.
We then obtain the blown up vector field where f 3 (a 3 , b 3 , c 3 , r 3 , ε 3 ) reads as The flow of (81) is described as follows.
1. There exist a 1-dimensional local stable manifold W s 3 and a 4-dimensional local centre-stable manifold W c 3 . The centre manifold is given by the graph of c 3 = a3+b3 2 .
Restricted to W c 3 one has b 3 = −a 3 , c 3 = 0, and: 2. There is a repelling 2-dimensional centre manifold C r 3 . The manifold C r 3 contains a line of zeros r 3 = (r 3 , a 3 , ε 3 ) ∈ R 3 | a 3 = ε 3 = 0 and a 1-dimensional centre manifold E r 3 = (r 3 , a 3 , ε 3 ) ∈ R 3 | r 3 = a 3 = 0 . On the plane {r 3 = 0}, the centre manifold E r 3 is unique. The flow along E r 3 is stable, that is, it converges to the origin; while the flow on C r 3 away from r 3 is locally equivalent to that of a saddle.
The flow in this chart is as depicted in Figure 11.

Full transition and proof of main result
In this section we prove items (T4)-(T6) of Theorem 2. First of all note that if we choose δ 1 = δ 3 = δ, then the sections ∆ en 1 and ∆ ex 3 are precisely the sections Σ en | A and Σ ex | A in the blow-up coordinates. Moreover, the set A corresponds, in each chart, to the centre manifold W a 1 , W a 2 , and Figure 11: Schematic representation of the flow of (81) restricted to the attracting centre manifold W c 3 . The wegde-like shape of the image of Π 3 (∆ en 3 ) (shaded in ∆ ex 1 ) is due to the contraction towards C a 3 .
W a 3 respectively. Thus it will suffice to consider the transition mapΠ : ∆ en 1 → ∆ ex 3 in the blow-up space (or equivalently Π| A ).
The mapΠ(∆ en 1 ) is then given as where the maps Π 1 , Π 2 , and Π 3 are given in Sections 3.3.1, 3.3.2, and 3.3.3 respectively, and where the maps κ 12 and κ 23 are defined in Lemma 2. We computeΠ(∆ en 1 ) as follows. For brevity we disregard the higher order terms in the chart maps.

Finally we compute Π
where h a3 = µ 1/2 ha 2 exp(2T3) (α1−α2)µ 1/2 ha 2 (exp(2T3)−1)+1 reads, after substitutions, as where . We see that, as it was already evident in each chart, the function h a3 is well-defined for a 1 ≥ 0, while for a 1 < 0 the function h a3 is well-defined only for finite time T . We thus assume that, in either case, we choose appropriate constants δ > 0, and µ > 0 sufficiently small, such that h a3 is well-defined.
Note that, restricted to W c j , all the sets {a j = 0}, j = 1, 2, 3, are invariant along the blow-up space. In other words, if (ā,b,c,ȳ,ε, r) denote the global blow-up coordinates as in (34) (T4) Indeed, we have thatΠ(0, δ, ε 1 ) = (0, δ, ε 1 ). Moreover, it follows from item 1 of Proposition 7 and Section 3.3.3 that the curve γ c connects the point (a 1 , r 1 , ε 1 ) = (0, 0, 0) in chart K 1 with the point (a 3 , r 3 , ε 3 ) = (0, 0, 0) in chart K 3 . Therefore, the center manifolds C a 1 and C r 3 are also connected in the central chart K 2 via the map Π 2 for r 2 ≥ 0 sufficiently small. It is then clear that, since we can identify C a 1 with N a ε and C r 1 with N r ε , the manifolds N a ε and N r 1 are also connected for ε ≥ 0 sufficiently small. The stability of N ε follows from C a 1 being attracting in chart K 1 and C r 3 being repelling in chart K 3 .
(T6) The expression of M a ε and M r ε are obtained from blowing down γ a 2 and γ r 2 given in (70). Accordingly the fact that M a ε attracts all trajectories with initial condition a 1 | ∆ en 1 > 0 follows equivalent arguments as those for the second item if Proposition 7. On the contrary, when we have a 1 | ∆ en 1 < 0 we see from the expression of h a3 that the trajectories become unbounded in finite time T , see also the remark at the end of Section 3.3.3. The proof is finalized by recalling the relationship between the signs of initial conditions in Σ en and the corresponding sign of a j in W c j given at the beginning of the proof.

Some generalizations
Here we develop a couple of generalizations for the results presented in Section 3. The first one is concerned with triangle motifs with one dynamic weight while the other two weights are fixed and positive, but not necessarily equal. The second generalization deals with consensus protocols defined on arbitrary graphs, where just one weight is dynamic.

The nonsymetric triangle motif
In Section 3 we studied a triangle motif with the fixed weights equal to 1. In this section we show that the non-symmetric case is topologically equivalent to the symmetric one. Let us start by considering the fast-slow system where w = w * + y + α 1 x 1 + α 2 x 2 , the weights w 13 and w 23 are fixed and positive, and w * ∈ R is such that dim ker L| {w=w * } = 2, see more details below. We recall that, from the arguments at the beginning of Section 3.2, we may also assume that x 1 + x 2 + x 3 = 0. System (92) corresponds to the network shown in Figure 12. Remark 15. If w 13 = w 23 =w > 0, one can show, for example using the exact same transformation T of Lemma 1, that the eigenvalues of L are {0, 3w, 2w +w}. Thus, the analysis in this case is completely equivalent to the one already performed in Section 3. The only difference would be the rate of convergence towards the set x 3 = x1+x2 2 . Therefore, in this section we rather assume w 13 = w 23 .
This means that, as in the symmetric case, the Laplacian matrix has always a positive eigenvalue λ 2 (w), and another λ 3 (w) whose sign depends on w.
We emphasize that, just as in the symmetric case, the previous proposition provides the characterization of the critical manifold of (92) given as the union of "the consensus" and the "the clustering" manifolds.
Proposition 11. The layer equation of (92) has a transcritical bifurcation at p.
Proof. We shall compute the eigenvalues associated to the equilibrium points of Proposition 10. We start by substituting x 3 = w13x1+w23x2 w13+w23 , and afterwards x 2 = − 2w13+w23 w13+2w23 x 1 . Naturally, both relations hold at all the equilibrium points. In particular, the equilibrium points along the consensus manifold are given by x 1 = 0, while those along the clustering manifold are given by . By doing so we rewrite (92) in the limit ε → 0 as where y is considered as a parameter. Let x 1 = λ N x 1 denote the linearization of (94) at x 1 = 0, and x 1 = λ M x 1 denote the linearization of (94) at x 1 = −(w13+2w23)y α1(w13+2w23)−α2(2w13+w23) . We have It is then clear that the eigenvalues along the consensus and the clustering manifolds (λ N and λ M respectively) have opposite signs and that there is an exchange in their signs at y = 0. Finally we note that y = 0 precisely corresponds to the point p, completing the proof.
With the previous analysis we have shown that, at the singular level, the dynamics of the symmetric and the non-symmetric graphs are topologically equivalent. The reasons for this are: a) the uniform positive eigenvalue of the Laplacian matrix L and b) that the dynamics of both systems are organized by a transcritical singularity corresponding to the intersection of the consensus and of the clustering manifolds. It remains to show that the passage through the transcritical singularity is also equivalent in both cases. We shall show this in the central chart K 2 . We recall the the blow-up in the central chart is given by Accordingly, the blown up vector field reads as For r 2 = 0 we get the linear system Using similar arguments as in Section 3 we can show that W c 2 = c 2 = w13a2+w23b2 w13+w23 is an attracting centre manifold. Restriction to W c 2 and division of the vector field by r 2 results in Note that (99) is the exact same equation (67) that we obtained in the symmetric case. This means that in both cases (symmetric and non-symmetric), the restriction to the centre manifold W c 2 coincide. With the above analysis we have shown the following: Proposition 12. The fast-slow system (92) with w 13 > 0 and w 23 > 0 is topologically equivalent to the case w 13 = w 23 = 1.
In qualitative terms, the only difference between the symmetric and the non-symmetric cases is the convergence rate towards the invariant set A. Once trajectories have converged to A, the dynamics are organized by the same transcritical singularity.

Arbitrary graphs
A natural question that arises is whether the analysis we have performed in Section 3, particularly in Section 3.3, has any relevance for consensus dynamics on arbitrary weighted graphs. In this section we argue that indeed, given some natural assumptions, generic consensus dynamics with one slowly varying weight behave essentially as the triangle motif.
Let us consider an undirected weighted graph G = {V, E, W}. We assume that there are no self-loops, i.e. w ii = 0 for all i ∈ 1, . . . , m and that there is at most one edge connecting two nodes. Next, without loss of generality, let us assume that w 12 = w ∈ R is dynamic, while the rest of the weights w ij , (i, j) ∈ E and (i, j) = (1, 2), are fixed and positive. Denote by L(w) the Laplacian matrix corresponding to the graphs we have defined so far. As in the analysis of the triangle motif we assume that the dynamic weight w depends smoothly on the nodes it connects (namely (x 1 , x 2 )) and on an extrinsic slow variable y ∈ R. Thus we consider the fast-slow system where x ∈ R m , y ∈ R and L is a Laplacian matrix. Recall from the rescaling we performed in Section 3.3, that it suffices to consider trajectories such that m i=0 x i (0) = 0, and to set w = w * + y + a 1 x 1 + α 2 x 2 + O(2), where by O(2) we denote monomials of degree at least 2. Moreover w * is a particular value at which dim(ker L(w * )) > 1.
Lemma 4. Consider the consensus protocol (100) as defined above. Then, the following hold.
2. Suppose that L(w) is analytic in w, and that dim ker(L(w)) = 2 at points (x, y) defined by w = w * . Then the consensus protocol (100) undergoes a (singular) transcritical bifurcation at Proof. Recall that 0 is a trivial eigenvalue with eigenvector 1 n . Therefore, dim ker L(w) increases its dimension whenever an eigenvalue crosses 0. Next, we note that smooth one parameter families of symmetric matrices have generically simple eigenvalues [32]. This means that, generically, only one of the nontrivial eigenvalues of L(w) can vanish for a certain value of w. Thus, the first item in the lemma follows. Next, assuming analytic dependence of L(w) on w and according to [34,II.6.2], the matrix L(w) can be orthogonally diagonalized as L(w) = Q (w)D(w)Q(w), where Q(w) and D(w) are also analytic in w. This means that the layer equation of (100) is conjugate to wherew =w(z, y) = w * + y + A(z) + O(2), where A is a linear function with A(0) = 0. We know from our previous arguments that there is a k ∈ [2, 3, . . . , m] such that λ k (w * ) = 0 while λ j (w * ) = 0 for all j = k. Thus, we note that z k undergoes an exchange of stability if λ k crosses transversally the origin. But note that ∂λ k ∂y (0) = ∂λ k ∂w ∂w ∂y (0). Since we have that λ k depends analytically oñ w, we expect that ∂λ k ∂w (0) is, generically, nonzero. Thus, we conclude that in a generic setting, whenever eigenvalues cross the origin, they do it transversally and thus a typical exchange of stability (transcritical bifurcation) occurs.
Remark 16. We note that singular pitchfork bifurcations can also occur, but this requires extra conditions on w, namely w = y + α 1 x 2 1 + α 2 x 2 2 . In that case one can follow a similar analysis as that performed here; see also [37].

Summary and outlook
We have studied a class of adaptive networks under a linear average consensus protocol. The main property of the networks we studied here, is that one of the edges is slowly varying and can take values over the whole reals. The fact that the dynamic weight can be negative implies that the Laplacian of the graph may not be positive semi-definite, as is the case of non-negative weights. We have shown that the dynamics of the network are organized by a transcritical singularity. Interestingly, the network structure induces a generic maximal canard (unlike the fast-slow transcritical singularity of [37]). Moreover, we have shown that the blow-up method preserves the network structure. That is, on each of the blow-up charts we have found a related network but whose analysis is simpler compared to the full fast-slow one. Overall we have provided a case study in which center manifold reduction and tools of geometric singular perturbation theory, in particular the blow-up method, have been successfully used to describe the dynamics of a class of two time scale networks with a dynamic weight.
As we have considered one of the simplest network communication protocols, we conjecture that similar and more complicated problems are to be encountered when one studies general complex networks. For example, already assuming two slow weights presents new mathematical challenges: on one hand the critical manifold is potentially more complicated leading to more complex singular dynamics; on the other hand, it does not necessarily hold that the nonzero eigenvalues of the Laplacian are simple, and that they cross zero transversally. These two obstacles imply that, probably, one needs to desingularize higher codimension singularities and that generic results would be harder to obtain. Furthermore, although in this paper we have studied continuous-time and continuous state-space network dynamics, we expect that analogous multiscale phenomena can be found in discrete systems. Similar relevance can be expected in more general adaptive network scenarios including directed networks or those incorporating stochastic phenomena. Beyond our work here, there are currently relatively few works linking techniques between multiple time scale dynamical systems and network science [7,14,38,40]. Yet, we conjecture that the inclusion of multiscale dynamics into network science will have far reaching consequences and will have a high impact in better modeling, analysis and understanding complex phenomena.

A.1 An issue with numerical integration
Due to the equivalences shown in Section 4, we shall restrict ourselves in this section to the triangle motif with w 13 = w 23 = 1. For convenience we recall that the model reads as where w = − 1 2 + y + α 1 a + α 2 b and a(t) + b(t) + c(t) = 0 for all t ≥ 0. We know that L(a, b, y) has eigenvalues λ 1 = 0, λ 2 = 3, λ 3 = λ 3 (a, b, y). Thus, roughly speaking, the numerical issue we present below has to do with which non-trivial eigenvalue dominates at t = 0. Recall that the smallest non-trivial eigenvalue of the Laplacian, called in some instances "spectral gap" or "algebraic connectivity", bounds the rate of convergence towards consensus.
Let us discretize (102) using the forward Euler approximation method x ≈ x k+1 −x k ∆t , where x k = x(k∆t) with k ∈ N 0 . This discretization preserves the invariant a(t) + b(t) + c(t) = 0 for all t ≥ 0, resulting in a k + b k + c k = 0 for all k ≥ 0. Taking into account that c k = −a k − b k , and disregarding the higher order terms in y , we write the discretized version of (102) as where w k = − 1 2 + y k + α 1 a k + α 2 b k . The matrix A k has spectrum spec A k = {λ 2 , λ 3 (k)} = {1 − 3∆t, 1 − (2w k + 1)∆t}. From Section 3.1, we further know that the eigenvalue λ 2 is related to the convergence rate towards c k = a k +b k 2 , which together with the invariant a k + b k + c k = 0 is equivalent to the convergence towards {a k = −b k }. On the other hand, the eigenvalue λ 3 (k) is related to the stability of the consensus manifold, that is {a k = b k }. Since the aforementioned convergences are both exponential, and for meaningful 1 initial conditions both eigenvalues are within the unit circle for k = 0, the relationship between the two eigenvalues plays an important role in the numerical integration.
Suppose that |λ 3 (0)| > M |λ 2 |, for some M > 0. Then, up to truncation and computer precision errors, the relation a k = b k dominates over a k = −b k for some k > K > 0. Substitution of a k = b k in (103) implies that the governing difference equation is where we observe that the weight w k does not play a role any more, and that a k = 0 is invariant. This means that, again disregarding numerical errors and approximations due to computer precision, a k = 0 is in this case a unique equilibrium point, independent of the value of the weight w k . In essence, this means that a computer algorithm may not recognize the instability of the consensus manifold; we note that this mechanism of "over-stabilization" induced by conserved quantities is different from recently discovered extended stabilization by the Euler method near transcritical and pitchfork singularities [6,22]. On the contrary case, if |λ 3 (0)| < M |λ 2 | for some M > 0, then the relation a k = −b k dominates and the governing difference equation is where the transition through a transcritical singularity, depending on the value of w k , is present. Therefore, as expected from our analysis, there is a typical exchange of stability through a transcritical singularity for some negative values of w k .
With the above simplified analysis we have argued that numerical integration of (102) may not be correct when |2w(0) + 1| > 3M for some M > 0. To prevent the aforementioned issue, one may adapt the analysis presented in Section 3.3 as shown in Algorithm 1 and Figure 13. The plots on the left are for y(0) = 1.9, while the plots on the right for y(0) = 2. In both figures we show: a) Integration via forward Euler on the first row; b) Integration via ode15s on the second row; and c) Integration via the proposed algorithm in the third row, where we set e A = 1 × 10 −9 . The Euler integrations are performed with ∆t = 1 × 10 −3 while for the ode15s we set the MaxStep to 1 × 10 −3 . We observe that for y(0) = 1.9 the three algorithms provide similar outcome, namely the trajectories first approach consensus and then, when the weight is sufficiently negative, they transition towards clustering. The delay on the transition towards clustering is due to the trajectories being exponentially close to the maximal canard. However, for the case y(0) = 2, only our proposed method provides a result aligned with the qualitative analysis of Section 3. Note that the simulation for y(0) = 2 falls under the case where after some time the dynamics are governed by (104), explaining the observation of the trajectories remaining at (or close to) consensus even though the weight is largely negative. We recall that a negative weight means that the consensus manifold is unstable, yet trayectories remain close to it. In conclusion, our conjecture is that, in general, numerical algorithms for fast-slow consensus networks in the context of this paper work well when initial conditions are near the invariant set A and y(0) is not too large. Otherwise, numerical integration methods may require careful set-up in order to guarantee correct simulations.

A.2 Ring, complete and star networks
To complement the analysis performed in Section 4, we present here a couple of numerical simulations of fast-slow consensus protocols defined on ring, complete and star networks with more than 3 nodes. In all the simulations shown in Figure 14 we keep the dynamic weight w = y + α 1 x 1 + α 2 x 2 between nodes x 1 and x 2 while all other edges are fixed to 1. We note that we produce simulations for initial conditions that lead to exchange between consensus and clustering. We observe that in all cases of Figure 14, we have a qualitative behaviour similar to the one analyzed in the triangle motif, thus validating the arguments of Section 4.

A.3 Periodic orbits on the triangle motif
Commonly, and historically, one considers consensus protocols seeking consensus among the nodes. This behaviour is the only possible one if the weights of the graph are non-negative. However, as we have seen in the main part of this paper, introducing negative weights enriches the dynamics. In this section we want to provide numerical evidence on the existence of periodic orbits in consensus networks. We do not attempt to give a full treatment of the problem. Rather, we present two instances that are constructed from the geometric description we developed in Section 3.
Let us then consider the triangle motif (102) and let us consider initial conditions with y(0) > 0. In order to produce periodic orbits one must introduce a return mechanism that allows trajectories to return to y > 0 after they have crossed the origin. Since we already know that the dynamics are organized as sketched in Figure 3, we propose two return mechanisms.
1. The first natural way to introduce a return mechanism is to add a drift on the slow variable y that acts away from the consensus manifold N ε . For this strategy to result in periodic orbits, one further requires that the clustering manifold M 0 is aligned with the fast-foliation, that is α 1 − α 2 = 0. For this example we them propose We emphasize that in this case, the existence of periodic solutions does not follow from the singular limit. However, we know from our geometric analysis, especially in the chart K 2 , that this model indeed has periodic solutions. We show in Figure 15 a simulation of (106).
2. Another way to produce a return mechanism is to add higher order terms to the dynamic weight. Based on the singular limit sketched in Figure 3, the idea is to achieve a singular limit as depicted in Figure 16.
We note that near the origin, the singular limit is just as in Figure 3. Furthermore, by inspecting Figure 16 we observe that returning on the left side of M 0 is "easier" than on the right, because, to produce a return mechanism on the right side we would actually require to generate a canard cycle. So, for the purposes of this example we shall concentrate on the case where the dynamics withā < 0 exhibit periodic solutions. Following Figure 16 we propose the weight  Figure 14: Simulation of a fast-slow consensus protocol (100) under several graph topologies. For all these simulations we consider the dynamic weight w = y + 2x 1 + x 2 on the edge {1, 2} and all other weights fixed to 1. We also set ε = 0.05 and y(0) = 0.5. We observe in all cases that the trajectories first converge towards the origin (average consensus), and then, when w reaches some negative value, the trajectories leave a small vicinity of the consensus manifold and approach a clustering state. The actual convergence rate in each case is given by the so-called spectral gap, or the smallest non-trivial eigenvalue.  Figure 15: Simulation of (106) with (y(0), α, k 1 , ε) = (0.5, 1, 1, 0.05). From left to right, the first two plots are the time series for the nodes and the weight, while the third plot depicts the corresponding phase portrait.
N 0 M 0 a y Figure 16: Singular limit for a return mechanism via higher order terms in the weight w.