Assortativity Coefficient Calculator

Measure how similar connected nodes are in networks. Reveal mixing patterns in physical systems. Use results to refine models and validate simulations accurately.

Choose how similarity is defined for your network.
Use directed correlations for flow-like graphs.
Applies only when direction is enabled.
Common in network physics for undirected mixing.
Accepted separators: spaces, commas, or semicolons. Lines starting with # are ignored.
Use numbers for numeric mode, or labels for categorical mode (e.g., A,metal).
Reset

Example data table

Edge Meaning Sample attribute
A — BConnection between nodes A and BA: 1.0, B: 0.6
A — CConnection between nodes A and CA: 1.0, C: 1.2
C — DConnection between nodes C and DC: 1.2, D: 0.9
D — EConnection between nodes D and ED: 0.9, E: 1.1

Try switching between degree and attribute modes to see how the coefficient changes.

Formula used

The assortativity coefficient measures correlation between endpoint properties across edges. For numeric properties (including degrees), it is computed as a Pearson correlation:

r = ( ⟨xy⟩ − ⟨x⟩⟨y⟩ ) / √( (⟨x²⟩ − ⟨x⟩²)(⟨y²⟩ − ⟨y⟩²) )

How to use this calculator

  1. Pick a calculation mode: degree, numeric, or categorical.
  2. Paste your edge list, one edge per line.
  3. If using attributes, paste node,value lines in the box.
  4. For directed graphs, enable direction and select pairing.
  5. Press Calculate to view results above the form.
  6. Use Download CSV or Download PDF to export.

Tip: If r is positive, similar nodes preferentially connect; if negative, dissimilar nodes connect more often.

Professional guide to assortativity analysis

1) What the coefficient represents

Assortativity quantifies whether connected nodes share similar properties. In many physics-inspired networks, nodes represent components, states, or sites, while edges represent interactions, transport channels, or correlations. The coefficient r ranges from -1 (perfectly disassortative) to +1 (perfectly assortative), with values near 0 indicating weak mixing.

2) Degree mixing in complex systems

In scale‑free or heterogeneous graphs, degree assortativity helps reveal whether hubs attach to hubs (positive) or hubs attach to low‑degree nodes (negative). Physical examples include flow networks, contact networks, and interaction graphs from simulations. This tool reports nodes, edges, average degree, and density to provide context for your computed correlation.

3) Excess degree option and why it matters

For undirected graphs, many studies use excess degree (degree − 1) because an edge already “uses” one connection. Excess degree reduces a structural bias when comparing networks of different sizes. Try toggling “Use excess degree” and observe how r shifts for sparse graphs.

4) Directed networks and pairing choices

Directed graphs arise in transport, reaction pathways, and causal models. This calculator supports four pairings: out→in, out→out, in→in, and in→out. Choose the pairing that matches your mechanism, such as source activity connecting to target receptivity (out→in) in driven systems.

5) Numeric attributes beyond degree

When nodes carry measurements (energy, mass, conductivity, temperature proxies, or order parameters), numeric assortativity measures the Pearson correlation between endpoint values across edges. A positive r suggests spatial or interaction clustering of similar magnitudes, often linked to phase separation or domain formation in lattice‑like models.

6) Categorical mixing with a matrix view

For labels such as material type, spin state, compartment, or class, categorical assortativity uses a mixing matrix. The method compares the observed fraction of within‑category edges to what would be expected from the category frequencies. Strong within‑class preference drives r upward.

7) Practical thresholds and reporting

In applied analysis, |r| below 0.1 is often described as weak, while values around 0.2–0.4 can indicate meaningful structure, depending on noise and sampling. Always report the network size, density, and attribute coverage. This tool shows how many edges were used when attributes are required, helping you diagnose missing data.

8) Interpreting results in workflows

Use assortativity as a comparative metric: compare experimental vs simulated networks, or compare states across temperatures, driving strengths, or time windows. Export CSV for record‑keeping and use the PDF report for lab notes. If variance is near zero, the calculator warns because correlation becomes unstable.

FAQs

1) What does r = 0.30 mean?

A value near 0.30 indicates moderate positive mixing: connected nodes tend to have similar degrees or attribute values. It often suggests clustering of similar states, especially when density is low and attributes cover most nodes.

2) Why is my result blank or missing?

If no valid edge‑pairs exist, the calculator cannot compute correlation. Common causes are empty edge lists, malformed lines, or missing attributes on one endpoint for attribute modes. Check the parsed edge count and edges used.

3) When should I use excess degree?

Use excess degree for undirected degree mixing when you want to compare networks fairly across sizes or sparsity. It reduces bias because an endpoint already participates in the edge being analyzed, so degree − 1 is often preferred.

4) Which directed pairing should I choose?

Pick the pairing that matches your mechanism. Out→in fits “source drives target” processes, out→out compares emitter activity, and in→in compares receptivity. If unsure, compute all four and report the pattern differences.

5) Why do I get a variance warning?

If many nodes share the same degree or identical attribute values, variance becomes near zero. Pearson correlation then becomes unstable or uninformative. Increase network size, use richer attributes, or verify your data variation.

6) Can r be outside −1 to +1?

In theory, r lies within −1 and +1. Small numerical rounding can slightly exceed bounds, so this calculator clamps results into the valid range. Large deviations usually indicate invalid inputs or a computation mismatch.

7) How many edges do I need for reliable r?

More is better. For stable estimates, aim for dozens of edges at minimum and preferably hundreds, especially with noisy attributes. Also ensure good attribute coverage; the tool reports edges used so you can judge sampling quality.