Opinion Dynamics
Deffuant bounded-confidence model — agents only influence each other when their opinions are close enough
Deffuant bounded-confidence model — agents only influence each other when their opinions are close enough
The Deffuant model (2000) is the simplest bounded-confidence model of opinion formation. Each agent holds a real-valued opinion x ∈ [0, 1]. At each step, two agents are chosen at random. If |xi − xj| < ε (the confidence threshold), both shift toward each other by a fraction μ of their difference. If they are further apart, nothing happens.
Small ε → agents only talk to like-minded people → echo chambers and political polarisation. Large ε → everyone is within tolerance → global consensus. Intermediate ε produces a fixed number of opinion clusters matching the rule ≈ 1/(2ε).
The media bias slider adds a persistent external nudge: a virtual media agent with fixed opinion pulls susceptible agents slightly toward it every step — modelling the influence of mass media or social-media feed algorithms.
This simulation runs the Deffuant bounded-confidence model, one of the classic agent-based models of opinion formation. Each of N agents holds a real-valued opinion between 0 and 1. At every step two agents are picked at random and, only if their opinions are within the confidence threshold ε, both move toward each other by a fraction μ of their difference — agents who disagree too strongly simply ignore each other. An optional media bias term adds a constant external nudge toward one extreme, mimicking a biased broadcaster or a feed algorithm.
Hundreds of agents (50–500) start with random opinions scattered across the [0, 1] line. As random pairwise interactions accumulate, the population either collapses into a single consensus, splits into a few stable opinion clusters, or fragments into many isolated echo chambers — purely as a function of how tolerant (ε) and how strongly persuadable (μ) the agents are. Colour encodes opinion from red (left) through yellow (centre) to blue (right), and faint lines connect agents currently close enough to influence each other.
Drag the Confidence ε slider (0.05–0.50) to control how open-minded agents are — small ε locks people into echo chambers, large ε pulls everyone toward one shared view. Convergence μ (0.10–0.90) sets how far agents jump toward each other on each successful interaction. Media bias (−0.40 to 0.40) drags susceptible agents toward 0.15 or 0.85. Use Reset to reshuffle, Pause/Play to freeze the process, Step ×100 to fast-forward, and the Layout selector to switch between the scatter view and a timeline view of opinions over iterations.
The number of opinion clusters this model settles into is not random — it follows the rule of thumb clusters ≈ 1 / (2ε), a pattern documented since Guillaume Deffuant and colleagues first published the model in 2000. It is one of the most cited tools for explaining why some societies polarise into two rigid camps while others reach broad consensus, depending only on how tolerant of disagreement people are.
The Deffuant model, introduced by Guillaume Deffuant and co-authors in 2000, is a bounded-confidence model of social influence. Agents hold continuous opinions in the range [0, 1] and interact in random pairs. Two agents only influence each other if their opinions differ by less than a confidence threshold ε; when that condition holds, both shift toward each other by a fraction μ of their opinion gap. Agents whose views are too far apart simply do not interact at all in that step.
When ε is small, agents will only listen to others whose opinions are already very close to their own. Random pairs that start out far apart never cross that threshold, so they never converge — the population instead splinters into several separated opinion clusters that no longer talk to each other, which is the simulation's model of an echo chamber or filter bubble.
Setting media bias to a non-zero value adds a constant pull, each iteration, nudging every agent's opinion slightly toward 0.15 (negative bias) or 0.85 (positive bias), independent of the normal peer-to-peer interactions. It models the steady influence of a one-sided broadcaster or a recommendation algorithm that consistently favours one side, and can shift the population's final consensus point even when peer interactions alone would have produced a balanced outcome.
Analysis of the Deffuant model shows the equilibrium cluster count is approximately 1 divided by 2ε. A confidence threshold of ε = 0.25, for instance, predicts around 2 clusters, while ε = 0.1 predicts around 5. The live "Clusters" statistic in this simulation counts groups by sorting all current opinions and counting gaps larger than roughly 1.1×ε, letting you check this rule of thumb directly against the running simulation.
The scatter layout places every agent at a fixed random position on the canvas and colours each dot by its current opinion, drawing faint connecting lines between agents close enough to influence one another — useful for seeing clustering and isolation at a glance. The timeline layout instead plots each agent's opinion value as it evolves over successive iterations, making it easier to watch individual trajectories converge, oscillate, or get pulled toward a media bias target over time.