Skip to content
Omnikalc

Network density calculator

Enter the number of nodes and edges of an undirected network to get the mean degree, the density, the expected clustering and path length of a random graph and the connectivity regime.

Updated on
Your inputs

Value out of range

Value out of range

Results

Mean degree

10.00

A giant connected component is likely
Density
1.001 %
Possible edges
499,500
Clustering of a random graph
0.0100
Average path length of a random graph
3.00 steps
Connectivity ratio (mean degree / ln n)
1.45
A random graph like this is usually fully connected

The network density calculator gives the mean degree, the density, the number of possible edges and the clustering and average path length expected in a random graph of the same size.

How the calculation works

  • Enter the number of nodes.
  • Enter the number of edges.
  • The calculator gives the mean degree, the density, the possible edges, the random clustering, the average path length and the connectivity ratio.

Example

A network of 1,000 nodes and 5,000 edges has a mean degree of 2 × 5,000 / 1,000 = 10.00. It could have 1,000 × 999 / 2 = 499,500 edges, so its density is 1.001 %. A random graph of this size and degree has a clustering of 0.0100 and an average path of ln 1,000 / ln 10 = 3.00 steps. The ratio of degree to ln n is 1.45, above 1, so it is usually connected.

Why it matters

The calculator helps students of network science, social network analysts and developers who study graphs of users, links or computers and want a baseline to compare with.

Good to know

The formulas here are for undirected networks without self-loops or multiple edges. For directed networks, the density is edges divided by n × (n − 1), and the mean degree splits into in-degree and out-degree. Real networks often have hubs, nodes with very many links, which makes the degree distribution very uneven and the mean degree less informative. The path length estimate of a random graph is a typical order of magnitude, valid for a large connected network with a mean degree above 1. If your measured clustering is much larger than the random value while the path length is similar, the network has small-world properties.

The probability calculator covers chances, the logarithm calculators help with ln, the Metcalfe law calculator values a network by its connections and the normal distribution calculator describes bell curves.

Frequently asked questions

How is the density defined?

It is the share of possible edges that exist. An undirected network of n nodes has n × (n − 1) / 2 possible edges, so the density is edges divided by that number. Large real networks are usually sparse, with densities well under 1 %.

What does a random graph predict?

In an Erdős–Rényi random graph with mean degree k, the expected clustering equals the density, and the typical distance between two nodes is about ln n / ln k. A giant component appears when k passes 1, and the graph is connected once k exceeds ln n.

Why compare a real network to the random model?

Real social networks have a much higher clustering than a random graph of the same size, yet a similarly short average path. This small-world structure is a signature of communities with a few long links, and the comparison shows how far a network is from random.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.