What are graphons?
When are two networks structurally alike?
Suppose you’re a data scientist studying the social networks of different countries, and you want to quantify the differences in their broad structure. Maybe the network of one country is a patchwork of small, tight-knit communities with sparse connections between them. Maybe another country’s network is one big, densely interconnected community. How would you actually measure that difference?
The obvious first move is to count: how many people (vertices), how many relationships (edges)? But raw counts don’t tell you anything about structure — a country with a tenth the population could have an essentially identical social fabric, just scaled down. So you normalize: what’s the average number of relationships per person in country A versus country B? This is closer, but it collapses too much information into a single number. A network made of many small, tightly-knit clusters connected by sparse bridges, and a network where everyone is uniformly loosely connected, can have exactly the same average degree while looking nothing alike.
So maybe you go local instead of global: analyze the motifs. What fraction of triples of people are mutually connected (triangle density)? What fraction of quadruples are mutually connected (tetrahedron density)? This gets you somewhere — now you’re comparing structure, not just size. But it’s still not enough. Two networks can agree on triangle density, agree on tetrahedron density, agree on every motif you’ve thought to check, and still differ in their global structure in ways those finitely many statistics simply don’t capture. Closing that gap means checking larger and larger motifs, forever, with no guarantee you ever actually pin the structure down.
This is the problem graphons solve. They give you a single object that simultaneously encodes the density of every motif at once, and — just as importantly — a natural notion of distance between two such objects, so two networks with similar structure end up provably close together, not just similar on whichever finite checklist of statistics you happened to compute. In 2006, Lovász and Szegedy introduced graphons as continuous limit objects for sequences of dense graphs, with motivations well beyond this network-comparison problem — convergence, sampling, statistics on huge graphs — but the comparison problem is a clean way to see why you’d want them (Lovász–Szegedy 2006; Lovász 2012).
The philosophical move is the same one that gets you from the rational numbers to the real numbers. The rationals have gaps — isn’t one of them — and filling those gaps with limits gives you a complete, well-behaved space where calculus actually works. Graphons do this for graphs: a sequence of networks that keeps agreeing on more and more motifs, without ever quite settling into a fixed structure, is exactly the graph-theoretic analogue of a Cauchy sequence with no rational limit. Graphons fill that gap, completing the space of finite graphs into a continuous space where every reasonable sequence of dense graphs has a limit, and where the combinatorial act of counting motifs becomes the analytic act of integration.
Building the object
Go back to the social network problem. A network on people is, formally, a simple graph: a finite vertex set (the people) together with a set of unordered pairs of distinct vertices (the relationships) — no self-relationships, no relationship counted twice. The trouble is that is baked into the object from the start. Country A’s network lives on vertices, Country B’s on vertices, and there’s no canonical way to even line those vertex sets up against each other, let alone compare them, unless .
So the fix has to start before you even get to edges: stop indexing vertices by at all. Instead, index every possible vertex by a point in a fixed space that doesn’t grow with — say, the unit interval . Now “vertex 7 out of 50” and “vertex 7,000 out of 50,000” aren’t different kinds of labels in different-sized index sets; they’re both just points in , directly comparable regardless of how many vertices you actually sample.
Once vertices are points , a relationship between them is some function of the pair . Two things pin down what kind of function. First, relationships are undirected — “ and are connected” doesn’t distinguish from — so the function has to be symmetric: . Second, real social structure isn’t deterministic; whether two essentially-similar people happen to know each other is better modeled as a probability than a hard yes/no. So instead of a 0/1-valued adjacency, let
be the probability that the vertices labeled and are connected.
That’s the whole idea, and the random graph model falls out of it for free: to generate an -vertex sample from , draw labels independently and uniformly from , and connect each pair independently with probability . Call the result . This sampling viewpoint also sits inside the broader theory of exchangeable random graph models (Orbanz–Roy 2014). This single recipe already contains familiar models as special cases. If is a constant , every pair connects with the same probability and you recover the Erdős–Rényi random graph . If is a step function — constant on a grid of rectangles — you get the stochastic block model, where vertices fall into a handful of communities and connection probability depends only on which communities the two endpoints belong to.
This is exactly the -independent object the comparison problem was asking for: doesn’t care how many vertices you sample from it, so two networks of wildly different sizes can now be compared by comparing the ’s that plausibly generated them, rather than the raw graphs themselves. (Why this also resolves the motif-counting problem — that implicitly encodes the density of every motif at once — is the subject of a later section.)
With that picture in mind, the formal definition is almost just bookkeeping:
Definition (Graphon). The space of graphons is the set of Borel measurable, symmetric functions (so ), where we identify two functions if they agree almost everywhere.
That last clause — modding out by sets of measure zero — isn’t a technicality you can shrug off, because it’s actually load-bearing. If and differ only on a measure-zero set, then no randomly sampled pair will ever land in the region where they disagree, with probability 1. So and have exactly the same distribution. Two graphons that agree almost everywhere aren’t just similar — they’re indistinguishable as random graph models, full stop.
The simplest graphons: step functions
The stochastic block model picture above generalizes into the most important sub-family of graphons, the multipodal graphons: step functions on the unit square. Formally, is multipodal if you can partition into finitely many pieces (the “podes”) and assign a weight to each pair of pieces, so that equals on the rectangle .
These are worth dwelling on because they show, very concretely, how a graphon generalizes a finite graph — and how an actual, finite country’s network sits inside the same space as the continuous idealized version. Take any simple graph on vertices, chop into equal intervals , and define a graphon that’s on exactly when is an edge of , and otherwise. This is the graphon blowup of — sometimes called its checkerboard graphon, because that’s literally what it looks like as a picture: a black-and-white grid encoding the adjacency matrix. Every finite graph sits inside the space of graphons this way.
When are two graphons “the same”?
Now for the part that makes graphons genuinely useful rather than just a reformulation: a notion of distance.
Here’s the intuition first. Two graphons should count as “close” if they assign roughly the same amount of connection mass to every region of the unit square — not just on average, but region by region, no matter how you slice it. That’s a stronger requirement than it sounds, and it’s worth sitting with before the formula: you’re not just comparing two functions pointwise, you’re asking whether every possible chunk of one looks like the corresponding chunk of the other.
That’s the cut norm. For a graphon , define
where the supremum is over measurable subsets . This induces the cut distance between two graphons: is the supremum, over all pairs of subsets , of how differently and distribute mass onto . Intuitively, two graphons are cut-close if no pair of “label regions” sees a big discrepancy in connection mass between them.
But cut distance alone is too sensitive: it can declare two graphons “different” just because they use different labelings, even when they generate the exact same family of random graphs. Think of the finite-graph analogy. Two graphs on the same vertex set are isomorphic if relabeling the vertices of one turns it into the other, and any property we actually care about — triangle count, edge density, anything — is invariant under that relabeling. So isomorphic graphs are “the same” for essentially every purpose, even though they’re literally different objects on paper.
The graphon version of relabeling is a measure-preserving bijection — a way of permuting the label space itself. If , then generates exactly the same distribution of random graphs as does, because relabeling i.i.d. uniform samples with a measure-preserving map just gives you i.i.d. uniform samples again. So and play the role of isomorphic graphs.
This gives the right notion of distance, the cut metric:
minimizing over every possible relabeling . Where the cut distance compares two graphons under a fixed labeling, the cut metric compares them up to relabeling — which is exactly what you want if you’re trying to embed actual finite graphs (via their blowups) into this continuous space and compare them meaningfully.
Technically, ends up being only a pseudometric on the space of graphons — distinct graphons can sit at distance zero from each other. Quotienting by that relation gives the space of reduced graphons , on which is a genuine metric, and where “graphon” really means “graphon up to relabeling” from here on, even when I just write .
The reason all of this machinery is worth building: is a compact metric space — a theorem of Lovász and Szegedy, developed further in the graph-limit and regularity/topology literature (Lovász–Szegedy 2006; Borgs et al. 2008; Lovász–Szegedy 2010). Compactness is what makes graphons useful as limit objects rather than just an alternative encoding: every sequence of graphons has a convergent subsequence, which is exactly the kind of completeness you want from something playing the role of “the real numbers” for graphs.
And the limiting story closes the loop: for any graphon , if you sample and take its graphon blowup, that blowup converges to in cut metric almost surely as . So graphons are doing double duty — they parametrize random graph models, and they are the limits of the dense graph sequences those models produce. From here on, “graphon” really means an equivalence class in , even when I just write .
Counting subgraphs by integrating
Go back to the motif problem from the introduction. Checking triangle density, then tetrahedron density, then five-cycle density, one statistic at a time, never quite settles whether two networks are structurally alike — there’s always a larger motif left unchecked. What you actually want is a single object that hands you the density of any motif, on demand, from one formula. That object is the homomorphism density, and it’s where the graphon machinery built so far finally pays off.
First, the finite-graph version, so the graphon version doesn’t appear out of nowhere. A homomorphism from to is a map of vertices that sends edges to edges (it doesn’t need to be injective). The homomorphism density is the fraction of all functions that happen to be homomorphisms — equivalently, the probability that a uniformly random map is one. This is the precise version of the fuzzy thing “motif density” meant in the introduction: triangle density is , tetrahedron density is , and in general the density of motif is just .
The graphon analogue replaces “count and divide” with “integrate”: for a graph on vertices and a graphon ,
Two special cases come up constantly. The edge density is , and the triangle density is
These have a clean probabilistic meaning: is the limiting probability that a fixed map from lands inside as a homomorphism, as . In particular and are just the edge and triangle probabilities of the corresponding random graph model. And reassuringly, this all agrees with the finite picture: if is the graphon blowup of a graph , then — homomorphism density of finite graphs is a special case of the graphon version, not a different thing wearing the same name.
Two theorems justify treating as the right home for these questions, and both connect directly back to the introduction’s complaint about motifs (Lovász–Szegedy 2006; Lovász 2012).
- Continuity. For every graph , the map is continuous on . This is what ties homomorphism densities to the cut metric from the previous section: graphons that are close in are automatically close in every motif density at once, not just the ones you happened to check.
- Injectivity. The map sending to the entire tuple of its homomorphism densities is injective — a graphon is completely determined by its homomorphism densities, taken all together over every finite .
It’s worth being precise about what injectivity does and doesn’t buy you. It does not say that finitely many motif checks ever suffice to tell two graphons apart — it’s entirely possible for two distinct graphons to agree on triangle density, tetrahedron density, and every motif up to some enormous size, and still differ. What injectivity rules out is something narrower but still important: no structural information is permanently invisible to the motif densities. There’s no extra hidden feature of a graphon that homomorphism densities, taken all together, fail to see — if two graphons differ at all, some motif, possibly a very large one, will eventually show the difference. Combined with continuity, this is what makes the right home for the comparison problem the introduction posed: not a shortcut around checking infinitely many motifs, but a guarantee that the motif densities, as a complete collection, really do carry the full structural story.
The Razborov triangle
Here’s where the machinery pays off on a concrete question. Fix the edge density of a graphon. What triangle densities are achievable?
Plot every achievable pair as ranges over all graphons, and you get a region in called the Razborov triangle, after Alexander Razborov, who found the minimum achievable triangle density for each edge density in a 2008 paper (Razborov 2008).
The maximum is the easy direction, essentially a graphon version of a generalized Hölder/Finner inequality (Finner 1992):
Theorem (Maximum triangle density). For a graphon with edge density , , with equality uniquely at — a single dense block.
The minimum is where it gets interesting, and it comes in pieces. For , you can actually drive the triangle density all the way down to zero — achieved by a complete bipartite-style graphon (split in half and connect across, never within). Any edge density up to is reachable by a triangle-free graphon, so the lower boundary of just sits on the axis for that whole stretch.
Past it’s no longer possible to avoid triangles entirely, and the exact minimum — proven by Razborov using a technique called flag algebras, which is in a precise sense dual to the graphon picture via the injectivity theorem above — has a genuinely ugly closed form involving square roots and a parameter that increases as climbs (Razborov 2008; Razborov 2013). The extremal construction has a nice shape, though: partition into intervals, make every cross-pair of intervals fully connected, make all but one of the intervals internally triangle-free, and let the leftover interval absorb whatever edge density is needed without contributing extra triangles. Pikhurko and Razborov later made the asymptotic structure of these minimizing graphs precise (Pikhurko–Razborov 2017). The strategy — exhaust your triangle “budget” in one localized region, and let the rest of the graphon pad out the edge density for free — is a recurring trick.
Put the maximum, the minimum, and the Razborov minimum together, and you get the full shape of : a region bounded above by a smooth curve and below by a curve that’s flat near the origin and then breaks into infinitely many pieces, one for each integer , getting smoother as .
Where this is going
The Razborov triangle is built around a tension between two graphs: a fixed edge density caps how many triangles a graphon can pack in, and the question is how tight that cap actually is. Nothing about that tension is special to triangles. Replace “triangle” with any graph , and ask the analogous question: among graphons with edge density and triangle density , how large can get?
The next post picks up exactly there, in the limiting regime — the graphon analogue of “almost triangle-free.” It turns out the corner of the Razborov triangle near , where triangle density can be driven to zero outright, is the right place to start, and the extremal constructions look a lot like the localized, budget-exhausting graphons that show up in the minimum-triangle-density theorems above.
References
- Borgs, Christian; Chayes, Jennifer T.; Lovász, László; Sós, Vera T.; and Vesztergombi, Katalin. “Convergent Sequences of Dense Graphs I: Subgraph Frequencies, Metric Properties and Testing.” Advances in Mathematics 219, no. 6 (2008): 1801–1851.
- Finner, Helmut. “A Generalization of Hölder’s Inequality and Some Probability Inequalities.” The Annals of Probability (1992): 1893–1901.
- Lovász, László, and Szegedy, Balázs. “Limits of Dense Graph Sequences.” Journal of Combinatorial Theory, Series B 96, no. 6 (2006): 933–957.
- Lovász, László, and Szegedy, Balázs. “Regularity Partitions and the Topology of Graphons.” In An Irregular Mind: Szemerédi Is 70, 415–446. Springer, 2010.
- Lovász, László. Large Networks and Graph Limits. Vol. 60. American Mathematical Society, 2012.
- Orbanz, Peter, and Roy, Daniel M. “Bayesian Models of Graphs, Arrays and Other Exchangeable Random Structures.” IEEE Transactions on Pattern Analysis and Machine Intelligence 37, no. 2 (2014): 437–461.
- Pikhurko, Oleg, and Razborov, Alexander. “Asymptotic Structure of Graphs with the Minimum Number of Triangles.” Combinatorics, Probability and Computing 26, no. 1 (2017): 138–160.
- Razborov, Alexander A. “On the Minimal Density of Triangles in Graphs.” Combinatorics, Probability and Computing 17, no. 4 (2008): 603–618.
- Razborov, Alexander A. “Flag Algebras: An Interim Report.” In The Mathematics of Paul Erdős II, 207–232. Springer, 2013.