Φferromotion · textbook · chapter 2 rust → wasm · on-device
A swarm in which every agent can see only its neighbours still comes to agree — and how fast it does is governed entirely by a single number of the network, the Fiedler value λ₂. Everything below is computed on your device by the same Rust consensus code the native tools run.
Give each agent one instruction: drift toward the average of your neighbours. No agent sees the whole network, no one is in charge, no one holds the target. Written for the whole swarm at once, that rule is exactly ẋ = −L·x, where L = D − A is the graph Laplacian — the degree of each node minus who it links to.
Below is a live swarm. Drag the agents around; toggle edge mode and click two of them to add or cut a link; pick a network shape. Then run consensus and watch them collapse.
The Laplacian has a whole spectrum of eigenvalues. The smallest is always zero. The second-smallest, λ₂ — the Fiedler value — is the one that matters: the swarm's disagreement decays as e−λ₂ t. Not slower than that, not a worst case — that rate, exactly.
run consensus above · the gold trace is the measured disagreement, the green dashed line is e−λ₂ t — they lie on top of each other
Pick Complete and the whole spectrum lifts — everyone talks to everyone, λ₂ is large, agreement is near-instant. Pick Path and λ₂ is tiny; the same rule, but news crawls end to end. You are not changing the agents. You are changing one eigenvalue of the wiring, and it sets the clock.
Choose Two clusters: two tight groups joined by a single bridge. Run it — they still agree, but slowly, because that lone edge is the whole conversation between the halves. Now switch on edge mode and cut the bridge.
Watch the green centroid marker as the swarm collapses: it never moves. Because every row of L sums to zero, the average position is conserved to machine precision through the entire run. Consensus cannot invent a destination — it can only discover the one the swarm already averaged to. A leaderless network has no way to agree on anything but its own centre of mass.
Not an estimate of it, not an upper bound — the exact exponential rate at which a leaderless swarm reaches agreement. Verified on your device against the live simulation:
| Fiedler value λ₂ — from the Laplacian spectrum | … |
| decay rate — measured from a running swarm | … |
| agreement | … |
For a fleet of robots, a sensor mesh, or a formation of drones, this is the design lever. You do not tune agreement by making each agent cleverer; you tune it by choosing who talks to whom. Add a link and λ₂ rises and the fleet syncs faster; the same protocol on a better-connected graph is simply a faster algorithm. Formation control is this exact protocol run on the offsets from a target shape — which is why a well-connected formation holds together, and a stringy one wobbles.
What you just drove: the Graph and consensus_step from ferromotion-control, compiled to WebAssembly — the same code the native tools link against, not a reimplementation. λ₂ and the whole spectrum come from the Laplacian's eigendecomposition; the decay rate is fit from the live trace; nothing is precomputed.
Verified in the library: the measured decay rate matches λ₂ to under 2% · the centroid is conserved to 1e-12 · a disconnected graph has λ₂ = 0 and each component agrees only within itself · adding an edge never lowers λ₂. Each is a test in cargo test, not a claim in prose. See also chapter 1 — the body is the controller.
Institute for Physical AI · the Rust library · crates.io