Applied

The cheapest tree costs ζ(3)

Join n towns by every possible road, give each road a cost drawn at random between nought and one, and find the cheapest network of n − 1 roads that connects them all. However many towns there are, the bill tends to 1 + 1/8 + 1/27 + 1/64 + … = 1.2020569. The proof watches the cheap roads arrive one at a time and turns the cost into the area under a curve that counts the pieces of a growing random graph.

Worth reading first: One, plus a quarter, plus a ninth · The moment everything joins up.

One, plus a quarter, plus a ninth gave nn workers nn jobs at random costs and found that the cheapest way to pair them costs, on average, exactly 1+1/4+1/9+⋯+1/n21 + 1/4 + 1/9 + \cdots + 1/n^2 — a total that does not grow with nn and tends to π2/6\pi^2/6. That essay ended by pointing at a sibling result with a different shape of problem: the cheapest way to connect nn points when every link between them has a random cost.

The problem is the oldest in network design. Given nn towns and a cost for building a road between each pair, find the cheapest set of roads that lets every town reach every other. The answer is always a tree — a cycle would contain a road that could be removed — so it uses exactly n−1n - 1 roads out of (n2)\binom{n}{2} possible. When the costs are drawn independently and evenly from nought to one, how much does the cheapest tree cost?

The cheapest tree through forty points. n=40, seed 8: total 1.063675, largest edge 0.0605, ζ(3)=1.2020569.
Fig. 1 Forty points, every pair joined by a link whose cost is drawn evenly from 0 to 1, and the cheapest set of 39 links connecting them all, drawn from the tree’s centre.

The tree in the figure costs 1.064, though it uses 39 links and an average link costs a half. Its dearest link costs 0.06. Almost every link in it is among the cheapest few per cent of the 780 available, and as the number of points grows the total does not grow with it: Alan Frieze proved in 1985 that it tends to

ζ(3)=1+18+127+164+⋯=1.2020569…\zeta(3) = 1 + \frac{1}{8} + \frac{1}{27} + \frac{1}{64} + \cdots = 1.2020569\ldots

Two greedy methods that cannot go wrong

Cheapest trees are among the few optimisation problems that greed solves exactly. Joseph Kruskal’s method of 1956 takes the links in order of cost, cheapest first, and keeps each one unless it would close a cycle with links already kept. Robert Prim’s of 1957 grows one tree from a single point, each time adding the cheapest link from the tree to a point outside it. Both are exact, for the same reason: for any way of splitting the points into two groups, the cheapest link crossing between the groups belongs to some cheapest tree, and each method only ever adds such a link.

The computations behind every figure here use Prim’s method, which on a full table of (n2)\binom{n}{2} costs takes time proportional to n2n^2, and check it against Kruskal’s on the first figure’s table. They agree to the last digit, as they must.

The argument for that crossing property is a short exchange. Suppose a cheapest tree does not contain the cheapest link crossing between two groups. Adding that link to the tree closes a cycle, and the cycle must cross between the groups at least once more, by some other link that costs at least as much. Removing that other link leaves a tree again, no dearer than before. So some cheapest tree contains the cheapest crossing link, and Kruskal’s and Prim’s methods only ever add links that are cheapest across some split.

That greed works here and fails almost everywhere else — for the cheapest tour, for instance, no fast exact method is known — is a fact about the structure of the problem: the sets of links containing no cycle form what is called a matroid, and on a matroid the greedy method is always optimal. The random version of the problem inherits that luck. A random instance of a problem greed solves can be analysed by following the greedy method as it runs, and that is exactly what Frieze’s proof does.

The cost settles

The cheapest tree costs ζ(3). Mean MST cost: n=5 (40000 tables): 0.96758 ± 0.00200; n=10 (40000 tables): 1.11177 ± 0.00176; n=20 (40000 tables): 1.16893 ± 0.00136; n=50 (8000 tables): 1.18782 ± 0.00202; n=100 (2000 tables): 1.19472 ± 0.00296; n=200 (500 tables): 1.19990 ± 0.00409; n=500 (80 tables): 1.19590 ± 0.00719; n=1000 (40 tables): 1.18917 ± 0.00563; n=2000 (40 tables): 1.19766 ± 0.00408; ζ(3)=1.2020569.
Fig. 2 The average cost of the cheapest spanning tree on n points with every link’s cost drawn evenly from 0 to 1, from exact trees on fresh random tables, with bars of two standard errors.

Averaged over many random tables, the cost is 0.968 at five points, 1.112 at ten, 1.169 at twenty, 1.195 at a hundred and 1.198 at two thousand, against ζ(3)=1.2021\zeta(3) = 1.2021. The tree has n−1n - 1 links, so the average link in it costs about ζ(3)/n\zeta(3)/n: each link is about as cheap as the cheapest of nn random costs, which is about 1/n1/n. The tree manages to be built almost entirely out of links that are each nearly the cheapest available at their point.

The smallest cases can be done by hand. With two points there is one link and the tree is that link, costing a half on average. With three points the cheapest tree takes the two cheapest of three links, and the expected values of the smallest and middle of three even draws are a quarter and a half, so the tree costs three quarters. With four points the tree takes three of six links, but not always the three cheapest — those might form a triangle — and the exact average is already an awkward rational number. The simulation’s 0.968 at five points continues the climb, and by twenty points the cost is within three hundredths of its limit.

Why the constant is ζ(3)\zeta(3), and not some other number of about the same size, is the content of the theorem, and the proof shows it with unusual clarity.

Kruskal’s method is a growing random graph

Run Kruskal’s method and watch the links it considers, in order of cost. By the time it has considered every link costing at most pp, it has looked at a graph on nn points in which each link is present independently with probability pp — exactly Erdős and Rényi’s random graph. The links Kruskal keeps are the ones that join two previously separate pieces of that graph. So every time the number of pieces κ(p)\kappa(p) drops by one, Kruskal adds a link costing pp, and the total cost of the tree is

∑kept linksp=∫01(κ(p)−1) dp,\sum_{\text{kept links}} p = \int_0^1 \big(\kappa(p) - 1\big)\, dp,

the area under the curve of pieces, less the final single piece. The cost of the cheapest tree is a statement about how fast a random graph comes together.

The tree's cost is the area under the pieces. n=3000: components/n at c=0.5,1,2,4: 0.7593, 0.5173, 0.1657, 0.0157; limit 0.7500, 0.5000, 0.1619, 0.0190; area 1.202054.
Fig. 3 The number of separate pieces per point in the random graph containing every link of cost at most c/n, as c grows, for 3,000 points, against its limit — the number of tree-shaped pieces of each size.

The pieces come together on the scale p=c/np = c/n, where the average point has cc links. At that scale almost every piece is a tree, and the expected number of tree-shaped pieces with kk points is about

n⋅kk−2 ck−1 e−kck!n \cdot \frac{k^{k-2}\, c^{k-1}\, e^{-kc}}{k!}

— Cayley’s count of kk−2k^{k-2} labelled trees on kk points, times the chance that a particular such tree’s k−1k - 1 links are present, times the chance that none of the roughly knkn links leaving it are. The figure’s line is the sum over all kk, and the shaded columns, measured on 3,000 points, follow it to within a few hundredths everywhere and to much better away from c=1c = 1, where the random graph is in the window in which its giant piece is born and finite sizes matter most.

Scaling back from cc to pp multiplies the area by 1/n1/n and the pieces by nn, so the tree’s cost tends to the area under the limiting curve:

∫0∞∑k≥1kk−2 ck−1 e−kck! dc=∑k≥1kk−2k!⋅(k−1)!kk=∑k≥11k3.\int_0^\infty \sum_{k \ge 1} \frac{k^{k-2}\, c^{k-1}\, e^{-kc}}{k!}\, dc = \sum_{k \ge 1} \frac{k^{k-2}}{k!} \cdot \frac{(k-1)!}{k^{k}} = \sum_{k \ge 1} \frac{1}{k^3}.

Each size of tree contributes exactly 1/k31/k^3. Pieces of one point contribute 1, pieces of two points contribute 1/8, pieces of three contribute 1/27, and so on, and the cost of the cheapest spanning tree is the sum. The figure integrates the limiting curve numerically to 1.20205.

Most of the cost is paid by loners

The sum has a reading that is easy to miss. The term 1/k31/k^3 is the area contributed by pieces of kk points, and the first term, 1, comes from pieces of a single point — points that have not yet been joined to anything. Of the total 1.202, the isolated points account for 1, or 83%. Pairs account for 1/81/8, about 10%, and every larger size together for the remaining 7%.

That says where the money goes. Most of the tree’s cost is spent on the moment each point stops being alone: the link by which a lone point first joins anything. In the random graph growing by cost, a point stays isolated until its cheapest link appears, which happens at a cost of about 1/n1/n — and the integral of the isolated points’ share, ∫0∞e−c dc=1\int_0^\infty e^{-c}\,dc = 1, is exactly the sum of those first links, scaled. The rest of the tree, joining pairs to pairs and small trees to small trees, costs the remaining fifth.

A crude bound tells the same story from the other side. Every spanning tree contains, at every point, at least one link at that point, so it costs at least half the sum, over all points, of each point’s cheapest link — half because a link can be the cheapest at both its ends. Each point’s cheapest link costs about 1/n1/n, so the bound is about 1/21/2. The true value, 1.202, sits a little above twice the bound, and the sum over kk says exactly how much more than the loners’ links a connected network needs.

How much it varies

How much the cheapest tree varies. n=400, 1500 tables: mean 1.19671, sd 0.06442, sd·√n 1.2884 vs √(6ζ(4)−4ζ(3)) = 1.2983.
Fig. 4 The costs of 1,500 cheapest trees on 400 points, each measured from their average in units of (6ζ(4)−4ζ(3))/n\sqrt{(6\zeta(4) - 4\zeta(3))/n}, against the standard bell curve.

The cost of a tree on 400 points is the sum of 399 random link costs, but not independent ones, since each link was chosen because it was cheap given the others. It nevertheless follows a bell curve, and a remarkably narrow one: the 1,500 trees in the figure have a standard deviation of 0.064, which times 400\sqrt{400} is 1.288. Svante Janson proved in 1995 that the cost is asymptotically normal with variance (6ζ(4)−4ζ(3))/n(6\zeta(4) - 4\zeta(3))/n, whose square root times n\sqrt n is 1.298. The whole tree varies less than a single link does, which is the general habit of an average of many weakly dependent pieces, and the variance has its own zeta values, one argument higher.

Only the cheapest links matter. even on [0, 1]: 1.2070 (pred 1.2021); exponential, mean 1: 1.1942 (pred 1.2021); even on [0, 1] plus ½ half the time: 2.4255 (pred 2.4041); even on [0, 2]: 2.3995 (pred 2.4041); larger of two even draws: 22.4295 (pred ∞)
Fig. 5 The average cost of the cheapest tree on 500 points over 40 tables, for five ways of drawing the link costs, against ζ(3) divided by the density of the cost distribution at nought.

The cheapest tree never uses a link that costs more than a few multiples of 1/n1/n, so it never consults the cost distribution anywhere except near nought. Frieze’s theorem says exactly this: if the costs have density ff with f(0)>0f(0) > 0, the cost tends to ζ(3)/f(0)\zeta(3)/f(0). Exponential costs, with density 1 at nought, give the same limit as costs spread evenly from 0 to 1 — 1.194 against 1.207 at 500 points, both within sampling error of 1.202. Costs spread evenly over twice the range give twice the limit, and so does a distribution that adds a half to half its draws, though the two look nothing alike above 1/21/2; at 500 points they cost 2.400 and 2.426, against 2.404.

A distribution with no density at nought — the larger of two independent even draws, whose density near nought is 2x2x — gives no limit at all: the cheapest tree on 500 points costs about 22, and the cost grows like n\sqrt n. The behaviour of the whole optimisation is decided by the shape of the cost distribution in an interval of width a few times 1/n1/n, and the rest of the distribution could be anything.

The growth like n\sqrt n follows from the same picture. For the random graph of usable links to come together, each point needs on the order of one link of usable cost, which means a cost xx with n F(x)n\,F(x) of order one. When F(x)F(x) behaves like x2x^2 near nought, that cost is about n−1/2n^{-1/2} rather than n−1n^{-1}, and a tree of n−1n - 1 links each costing about n−1/2n^{-1/2} costs about n\sqrt n. Wherever the density at nought vanishes, the tree’s cost grows; wherever it is infinite, the cost falls to nought; and only when it is a positive finite number does the answer settle on a constant, ζ(3)/f(0)\zeta(3)/f(0).

A tree, a pairing and a tour

A tree, a pairing and a tour on random costs. n=120, 30 tables: tree 1.1868 (ζ(3) 1.2021), assignment 1.6210 (π²/6 1.6449); tour limit 2.0415.
Fig. 6 Three cheapest structures on random link costs: the spanning tree and the assignment computed exactly on 30 tables of 120 points, and the limit of the cheapest tour.

The tree is the cheapest of three classic structures on random costs, and each has a limit that does not grow with nn. The cheapest assignment of nn workers to nn jobs tends to π2/6=1.645\pi^2/6 = 1.645, as Parisi’s formula showed exactly; at 120 points the computation gives 1.621. The cheapest tour through all the points, a closed path visiting each once, tends to 2.0415…, a constant that Johan Wästlund proved in 2010 is the solution of an equation from statistical physics and that has no known closed form. The tree is cheapest because it is least constrained — it need not return to its start, pair anything, or visit each point exactly twice — and its constant is the most explicit.

The tree is also a floor under the tour in every single instance, not just on average. Remove any one link from a tour and what is left is a path through every point, which is a spanning tree; so the cheapest tour always costs at least as much as the cheapest tree, and on random costs at least ζ(3)\zeta(3). That inequality is the starting point of the classical approximations for tours, which build a cheap tour out of a cheap tree, and it is why the tree’s constant is the easiest of the three: it is the relaxation the others are measured against.

The appearance of ζ(2)\zeta(2) for the assignment and ζ(3)\zeta(3) for the tree is tempting to read as a pattern, and it is not one in any simple sense: the two come from different proofs, the assignment’s from a recursive structure discovered by Parisi and proved by Linusson, Wästlund, Nair, Prabhakar and Sharma, the tree’s from the component count above. That ζ(3)\zeta(3) is irrational at all is Apéry’s theorem of 1978, and nothing is known about it beyond that — so the cost of a random cheapest tree is a number that is known to be irrational and not known to be anything else.

Where ζ(3) turns up

The constant has a habit of appearing where something three-dimensional is being counted or something cubed is being summed. Piling cubes into the corner of a room gives partition counts whose growth is governed by ζ(3)\zeta(3) where flat partitions had π\pi. The integral ∫0∞x2/(ex−1) dx=2ζ(3)\int_0^\infty x^2/(e^x - 1)\,dx = 2\zeta(3) counts the photons in a box of radiation. And here the cubes come from three separate powers of kk that cancel against Cayley’s kk−2k^{k-2}: one from the size of a piece, two from the kk links leaving it that must all still be absent. The appearance is the end of a calculation rather than a reason, and the calculation is the explanation.

What the computations show and assume

Every cost in the figures comes from an exact cheapest tree on a fresh random table; nothing is approximated except by sampling. The theorems are about the limit, and the figures show where finite sizes stand: the mean is within a few thousandths of ζ(3)\zeta(3) by two thousand points, the component curve within three hundredths at three thousand, the spread within one per cent of Janson’s value at four hundred.

The model assumes every pair of points can be linked and every link’s cost is independent of every other’s. Real networks are neither: the towns sit in a plane, and the cost of a road depends on the distance, which makes nearby links correlated through shared endpoints. For points scattered at random in a square with costs equal to distances, the cheapest tree grows like n\sqrt n, with a constant known only numerically, and the elegant independence that gives ζ(3)\zeta(3) is lost. The figures cannot show the geometric case, and its constant remains a measured number.

Still open: the corrections, and the geometric constant

How does the expected cost approach ζ(3)\zeta(3)? For costs drawn evenly from 0 to 1 the expected cost of the cheapest tree on nn points has an exact formula as a finite sum, found by Colin Cooper, Alan Frieze and collaborators in 2016, and its expansion in powers of 1/n1/n is known to its first terms; for other distributions only the leading constant is known in general. The geometric versions — points in a square, costs equal to distances — are further from understood: the constant multiplying n\sqrt n for the cheapest tree, and the analogous constants for the cheapest matching and the shortest tour through random points, the last of which goes back to Beardwood, Halton and Hammersley in 1959, are known only by simulation, and no formula for any of them is in sight.

The area under the pieces

On random link costs the cheapest spanning tree costs ζ(3), and the reason is visible in Kruskal’s method. Adding links cheapest first is watching a random graph grow, each kept link joins two pieces, and so the cost is the area under the number of pieces; at the scale where each point has cc links the pieces are trees of every size, the trees of size kk contribute exactly 1/k31/k^3 to the area, and the sum is 1+1/8+1/27+⋯1 + 1/8 + 1/27 + \cdots. The cost varies by (6ζ(4)−4ζ(3))/n\sqrt{(6\zeta(4) - 4\zeta(3))/n}, depends on the cost distribution only through its density at nought, and sits below the cheapest assignment’s π2/6\pi^2/6 and the cheapest tour’s 2.0415 because a tree is the least that connecting everything can demand.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Cayleys formulaCentral limit theoremExpectationGreedy algorithmRandom graphRiemann zeta functionSpanning tree