Fundamentals / Numerical mathematics / Numerical linear algebra

Graph structure and fill-in

Predict which entries appear when an unknown is eliminated and use graph ordering to compare storage for two equivalent factorisations.

From first principles

Derive fill-in from one sparse elimination step

Represent a symmetric matrix as a graph with one vertex per unknown and edges at its nonzero off-diagonal entries. Reorder the first pivot to the top and write its diagonal entry as \(a\ne0\), with couplings \(c\) to the remaining vertices and a trailing block \(B\). Solving the pivot equation for its unknown gives

\[a x+c^Ty=f,\]
\[x=(f-c^Ty)/a .\]

Insert this expression into the remaining equations. The matrix update at a pair of remaining vertices is

\[B_{\rm new}=B-\frac{cc^T}{a},\qquad (B_{\rm new})_{ij}=B_{ij}-\frac{c_i c_j}{a}.\]

If both \(i\) and \(j\) touch the pivot, a new entry can appear even when \(B_{ij}=0\). This is fill-in. A symbolic elimination graph therefore joins all remaining neighbours before removing the pivot. Exact numerical cancellation can remove a predicted entry, so the graph describes the general pattern. Choosing vertices with fewer or better-connected neighbours can reduce fill and factorization work.

Derivation and applications

Reduce a conducting star and preserve boundary currents

In a resistor network, symbolic fill has an observable magnitude. Consider one interior node of potential \(u\) connected to boundary nodes with prescribed potentials \(v_i\) through positive conductances \(g_i\). Assume ideal linear resistors and no independent current injected at the interior node. Charge conservation there requires the sum of currents into it to vanish. With \(G=\sum_i g_i\), the interior voltage is the conductance-weighted average

\[\sum_i g_i(u-v_i)=0,\]
\[u=\frac{\sum_i g_i v_i}{G}.\]

The boundary current entering the star at terminal \(i\) is \(I_i=g_i(v_i-u)\). Substitute the reconstructed \(u\), then collect potential differences relative to the other terminals. The reduced graph contains a physical branch between every pair of formerly separate neighbours,

\[I_i=\sum_{j\ne i}\frac{g_i g_j}{G}(v_i-v_j),\]
\[g_{ij}^{\rm eff}=\frac{g_i g_j}{G}.\]

Summing the currents gives zero by pairwise cancellation. Multiplying the currents by the corresponding terminal voltages and summing gives the dissipated power, which must agree before and after elimination,

\[\sum_i v_i I_i=\sum_i g_i(v_i-u)^2=\sum_{i<j}g_{ij}^{\rm eff}(v_i-v_j)^2 .\]

The two graphs can have very different numbers of branches while producing identical boundary measurements. An interior current source would additionally transfer a load vector to the terminals and cannot be dropped in a pure graph reduction.

Worked example

Reduce a three-terminal network

With conductances \(1,2,3\,\mathrm S\), the new pairwise conductances are \(1/3,1/2,1\,\mathrm S\) for pairs \(12,13,23\). For terminal voltages \(1,0,0\,\mathrm V\), the original centre sits at \(1/6\,\mathrm V\). Current from the first terminal is \(5/6\,\mathrm A\), equal to \((1/3+1/2)\times1\,\mathrm A\) in the reduced graph. Both dissipate \(5/6\,\mathrm W\).

Second application

Price the fill of a high-degree node

A centre joined to ten isolated boundary nodes by identical \(5\,\mathrm S\) branches produces \(10\times9/2=45\) reduced branches of \(25/50=0.5\,\mathrm S\). Driving one terminal to \(2\,\mathrm V\) with the other nine grounded gives current \(9(0.5)(2)=9\,\mathrm A\). The unreduced centre is at \(0.2\,\mathrm V\), giving \(5(2-0.2)=9\,\mathrm A\) by an independent balance.

Interpret matrix entries as connections

For a symmetric sparse stiffness matrix, put one graph vertex at each unknown and an edge between distinct vertices whose corresponding entry is nonzero. A spring, diffusion face or shared element typically couples nearby unknowns, so the assembled matrix has far fewer entries than a dense array. Gaussian elimination changes this graph. Partition a pivot \(a\), its column below the pivot \(v\) and the trailing block \(B\). Eliminating the pivot replaces \(B\) by the Schur complement \(B-vv^T/a\). For every pair of nonzero entries of \(v\), the outer product can create a coupling between their vertices.

Thus the remaining neighbours of the eliminated vertex can become a clique. These added entries are called fill. Some may cancel for particular coefficients, but symbolic analysis usually retains every position that can be nonzero. It predicts a storage pattern before numerical values are known and can often be reused when material properties or loads change on the same mesh.

Compare two orders on a star

Take four unknowns arranged as a centre joined to three leaves, with no direct leaf-to-leaf connections. Give each diagonal value 4 and each centre-to-leaf coupling −1. Eliminating the centre first subtracts \(1/4\) from every leaf diagonal and creates three off-diagonals of \(-1/4\) connecting the three pairs of leaves. Although those leaves were initially independent when the centre was specified, eliminating it lets a disturbance at one leaf affect every other.

Instead eliminate one leaf at a time. Each has only one remaining neighbour, so its elimination modifies only the central diagonal and creates no off-diagonal fill. Three eliminations lower the central diagonal from 4 to \(4-3/4=3.25\). The two factorizations give the same physical answer in exact arithmetic, but their intermediate matrices require different storage and work. Relabelling the equations and unknowns together preserves symmetry and changes which order the eliminator encounters.

Use separators on a mesh

A one-dimensional chain eliminated from an end retains its narrow bandwidth. Eliminating interior vertices in an inconvenient order can create distant couplings relative to the original numbering. In a two-dimensional mesh even a careful sweep can leave a long front of mutually coupled vertices. Nested dissection separates the graph into smaller disconnected regions by setting aside a separator, factors the interiors independently and processes that separator later.

There is a practical trade between the cost of constructing an ordering and the savings in repeated factorisations. For a fixed matrix shape with many load cases this overhead can be amortised. For unsymmetric or indefinite systems numerical pivoting may alter the predicted pattern to maintain accuracy. Record both the number of nonzeros in the original operator and the number stored in the factors. Quoting the former alone can severely underestimate memory requirements, particularly for a three-dimensional mesh whose separators contain many more nodes than a one-dimensional chain.

Count the work created by a mesh separator

Ordering influences more than the final number of nonzeros. In a two-dimensional \(m\)-by-\(m\) grid with nearest-neighbour couplings, remove a cross of order \(m\) unknowns and factor the resulting quadrants before the cross. Eliminating each interior communicates among the adjacent separator variables. In a generic factorisation their remaining block is dense: eliminating a separator of size proportional to \(m\) then costs order \(m^3\) arithmetic operations and stores order \(m^2\) factor entries. The cost of finding the ordering is separate from this symbolic estimate.

Repeat the argument recursively on the four quadrants of side approximately \(m/2\). At level \(j\) there are about \(4^j\) independent subdomains with separator side \(m/2^j\). Total dense-block storage for this level is proportional to \(4^j(m/2^j)^2=m^2\). There are order \(\log m\) levels, yielding storage \(O(m^2\log m)\). Arithmetic at that level is proportional to \(4^j(m/2^j)^3=m^3/2^j\); summing a geometric series gives \(O(m^3)\). In terms of the total unknown count \(N\simeq m^2\), these are \(O(N\log N)\) storage and \(O(N^{3/2})\) arithmetic.

Compare memory growth on a sequence of grids

To see why the two resource estimates differ, use an idealised separator count with top separator length 64 and seven levels through length one. Ignore constants and store the square of each separator length. The root contributes \(64^2=4096\) units; the four children of length 32 contribute \(4\cdot32^2=4096\) as well. Seven levels therefore contribute 28,672 units. For work counted as the cube of each length, the root contributes 262,144 units and its children 131,072. Summing all seven contributions gives

\[262144(1+1/2+\cdots+1/64)=520192.\]

Refining each spatial direction by a factor of two produces top length 128 and eight levels. Storage becomes \(8\cdot128^2=131072\), about 4.57 times as much. Work becomes \(128^3(2-1/128)=4177920\), about 8.03 times as much. The unknown count grew by four. A budget estimate assuming linear growth in both memory and factorisation time would miss the dominant cost early in this idealised sequence. The constants are structural units, not predictions in bytes or seconds.

These estimates assume balanced geometric partitions, bounded local connectivity and a factorisation that does not introduce unexpected pivot exchanges. Strong global couplings can destroy small separators; in three dimensions the separator of an \(m^3\) grid is a surface of order \(m^2\) unknowns. Substituting surface size into the same argument immediately predicts much heavier top-level work. Before extrapolating timings, inspect actual separator sizes and factor nonzeros for the physical mesh family at hand.

The same symbolic factorisation can often serve many load cases on an unchanged mesh. After numerical factors have been computed, each new pair of triangular substitutions has work proportional to the stored factor entries rather than the cubic separator work. A memory increase can therefore affect every repeated solve even when the one-time factorisation cost is amortised over many sources.

Predict the cost of moving from a sheet to a solid

For a three-dimensional \(m\)-by-\(m\)-by-\(m\) grid, divide a cube into eight smaller cubes separated by coordinate planes. An idealised top separator has order \(m^2\) unknowns rather than order \(m\). At level \(j\) the separator storage is proportional to \(8^j(m/2^j)^4=m^4/2^j\), and separator arithmetic to \(8^j(m/2^j)^6=m^6/8^j\). Both level sums are geometrically dominated by the largest separators. In terms of \(N=m^3\) unknowns the resulting estimates are \(O(N^{4/3})\) storage and \(O(N^2)\) factorisation work. The logarithmic storage factor of the two-dimensional sheet has given way to a different power of system size.

Doubling resolution along each axis multiplies \(N\) by eight, asymptotic factor storage by roughly sixteen, and factor arithmetic by roughly sixty-four. Suppose the factors of a current three-dimensional problem occupy 3 GB and take 90 seconds to compute. Applying these scalings gives about 48 GB and 96 minutes after such refinement, subject to ordering and machine efficiency. By contrast, applying the existing factors to each extra load scales primarily with factor entries. If memory is limited, the predicted top separator may rule out the planned direct factorisation before the nominal total number of input matrix entries does. An iterative alternative should then be compared at the actual required tolerance and with the cost of its preconditioner included.

Change parameters · Explore the worked calculation

Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.

Study the full derivation

Solve a singular network without inventing a ground current · Matrix computations and spectral accuracy

A floating resistor network has unique voltage drops but no absolute voltage reference. Derive its nullspace, test charge balance, and distinguish adding a computational gauge from changing the physical boundary conditions.