{'fraction_non_alphanumeric': 0.04983336600666536, 'fraction_numerical': 0.010821407567143696, 'mean_word_length': 4.052694136291601, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Control of collective dynamics with time-varying weights

This paper focuses on a model for opinion dynamics, where the influence weights of agents evolve in time. We formulate a control problem of consensus type, in which the objective is to drive all agents to a final target point under suitable control constraints. Controllability is discussed for the corresponding problem with and without constraints on the total mass of the system, and control strategies are designed with the steepest descent approach. The mean-field limit is described both for the opinion dynamics and the control problem. Numerical simulations illustrate the control strategies for the finite-dimensional system.


Introduction
Social dynamics models are used to describe the complex behavior of large systems of interacting agents. Application areas include examples from biology, such as the collective behavior of animal groups [2,5,9,14], aviation [25], opinion dynamics [12] and other. In most applications, a key phenomenon observed is that of self-organization, that is the spontaneous emergence of global patterns from local interactions. Self-organization patterns include consensus, alignment, clustering, or the less studied dancing equilibrium [1,4]. On the other side, the control of such systems was addressed in the control community with a wealth of different approaches, see [3,13,24]. This paper focuses on models for opinion dynamics. A long history started back in the 50's, see [8,10], then linear models were studied by De Groot [6] and others, while among recent approaches let us mention the bounded-confidence model by Hegselmann and Krause of [12], see also [11,15]. In most of the existing models, interactions take place between pairs of individuals (typically referred to as agents) and depend only on the distance separating the two agents. More recently, a model was introduced with the interactions proportional to an agent's weight of influence, which can evolve over time according to its own dynamics [18,23]. This augmented framework allows us to model opinion dynamics in which an agent's capacity to influence its neighbors depends not only on their proximity but also on an internal time-varying characteristic (such as charisma, popularity, etc.). Four models were proposed in [18] for the time-varying weights: the first model allows agents to gain mass in pairwise interactions depending on midpoint dynamics; the second increases the weights of agents that influence the most the other agents; and the third and fourth focus on the capability to attract the most influential agents. In particular, the developed theory allows to address control problems, which is the focus of the present paper.
The main idea is that an external entity (for instance with global control) may influence the dynamics of agents by increasing the weights of some of them. We thus assume that a central controller is able to act on each agent but possibly influence just a few at a time, thus also looking for sparse control strategies. We first formulate the control problem by allowing a direct control of weights but imposing the total sum of weights to be constant, resulting in a linear constraint on allowable controls. Under natural assumptions on the interaction kernel we show that the convex hull of the agents' positions is shrinking, thus we look for control strategies stabilizing to a specific point of the initial convex hull.
The constraints on the control and given by the dynamics (shrinking convex hull) prevent a complete controllability of the system. However, we show that any target position strictly within the initial convex hull of the system can be reached given large enough bounds on the control.
We then look for a greedy policy by maximizing the instantaneous decrease of the distance from the target point. This gives rise to a steepest descent algorithm which is formulated via the linear constraints of the problem. Under generic conditions, the solution is expected to be at a vertex of the convex set determined by constraints.
As customary for multi-agent and multi-particle systems, we consider the mean-field limit obtained when the number of agents tends to infinity. In classical models without mass variation, the limit measure satisfies a transport-type equation with non-local velocity. Here, due to the presence of the weight dynamics, our mean-field equation presents a non-local source term. We formulate a control problem for the mean-field limit and show how to formulate the control constraints in this setting.
In the last section we provide simulations for the finite-dimensional control algorithm and illustrate how the control strategies reach the final target in the various imposed constraints.

Control problems
We consider a collective dynamics system with time-varying weights, introduced in [18]. Let x 0 ∈ (R d ) N represent the N agents' initial positions (or opinions) and m 0 ∈ (R + ) N represent their initial weights of influence. We denote by a ∈ C(R + , R + ) the interaction function. Lastly, let M = N i=1 m 0 i denote the initial mass of the system. In this model, the evolution of each agents' state variable x i (t) depends on its interaction with other agents through the interaction function a (as in the classical Hegselmann-Krause dynamics [12]), weighted by the other agents' weights of influence m i (t). The weights of influence also evolve in time due to their own dynamics. More precisely, the evolution of the N positions and weights is given by the following system: We have established in [18] the well-posedness of (1) along with the following hypotheses: Hypothesis 1. The function s → a( s )s is locally Lipschitz in R d , and the function ψ is locally bounded in (R d ) N × R N .
Note that Hypothesis 2 is not necessary for the well-posedness of (1). It is a modeling choice which enforces conservation of the total mass of the system, so that the weights m i are allowed to shift continuously between agents, but their sum remains constant. We refer the reader to [18] for a detailed analysis of this system for various choices of the weight dynamics, exhibiting behaviors such as emergence of a single leader, or emergence of two co-leaders.
In the present paper, we aim to study the control of system (1) by acting only on the weights of influence. Let Ω(x) denote the convex hull of x, defined as follows.
It was shown in [18] that for the dynamics (1)-(2), the convex hull Ω(x(t)) is contracting in time, i.e. for all t 2 ≥ t 1 ≥ 0, Ω(x(t 2 )) ⊆ Ω(x(t 1 )). Given α ∈ R + and A ∈ R + , we define two control sets U α ∞ and U A 1 : We also define a set of controls that conserve the total mass M of the system: . From here onwards, U will stand for a general control set, equal to either We aim to solve the following control problem: For all x * ∈ Ω(x 0 ), find u ∈ U such that the solution to satisfies: for all i ∈ {1, · · · , N }, lim t→∞ x i (t) − x * = 0.
We also suppose that the interaction function satisfies a(s) > 0 for all s > 0. Then from [18], the system converges asymptotically to consensus. Letx := m i x i denote the weighted barycenter of the system. Then the control problem simplifies to: We seek a control that will vary the weights of the system so that its barycenter converges to the target position x * . In (3), the control u must also compensate for the inherent mass dynamics. Here we will only consider the simpler case in which there is no inherent mass dynamics, i.e. ψ i ≡ 0 for all i ∈ {1, · · · , N }. The control problem re-writes: satisfies: lim t→∞ x(t) − x * = 0.
The solution to the more general Problem 2 can be recovered by the feedback transformation u i → u i − ψ i , hence without loss of generality we will focus on Problem 3. It was proven in [18] that without control (i.e. with non-evolving weights), the weighted averagex is constant. The control strategy will consist of drivingx to x * .

Control with mass conservation
In this section, we explore the controllability of the system when constraining the total mass of the system N i=1 m i (t) to M , by imposing u ∈ U M . This amounts to looking for a control that will redistribute the weights of the agents while preserving their sum. It was shown in [18] that this condition implies that the convex hull Ω(t) is contracting in time. We remind an even stronger property of the system in the case of constant total mass (see [18], Prop. 10): , · · · , N } 2 } be the diameter of the system. If inf{a(s) | s ≤ D(0)} := a min > 0 then the system (1)-(2) converges to consensus, with the rate D(t) ≤ D(0)e amint . Remark 1. As a consequence, the convex hull converges to a single point The properties of contraction of the convex hull and convergence to consensus imply that the target position x * is susceptible to exit the convex hull in finite time. However, we show that that given sufficiently large upper bounds on the strength of the control, the system is approximately controllable to any target position within the interior of the convex hull, that we denote byΩ. We state and demonstrate the result for the control constraints u ∈ U α ∞ ∩ U M , but the proof can be easily adapted to the case u ∈ U A 1 ∩ U M .
. Then for all ε > 0, there exists α > 0, t ε ≥ 0 and u ∈ U α ∞ ∩ U M such that the solution to (4) satisfies: Notice also that since the shrinking hull is contracting, we have x i (t) − x j (t) ≤ D 0 for all (i, j) ∈ {1, · · · , N } 2 and t ≥ 0, where D 0 denotes the initial diameter of the system. Let for any control u. We now look for a control strategy that can drivex to a distance ε of x * in time t ε ≤ η δ . Let us compute the time derivative of the weighted barycenter. For u ∈ U M , the sum of masses is as the second term vanishes by antisymmetry of the summed coefficient.
Let i − and i + be defined as follows: for all i ∈ {1, · · · , N }, Note that i − and i + are time-dependent, but we keep the notation i − = i − (t) and i + = i + (t) for conciseness. For all t ≤ t ε , x * ∈Ω(x(t)) so necessarily Notice also that the following holds (by summing over all indices): We now design a control u such that: One can easily check that u ∈ U α ∞ ∩ U M . With this control, we compute: Remark 2. The proof can be easily adapted to the case u ∈ U A 1 ∩ U M by replacing α by A/2.
We have shown that any target position strictly within the initial convex hull of the system can be reached given sufficient control strength. The converse problem of determining the set of reachable positions given a control bound is much more difficult and remains open.
We now focus on designing feedback control strategies. Let us define the functional We propose a gradient-descent control strategy to minimize instantaneously the time-derivative of X, i.e. we define u ∈ U such that for almost all t ∈ [0, T ], We have We minimize a linear functional on a convex set U . Hence the minimum is achieved at extremal points of U . Notice that the control set U α ∞ ∩ U M is the intersection of the hypercube U α ∞ and of the hyperplane U M . Similarly, the control set U A 1 ∩ U M is the intersection of the diamond U A 1 and of the hyperplane U M . These intersections are non-empty since U α ∞ , U A 1 and U M contain the origin. The condition u ∈ U M renders even this simple instantaneous-decrease control strategy not straightforward. Notice that despite the condition u ∈ U A 1 that promotes sparse control, no control satisfying u ∈ U M can have just one active component. We will provide illustrations of this phenomenon in Section 5.

Control with mass variation
In this section, we remove the total mass conservation constraint on the control, and consider Problem 3 for U = U α ∞ or U = U A 1 . Remark that this problem can be solved with the controls found in Section 2 (thus satisfying the mass conservation constraint). However we purposefully look for a different solution in order to exploit the larger control possibilities that appear due to the fewer constraints.
We first point out a fundamental difference in the behavior of the system compared to that of the previous section: with a varying total mass, one can break free of the convergence property stated in Prop. 1.

Proposition 2.
Let (x, m) be a solution to (1). Then there exist mass dynamics ψ that do not satisfy Hyp. 2, such that the system does not converge to consensus.
Proof. Consider the constant mass dynamics given by: ψ i (x, m) ≡ −A for all i ∈ {1, · · · , N }. Then for all i ∈ {1, · · · , N }, m i (t) = m 0 i e −At and we can compute: where δ was defined in (5). From this we get: . Hence for A big enough, each x i is confined to a neighborhood of its initial position, which prevents convergence to consensus.
Remark 3. As a consequence, in such cases the convex hull tends to a limit set Ω ∞ := ∩ t≥0 Ω(x(t)) not restricted to a single point.
The dynamics of the barycenter of the system are now less trivial than in the previous section due to the total mass variation. Nevertheless, as previously, we prove approximate controllability to any target position strictly within the initial convex hull.
. Then for all ε > 0, there exists α > 0, t ε ≥ 0 and u ∈ U α ∞ \ U M such that the solution to (4) satisfies: Proof. Let x * ∈Ω(x 0 ) and let ε > 0. Then there exists (τ 0 We will show that we can drive each weight m i to a multiple κτ 0 i of its target weight, while maintaining the positions withing close distance of the initial ones, ensuring that the target position remains in the shrinking convex hull. Define Letα ≥ δ ε , with δ defined in (5) and let α >α > 0. Let T := rmax−rmin α−α and κ := e rmin−αT . Now consider the constant control defined by: for all i ∈ {1, · · · , N },

One can easily show that for all
where δ was defined in (5). From this we compute: which proves the theorem.
Remark 4. As for Theorem 2.1, the proof can be easily adapted to the case u ∈ U A 1 by replacing α by A N .
As in the previous section, we design a feedback control strategy that minimizes the time-derivative of the functional X instantaneously. With a total mass now varying in time, we have: Since we removed the constraint u ∈ U M , the control strategy minimizing dX dt is straightforward. For u ∈ U α ∞ , we have: For u ∈ U A 1 , we define the set I := arg max{|m i x − x * , x i −x |, i ∈ {1, · · · , N }}, and we have: where | · | represents the cardinality of a set.

Mean-field limit 4.1 Mean-field limit of mass-varying dynamics without control
In this section, we recall the definition of mean-field limit. Consider System (1). The goal of the meanfield limit is to describe the behavior of the system when the number of agents N tends to infinity. Instead of following the individual trajectory of each individual, we aim to describe the group by its limit density µ, which belongs to M(R d ), the set of Radon measures with finite mass. We endow M(R d ) with the topology of the weak convergence of measures, i.e.
We consider the following transport equation for µ: We recall conditions for well-posedness of (11), see [23]: is uniformly Lipschitz and uniformly bounded • V is uniformly Lipschitz with respect to the generalized Wasserstein distance (see [23]) has uniformly bounded mass and support • h is uniformly Lipschitz with respect to the generalized Wasserstein distance (see [23]) We now recall the definition of mean-field limit.

Definition 2.
Let (x, m) ∈ R dN × (R + ) N be a solution to (1). We denote by µ N the corresponding empirical measure defined by The transport equation (11) is the mean-field limit of the collective dynamics (1) if where µ is the solution to (11) with initial data µ(0).
The definition of empirical measure requires a crucial property of the finite-dimensional system (1): that of indistinguishability of the agents. Indeed, notice that there isn't a one-to-one relationship between the set of empirical measures (finite sums of weighted Dirac masses) and the set of coupled positions and weights (x, m) ∈ R dN × (R + ) N . For instance, two couples ( , · · · , N −1} correspond to the same empirical measure. Hence if we want the concept of mean-field limit to make sense, we must consider discrete systems that give the same dynamics to (x(t), m(t)) and (y(t), q(t)).
Definition 3. Let t → (x(t), m(t)) ∈ R dN × (R + ) N and t → (y(t), q(t)) ∈ R d(N −1) × (R + ) N −1 be two solutions to system (1). We say that indistinguishability is satisfied if Indistinguishability is a strong property, and it is not necessarily satisfied by the general function ψ defining the weights' dynamics in (1). We refer the reader to [18] for examples of mass dynamics satisfying or not the indistinguishability property. From here onward, we will focus on the following particular form of mass dynamics that does satisfy indistinguishability: with S ∈ C(R d × R d , R) . In order for a transport equation to be the mean-field limit of a finite-dimensional system, it is sufficient for it to satisfy the following two properties (see [26]): (i) When the initial data µ 0 is an empirical measure µ 0 N associated with an initial data (x 0 , m 0 ) ∈ R dN × R N of N particles, then the dynamics (11) can be rewritten as the system of ordinary differential equations (1).
(ii) The solution µ(t) to (11) is continuous with respect to the initial data µ 0 .
We now aim to prove the following: Proposition 3. Consider System (1) with mass dynamics given by (12), where S ∈ C(R d × R d , R) is skew-symmetric: S(x, y) = −S(y, x). Then its mean-field limit is the transport equation with source (11) with the interaction kernel and the source term Remark 5. The proof should consist of proving the two properties (i) and (ii) above. Notice that well-posedness of (11)-(13)- (14) and continuity with respect to the initial data cannot be obtained by applying directly the results of [23] since h does not satisfy Hypothesis 4. Nevertheless, well-posedness and continuity can be proven, using the total conservation of mass coming from the skew-symmetric property of S. We will provide the proof in a later work. In the present paper, we focus on proving the first property (i).
The general weight dynamics (12) include special cases studied in previous works. Indeed: • if S(x, y) := S 0 (x), the mass dynamics can be simply written as h[µ](x) = |µ|S 0 (x)µ(x) (see [23]) • if S(x, y) := S 1 (y − x), the mass dynamics can be rewritten as the convolution h[µ] = (S 1 * µ)µ (see [23]) , we can show in a similar way that the mean-field limit is the PDE (11) with the source term h[µ](x) = R d R d S(x, y, z)dµ(y)dµ(z) µ(x). In particular, this applies to the following mass-conserving dynamics, which are a slight modification of Model 2 proposed in [18]:

Control problem
From the mean-field limit of the system without control, we extract a natural control problem corresponding to the mean-field limit of (3). Consider the controlled PDE: We define the kinetic variance We seek a control function u : R + × R dN that minimizes instantaneously d dt X (t). Similarly to Section 2, we can further restrict the set of controls to functions satisfying R d u(t, x)dµ(t, x) = 0 for a.e t ∈ R + .
We can also extend the L 1 and L ∞ bounds on the control to the mean-field setting:

Numerical simulations
We now provide simulations of the evolution of System (4) with the various control strategies presented in Sections 2 (u ∈ U α ∞ ∩ U M and u ∈ U A 1 ∩ U M ) and 3 (u ∈ U α ∞ and u ∈ U A 1 ). Four simulations were run with the same set of initial conditions x 0 ∈ R dN for d = 2, N = 10, and control bounds α = 2 and A = 10. In each simulation, the control maximizes the instantaneous decrease of the functional X, with one of the various constraints exposed in Sections 2 and 3. Figure 1 shows that in all cases, the control successfully steers the weighted barycenterx to the target position x * . The Figure 1: Trajectories of the positions x i (t) in R 2 corresponding to the controlled system (4) with N = 10 and a : s → e −s 2 . The top row corresponds to controls satisfying u ∈ U M (Section 2) while the second row corresponds to controls allowing total mass variation (Section 3). In each row, the left column corresponds to u ∈ U α ∞ and the right one corresponds to u ∈ U A 1 . In each plot, different agents are represented by different colors, and the size of each dot is proportional to the weight of the corresponding agent at that time. The gray dotted trajectory represents the weighted barycenterx. The black star represents the target position, inside the convex hull of the initial positions (dashed polygon). The convex hull of the positions at final time is represented by the dot-dashed polygon. evolution of the functional t → x(t) − x * (Figure 4 (right)) shows that the target is reached faster with controls that allow for mass variation than for controls constrained to the set U M . Figure 2 shows the evolution of each agent's individual weight for each of the four cases of Figure 1. Interestingly, when mass variation is allowed, we observe a general decrease in the total mass of the system in the case u ∈ U α ∞ (dotted grey line, Fig. 2 -left) and a general increase in the case u ∈ U A 1 (dotted grey line, Fig. 2 right). Figure 3 shows the control values u i (t) for each i ∈ {1, · · · , N } and each t ∈ [0, 1]. Notice that in the case of mass-preserving control u ∈ U M (top row), the controls do not saturate the constraints u ∈ U α ∞ or u ∈ U A 1 . In the case of varying total mass, as shown in Section 3, the control strategies minimizing dX dt saturate the constraints. Figure 4 (left) shows that the constraint u ∈ U A 1 promotes a sparse control strategy. A control is said to be sparse if it is active only on a small number of agents. As mentioned in Section 2, mass-varying controls cannot be strictly sparse, and need to have at least two non-zero components at each time. Indeed, the control strategy u ∈ U A 1 ∩ U M has either two or three active components at all time.

Conclusion
In this paper we aimed to control to a fixed consensus target a multi-agent system with time-varying influence, by acting only on each agent's weight of influence. We proved approximate controllability of the system to any target position inside the convex hull of the initial positions. We then focused on designing control strategies with various constraints on the control bounds and on the total mass of the system. Figure 2: Evolution of the weights t → m i (t) corresponding to control strategies u ∈ U α ∞ (left) and u ∈ U A 1 (right). In each plot, the continuous lines correspond to the mass-preserving control u ∈ U M of Section 2, and the dashed lines to the controls of Section 3. Each colored line (respectively dashed or continuous) shows the evolution of the corresponding colored agent of Fig. 1, and the grey lines represent the evolution of the average weight 1  Fig. 1. The top row corresponds to controls satisfying u ∈ U M (Section 2) while the second row corresponds to controls allowing total mass variation (Section 3). In each row, the left column corresponds to u ∈ U α ∞ and the right one corresponds to u ∈ U A 1 . Each control function u i is colored according to the corresponding agent x i of Fig. 1. We also presented the mean-field limit of the discrete model for general mass dynamics that satisfy the indistinguishability property. The population density satisfies a transport equation with source, where both the source term and the velocity are non-local. Well-posedness of this equation as well as continuity with respect to the initial data are assumed, and will be proven in a later work.
The combination of our analysis with numerical simulations allows us to compare the control performances of the four strategies. Firstly, the control strategies allowing total mass variation are more efficient than the control strategies conserving the total mass, as the weighted barycenter reaches the target position faster.Interestingly, this is not obvious a priori from Equations (7) and (8), as the time derivatives of the functional X = x − x * 2 are of the same order of magnitude in the two cases. We also remark that the controls allowing mass variation can either increase or decrease the total mass of the system.
The constraint u ∈ U A 1 is usually enforced to promote sparsity (see [7,22]), that is the activation at any given time of as few control components as possible. However, the added constraint u ∈ U M renders strict sparsity impossible, and we already remarked that in order to preserve the total mass, the control has to be active on at least two components at any given time. Simulations shows that indeed, the control u ∈ U A 1 ∩ U M oscillates between two and three active components, whereas the control u ∈ U A 1 maintains strict sparsity. On the other hand, the controls u ∈ U α ∞ and u ∈ U α ∞ ∩ U M act simultaneously on all components at all time.
Although in the illustrating simulations, all four controls manage to drive the system's weighted barycenter to the target position x * , this would not have necessarily been achievable with either a target closer to the initial convex hull boundary or with stricter control bounds α and A. The question of determining the set of achievable targets given an initial distribution of positions and weights and control bounds remains open and is an intriguing future direction of this work, as is the control of the mean-field model obtained as limit of the finite-dimensional one when the number of agents tends to infinity.