Orthogonality, measured

Long loops pay before the factor starts

The least-resistance spanning tree makes a network's loop equations well conditioned and its loops long, and the question left was what a direct solver pays for the length, and whether a tree reading the resistances only coarsely buys the conditioning back for less. Counted symbolically under minimum-degree ordering, the least tree's factor costs a median 1.2 to 2.0 times the breadth-first tree's on grids of 4 to 12 points a side, and the loop formulation goes from cheaper than the node equations at 4 × 4 to 3.8 times dearer at 12 × 12, for a conditioning two to three orders better. The price is paid in the loop matrix itself: on every network measured its factor fills in fewer entries than the breadth-first tree's. And no tree between them is a bargain. Kruskal on resistances rounded into bands pays nearly all the extra work until one band holds three quarters of the spread, and by then the conditioning has gone too.

Worth reading first: The basis nobody chose on purpose · The spectrum is not the graph · The factor is not sparse.

Spread resistances make the loops easy found that on a resistor network the loop equations ZTHZZ^{\mathsf T}HZ, built from the spanning tree of least total resistance, stay well conditioned however far the resistances spread, while the node equations of the same flow get worse. The tree that does it, the tree the resistances choose, follows the light arcs wherever they go, and its loops are long. In an iterative solve that cost most of the conditioning’s advantage, because each product with a long loop touches many arcs.

The essay left the direct solver’s side open in two sentences. “A direct method on the loop equations would pay for that density again in the fill of their factor, and a tree that balanced short loops against the cycle property — shorter paths among the arcs light enough to belong on a tree — might buy the conditioning at a fraction of the density. Whether such a tree exists on a grid, and how close it comes to both, is measurable with the same trees and loops.”

Both are measured here. The first sentence is right about the price and wrong about where it is paid. The second is wrong.

The work of a factor, counted without numbers

The networks are the earlier essays’: a square grid of k×kk \times k nodes, an arc between neighbours, one node grounded, and a resistance on each arc drawn log-uniformly over a stated number of decades. A spanning tree picks a fundamental loop for every arc off it, and the loop equations are a symmetric positive definite matrix with one row per loop, nonzero wherever two loops share an arc.

A direct solver factors that matrix by Cholesky. How much the factor costs is decided by its pattern of nonzeros and the order the unknowns are eliminated in, and not by the numbers in it, so it can be counted exactly without computing anything. The ordering used is minimum degree, the greedy rule the least fill there is measured against the true optimum on small graphs: eliminate the unknown with the fewest neighbours, connect its neighbours to each other, repeat. Two counts come out. The entries of the factor, and the work, the sum over pivots of the square of the pivot’s column count, which is what the dense column updates cost to leading order. Conditioning is measured on the loop matrix scaled to a unit diagonal, which is what the earlier essays used and what a diagonal preconditioner sees.

The figure at the top of the page is the result on a 10 × 10 grid with resistances over four decades, median over five draws. The breadth-first tree’s loop equations factor with 8,547 units of work and a conditioning of 2,480. The least tree’s need 16,913, twice as much, at a conditioning of 12.5, two hundred times better. The node equations, the range-space formulation of the same flow, need 5,111 at a conditioning of 6,960. And the trees between them, which the rest of this essay is about, do not sit on a line between the two ends: they stay at the dear end of the work axis while the conditioning holds, and come back toward cheap work only after the conditioning has gone.

Where the least tree’s work comes from

The earlier essay expected the long loops to be paid for in fill, the entries elimination creates where the matrix had zeros.

The loop equations of two spanning trees of one 8 by 8 network, in minimum-degree elimination order, with the entries their Cholesky factor fills inbreadth-first: 49 loops, 613 nonzeros in the loop matrix, factor 376 entries, work 3124; least resistance: 49 loops, 931 nonzeros in the loop matrix, factor 505 entries, work 6161. Blue: entries of the loop matrix; red: fill.breadth-first613 nonzeros, 45 fill entries a triangle, work 3124least resistance931 nonzeros, 15 fill entries a triangle, work 6161blue: the loop matrix · red: filllong loops couple more loops
Fig. 1 The loop equations of the breadth-first and least-resistance trees on one 8 × 8 network with resistances over four decades, each in minimum-degree elimination order. Blue cells are entries of the loop matrix, red cells the fill its Cholesky factor adds.

On this 8 × 8 network the breadth-first tree’s loop matrix has 613 nonzeros and its factor adds 45 entries of fill to each triangle. The least tree’s has 931 nonzeros and adds 15. Its factor still costs twice the work, 6,161 against 3,124, but the reason is not fill: the matrix it starts from is half as dense again, and elimination makes less of it worse. The same holds on every network measured — grids of 4, 6, 8, 10 and 12 points a side, five draws each. On all twenty-five the least tree’s loop matrix is denser, by a factor of 1.12 to 1.89, and its factor fills in fewer entries than the breadth-first tree’s: 0 to 121 against 3 to 175.

The reason is in the loops themselves. A long loop shares arcs with many other loops, and every pair of loops that share an arc is a nonzero of ZTHZZ^{\mathsf T}HZ before any elimination happens. Elimination then mostly connects loops that were connected already. The breadth-first tree’s loops are short and local, so the loop matrix is sparse and grid-like, and eliminating it fills the gaps a grid always leaves, the way the node equations’ Laplacian does. The least tree’s loops pay first, in their own overlaps.

The length of every fundamental loop of two spanning trees of one 10 by 10 network, sorted from longest to shortestbreadth-first: 81 loops, mean 7.31 arcs, longest 12, median 8; least resistance: 81 loops, mean 11.46 arcs, longest 42, median 6.81 loops eachbreadth-first: mean arcs7.3least resistance: mean arcs11020406080010203040loop, longest firstarcs in the loopbreadth-firstleast resistanceevery loop has at least four arcs on a gridthe light arcs make long loops
Fig. 2 The length in arcs of every fundamental loop of the breadth-first and least-resistance trees on one 10 × 10 network, sorted from longest to shortest.

The lengths show where the overlaps come from. On the 10 × 10 network the breadth-first tree’s 81 loops have a mean of 7.31 arcs and none longer than 12. The least tree’s have a median of 6 — shorter than breadth-first’s 8 — and a mean of 11.46, because a minority are very long: the longest runs to 42 arcs, on a grid where the shortest path between opposite corners is 18 arcs. Most loops of the least tree close a heavy arc across a short gap. A few close an arc the tree reaches only by wandering, and those few loops overlap with dozens of others. The work of the factor is set by them. That is also why the count can be made before any factorisation: the loop matrix’s nonzeros are pairs of loops sharing an arc, readable off the loops, and an ordering that does not wait for the numbers is the general case of deciding a factor’s cost from a pattern alone.

The loops lose ground as the grid grows

The work of the least-resistance tree's loop-equation factor over the breadth-first tree's and over the node equations', against the size of the grid, resistances over four decades4 by 4: over breadth-first 1.22 (1.07 to 1.48), over the node equations 0.75 (0.65 to 0.91); 6 by 6: over breadth-first 1.56 (1.27 to 1.93), over the node equations 1.57 (1.29 to 1.95); 8 by 8: over breadth-first 1.44 (1.05 to 1.97), over the node equations 2.00 (1.47 to 2.75); 10 by 10: over breadth-first 1.98 (1.34 to 3.08), over the node equations 3.31 (2.24 to 5.15); 12 by 12: over breadth-first 1.78 (1.50 to 2.27), over the node equations 3.80 (3.21 to 4.86). Median and range over five draws.least tree's factor workover the nodes, 4 × 40.75over the nodes, 12 × 123.846810120123456grid, k by kwork ÷ the other formulation'sover breadth-first loopsover the node equationsdashed: equal workthe loops lose ground as the grid grows
Fig. 3 The least-resistance tree’s factor work over the breadth-first tree’s and over the node equations’, against the size of the grid, resistances over four decades. Median and range over five draws.

Over the breadth-first tree the least tree’s factor costs a median 1.22, 1.56, 1.44, 1.98 and 1.78 times as much on grids of 4 to 12 points a side, with a worst case of 3.08 at 10 × 10. That ratio does not run away. The ratio to the node equations does. At 4 × 4 the loop formulation is the cheaper one, 0.75 times the node equations’ work, because it has fewer unknowns: 9 loops against 15 nodes. At 12 × 12 the loop formulation has 121 unknowns against the node equations’ 143, still fewer, and costs 3.80 times as much, from 3.21 to 4.86 over the five draws. A grid’s node equations are a planar Laplacian, the case orderings were designed for, and their fill grows slowly. The loop matrix of a tree that follows the resistances is not planar in any useful sense, since its long loops couple distant parts of the grid, and its density grows with the longest loops.

The conditioning the work buys is large and holds with size. On the 10 × 10 grid the least tree’s loop equations are a median 198 times better conditioned than the breadth-first tree’s and 555 times better than the node equations. For a direct solve the conditioning sets how many digits the answer loses, through κu\kappa u; on these sizes and in double precision every formulation keeps eleven or more, so the trade matters for a reduced-precision factorisation or for a network whose resistances spread further than four decades. Two ways to remove a constraint drew that line in general: the null-space and range-space routes give one answer in exact arithmetic and lose different digits in floating point.

A tree that reads the resistances coarsely

The earlier essay’s second sentence proposed a middle tree: one that follows the light arcs, which buys the conditioning, without following them so faithfully that its loops wander. The natural family is Kruskal’s algorithm on rounded resistances. Round every resistance’s logarithm down to a band of β\beta decades, take arcs band by band from the lightest, and within a band take them in breadth-first order from the centre. A band of zero width is the least tree. A band wide enough to hold every resistance is a breadth-first tree. In between, the tree respects the resistances only to the precision of a band.

A spanning tree of a 10 by 10 resistor network chosen by bands of 1 decade, with its longest loopResistances drawn over four decades; tree arcs dark, thicker for lighter resistance, off-tree arcs faint, and the longest fundamental loop in red, 34 arcs. Mean loop length 9.60 arcs; the loop matrix has 1987 nonzeros, its Cholesky factor 1076 entries and 17628 units of work; κ after scaling 45.2.bands of 1 decademean loop, arcs9.6longest loop, arcs34factor work1.8·10⁴κ, scaled45red: the longest loop the tree makesthe tree follows the light arcs
Fig. 4 One 10 × 10 network with resistances over four decades and the spanning tree Kruskal takes on resistances rounded into bands, with its longest loop in red. Tree arcs are drawn thicker the lighter their resistance. The dial sets the band width, from the least tree to one band.

With bands of a decade the tree on this network has loops of a mean 9.60 arcs and a longest of 34, a factor costing 17,628 units of work, and a conditioning of 45.2. The least tree had 11.46, 42, 18,896 and 14.8. So a decade’s rounding shortens the loops a little, saves 7 per cent of the work and costs a factor of three in the conditioning. On the dial the pattern holds across the family: as the bands widen the loops shorten slowly, the work barely moves, and the conditioning goes. Only at one band does the tree become breadth-first, with loops of 7.31 arcs, a longest of 12, work of 8,547 and a conditioning of 1,700.

What a band does to the cycle property

The conditioning of the least tree’s loop equations came, in the earlier essays, from one property: every arc on a loop’s tree path is lighter than the loop’s own off-tree arc. That bounds how strongly two loops are coupled relative to their own diagonals, and the unit-diagonal scaling turns the bound into a condition number that does not grow with the spread. The measure of it is the heaviest resistance on a loop’s tree path over the resistance of its own arc, maximised over the loops; it is below one for the least tree by construction.

A band of β\beta decades relaxes it by at most a factor of 10β10^\beta, since inside a band the tree takes arcs in breadth-first order and may put an arc on a path that is heavier than the arc closing the loop, by up to the band’s width. Measured on the 10 × 10 network at four decades, median over five draws, the worst ratio is 0.97 for the least tree, 1.23 with bands of a quarter decade, 2.87 at half a decade, 8.87 at a decade, 64.5 at two and 544 at three, each under its bound of 10β10^\beta and within a factor of two of it. The breadth-first tree, which ignores the resistances, reaches 5,480. So a band does exactly what it promises to the cycle property, a violation no worse than its width, and the conditioning follows the violation: the median conditioning over the least tree’s is 1.00, 1.38, 2.97, 18.9 and 11.1 at the five band widths in the same order. What a band does not do is shorten the loops, because shortening them needs the tree to stop following light arcs, and inside each band it still follows them, only in a coarser order.

The work is paid as soon as the resistances choose

Because the resistances are drawn log-uniformly, two bandings with the same width as a fraction of the spread give exactly the same tree. So the family has one parameter that matters: how much of the spread one band covers.

How much of the least-resistance tree's extra Cholesky work a banded tree pays, against the number of bands the resistances fall into, on the 10 by 10 grid at three spreadsShare is the banded tree's work less breadth-first's over the least tree's less breadth-first's: one means all of it, zero none. Median and range over five draws, against a band's width as a fraction of the spread. two decades: width 0.125, 1.02 (0.82 to 2.28); width 0.250, 0.88 (0.47 to 1.80); width 0.500, 0.66 (0.47 to 1.86); width 1.000, 0.00 (0.00 to 0.00); width 1.000, 0.00 (0.00 to 0.00); width 1.000, 0.00 (0.00 to 0.00). four decades: width 0.063, 1.00 (0.89 to 1.50); width 0.125, 1.02 (0.82 to 2.28); width 0.250, 0.88 (0.47 to 1.80); width 0.500, 0.66 (0.47 to 1.86); width 0.750, 0.04 (-0.04 to 0.54); width 1.000, 0.00 (0.00 to 0.00). six decades: width 0.042, 1.00 (0.89 to 1.04); width 0.083, 1.01 (0.89 to 1.58); width 0.167, 1.01 (0.66 to 2.22); width 0.333, 0.82 (0.69 to 1.98); width 0.500, 0.66 (0.47 to 1.86); width 1.000, 0.00 (0.00 to 0.00).share of the extra worktwo decades, a decade a band0.66four decades, a decade a band0.88six decades, a decade a band100.511.52a band's width, as a fraction of the spreadshare of the least tree's extra work1/161/81/41/2alltwo decadesfour decadessix decadesdashed: the whole of the extra workany band narrower than the spread pays
Fig. 5 A banded tree’s share of the least tree’s extra factor work over breadth-first, against a band’s width as a fraction of the spread, at three spreads on the 10 × 10 grid. One means all of it, zero none. Median and range over five draws.

Measured as a share of the least tree’s extra work, a banded tree pays a median 1.00 or more of it with bands up to a sixth of the spread, 0.82 to 0.88 at a quarter to a third, and 0.66 at half. A banded tree can pay more than the least tree, up to 2.28 times its extra work on one draw, because rounding replaces the least tree’s ordering with an arbitrary one inside each band and the loops that result are no shorter. The share falls to nothing only when one band holds three quarters of the spread or all of it, 0.04 and 0.00. A tree that lets the resistances choose at all pays nearly the whole price of letting them choose exactly.

The conditioning of a banded tree's loop equations over the least-resistance tree's, against the number of bands, on the 10 by 10 grid at three spreadstwo decades: width 0.125, 1.02; width 0.250, 1.22; width 0.500, 1.58; width 1.000, 5.91. four decades: width 0.063, 1.00; width 0.125, 1.38; width 0.250, 2.97; width 0.500, 18.9; width 0.750, 11.1; width 1.000, 198. six decades: width 0.042, 1.00; width 0.083, 1.53; width 0.167, 2.13; width 0.333, 18.2; width 0.500, 276; width 1.000, 7.24e+3. Median over five draws, against a band's width as a fraction of the spread.κ ÷ least tree's, breadth-firsttwo decades, one band5.9four decades, one band198six decades, one band7240110¹10²10³10⁴10⁵a band's width, as a fraction of the spreadκ ÷ least tree's κ1/161/81/41/2alltwo decadesfour decadessix decadesdashed: three times the least tree'scoarse bands lose it fast
Fig. 6 A banded tree’s conditioning over the least tree’s, against a band’s width as a fraction of the spread, at three spreads. The dashed line is three times the least tree’s.

The conditioning is lost on the opposite schedule. With bands an eighth of the spread wide or narrower it is within 1.53 times the least tree’s on every spread measured. At a quarter it is 1.22 and 2.97 times on two and four decades, and 2.13 at a sixth on six; at half, 1.58, 18.9 and 276 times; with one band, the breadth-first tree, 5.9, 198 and 7,240 times. The wider the spread, the faster coarse bands lose it, because each band then mixes resistances further apart and the cycle property that bounded every coupling, found by the tree the resistances choose, fails by more.

Put the two figures together and the middle tree is not there. The measurement asks, for every band width at every spread, whether the median conditioning stays within three times the least tree’s while the work falls below half of the extra. None does. The work stays near its full price until the bands are wide enough to cost the conditioning a factor of ten or more, and the frontier at the top of the page is that fact as a curve: it runs along the top of the work axis while the conditioning is still good and drops only when the conditioning has gone.

What a solver can take from this

Long loops cost the factor twice the work, not more, at these sizes: a median 1.2 to 2.0 times the breadth-first tree’s, and the ratio does not grow with the grid. A preconditioner that is a tree priced a tree’s loops by their stretch for an iterative method; for a direct one the measure is the loop matrix’s density, which the stretch drives.

The cost is in the matrix, not the elimination, so it is visible before any factorisation: the loop matrix’s nonzeros, which are counted from the loops, predict the least tree’s extra work where the fill does not.

The node equations factor more cheaply from 6 × 6 upwards and the gap widens, to 3.8 times at 12 × 12. The loop formulation’s case on a direct solver is its conditioning, two to three orders better here, and nothing else.

There is no middle tree in this family. Reading the resistances coarsely keeps the cost and loses the benefit. The basis nobody chose on purpose began this line with the observation that the choice of basis is usually made by a one-line rule nobody thought of as numerical; on a network the rule that matters most for a direct solver is the one that decides whether the resistances choose the tree at all.

What five draws on grids do not show

Planar grids only, with resistances drawn independently and log-uniformly; a network with correlated resistances, light corridors and heavy regions, would give the least tree long loops along the corridors and might change both the density and how fast banding loses the conditioning. One ordering, minimum degree, applied to each matrix separately; nested dissection would cut the node equations’ work further on a grid and would find less to cut in a loop matrix whose long loops cross every separator. The work is a symbolic count of dense column updates, not a time, and a supernodal code would charge the denser loop matrix less per entry. Five draws give medians whose ranges are wide, from 1.05 to 1.97 for the least tree’s work over breadth-first’s on the 8 × 8 grid, and every comparison above is a median with its range beside it.

Still open: a tree that limits its loops, and a separator the loops respect

A tree with a length budget. The family here rounds the resistances and leaves the loop lengths alone, and the long loops were the whole cost. A tree built by Kruskal on exact resistances but refusing any arc whose fundamental loop would exceed a stated length, falling back to the next arc, attacks the cost directly. The prediction with a sign is that on the 10 × 10 grid at four decades a budget of twice the breadth-first tree’s longest loop, 24 arcs, keeps the median conditioning within twice the least tree’s and cuts at least a third of its extra work — that a length budget is a middle tree where a resistance band is not.

An ordering that knows the loops. Minimum degree sees only the loop matrix’s pattern. Ordering the loops by where on the grid their off-tree arc sits, so that a nested dissection of the grid induces one of the loops, would let the long loops be eliminated last. The prediction is that it reduces the least tree’s factor work on the 12 × 12 grid by at least a fifth below minimum degree’s, and leaves the breadth-first tree’s within a tenth of it, since short loops already follow the grid.

Shares its objects with

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

Named objects

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

CholeskyCondition numberFill-inGraph laplacianMinimum degreeNull-space methodReduced hessianSpanning tree