Solving Consensus Dynamics in Networks Using Mathematical and Computational Method
How the structure of a network decides whether a group of agents can agree — worked through adjacency, degree and Laplacian matrices, and simulated on graphs from four nodes to a hundred.
- Keywords
- consensus dynamics · graph Laplacian · algebraic connectivity · network topology · multi-agent systems
Contents
A network of agents that can only see their immediate neighbours is asked to agree on a single number. Nobody has a global view, there is no leader, and the only thing each agent can do is move a little towards the people it can hear. Whether that is enough — and how long it takes — turns out not to be a question about the agents at all. It is a question about the shape of the network.
This project works that claim out concretely. Each network is written down as three matrices, the consensus rule is written as one differential equation, and the equation is integrated numerically on graphs ranging from four nodes to a hundred. What emerges is that a single number extracted from the network’s structure — the second-smallest eigenvalue of its Laplacian — predicts both whether agreement happens and how quickly.
Research question
How do network topology, connection strength and the pattern of information flow determine the speed and stability with which a set of interacting agents reaches consensus?
Theoretical background
A network of agents is an undirected, unweighted graph. Its adjacency matrix records who can hear whom,
and the degree matrix is the diagonal matrix of connection counts, . The object that does the real work is their difference, the graph Laplacian
Each agent holds a state and repeatedly moves towards its neighbours by the sum of its disagreements with them,
which for the whole system collapses into a single linear equation,
Because every row of sums to zero, the all-ones vector is always an eigenvector with eigenvalue : a state in which everyone already agrees never changes. The rest of the spectrum decides what happens on the way there. is symmetric and positive semidefinite, so its eigenvalues are real and non-negative,
and the multiplicity of counts the connected components of the graph. The second-smallest, , is Fiedler’s algebraic connectivity. It is strictly positive exactly when the graph is connected, and it sets the slowest rate at which disagreement decays.
Methodology
Network construction. Networks were written as undirected graphs with each node an agent and each edge a communication link, and were varied systematically from sparse to dense. The worked example is a six-node graph given by the edge list
that is, the nine edges .
Matrix formulation. For every structure, , and were constructed explicitly. For the six-node graph above the degree sequence is , giving
The four-node case analysed in detail is the subgraph induced on nodes –, with edges , degree sequence and
Numerical implementation. The consensus equation was integrated in Python
with networkx, numpy and matplotlib, using the explicit Euler method,
with over steps, from assorted initial states. Graphs were drawn with force-directed layouts; node trajectories were plotted against time; and the Laplacian spectrum was examined with attention to .
Cases simulated. A four-node graph; a sparse six-node chain –––– with node attached to nothing; the nine-edge six-node graph above; the complete graph ; and sparse networks of and nodes.
Graph
Node states, 50 Euler steps at dt = 0.1
- Edges
- 4
- λ₂ (connectivity)
- 1.000
- Components
- 1
- Spread after 50 steps
- 1.0e-2
Results and observations
Connected graphs reach agreement; disconnected ones do not. In every connected case the node states converged to a common value. In the sparse case the chain –––– converged while node , having no neighbours, stayed at its initial value for all time — its row of is identically zero, so the dynamics never touch it.
Density accelerates convergence. The complete graph settled fastest and most smoothly; the nine-edge graph next; the chain slowest. Convergence in the moderately connected networks increased with algebraic connectivity, and across every topology tested the manuscript reports convergence speed tracking .
Scale slows it down. The - and -node sparse networks still converged, but more slowly and with more variation than the small or dense cases.
The table below gathers the spectra of the graphs whose matrices the manuscript writes out, computed from those matrices:
| Graph | Edges | Zero eigenvalues | Behaviour reported | |
|---|---|---|---|---|
| Chain of 5, node 6 isolated | 4 | 0 | 2 | Chain agrees, node 6 never moves |
| Four-node subgraph | 4 | 1.000 | 1 | Converges |
| Six nodes, nine edges | 9 | 1.186 | 1 | Converges, faster |
| Complete graph | 15 | 6.000 | 1 | Converges fastest |
The disconnected case is the clean one. Its Laplacian has two zero eigenvalues rather than one, so — and is precisely the algebraic statement that the graph falls into more than one piece. The isolated node is not a numerical nuisance; it is the spectrum reporting a fact about the topology.
Challenges and limitations
- The model is the simplest one available: undirected, unweighted, static graphs, with identical agents, no delay, no noise and no external input. Real social and infrastructural networks are directed, weighted and time-varying.
- Convergence rate is governed by , but the apparent speed in a plot also depends on how far apart the initial states were. The cases shown use different initial vectors as well as different graphs, so visual comparisons between plots conflate the two.
- Explicit Euler is only conditionally stable, requiring . It holds comfortably for every graph above — is the tightest at — but it is a constraint the method inherits, not a property of consensus.
- The manuscript’s applied claims about social media, public-health messaging and smart grids are motivation drawn from the literature, not results of these simulations. Nothing here was tested against real network data.
- The - and -node networks are described qualitatively; their edge lists and initial states are not recorded in the manuscript, so those two results cannot be reproduced from it as written.