How the internet looks as a graph Image: The Opte Project, CC BY 2.5

How the internet looks as a graph

The cover picture of this post is the Opte Project's map of the internet from January 2005, drawn by Barrett Lyon. Each line joins two IP addresses, the colours mark regions of the world, and the data came from tracing the routes that packets take across the network. It has been reproduced in museums and textbooks ever since, because it was the first time most people had seen the internet as what it is to a mathematician: a graph.

Which graph

There are several, depending on what one takes as a vertex. At the finest level the vertices are routers, the machines that forward packets, and an edge is a cable or a radio link between two of them; this graph has hundreds of millions of vertices and nobody has all of it. At a coarser level the vertices are autonomous systems, the networks run by a single organization, such as an internet service provider, a university, or a large company, and an edge means that the two have agreed to exchange traffic; there are tens of thousands of autonomous systems, and the graph is known reasonably well from the routing tables that the systems publish to each other. The Opte map is in between: its vertices are the addresses reached by the trace, aggregated.

The web is a different graph again. Its vertices are pages and its edges are links, which have a direction, from the page that links to the page linked. The web graph is far larger than the internet graph and is what PageRank runs on.

What one measures

Three numbers describe a large graph at first sight, and Unit 8 of the Graph Theory Masterclass computes all three on real data. The degree distribution says what fraction of vertices have 1, 2, 3, and more neighbours. The average distance says how many edges separate two typical vertices. The clustering coefficient says how often two neighbours of a vertex are neighbours of each other.

On the internet all three are striking. The degree distribution has a heavy tail: most routers have a handful of links, and a few have thousands. When the fraction of vertices of degree k is plotted against k on logarithmic axes, the points fall roughly on a straight line, which means that the fraction decays like a power of k rather than exponentially. Michalis, Petros, and Christos Faloutsos reported this for the autonomous system graph in 1999, with an exponent near 2.2. The average distance is small, a few hops at the autonomous system level. And the clustering is high: the neighbours of a router tend to be connected to each other, because networks are built regionally.

What a random graph gets wrong

The natural first model is the random graph of Erdős and Rényi: n vertices, each pair joined with probability p, independently. Unit 11 studies it in detail. Its degree distribution is binomial, concentrated around the average degree pn with a tail that falls off exponentially fast; a vertex with a hundred times the average degree never appears. Its clustering coefficient is p, which is tiny for a sparse graph. The random graph gets one thing right, the small distances, and gets the hubs and the clustering completely wrong. The cover picture is not a random graph, and a trained eye sees that at once from the bright, dense centres with many spokes.

Where hubs come from

In 1999 Albert-László Barabási and Réka Albert proposed a model in Science that produces the heavy tail. Start with a few vertices. Add vertices one at a time, each with m edges to existing vertices, and choose the endpoints with probability proportional to their current degree: a vertex with twice as many links is twice as likely to receive the new one. Growth and preferential attachment together produce a degree distribution in which the fraction of vertices of degree k falls like k to the power minus 3, for every m, and the oldest vertices become hubs. The paper is free on the arXiv, and Unit 8 presents it in a research spotlight.

The mechanism is old: Yule used it for the sizes of genera in 1925, Simon for word frequencies and city sizes in 1955, and Price for citations in 1976. What Barabási and Albert did was apply it to graphs, measure the web and the actor collaboration graph, and give the result a name, the scale-free network, that stuck. The exponent 3 of the model does not match the 2.2 of the internet, and later models add rewiring, ageing, and fitness to tune it.

How universal it is

Whether real networks are scale-free in a strict sense has been argued about for twenty-five years. A straight line on logarithmic axes is easy to see and hard to establish statistically, because the tail contains few vertices, and Anna Broido and Aaron Clauset tested nearly a thousand real networks in 2019 and found that only a minority pass a strict test for a power law. The reply from the other side is that the strict test asks the wrong question, and that the heavy tail, whatever its precise shape, is the fact that matters for how the network behaves. Both sides agree on that fact. The internet has hubs, and removing a few of the largest would disconnect it, while removing vertices at random does almost nothing. That asymmetry is the practical content of the picture, and it holds for airline routes, power grids, and protein interaction networks as well.

Looking for yourself

The Opte Project has released later maps and a time-lapse of the internet's growth from 1997 to 2021. The Stanford Large Network Dataset Collection, the tool of the week for Unit 8, has the autonomous system graph in several snapshots from 1997 to 2000 as plain edge lists, with up to 6,500 vertices, small enough to load into NetworkX and plot the degree distribution in a minute. The straight line on logarithmic axes is there to see, and so is its roughness in the tail, which is where the argument lives.

ARPANET, the internet's ancestor, had four vertices in December 1969: UCLA, the Stanford Research Institute, Santa Barbara, and Utah. Its graph was a path with one extra edge. The Opte map of 2005 has more lines than an eye can separate, and no map of the whole graph exists today. A graph that nobody can see whole and that everybody uses is why Unit 8 ends with László Lovász's question of what can be said about a graph far too large to be written down.

Study graph theory properly

The Graph Theory Masterclass: weekly units, quizzes, a final exam, and a certificate.
About the program