Introduction

Look at any network — the internet, a social platform, a protein interaction map — and you will notice that some nodes are hubs: they have vastly more connections than average. The natural question is: do those hubs connect to each other, forming an exclusive club, or do they mainly connect to the many low-degree nodes at the periphery?

Assortative mixing is the tendency for nodes with similar degree to connect to each other. A network is called assortative when high-degree nodes preferentially link to other high-degree nodes, and low-degree nodes link to other low-degree nodes. It is called disassortative when hubs connect mainly to the fringe and vice versa.

The difference is not cosmetic. Assortative networks like academic co-authorship graphs and social networks tend to be robust: removing a hub rarely disconnects the rest because the other hubs stay connected. Disassortative networks like the internet and biological protein networks are fragile at the hubs but hard to fragment by random removal. One scalar — the assortativity coefficient rr — captures all of this.

Try It: Measure a Network

Pick a preset or click two nodes to add an edge between them. The demo computes the assortativity coefficient rr in real time using Newman's degree-correlation formula.

<!-- {{c_intro}} -->
<div class="controls">
  <label>{{label_preset}}</label>
  <div class="presets">
    <button type="button" data-preset="star">{{btn_star}}</button>
    <button type="button" data-preset="path">{{btn_path}}</button>
    <button type="button" data-preset="clique">{{btn_clique}}</button>
    <button type="button" data-preset="social">{{btn_social}}</button>
    <button type="button" class="ghost" data-preset="clear">{{btn_clear}}</button>
  </div>
</div>
<canvas id="canvas" width="480" height="260" title="{{canvas_title}}"></canvas>
<p class="instruction">{{instruction}}</p>
<div class="result" id="result">
  <span class="r-label">r =</span>
  <span class="r-value" id="rval">—</span>
  <span class="r-desc" id="rdesc"></span>
</div>
/* {{c_layout}} */
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; color: #222; }
.controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
label { font-size: .85rem; font-weight: 600; color: #555; }
.presets { display: flex; gap: .4rem; flex-wrap: wrap; }
button { font: 600 13px system-ui; padding: .35rem .75rem; border: 1px solid #1d3557;
         background: #1d3557; color: #fff; border-radius: 6px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
canvas { display: block; border: 1px solid #cdd9e3; border-radius: 8px;
         background: #f7f9fb; width: 100%; max-width: 480px; cursor: crosshair; }
.instruction { font-size: .82rem; color: #666; margin: .4rem 0; }
/* {{c_result}} */
.result { display: flex; align-items: baseline; gap: .5rem; margin-top: .3rem; min-height: 2rem; }
.r-label { font: 700 1.1rem ui-monospace, monospace; color: #444; }
.r-value { font: 700 1.6rem ui-monospace, monospace; color: #1d3557; }
.r-desc { font-size: .9rem; color: #555; }
// Code not found

Notice how the score shifts. A star graph (one hub connected to many leaves) scores close to 1-1: the hub's many connections pair with leaves that each have just one. A clique (everyone connected to everyone) scores exactly 00 — all degrees are equal, so there is no preference at all. Real social networks typically land between 00 and +0.5+0.5.

The Real Complexity

The assortativity coefficient rr was defined and solved by M. E. J. Newman in 2002. It is the Pearson correlation coefficient of the degrees at both ends of every edge in the network.

Formally, for a network with mm edges, label each edge \ell with the degrees of its two endpoints (j,k)(j_\ell, k_\ell). Then:

r=m1jk[m112(j+k)]2m112(j2+k2)[m112(j+k)]2r = \frac{m^{-1}\sum_\ell j_\ell k_\ell - \left[m^{-1}\sum_\ell \tfrac{1}{2}(j_\ell + k_\ell)\right]^2}{m^{-1}\sum_\ell \tfrac{1}{2}(j_\ell^2 + k_\ell^2) - \left[m^{-1}\sum_\ell \tfrac{1}{2}(j_\ell + k_\ell)\right]^2}

This is not an open problem: the formula is exact and computable in O(m)O(m) time once you know the edges.

  • r=+1r = +1: perfectly assortative — every edge links two nodes of identical degree.
  • r=0r = 0: neutral — no degree preference at all (random graph baseline).
  • r=1r = -1: perfectly disassortative — every edge links nodes of maximally different degree.

The interesting complexity lies in understanding why a network settles into its assortativity regime and whether you can reshape it — adding or rewiring edges to hit a target rr — which connects to graph coloring and degree-sequence realization problems.

Where It Matters

Knowing a network's assortativity coefficient changes how you reason about it in practice:

  • Epidemic spreading: in a disassortative network the hub infects many low-degree nodes but those nodes rarely reach another hub, slowing spread. In an assortative network an infection that reaches one hub quickly jumps to other hubs — P vs NP-style intractability shows up when you try to optimally vaccinate such a network.
  • Network robustness: assortative networks (social, biological) are resilient to targeted hub removal because the remaining hubs stay mutually connected. Disassortative networks (the internet, power grids) collapse faster when key hubs fail.
  • Recommendation systems: user–item bipartite graphs are strongly disassortative by construction; knowing this lets engineers calibrate collaborative-filtering algorithms.
  • Community detection: assortative mixing is structurally linked to graph coloring — dense blocks with similar degrees are the seeds of communities.
  • Synthetic network design: protocol designers target specific rr values to balance load-balancing and fault tolerance in data-center topologies.

Assortativity is one of the handful of numbers — alongside clustering coefficient, diameter, and degree distribution — that together fingerprint a network's personality.

Conclusion

Assortative mixing answers one of the most natural questions you can ask about a network: do the powerful nodes keep to themselves, or do they reach out? The answer — encoded in a single number rr between 1-1 and +1+1 — was pinned down by Newman in 2002 and is computable from the edge list alone.

That one number predicts whether an epidemic burns through a population's hubs or sputters at the fringe, whether targeted attacks shatter a network or leave it mostly intact, and whether communities are tightly self-referential or loosely bridged.

So the next time you see a network diagram, ask not just "who has the most links?" but "do those people link to each other?" — the answer, captured in rr, tells you almost everything about how the network will behave under stress, spread, or attack.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/assortative-mixing/Content licensed under CC BY-NC 4.0.