Sparsity, and what elimination costs

The band is cheap only while it is rough

An incomplete Cholesky factor can be bounded by level of fill, keeping each entry by how many eliminations it took to create, instead of by its size. On a 20-by-20 Laplacian, Cuthill–McKee at one level keeps 1,521 entries for 15 iterations where minimum degree keeps 1,828 for 18, as predicted, and it stays ahead at every level up to five, at three sizes of grid. Then it falls behind and does not recover: minimum degree reaches six iterations on 3,280 entries and the band on 3,550, four on 3,677 against 4,964, and its complete factor needs 63 per cent of the band's. The prediction said the band would hold until minimum degree was complete. It holds for the rough factors, and where it stops moves to more iterations as the grid grows. At level zero, the same 1,160 entries in each ordering, minimum degree takes half again as many iterations as the band.

Worth reading first: The factor is not sparse · The zero you are allowed to write.

A count of fill is not a size took a 20-by-20 grid Laplacian’s Cholesky factor apart entry by entry and found that the orderings’ ranking by fill, which every sparse direct code relies on, says little about an incomplete factor. Three quarters of the natural order’s fill is below a hundredth of its column’s diagonal. Drop by size and reverse Cuthill–McKee, the ordering with nearly the most fill, reaches fifteen iterations of preconditioned conjugate gradients on fewer entries than minimum degree, the ordering with the least, reaches twenty. Drop during elimination and the ranking holds at a threshold of a hundredth and turns at a thousandth.

Size is one way a code bounds an incomplete factor. The other is structural: give every entry of the matrix level zero, give an entry created by elimination a level one more than the sum of the levels of the two entries that created it, and keep only entries up to a chosen level pp. That is IC(pp), and its appeal is that the pattern is decided before any number is computed, as a complete factorisation’s is. The earlier essay predicted, with a sign, how the orderings would compare under it: at one level of fill, Cuthill–McKee would keep fewer entries and take no more iterations than minimum degree, “since the band’s first level is the large part of its fill”, and this would hold up to the level at which minimum degree’s factor is complete.

The first half holds at every size measured. The second fails, at a level far below the one the prediction named.

Keeping entries by their ancestry

The setting is the earlier essay’s: the five-point Laplacian on a k×kk \times k grid, ordered four ways, with the same random right-hand side and conjugate gradients to a relative residual of 10−810^{-8}. The factorisation works column by column. Each candidate entry’s level is found first, as the least over every path that creates it, and only then are the numbers formed, on the kept pattern alone. A grid Laplacian is an M-matrix, so the incomplete factorisation exists at every level and the pivots never fail. At a high enough level the incomplete factor is the complete one, and conjugate gradients converges in one iteration.

On the 20 × 20 Laplacian, the conjugate gradient iterations to 10⁻⁸ against the entries an incomplete Cholesky keeps, one point for each level of fill from zero to complete, under four orderingsnatural: level 0 1160 entries 24 iterations, level 1 1521 entries 15 iterations, level 2 1863 entries 13 iterations, level 3 2528 entries 10 iterations, level 4 3155 entries 8 iterations, level 5 3744 entries 7 iterations, level 6 4295 entries 6 iterations, level 8 5283 entries 5 iterations, level 10 6119 entries 4 iterations, level 12 6803 entries 4 iterations, level 16 7715 entries 3 iterations, level 20 8019 entries 1 iterations; reverse Cuthill–McKee: level 0 1160 entries 24 iterations, level 1 1521 entries 15 iterations, level 2 1863 entries 12 iterations, level 3 2187 entries 10 iterations, level 4 2493 entries 8 iterations, level 5 2782 entries 7 iterations, level 6 3054 entries 7 iterations, level 8 3550 entries 6 iterations, level 10 3985 entries 5 iterations, level 12 4363 entries 5 iterations, level 16 4964 entries 4 iterations, level 20 5385 entries 3 iterations, level 24 5658 entries 3 iterations, level 32 5888 entries 2 iterations, level 48 5910 entries 1 iterations; minimum degree: level 0 1160 entries 36 iterations, level 1 1828 entries 18 iterations, level 2 2039 entries 15 iterations, level 3 2458 entries 12 iterations, level 4 2647 entries 9 iterations, level 5 2873 entries 8 iterations, level 6 3022 entries 8 iterations, level 8 3280 entries 6 iterations, level 10 3435 entries 6 iterations, level 12 3538 entries 5 iterations, level 16 3677 entries 3 iterations, level 20 3708 entries 2 iterations, level 24 3727 entries 2 iterations, level 32 3729 entries 1 iterations; nested dissection: level 0 1160 entries 27 iterations, level 1 1685 entries 19 iterations, level 2 2315 entries 15 iterations, level 3 3046 entries 12 iterations, level 4 3616 entries 10 iterations, level 5 4007 entries 9 iterations, level 6 4268 entries 8 iterations, level 8 4629 entries 6 iterations, level 10 4859 entries 5 iterations, level 12 5000 entries 4 iterations, level 16 5106 entries 3 iterations, level 20 5129 entries 1 iterations.0246805101520253035entries kept in the factor, thousandsiterationsnaturalreverse Cuthill–McKeeminimum degreenested dissectionone point a level · the same right-hand sidethe band is cheap rough, dear fine
Fig. 1 Conjugate gradient iterations against the entries an incomplete Cholesky keeps, one point for each level of fill from zero to complete, under four orderings. The dial sets the grid.

Each curve starts at the same point on the horizontal axis, 1,160 entries on the 20-by-20 grid, which is the matrix’s own lower triangle, kept at level zero whatever the ordering. It ends where the ordering’s complete factor ends: 3,729 entries for minimum degree, 5,129 for nested dissection, 5,910 for Cuthill–McKee and 8,019 for the natural order. In between, each point is a level. The band’s curve is the lowest at the left of the figure and minimum degree’s the lowest at the right, and they cross between six and eight iterations. Turning the dial to the 14-by-14 and 30-by-30 grids moves the crossing and keeps the shape.

The prediction’s first half

On the 20 × 20 Laplacian, the entries an incomplete Cholesky keeps against the level of fill allowed, under four orderingsnatural: 1160 at 0, 1521 at 1, 1863 at 2, 2528 at 3, 3155 at 4, 3744 at 5, 4295 at 6, 5283 at 8, 6119 at 10, 6803 at 12, 7715 at 16, 8019 at 20, 8019 at 24, 8019 at 32, 8019 at 48; complete at level 20 with 8019; reverse Cuthill–McKee: 1160 at 0, 1521 at 1, 1863 at 2, 2187 at 3, 2493 at 4, 2782 at 5, 3054 at 6, 3550 at 8, 3985 at 10, 4363 at 12, 4964 at 16, 5385 at 20, 5658 at 24, 5888 at 32, 5910 at 48; complete at level 37 with 5910; minimum degree: 1160 at 0, 1828 at 1, 2039 at 2, 2458 at 3, 2647 at 4, 2873 at 5, 3022 at 6, 3280 at 8, 3435 at 10, 3538 at 12, 3677 at 16, 3708 at 20, 3727 at 24, 3729 at 32, 3729 at 48; complete at level 26 with 3729; nested dissection: 1160 at 0, 1685 at 1, 2315 at 2, 3046 at 3, 3616 at 4, 4007 at 5, 4268 at 6, 4629 at 8, 4859 at 10, 5000 at 12, 5106 at 16, 5129 at 20, 5129 at 24, 5129 at 32, 5129 at 48; complete at level 20 with 5129.081624324048012345678level of fill allowed, pentries kept, thousandsnatural, complete at 20reverse Cuthill–McKee, complete at 37minimum degree, complete at 26nested dissection, complete at 20n = 400the band's first levels are its cheapest
Fig. 2 The entries an incomplete Cholesky keeps against the level of fill allowed, under four orderings, on the 20-by-20 grid.

At level one the band keeps 1,521 entries and takes 15 iterations, and minimum degree keeps 1,828 and takes 18. The prediction asked for fewer entries and no more iterations, and gets both. It goes on getting both at levels two to five: 1,863 against 2,039 entries, 2,187 against 2,458, 2,493 against 2,647, 2,782 against 2,873, with the band never behind on iterations. On the 14-by-14 and 30-by-30 grids the same holds at every level from one to five.

The figure shows why. A banded ordering of a grid creates fill in a band of fixed width, and each level fills in the next diagonal of that band, a few hundred entries a level, at a steady rate. Minimum degree eliminates the vertices with fewest neighbours first, which on a grid are scattered, and its first levels connect neighbours of neighbours across the whole graph: it adds 668 entries at level one where the band adds 361. After that its additions shrink quickly, because its complete factor is small, while the band keeps adding at the same rate all the way to level 37, where its last entry appears.

The other two orderings, and what a level is in each

The natural order and nested dissection fill in the picture from either side. The natural order is a band too, of width twenty on this grid, and for its first two levels it keeps exactly the entries Cuthill–McKee keeps, 1,521 and 1,863, with the same 15 iterations at the first and one more at the second. At level three it adds 665 entries where Cuthill–McKee adds 324, and from there it keeps adding between five and six hundred a level until it is complete at level twenty with 8,019 entries, the largest factor of the four. Cuthill–McKee’s band, which runs along the grid’s anti-diagonals, is narrower in the middle and wider nowhere, which is why its additions per level stay near three hundred: 361, 342, 324, 306, 289 and 272 over the first six. A level of the band is one more diagonal of a band that does not change width, and costs about the same each time.

Nested dissection is the case where the measure by level is most unkind. Its first level adds 525 entries, its second 630, its third 731, because it eliminates the interiors of small boxes first and their separators last, and the separators’ fill appears at low levels across every box at once. Its iterations at each level are the worst or second-worst of the four, 19 at level one and 15 at level two, and its curve in the first figure lies above the band’s and the natural order’s until near its end. It is complete at level twenty with 5,129 entries, between minimum degree and the band. On the measure a direct solver uses it is a good ordering; as the source of a rough incomplete factor it is the poorest measured, and the order decides the memory is the reminder that which ordering is good depends on which memory is being decided.

Minimum degree’s additions per level are irregular: 668, 211, 419, 189, 226, 149. They reflect its order of elimination, which jumps across the graph, picking vertices whose current degree is least and so creating fill wherever the last eliminations left a dense patch. The first level is the expensive one because it is the first time any of that fill is allowed, and it is spread across the whole grid. The pattern of fill is fixed by the symbolic phase in every case, as what the symbolic phase can only bound established for a complete factor; a level bound simply reads that pattern with an extra number attached to each entry.

Where the band falls behind

On the 20 × 20 Laplacian, conjugate gradient iterations to 10⁻⁸ preconditioned by an incomplete Cholesky against the level of fill allowed, under four orderingsnatural: 24 at 0, 15 at 1, 13 at 2, 10 at 3, 8 at 4, 7 at 5, 6 at 6, 5 at 8, 4 at 10, 4 at 12, 3 at 16, 1 at 20, 1 at 24; reverse Cuthill–McKee: 24 at 0, 15 at 1, 12 at 2, 10 at 3, 8 at 4, 7 at 5, 7 at 6, 6 at 8, 5 at 10, 5 at 12, 4 at 16, 3 at 20, 3 at 24; minimum degree: 36 at 0, 18 at 1, 15 at 2, 12 at 3, 9 at 4, 8 at 5, 8 at 6, 6 at 8, 6 at 10, 5 at 12, 3 at 16, 2 at 20, 2 at 24; nested dissection: 27 at 0, 19 at 1, 15 at 2, 12 at 3, 10 at 4, 9 at 5, 8 at 6, 6 at 8, 5 at 10, 4 at 12, 3 at 16, 1 at 20, 1 at 24.048121620240510152025303540level of fill allowed, piterationsnaturalreverse Cuthill–McKeeminimum degreenested dissectionn = 400 · plain CG takes 63 to 65a level is not the same amount of fill
Fig. 3 Conjugate gradient iterations against the level of fill allowed, under four orderings, on the 20-by-20 grid.

At level six minimum degree keeps 3,022 entries to the band’s 3,054, and from level eight on it keeps fewer at every level: 3,280 against 3,550 at eight, 3,538 against 4,363 at twelve. Its iterations fall steeply over the same range, to 6 at level eight and 3 at sixteen, and it is complete at level 26 with 3,729 entries. The band is still adding a diagonal of its band a level at level 26, and needs eleven more levels and 2,200 more entries to finish. So the prediction’s second half fails at level six, twenty levels before the one it named.

Read against levels, the two orderings are hard to compare, because a level is not an amount: one level of minimum degree is a different number of entries from one level of the band, and the number changes from level to level. The fair comparison is the one the first figure makes, iterations against entries kept, and there the question is how many entries each ordering needs to reach a given number of iterations.

What each ordering pays for a given accuracy

The fewest entries, per unknown, at which an incomplete Cholesky by level of fill reaches a given number of conjugate gradient iterations, under reverse Cuthill–McKee and minimum degree, at three grids14 × 14: 15 iterations 729 and 862, 8 iterations 1029 and 1225, 6 iterations 1282 and 1306, 4 iterations 1735 and 1436, 1 iterations 2107 and 1536; 20 × 20: 15 iterations 1521 and 2039, 8 iterations 2493 and 2873, 6 iterations 3550 and 3280, 4 iterations 4964 and 3677, 1 iterations 5910 and 3729; 30 × 30: 15 iterations 5077 and 6120, 8 iterations 8590 and 8564, 6 iterations 9815 and 9628, 4 iterations 14565 and 10005, 1 iterations 19315 and 10351, Cuthill–McKee first.261014182214 × 14 grid15 iterations: Cuthill–McKee3.715 iterations: minimum degree4.48 iterations: Cuthill–McKee5.38 iterations: minimum degree6.36 iterations: Cuthill–McKee6.56 iterations: minimum degree6.74 iterations: Cuthill–McKee8.94 iterations: minimum degree7.31 iteration: Cuthill–McKee10.81 iteration: minimum degree7.820 × 20 grid15 iterations: Cuthill–McKee3.815 iterations: minimum degree5.18 iterations: Cuthill–McKee6.28 iterations: minimum degree7.26 iterations: Cuthill–McKee8.96 iterations: minimum degree8.24 iterations: Cuthill–McKee12.44 iterations: minimum degree9.21 iteration: Cuthill–McKee14.81 iteration: minimum degree9.330 × 30 grid15 iterations: Cuthill–McKee5.615 iterations: minimum degree6.88 iterations: Cuthill–McKee9.58 iterations: minimum degree9.56 iterations: Cuthill–McKee10.96 iterations: minimum degree10.74 iterations: Cuthill–McKee16.24 iterations: minimum degree11.11 iteration: Cuthill–McKee21.51 iteration: minimum degree11.5entries kept per unknownlevels swept from zero to completethe crossing moves to more iterations
Fig. 4 The fewest entries per unknown at which an incomplete Cholesky by level of fill reaches a given number of iterations, under Cuthill–McKee and minimum degree, at three grids.

On the 20-by-20 grid, fifteen iterations cost the band 3.8 entries an unknown and minimum degree 5.1. Eight cost 6.2 and 7.2. Six cost 8.9 and 8.2, the first count at which minimum degree is cheaper. Four cost 12.4 and 9.2, and one iteration, the complete factor, 14.8 and 9.3. So there are two regimes. A rough preconditioner, one that leaves conjugate gradients eight or more iterations, is cheapest on the band. A fine one, which leaves six or fewer, is cheapest on minimum degree, and increasingly so.

The boundary between them moves with the grid. On the 14-by-14 grid the band is cheaper down to six iterations and minimum degree takes over at four. On the 30-by-30 grid the two are level at eight, 9.5 entries an unknown each, and minimum degree is cheaper below that. The complete factors’ ratio moves the same way: minimum degree’s is 73 per cent of the band’s at 196 unknowns, 63 per cent at 400, and 54 per cent at 900. Minimum degree’s advantage in the complete factor is a property of large problems, as the factor is not sparse found for the fill itself; the band’s advantage in rough factors is a property of every size measured. As the grid grows the region where the band wins narrows toward the roughest preconditioners.

That is also the opposite of what the earlier essay predicted for a threshold on a larger grid, that “the band orderings’ rough factors keep improving their position as the grid grows”. For a level of fill they do not, and the reason is the steady rate of the band’s growth: its band widens with the grid, so each of its levels costs more entries on a larger grid, while minimum degree’s first levels cost about the same per unknown.

Level zero, where only the order differs

Conjugate gradient iterations to 10⁻⁸ preconditioned by incomplete Cholesky at level zero, the pattern of the matrix alone, under four orderings, at three grids14 × 14: natural 18, reverse Cuthill–McKee 18, minimum degree 24, nested dissection 20; 20 × 20: natural 24, reverse Cuthill–McKee 24, minimum degree 36, nested dissection 27; 30 × 30: natural 32, reverse Cuthill–McKee 33, minimum degree 52, nested dissection 40.01530456014 × 14 grid, 560 entries in every orderingnatural18reverse Cuthill–McKee18minimum degree24nested dissection2020 × 20 grid, 1160 entries in every orderingnatural24reverse Cuthill–McKee24minimum degree36nested dissection2730 × 30 grid, 2640 entries in every orderingnatural32reverse Cuthill–McKee33minimum degree52nested dissection40iterations at level zerothe same entries, kept in a different orderminimum degree's level zero is the worst
Fig. 5 Conjugate gradient iterations preconditioned by incomplete Cholesky at level zero, the pattern of the matrix alone, under four orderings, at three grids.

The first point of every curve is the cleanest comparison in the whole measurement, because every ordering keeps exactly the same entries, the matrix’s own, and differs only in the order the elimination visits them. On the 20-by-20 grid conjugate gradients then takes 24 iterations under the natural order and Cuthill–McKee, 27 under nested dissection and 36 under minimum degree. On the 14-by-14 grid it is 18, 18, 20 and 24; on the 30-by-30, 32, 33, 40 and 52. Minimum degree’s level-zero factor is the worst at every size, by half again, although its complete factor is the smallest. Duff and Meurant reported this in 1989 for incomplete factorisations of model problems, and it is still the result that surprises: the ordering that does least damage when nothing is dropped does most when everything is.

The mechanism is the same as the band’s slow and steady growth, seen from the other side. A level-zero factor drops every entry elimination would have created, and the error it leaves is the sum of what was dropped. Minimum degree’s early eliminations create fill between distant vertices, entries of a discrete Green’s function that are not small, and dropping them discards large numbers. A banded ordering creates its fill next to the band, where the entries are the decaying ones the earlier essay measured, and dropping them discards small numbers. A level is a count of ancestors, and it is blind to the size of the entry; the orderings differ in whether their low-level entries happen to be the large ones. This matters in practice more than any other point on the curves, because level zero is the default incomplete factorisation in most iterative libraries, chosen because it needs no memory beyond the matrix’s own. A program that reorders its matrix with minimum degree for the sake of a direct solver elsewhere, and then calls the library’s default preconditioner on the reordered matrix, pays half again in iterations for an ordering it chose for a different reason, and nothing in the iteration count alone would tell it why.

What a program choosing a preconditioner should take from this

The cliff behind the count and the fill that is not independent both found that a factor’s structure, read alone, misleads about its numbers. This adds a rule a program can act on without reading any numbers at all. If the preconditioner is meant to be rough, a level of one to four with conjugate gradients doing the rest, order the matrix by bandwidth: it keeps fewer entries for the same iterations at every size measured. If it is meant to be nearly exact, a high level or a nearly complete factor, order by minimum degree, whose complete factor is half the size of the band’s at nine hundred unknowns and whose fine incomplete factors share that advantage. The choice of ordering should follow the choice of level, and the two are usually made by different parts of a code. A program solving a sequence of related systems, which the order that was right last time priced for direct factorisations, has the same decision to make once per sequence: the ordering its first factorisation used is right for its later incomplete ones only if they are about as fine.

It also says something about the measure the earlier essays used. Two ends of the same arrow and the least fill there is ranked orderings by the fill of a complete factor, which is the right measure for a direct solver and the one minimum degree is built to minimise. An incomplete factor has a different measure, the entries needed for a given number of iterations, and the two measures agree only at the fine end. A program that inherits its ordering from its direct solver and then drops to level one has chosen the ordering for the wrong job.

What three grids and one equation cannot settle

One operator, the five-point Laplacian, on square grids of three sizes; a variable coefficient or an anisotropy would change which entries are large, and so whether a level picks the large ones. One right-hand side, which matters only for the iteration counts and moves them by one at most between draws in the earlier essay’s measurements. Minimum degree is one implementation of a family, and an approximate minimum degree would order differently in detail. The levels are swept on a grid of sixteen values, so the fewest entries for a given number of iterations is the fewest on that grid, and the crossings are read to within a level. And entries kept is a proxy for cost: a factor’s cost to apply is its entries, but its cost to build depends on the updates it performs, which a level bound limits differently from a threshold. On a machine where the triangular solves of an incomplete factor run at a fraction of the speed of a product with the matrix, as they often do because they are sequential, the iterations and the entries trade at a different rate, and the crossing would move toward the band; how far is a question about the machine and is not measured here. The iteration counts are small integers, so a crossing read from them is coarse by construction: between six and eight iterations on the middle grid means somewhere in a range of two.

Still open: levels against thresholds, and an anisotropic grid

A level against a threshold, at equal entries. At a hundredth, the earlier essay’s threshold factor under Cuthill–McKee kept 2,376 entries for 8 iterations, close to level four’s 2,493 for 8. The prediction with a sign is that at every number of entries from 1,500 to 4,000 a threshold factor under Cuthill–McKee takes no more iterations than a level factor under the same ordering, and that under minimum degree the threshold factor takes at least two fewer iterations at 2,000 to 2,500 entries, because minimum degree’s low levels hold the large entries a threshold would have kept and its high levels hold small ones it would have dropped.

An anisotropic grid. With the coupling in one direction a hundred times the other, the large entries of the factor line up with the strong direction. The prediction is that a band ordered along the strong direction then beats minimum degree at every level and every number of iterations at 400 unknowns, so that the crossing measured here is a property of an isotropic operator, while a band ordered across the strong direction is worse than minimum degree from level 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.

Conjugate gradientsFill-inFill-reducing orderingIncomplete factorisationNested dissectionSymbolic factorisation