Sparsity, and what elimination costs

A count of fill is not a size

The fill of a sparse factor can be counted from the graph alone, before any arithmetic runs, and the count is exact: on a grid Laplacian not one of the entries the graph marks is zero. But a count holds every entry at one number. In the natural order, three quarters of the fill of a 20-by-20 grid is below a hundredth of its column's diagonal, and fifteen per cent is below 10⁻⁴. The better orderings remove exactly that part: under nested dissection almost nothing is that small. So the count's ranking stops meaning what it says once a factor is dropped. Minimum degree has the least fill of the four orderings, and at a threshold of a tenth it takes 20 iterations on more kept entries than the reverse Cuthill–McKee factor takes 14.

Worth reading first: The factor is not sparse · A factorisation with nothing to pivot for.

The factor is not sparse began this line of argument with a count. A sparse matrix’s factor has entries the matrix does not, and elimination’s new entries can be counted from the graph alone before any arithmetic runs. The fill that is not independent and the cliff behind the count then looked inside a block of that fill and found it dense in entries and low in rank, with singular values falling off a cliff. So the fill’s rank is one thing a count leaves out. There is a plainer one still: the count gives every entry the weight of one, and none of them weighs one.

Whether this matters depends on what the count is for. If it is budgeting memory for an exact factor, each entry occupies a word regardless, and the count is exactly what is needed. If it is ranking orderings for a preconditioner, or deciding how much of a factor might be left out, the entries’ sizes are the whole question. This essay reads them on the plainest possible case: the five-point Laplacian on a 20-by-20 grid, 400 unknowns, factored exactly, under the four orderings the field has been comparing.

None of it is zero

One thing should be settled first. A symbolic count is an upper bound in general, since accidental cancellation can make a predicted entry zero. On this matrix it never happens: every one of the entries the graph marks is nonzero in the computed factor, under all four orderings, in every case measured. So the count really is exact here, and what follows concerns how large those nonzeros are and not whether they exist. The word “size” has a meaning that has to be chosen: an entry is measured relative to the diagonal of its own column, which is the size it has when the factor is used in a triangular solve.

Of the fill in the Cholesky factor of a 20-by-20 grid Laplacian under the natural ordering, the share below each fraction of its column's diagonalnatural: 8019 entries, 6859 of them fill. 95.5 per cent below 0.1, 74.7 per cent below 0.01, 39.4 per cent below 0.001, 14.8 per cent below 0.0001, 3.2 per cent below 0.000001, 1.0 per cent below 1e-8, 0.2 per cent below 1e-10, 0.0 per cent below 1e-12, 0.0 per cent below 1e-14.0255075100natural: 8,019 entries in the factorbelow 10⁻¹ of its diagonal95.5%below 10⁻² of its diagonal74.7%below 10⁻³ of its diagonal39.4%below 10⁻⁴ of its diagonal14.8%below 10⁻⁶ of its diagonal3.2%below 10⁻⁸ of its diagonal1.0%below 10⁻¹⁰ of its diagonal0.2%per cent of the fill400 unknowns · none of it exactly zeroa count holds every one at one number
Fig. 1 Of the fill in the Cholesky factor of a 20-by-20 grid Laplacian, the share below each fraction of its column’s diagonal. The dial sets the ordering.

In the natural order the factor has 8,019 entries, 6,859 of them fill. Of that fill, 95.5 per cent is below a tenth of its column’s diagonal. 74.7 per cent is below a hundredth, 39.4 per cent below a thousandth, and 14.8 per cent below 10−410^{-4}. Even at 10−810^{-8} one per cent of the fill remains. The factor that was budgeted at 8,019 words is largely a set of small numbers, and a large part of it is much smaller than any tolerance a preconditioner would use.

The picture for one column shows where these sizes come from.

The entries of one column of the Cholesky factor of a 20-by-20 grid Laplacian in the natural ordering, relative to the column's diagonal, against the distance below itColumn 190: 3.6e-1 at 1, 2.3e-2 at 2, 1.2e-2 at 3, 6.6e-3 at 4, 4.0e-3 at 5, 2.5e-3 at 6, 1.6e-3 at 7, 9.4e-4 at 8, 4.4e-4 at 9, 5.5e-4 at 10, 1.2e-3 at 11, 2.0e-3 at 12, 3.1e-3 at 13, 4.8e-3 at 14, 7.7e-3 at 15, 1.3e-2 at 16, 2.3e-2 at 17, 4.7e-2 at 18, 1.1e-1 at 19, 3.1e-1 at 20.04812162010⁻⁸10⁻⁶10⁻⁴10⁻²1distance below the diagonalentry over its column's diagonalone columna band of twenty · both ends are in the matrixlarge at the edges, tiny in between
Fig. 2 The entries of one column of the Cholesky factor in the natural ordering, relative to the column’s diagonal, against the distance below the diagonal.

The two entries the matrix already had, at distances one and twenty, stay large: 0.4 and 0.3 of the diagonal. Between them the fill runs down from 2⋅10−22 \cdot 10^{-2} next to the first, to a minimum of 4⋅10−44 \cdot 10^{-4} near the middle of the band, and back up to 0.1 next to the second. A band of twenty is what the natural order gives this grid: each row couples only to its neighbours in the row above and to its neighbours in its own, and a chain of elimination couples them further along. That decays smoothly away from the two neighbours, as one would expect from something like a discrete Green’s function, and it is why the count sees twenty entries where a reader sees two and a tail.

The orderings’ fill is a different kind of fill

Now turn the dial. Reverse Cuthill–McKee has a factor of 5,910 entries, and it has the same shape as the natural order: 70 per cent of its fill below a hundredth, 14.8 per cent below 10−410^{-4}. Minimum degree has only 3,729 entries, and 35.7 per cent of its fill is below a hundredth, with 2.6 per cent below 10−410^{-4}. Nested dissection has 5,129 entries, with 39.7 per cent below a hundredth and 0.4 per cent below 10−410^{-4}.

Those numbers mean that an ordering which reduces fill mostly removes small fill. Going from the natural order to minimum degree removes 4,290 fill entries, and at 10−310^{-3} the natural order has 2,700 entries below that threshold while minimum degree has 277. So a good share of what minimum degree saved was never very large, and what is left of its fill is the part that carries weight. An ordering’s count falls by more than its information does.

That also means the count overstates differences among orderings. Compare the entries at or above a thousandth, which are what a preconditioner at a fine threshold would keep. The natural order’s are 5,319 out of 8,019, Cuthill–McKee’s are 4,166 out of 5,910, and minimum degree’s are 3,452 out of 3,729, nested dissection’s 4,940 of 5,129. Those are a factor of 1.5 apart where the counts are a factor of 2.2. At a tenth of the diagonal the four are 1,466, 1,484, 1,599 and 1,242, all within about a quarter of each other.

What a dropped entry costs

The natural test is to drop. Take the exact factor, remove the entries below a threshold relative to the column’s diagonal, and use what is left to precondition conjugate gradients. This is not an incomplete factorisation, which would drop during elimination and would have to live with the consequences for later columns. It reads something simpler: how much of the finished factor is doing any work.

Conjugate gradient iterations against the threshold below which a factor's entries are dropped, under each of four orderings of a 20-by-20 grid, against 65 for no preconditionernatural: 2, 3, 4, 8, 15; reverse Cuthill–McKee: 2, 3, 4, 7, 14; minimum degree: 2, 3, 4, 7, 20; nested dissection: 1, 3, 4, 8, 26 at thresholds 0.000001, 0.0001, 0.001, 0.01, 0.1.10⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹051015202530threshold relative to the column's diagonaliterationsnaturalreverse Cuthill–McKeeminimum degreenested dissection400 unknowns · tolerance 10⁻⁸four orderings, nearly one curve at the fine end
Fig. 3 Conjugate gradient iterations against the threshold below which a factor’s entries are dropped, under each of four orderings, against 65 for no preconditioner.

Without a preconditioner conjugate gradients takes 65 iterations to a residual of 10−810^{-8} on this grid. Keeping everything takes one. In between, the threshold reads off like a dial. At 10−610^{-6} the count is two or one, at 10−410^{-4} three, at 10−310^{-3} four, under all four orderings. So at a thousandth of the diagonal every ordering takes four iterations, and the natural order has thrown away a third of its 8,019 entries while nested dissection has dropped about a twentieth of its 5,129. At 10−210^{-2} they read 8, 7, 7 and 8. So down to here the ordering is hardly visible at all. In the fine range the count of iterations reads the threshold, and nothing else.

Conjugate gradient iterations to a residual of ten to the minus eight, against the entries of the factor kept after a threshold, under each of four orderings of a 20-by-20 gridnatural: 15 iterations at 1466, 8 iterations at 2898, 4 iterations at 5319, 3 iterations at 7002, 2 iterations at 7800; reverse Cuthill–McKee: 14 iterations at 1484, 7 iterations at 2569, 4 iterations at 4166, 3 iterations at 5208, 2 iterations at 5848; minimum degree: 20 iterations at 1599, 7 iterations at 2813, 4 iterations at 3452, 3 iterations at 3661, 2 iterations at 3727; nested dissection: 26 iterations at 1242, 8 iterations at 3554, 4 iterations at 4940, 3 iterations at 5114, 1 iterations at 5129.10³110¹entries kept in the factoriterationsnaturalreverse Cuthill–McKeeminimum degreenested dissection400 unknowns · dropped after the factorthe ordering with most fill is not the worst
Fig. 4 Conjugate gradient iterations against the entries of the factor kept after a threshold, under each of four orderings of a 20-by-20 grid.

Plotted against what is kept, these turn into a trade-off curve, and at the rough end the orderings part in an unexpected way. At a threshold of a tenth, Cuthill–McKee keeps 1,484 entries and takes 14 iterations. The natural order keeps 1,466 and takes 15. Minimum degree keeps 1,599, more than either, and takes 20. Nested dissection keeps 1,242 and takes 26. So the two orderings with the least complete fill make the worst rough preconditioners, and the two with the most make the best.

The ranking by count has been reversed exactly where a preconditioner would be used. That result has a history: Duff and Meurant found in 1989 that the ordering matters very much to incomplete factorisations and that minimum degree does badly, with the band orderings holding up well. The measurement here adds a reading of why. A minimum-degree or dissection factor has few small entries left to drop, so a threshold strips out entries that were doing work. A band factor has a large tail of entries doing nothing, and dropping them costs nothing, so its rough factor is close to its whole factor in the sense that matters.

For each ordering of a 20-by-20 grid, the factor's entries as the graph counts them, and how many survive thresholds of a hundredth and a tenth, with the iterations each then takesnatural: the graph's count 8019, kept at a hundredth, 8 iterations 2898, kept at a tenth, 15 iterations 1466; reverse Cuthill–McKee: the graph's count 5910, kept at a hundredth, 7 iterations 2569, kept at a tenth, 14 iterations 1484; minimum degree: the graph's count 3729, kept at a hundredth, 7 iterations 2813, kept at a tenth, 20 iterations 1599; nested dissection: the graph's count 5129, kept at a hundredth, 8 iterations 3554, kept at a tenth, 26 iterations 1242.02000400060008000naturalthe graph's count8019kept at a hundredth, 8 iterations2898kept at a tenth, 15 iterations1466reverse Cuthill–McKeethe graph's count5910kept at a hundredth, 7 iterations2569kept at a tenth, 14 iterations1484minimum degreethe graph's count3729kept at a hundredth, 7 iterations2813kept at a tenth, 20 iterations1599nested dissectionthe graph's count5129kept at a hundredth, 8 iterations3554kept at a tenth, 26 iterations1242entries in the factor400 unknownsthe ranking does not survive
Fig. 5 For each ordering, the factor’s entries as the graph counts them, and how many survive thresholds of a hundredth and a tenth, with the iterations each then takes.

The natural-order row shows the whole argument. The graph’s count is 8,019. Keeping 2,898 costs 8 iterations in place of one, and keeping 1,466 costs 15. A code that had rejected this ordering for its fill was rejecting a large number that mostly does not matter. It is also a fact that nothing changes in the direct case: an exact factor must hold all its entries and the order decides the memory stands. A code that wants an exact factor should go on using the ordering with the least fill. These are two different problems with different answers, and the single word “fill” has concealed that.

Dropping as the factor is built

An exact factor with its small entries removed is a tidy thing to measure and an unusual thing to compute. A real incomplete factorisation drops entries as each column is finished, so that later columns are computed from an already altered factor, and an early drop can compound. So the same four orderings were run through a threshold incomplete Cholesky, at the same relative thresholds, on the same grid.

At a threshold of a tenth, all four take more iterations than dropping afterwards: 24, 24, 23 and 27, against 15, 14, 20 and 26. The rough end has been levelled. The band orderings have lost their lead there, since dropping during elimination takes away the small entries from which the later large ones would have been built. The kept counts are 1,160 for three of them and 1,543 for minimum degree, so on entries kept the band orderings are still ahead of it, by a third.

At a hundredth they read 10, 8, 8 and 10, on 2,440, 2,376, 2,718 and 3,113 entries. So Cuthill–McKee takes the same eight iterations as minimum degree on about an eighth fewer entries. Dissection pays most at this threshold, with the natural order’s iteration count on nearly a quarter fewer entries.

At a thousandth the result turns. Minimum degree takes four iterations on 3,436 entries, where Cuthill–McKee takes five on 3,688 and the natural order six on 4,681. So minimum degree, which was a poor rough factor, is the best fine one, by both measures at once. It has few entries left to drop at this threshold and very little to lose by dropping them. Nested dissection also takes four here, on 4,893.

So the ranking by count does not survive anywhere as a statement about iterations per entry, and neither does the reversal found above. What can be said is that the rough end prefers a band ordering by a modest margin, on the same grid and in both ways of dropping, and the fine end prefers a fill-reducing one. A preconditioner’s ordering should be chosen by the threshold it will be used at, which is a sentence no count could produce, since a count knows of no thresholds. And the iteration counts in this section are the ones that matter for a real code, because this is the factorisation it would compute: the tidy afterwards-dropped version overstated how well the band orderings do at the rough end, by about ten iterations out of twenty-four. At 784 unknowns the same pattern stands: at a tenth 31, 31, 30 and 36 on 2,296, 2,296, 3,149 and 2,296 entries, and at a hundredth 12, 11, 10 and 13.

It grows with the grid

The share of a grid Laplacian's fill below ten to the minus four of its column's diagonal, against the unknowns, under four orderingsnatural: 4.80%, 9.15%, 14.83%, 21.16%; reverse Cuthill–McKee: 5.52%, 9.50%, 14.78%, 20.42%; minimum degree: 0.53%, 2.56%, 2.65%, 6.31%; nested dissection: 0.00%, 0.21%, 0.38%, 1.08% at 100, 196, 400, 784 unknowns.10²10³10⁻²10⁻¹110¹10²unknownsper cent of the fill below 10⁻⁴naturalreverse Cuthill–McKeeminimum degreenested dissectionfloored at a hundredth of a per centa band's tiny fill grows with the grid
Fig. 6 The share of a grid Laplacian’s fill below 10−410^{-4} of its column’s diagonal, against the unknowns, under four orderings.

Twenty points a side is small, and the share of tiny fill is not stable under refinement. Under the natural order the part below 10−410^{-4} is 4.8 per cent at 100 unknowns, 9.1 at 196, 14.8 at 400 and 21.2 at 784. Reverse Cuthill–McKee tracks it closely. On a larger grid the band is longer, and the middle of the band sits further from the two large entries, so more of it is small. Under nested dissection the same share is about one per cent at the largest size measured, and minimum degree sits between. If this keeps going, a band ordering’s factor on a large grid is overwhelmingly tiny entries, which is another way of saying that its count, n3/2n^{3/2}, has much less to do with the information in the factor than the count of a dissection ordering has.

That connects with the fill that is not independent in a straightforward way. The separator block there was dense and low in rank, and a block of low rank whose entries decay away from a line has a good share of small entries as well. Both descriptions are of the same object: a smooth Green’s function’s sampled values. Rank and size are different questions, though, and an entry’s being small is stronger than its being redundant, since a small entry can simply be removed without any basis to rebuild it.

What a count was for

The count has a defined job and does it with no error. It is what memory must hold if every entry is held. And since a triangular solve visits every stored entry, it also counts a solve’s cost. Two ends of the same arrow needed nothing more, because it was comparing a dense factor with an empty one. An ordering chosen to minimise it has a clear purpose in a direct solver, and the least fill there is studies exactly that.

What it does not do is measure how much of a factor carries weight, and a count that has become the only figure in an ordering’s report invites that reading. A code choosing an ordering for an incomplete factorisation, or for a drop-tolerance solver, or for a low-accuracy direct solve with refinement, needs the second number as well: not how many entries there will be, but how many at or above the tolerance it is going to use. Only a numerical factorisation can report that. It may be why a symbolic phase can only bound what is worth knowing about a factor, in a further sense than the one that essay measured. Here the bound is exact and it is still not the thing wanted.

There is a useful practical test that comes out of the same data, and it needs only one numerical factorisation at a coarse size. A factor whose fill has a large tail at 10−310^{-3} is an advertisement for dropping, and the natural ordering is a good place to look for that. So the choice of ordering and the choice of threshold are not independent of each other. A code wanting a rough factor might begin from an ordering with a long band, which an exact solver would never use.

What these 400 unknowns cannot show

One model problem has been measured here, with constant coefficients, a five-point stencil, and well-separated scales. Anisotropy, or strongly varying coefficients, changes where the size of an entry goes, and how much direction there was to lose suggests that a dropped factor is a very different object on an anisotropic problem. Dropping from the finished factor is not what an incomplete factorisation does. And a threshold relative to the column’s diagonal is only one way of measuring size. A relative measure against the row, or against the norm of the column, gives different shares, and it would change the percentages if not their ordering.

Nor has any coefficient but one been used anywhere on this page, and a code with a strongly varying coefficient cannot read these counts across. These iteration counts also come from a single right-hand side, and conjugate gradients on a preconditioned Laplacian has a small enough variation that this is unlikely to matter, though nothing here measures that.

Still open: dropping during elimination, and a grid on which it has room

A level of fill instead of a threshold. A code’s other way of bounding a factor is a structural one, keeping entries by how many eliminations it took to create them. The prediction with a sign is that at one level of fill Cuthill–McKee keeps fewer entries and takes no more iterations than minimum degree, since the band’s first level is the large part of its fill, and that this holds up to the level at which minimum degree’s factor is complete.

The rough end on a larger grid. The prediction is that at 900 unknowns and a threshold of a tenth, the natural order and Cuthill–McKee keep about the same share of a much larger factor and take between 20 and 30 iterations, while nested dissection’s count at that threshold more than doubles, so that the band orderings’ rough factors keep improving their position as the grid grows, in step with the tiny fraction’s own growth.

What links here

Computed from the collection, not written here: the essays that point at this one.

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.

CholeskyElimination orderFill-inFill-reducing orderingNested dissectionSymbolic factorisation