Networks, Fast and Slow

Annealed and quenched networks in contagion dynamics

During Covid-19, the Washington Post published the corona-simulator. The animation took place in the quintessential simulation world — the billiard ball world — examining how different public health measures influenced the dynamics of the system: what if people practiced social distancing, or quarantined when sick?

With networks, we can represent how social structures shape the dynamics of contagion. Who talks to whom, who touches whom, who works or lives with whom — all of that matters.

Some interactions are fleeting, like a conversation with a stranger on a train. Others are deeply persistent, like sharing a household or workplace. These differences matter — and they define two fundamentally different modeling regimes: annealed and quenched networks.

Part I: Annealing

But doing math on exact networks can get… messy. It's often unwieldy to carry full structure through the equations. So instead, people often model the average effect of the dynamics — smoothing over the specific network in favor of general trends. To preserve some notion of structure without going fully detailed, modelers sometimes use what's called an annealed approximation.

Borrowed from metallurgy, annealing refers to the process of slowly cooling a metal so that its atomic structure settles into a stable — though not static — configuration. In network modeling, annealed networks refer to a similar idea: connections between nodes are not fixed, but constantly reshuffling, like social ties in a fast-moving crowd.

But why does that make sense? Think back to the bouncing balls. On average, the more infected balls there were, the more likely you were to bump into one. That's the essence of a mean-field approximation — we ignore the specific bump and just look at average exposure.

Annealed networks work similarly: by rapidly reshuffling, we erase specific structures while preserving general patterns, like degree. We implement this by reshuffling the network's edges every 500 milliseconds, effectively sampling a new adjacency matrix each time. This corresponds to the assumption that network structure changes much faster than the dynamics evolving on top of it.

Lets freeze the network with an infected node to show the dynamics (it is also the star of our show, for now, so we'll make it a star). We'll perform a simple Susceptible-Infected step among a node's flickering neighbors — those it's currently connected to.

In contagion processes, these are typically interpreted as the people you could influence or be influenced by. In a way, this momentary set of neighbors is your group. Granted, it's a pretty rough definition of a group — in our little simulation, you might never see that exact same configuration of people again!

Among neighbors we will select one random neighbor to maybe infect. Here's the lucky neighbor. Now with some probability (50%) we infect it.

Success!

Now that the SI step is done, repeat! We shuffle, we do a SI step. We shuffle, we do a SI step.

Ok, cool. What else.

In the mean-field world, we can also start from the neighbors. They are the stars now. This view make more sense for complex contagion of social behaviors, but it works just fine with airborn diseases.

In this case, we can think about the chance of your friends make you buy an iphone. In red, they are the red nodes again. In threshold models, your decision isn't just a matter of one friend's influence — it's nonlinear. Once enough of your friends are on board, you hit a tipping point and adopt the behavior yourself. Here, we see that out of NN friends, 4 are currently active. Are they enough to sway you?

Huzzay, you got pressured by your friend to have a new iphone you absolutely didn't need!

Lets reset everything and move to quenched networks. This time around, we want our group to stick around (maybe too much).

Part II: Quenching

The annealed assumption is a powerful one, but it also has a fundamental drawback; it washes away persistent group interactions. In that sense, this is terrible (but still slightly better than the bouncing ball world). It can capture somewhat ephemeral group interactions, which can be fairly inclusive as a process. For instance, many models of higher-order interactions (or complex contagion) are about paper coauthorships, where the ephemerality of the interactions is the span it takes to publish a paper. It might be good enough.

But workplace and households are both great examples of group behaviors that are so persistent that they influence the dynamics in ways that mean-field just cannot. If your kid gets sick, the chances are that the rest of the household will get sick too. There is dynamical correlation between the states of individuals within the household.

Ok. Now a way to make clearer the two limits of annealed vs quenched would be to take two nodes as reference, of which one is infected.

We let the dynamics run, taking note every time the two nodes are in contact — that is, measuring their contact duration. At an infection rate r=0.2r = 0.2 (per second), it will take on average t=1r=5t = \frac{1}{r} = 5 seconds of contact for an infection to occur — at which point the susceptible node turns red. This is because we're assuming a small probability of infection per unit of contact time. If each contact lasts ss seconds, then the probability of infection during that contact is approximately: P(infection in contact)=1exp(rs)rsP(\text{infection in contact}) = 1 - \exp(-r \cdot s) \approx r \cdot s (for small ss, the exponential approximates linearly). So, if contacts are short — say s=1s = 1 second — it takes ts=5\frac{t}{s} = 5 contact events on average before the infection happens. Longer contacts mean infection is more likely to happen in a single encounter. Shorter contacts require repeated interactions.

We generalize this process to get the average ss for many trials (let it time to run). Showing some measure of correlation and ss.

One more plot to show showing structural similarity and mutual information.

We're done with Scrolling!

You should now have a better idea what physicists mean when they say that annealed networks are thought to be reshuffled constantly, leading to the system to relax faster than the dynamics. In contrast, quench changes slowly compared to the dynamics, meaning that local structures can strongly influence the dynamics.